@open-captable-protocol/canton 0.0.13 → 0.0.15

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,9 +1,25 @@
1
1
  import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
+ /**
3
+ * Details about the FeaturedAppRight contract that need to be disclosed
4
+ * when exercising the CreateCompanyValuationReport choice. This is required for cross-domain
5
+ * contract interactions in Canton.
6
+ */
7
+ export interface FeaturedAppRightContractDetails {
8
+ /** The contract ID of the FeaturedAppRight contract */
9
+ contractId: string;
10
+ /** The serialized created event blob of the contract */
11
+ createdEventBlob: string;
12
+ /** The synchronizer ID associated with the contract */
13
+ synchronizerId: string;
14
+ /** The template ID of the contract */
15
+ templateId: string;
16
+ }
2
17
  export interface CreateCompanyValuationReportParams {
3
18
  companyId: string;
4
19
  companyValuation: string | number;
5
20
  observers?: string[];
6
- featuredAppRight: string;
21
+ /** Details of the FeaturedAppRight contract for disclosed contracts */
22
+ featuredAppRightContractDetails: FeaturedAppRightContractDetails;
7
23
  }
8
24
  export interface CreateCompanyValuationReportResult {
9
25
  contractId: string;
@@ -12,6 +28,26 @@ export interface CreateCompanyValuationReportResult {
12
28
  /**
13
29
  * Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
14
30
  * on the OCP Factory contract.
31
+ *
32
+ * This function requires the FeaturedAppRight contract details to be provided for disclosed contracts,
33
+ * which is necessary for cross-domain contract interactions in Canton.
34
+ *
35
+ * @example
36
+ * ```typescript
37
+ * const featuredAppRightContractDetails = {
38
+ * contractId: "1234567890abcdef",
39
+ * createdEventBlob: "serialized_contract_blob_here",
40
+ * synchronizerId: "sync_id_here",
41
+ * templateId: "FeaturedAppRight:template:id:here"
42
+ * };
43
+ *
44
+ * const result = await createCompanyValuationReport(client, {
45
+ * companyId: "company123",
46
+ * companyValuation: "1000000",
47
+ * observers: ["observer1", "observer2"],
48
+ * featuredAppRightContractDetails
49
+ * });
50
+ * ```
15
51
  */
16
52
  export declare function createCompanyValuationReport(client: LedgerJsonApiClient, params: CreateCompanyValuationReportParams): Promise<CreateCompanyValuationReportResult>;
17
53
  //# sourceMappingURL=createCompanyValuationReport.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"createCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,MAAM,WAAW,kCAAkC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;GAGG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CAsC7C"}
1
+ {"version":3,"file":"createCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAKhE;;;;GAIG;AACH,MAAM,WAAW,+BAA+B;IAC9C,uDAAuD;IACvD,UAAU,EAAE,MAAM,CAAC;IACnB,wDAAwD;IACxD,gBAAgB,EAAE,MAAM,CAAC;IACzB,uDAAuD;IACvD,cAAc,EAAE,MAAM,CAAC;IACvB,sCAAsC;IACtC,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,kCAAkC;IACjD,SAAS,EAAE,MAAM,CAAC;IAClB,gBAAgB,EAAE,MAAM,GAAG,MAAM,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;IACrB,uEAAuE;IACvE,+BAA+B,EAAE,+BAA+B,CAAC;CAClE;AAED,MAAM,WAAW,kCAAkC;IACjD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CA8C7C"}
@@ -8,6 +8,26 @@ const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-c
8
8
  /**
9
9
  * Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
10
10
  * on the OCP Factory contract.
11
+ *
12
+ * This function requires the FeaturedAppRight contract details to be provided for disclosed contracts,
13
+ * which is necessary for cross-domain contract interactions in Canton.
14
+ *
15
+ * @example
16
+ * ```typescript
17
+ * const featuredAppRightContractDetails = {
18
+ * contractId: "1234567890abcdef",
19
+ * createdEventBlob: "serialized_contract_blob_here",
20
+ * synchronizerId: "sync_id_here",
21
+ * templateId: "FeaturedAppRight:template:id:here"
22
+ * };
23
+ *
24
+ * const result = await createCompanyValuationReport(client, {
25
+ * companyId: "company123",
26
+ * companyValuation: "1000000",
27
+ * observers: ["observer1", "observer2"],
28
+ * featuredAppRightContractDetails
29
+ * });
30
+ * ```
11
31
  */
12
32
  async function createCompanyValuationReport(client, params) {
13
33
  const network = client.getNetwork();
@@ -21,7 +41,7 @@ async function createCompanyValuationReport(client, params) {
21
41
  ? params.companyValuation.toString()
22
42
  : params.companyValuation,
23
43
  observers: params.observers ?? [],
24
- featured_app_right: params.featuredAppRight
44
+ featured_app_right: params.featuredAppRightContractDetails.contractId
25
45
  };
26
46
  const response = await client.submitAndWaitForTransactionTree({
27
47
  commands: [
@@ -33,6 +53,14 @@ async function createCompanyValuationReport(client, params) {
33
53
  choiceArgument: choiceArguments
34
54
  }
35
55
  }
56
+ ],
57
+ disclosedContracts: [
58
+ {
59
+ templateId: params.featuredAppRightContractDetails.templateId,
60
+ contractId: params.featuredAppRightContractDetails.contractId,
61
+ createdEventBlob: params.featuredAppRightContractDetails.createdEventBlob,
62
+ synchronizerId: params.featuredAppRightContractDetails.synchronizerId
63
+ }
36
64
  ]
37
65
  });
38
66
  const event = response.transactionTree.eventsById[1];
@@ -1 +1 @@
1
- {"version":3,"file":"createCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":";;;;;AAqBA,oEAyCC;AA5DD,yIAA0G;AAe1G;;;GAGG;AACI,KAAK,UAAU,4BAA4B,CAChD,MAA2B,EAC3B,MAA0C;IAE1C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,WAAW,GAAG,sCAAqB,CAAC,OAA6C,CAAC,CAAC;IACzF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,eAAe,GAAkE;QACrF,UAAU,EAAE,MAAM,CAAC,SAAS;QAC5B,iBAAiB,EAAE,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ;YAC5D,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE;YACpC,CAAC,CAAC,MAAM,CAAC,gBAAgB;QAC3B,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;QACjC,kBAAkB,EAAE,MAAM,CAAC,gBAAuB;KACnD,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,WAAW,CAAC,UAAU;oBAClC,UAAU,EAAE,WAAW,CAAC,oBAAoB;oBAC5C,MAAM,EAAE,8BAA8B;oBACtC,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,kBAAkB,IAAI,KAAK,EAAE,CAAC;QAChC,OAAO;YACL,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;YACnD,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;SAC5C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
1
+ {"version":3,"file":"createCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":";;;;;AA2DA,oEAiDC;AA1GD,yIAA0G;AAiC1G;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACI,KAAK,UAAU,4BAA4B,CAChD,MAA2B,EAC3B,MAA0C;IAE1C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IACpC,MAAM,WAAW,GAAG,sCAAqB,CAAC,OAA6C,CAAC,CAAC;IACzF,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,MAAM,eAAe,GAAkE;QACrF,UAAU,EAAE,MAAM,CAAC,SAAS;QAC5B,iBAAiB,EAAE,OAAO,MAAM,CAAC,gBAAgB,KAAK,QAAQ;YAC5D,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,QAAQ,EAAE;YACpC,CAAC,CAAC,MAAM,CAAC,gBAAgB;QAC3B,SAAS,EAAE,MAAM,CAAC,SAAS,IAAI,EAAE;QACjC,kBAAkB,EAAE,MAAM,CAAC,+BAA+B,CAAC,UAAuC;KACnG,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,WAAW,CAAC,UAAU;oBAClC,UAAU,EAAE,WAAW,CAAC,oBAAoB;oBAC5C,MAAM,EAAE,8BAA8B;oBACtC,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;QACD,kBAAkB,EAAE;YAClB;gBACE,UAAU,EAAE,MAAM,CAAC,+BAA+B,CAAC,UAAU;gBAC7D,UAAU,EAAE,MAAM,CAAC,+BAA+B,CAAC,UAAU;gBAC7D,gBAAgB,EAAE,MAAM,CAAC,+BAA+B,CAAC,gBAAgB;gBACzE,cAAc,EAAE,MAAM,CAAC,+BAA+B,CAAC,cAAc;aACtE;SACF;KACF,CAA4C,CAAC;IAE9C,MAAM,KAAK,GAAG,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC;IACrD,IAAI,kBAAkB,IAAI,KAAK,EAAE,CAAC;QAChC,OAAO;YACL,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;YACnD,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;SAC5C,CAAC;IACJ,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;AACH,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-captable-protocol/canton",
3
- "version": "0.0.13",
3
+ "version": "0.0.15",
4
4
  "description": "A TypeScript SDK for interacting with the Open CapTable Protocol (OCP) Factory contract on Canton blockchain",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -13,14 +13,16 @@
13
13
  "dev": "tsc --watch",
14
14
  "clean": "rm -rf dist",
15
15
  "script:authorize": "ts-node scripts/authorizeIssuer.ts",
16
- "script:create-issuer": "ts-node scripts/createIssuer.ts"
16
+ "script:create-issuer": "ts-node scripts/createIssuer.ts",
17
+ "patch-dependency": "node scripts/patch-missing-dependency.js"
17
18
  },
18
19
  "dependencies": {
19
20
  "@daml/ledger": "^2.10.2",
20
21
  "@daml/types": "^2.10.2",
21
22
  "@fairmint/canton-node-sdk": "^0.0.79",
22
- "@fairmint/open-captable-protocol-daml-js": "^0.0.22"
23
+ "@fairmint/open-captable-protocol-daml-js": "^0.0.24"
23
24
  },
25
+
24
26
  "devDependencies": {
25
27
  "@types/node": "^24.2.0",
26
28
  "ts-node": "^10.9.2",