@open-captable-protocol/canton 0.0.11 → 0.0.13

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.
Files changed (55) hide show
  1. package/dist/functions/companyValuationReport/addObserversToCompanyValuationReport.d.ts.map +1 -1
  2. package/dist/functions/companyValuationReport/addObserversToCompanyValuationReport.js +10 -4
  3. package/dist/functions/companyValuationReport/addObserversToCompanyValuationReport.js.map +1 -1
  4. package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.d.ts.map +1 -1
  5. package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.js +10 -4
  6. package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.js.map +1 -1
  7. package/dist/functions/companyValuationReport/createCompanyValuationReport.d.ts +1 -0
  8. package/dist/functions/companyValuationReport/createCompanyValuationReport.d.ts.map +1 -1
  9. package/dist/functions/companyValuationReport/createCompanyValuationReport.js +13 -7
  10. package/dist/functions/companyValuationReport/createCompanyValuationReport.js.map +1 -1
  11. package/dist/functions/companyValuationReport/updateCompanyValuation.d.ts.map +1 -1
  12. package/dist/functions/companyValuationReport/updateCompanyValuation.js +10 -4
  13. package/dist/functions/companyValuationReport/updateCompanyValuation.js.map +1 -1
  14. package/dist/functions/issuer/authorizeIssuer.d.ts.map +1 -1
  15. package/dist/functions/issuer/authorizeIssuer.js +7 -4
  16. package/dist/functions/issuer/authorizeIssuer.js.map +1 -1
  17. package/dist/functions/issuer/createIssuer.d.ts.map +1 -1
  18. package/dist/functions/issuer/createIssuer.js +10 -4
  19. package/dist/functions/issuer/createIssuer.js.map +1 -1
  20. package/dist/functions/issuer/updateIssuerData.d.ts.map +1 -1
  21. package/dist/functions/issuer/updateIssuerData.js +10 -4
  22. package/dist/functions/issuer/updateIssuerData.js.map +1 -1
  23. package/package.json +3 -3
  24. package/dist/OcpFactoryClient.d.ts +0 -46
  25. package/dist/OcpFactoryClient.d.ts.map +0 -1
  26. package/dist/OcpFactoryClient.js +0 -57
  27. package/dist/OcpFactoryClient.js.map +0 -1
  28. package/dist/functions/addObserversToCompanyValuationReport.d.ts +0 -14
  29. package/dist/functions/addObserversToCompanyValuationReport.d.ts.map +0 -1
  30. package/dist/functions/addObserversToCompanyValuationReport.js +0 -35
  31. package/dist/functions/addObserversToCompanyValuationReport.js.map +0 -1
  32. package/dist/functions/authorizeIssuer.d.ts +0 -19
  33. package/dist/functions/authorizeIssuer.d.ts.map +0 -1
  34. package/dist/functions/authorizeIssuer.js +0 -52
  35. package/dist/functions/authorizeIssuer.js.map +0 -1
  36. package/dist/functions/confirmCurrentCompanyValuationReport.d.ts +0 -13
  37. package/dist/functions/confirmCurrentCompanyValuationReport.d.ts.map +0 -1
  38. package/dist/functions/confirmCurrentCompanyValuationReport.js +0 -33
  39. package/dist/functions/confirmCurrentCompanyValuationReport.js.map +0 -1
  40. package/dist/functions/createCompanyValuationReport.d.ts +0 -16
  41. package/dist/functions/createCompanyValuationReport.d.ts.map +0 -1
  42. package/dist/functions/createCompanyValuationReport.js +0 -43
  43. package/dist/functions/createCompanyValuationReport.js.map +0 -1
  44. package/dist/functions/createIssuer.d.ts +0 -58
  45. package/dist/functions/createIssuer.d.ts.map +0 -1
  46. package/dist/functions/createIssuer.js +0 -65
  47. package/dist/functions/createIssuer.js.map +0 -1
  48. package/dist/functions/updateCompanyValuation.d.ts +0 -14
  49. package/dist/functions/updateCompanyValuation.d.ts.map +0 -1
  50. package/dist/functions/updateCompanyValuation.js +0 -37
  51. package/dist/functions/updateCompanyValuation.js.map +0 -1
  52. package/dist/functions/updateIssuerData.d.ts +0 -18
  53. package/dist/functions/updateIssuerData.d.ts.map +0 -1
  54. package/dist/functions/updateIssuerData.js +0 -40
  55. package/dist/functions/updateIssuerData.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"addObserversToCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;IACzC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CA6BrD"}
1
+ {"version":3,"file":"addObserversToCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;IACzC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CAkCrD"}
@@ -27,9 +27,15 @@ async function addObserversToCompanyValuationReport(client, params) {
27
27
  }
28
28
  ]
29
29
  });
30
- return {
31
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
32
- updateId: response.transactionTree.updateId
33
- };
30
+ const event = response.transactionTree.eventsById[1];
31
+ if ('CreatedTreeEvent' in event) {
32
+ return {
33
+ contractId: event.CreatedTreeEvent.value.contractId,
34
+ updateId: response.transactionTree.updateId
35
+ };
36
+ }
37
+ else {
38
+ throw new Error('Expected CreatedTreeEvent not found');
39
+ }
34
40
  }
35
41
  //# sourceMappingURL=addObserversToCompanyValuationReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"addObserversToCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":";;AAiBA,oFAgCC;AAjDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAA8D;QACjF,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,cAAc;oBACtB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"addObserversToCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":";;AAiBA,oFAqCC;AAtDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAA8D;QACjF,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,cAAc;oBACtB,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 +1 @@
1
- {"version":3,"file":"confirmCurrentCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;CAC1C;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CA2BrD"}
1
+ {"version":3,"file":"confirmCurrentCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;CAC1C;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CAgCrD"}
@@ -25,9 +25,15 @@ async function confirmCurrentCompanyValuationReport(client, params) {
25
25
  }
26
26
  ]
27
27
  });
28
- return {
29
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
30
- updateId: response.transactionTree.updateId
31
- };
28
+ const event = response.transactionTree.eventsById[1];
29
+ if ('CreatedTreeEvent' in event) {
30
+ return {
31
+ contractId: event.CreatedTreeEvent.value.contractId,
32
+ updateId: response.transactionTree.updateId
33
+ };
34
+ }
35
+ else {
36
+ throw new Error('Expected CreatedTreeEvent not found');
37
+ }
32
38
  }
33
39
  //# sourceMappingURL=confirmCurrentCompanyValuationReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"confirmCurrentCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":";;AAgBA,oFA8BC;AA9CD,6FAAoE;AAapE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAAgE,EAAE,CAAC;IAExF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,gBAAgB;oBACxB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"confirmCurrentCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":";;AAgBA,oFAmCC;AAnDD,6FAAoE;AAapE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAAgE,EAAE,CAAC;IAExF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,gBAAgB;oBACxB,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"}
@@ -3,6 +3,7 @@ export interface CreateCompanyValuationReportParams {
3
3
  companyId: string;
4
4
  companyValuation: string | number;
5
5
  observers?: string[];
6
+ featuredAppRight: string;
6
7
  }
7
8
  export interface CreateCompanyValuationReportResult {
8
9
  contractId: string;
@@ -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;CACtB;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,CAgC7C"}
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"}
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.createCompanyValuationReport = createCompanyValuationReport;
7
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
8
7
  const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/ocp-factory-contract-id.json"));
9
8
  /**
10
9
  * Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
@@ -21,13 +20,14 @@ async function createCompanyValuationReport(client, params) {
21
20
  company_valuation: typeof params.companyValuation === 'number'
22
21
  ? params.companyValuation.toString()
23
22
  : params.companyValuation,
24
- observers: params.observers ?? []
23
+ observers: params.observers ?? [],
24
+ featured_app_right: params.featuredAppRight
25
25
  };
26
26
  const response = await client.submitAndWaitForTransactionTree({
27
27
  commands: [
28
28
  {
29
29
  ExerciseCommand: {
30
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.OcpFactory.OcpFactory.templateId,
30
+ templateId: networkData.templateId,
31
31
  contractId: networkData.ocpFactoryContractId,
32
32
  choice: 'CreateCompanyValuationReport',
33
33
  choiceArgument: choiceArguments
@@ -35,9 +35,15 @@ async function createCompanyValuationReport(client, params) {
35
35
  }
36
36
  ]
37
37
  });
38
- return {
39
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
40
- updateId: response.transactionTree.updateId
41
- };
38
+ const event = response.transactionTree.eventsById[1];
39
+ if ('CreatedTreeEvent' in event) {
40
+ return {
41
+ contractId: event.CreatedTreeEvent.value.contractId,
42
+ updateId: response.transactionTree.updateId
43
+ };
44
+ }
45
+ else {
46
+ throw new Error('Expected CreatedTreeEvent not found');
47
+ }
42
48
  }
43
49
  //# sourceMappingURL=createCompanyValuationReport.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createCompanyValuationReport.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/createCompanyValuationReport.ts"],"names":[],"mappings":";;;;;AAoBA,oEAmCC;AAvDD,6FAAoE;AAEpE,yIAA0G;AAc1G;;;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;KAClC,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU;oBAClE,UAAU,EAAE,WAAW,CAAC,oBAAoB;oBAC5C,MAAM,EAAE,8BAA8B;oBACtC,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
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 +1 @@
1
- {"version":3,"file":"updateCompanyValuation.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/updateCompanyValuation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,4BAA4B;IAC3C,gCAAgC,EAAE,MAAM,CAAC;IACzC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CA+BvC"}
1
+ {"version":3,"file":"updateCompanyValuation.d.ts","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/updateCompanyValuation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,4BAA4B;IAC3C,gCAAgC,EAAE,MAAM,CAAC;IACzC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CAoCvC"}
@@ -29,9 +29,15 @@ async function updateCompanyValuation(client, params) {
29
29
  }
30
30
  ]
31
31
  });
32
- return {
33
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
34
- updateId: response.transactionTree.updateId
35
- };
32
+ const event = response.transactionTree.eventsById[1];
33
+ if ('CreatedTreeEvent' in event) {
34
+ return {
35
+ contractId: event.CreatedTreeEvent.value.contractId,
36
+ updateId: response.transactionTree.updateId
37
+ };
38
+ }
39
+ else {
40
+ throw new Error('Expected CreatedTreeEvent not found');
41
+ }
36
42
  }
37
43
  //# sourceMappingURL=updateCompanyValuation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateCompanyValuation.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/updateCompanyValuation.ts"],"names":[],"mappings":";;AAiBA,wDAkCC;AAnDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAC1C,MAA2B,EAC3B,MAAoC;IAEpC,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAAqE;QACxF,qBAAqB,EAAE,OAAO,MAAM,CAAC,mBAAmB,KAAK,QAAQ;YACnE,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YACvC,CAAC,CAAC,MAAM,CAAC,mBAAmB;KAC/B,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,qBAAqB;oBAC7B,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"updateCompanyValuation.js","sourceRoot":"","sources":["../../../src/functions/companyValuationReport/updateCompanyValuation.ts"],"names":[],"mappings":";;AAiBA,wDAuCC;AAxDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAC1C,MAA2B,EAC3B,MAAoC;IAEpC,sEAAsE;IACtE,MAAM,c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BAA2B,CAAC;AAIhE,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAyChC"}
1
+ {"version":3,"file":"authorizeIssuer.d.ts","sourceRoot":"","sources":["../../../src/functions/issuer/authorizeIssuer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CA8ChC"}
@@ -4,7 +4,6 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
4
4
  };
5
5
  Object.defineProperty(exports, "__esModule", { value: true });
6
6
  exports.authorizeIssuer = authorizeIssuer;
7
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
8
7
  const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/ocp-factory-contract-id.json"));
9
8
  /**
10
9
  * Authorize an issuer using the OCP Factory contract
@@ -29,7 +28,7 @@ async function authorizeIssuer(client, params) {
29
28
  commands: [
30
29
  {
31
30
  ExerciseCommand: {
32
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.OcpFactory.OcpFactory.templateId,
31
+ templateId: networkData.templateId,
33
32
  contractId: networkData.ocpFactoryContractId,
34
33
  choice: 'AuthorizeIssuer',
35
34
  choiceArgument: choiceArguments
@@ -37,7 +36,11 @@ async function authorizeIssuer(client, params) {
37
36
  }
38
37
  ]
39
38
  });
40
- const issuerContractId = response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId;
39
+ const event = response.transactionTree.eventsById[1];
40
+ if (!('CreatedTreeEvent' in event)) {
41
+ throw new Error('Expected CreatedTreeEvent not found');
42
+ }
43
+ const issuerContractId = event.CreatedTreeEvent.value.contractId;
41
44
  const issuerContractEvents = await client.getEventsByContractId({
42
45
  contractId: issuerContractId
43
46
  });
@@ -46,7 +49,7 @@ async function authorizeIssuer(client, params) {
46
49
  updateId: response.transactionTree.updateId,
47
50
  createdEventBlob: issuerContractEvents.created.createdEvent.createdEventBlob,
48
51
  synchronizerId: response.transactionTree.synchronizerId,
49
- templateId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.templateId
52
+ templateId: event.CreatedTreeEvent.value.templateId
50
53
  };
51
54
  }
52
55
  //# sourceMappingURL=authorizeIssuer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"authorizeIssuer.js","sourceRoot":"","sources":["../../../src/functions/issuer/authorizeIssuer.ts"],"names":[],"mappings":";;;;;AAuBA,0CA4CC;AAnED,6FAAoE;AAEpE,yIAA0G;AAe1G;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CACnC,MAA2B,EAC3B,MAA6B;IAE7B,0CAA0C;IAC1C,MAAM,OAAO,GAAG,MAAM,CAAC,UAAU,EAAE,CAAC;IAEpC,0DAA0D;IAC1D,MAAM,WAAW,GAAG,sCAAqB,CAAC,OAA6C,CAAC,CAAC;IACzF,IAAI,CAAC,WAAW,EAAE,CAAC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;QACvD,UAAU,EAAE,KAAK,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;KACpD,CAAC;AACJ,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"createIssuer.d.ts","sourceRoot":"","sources":["../../../src/functions/issuer/createIssuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,0DAA0D;IAC1D,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,kBAAkB;IACjC,0EAA0E;IAC1E,kCAAkC,EAAE,kCAAkC,CAAC;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC5D;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAiC7B"}
1
+ {"version":3,"file":"createIssuer.d.ts","sourceRoot":"","sources":["../../../src/functions/issuer/createIssuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,0DAA0D;IAC1D,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,kBAAkB;IACjC,0EAA0E;IAC1E,kCAAkC,EAAE,kCAAkC,CAAC;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC5D;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAsC7B"}
@@ -57,9 +57,15 @@ async function createIssuer(client, params) {
57
57
  }
58
58
  ]
59
59
  });
60
- return {
61
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
62
- updateId: response.transactionTree.updateId
63
- };
60
+ const event = response.transactionTree.eventsById[1];
61
+ if ('CreatedTreeEvent' in event) {
62
+ return {
63
+ contractId: event.CreatedTreeEvent.value.contractId,
64
+ updateId: response.transactionTree.updateId
65
+ };
66
+ }
67
+ else {
68
+ throw new Error('Expected CreatedTreeEvent not found');
69
+ }
64
70
  }
65
71
  //# sourceMappingURL=createIssuer.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"createIssuer.js","sourceRoot":"","sources":["../../../src/functions/issuer/createIssuer.ts"],"names":[],"mappings":";;AA6DA,oCAoCC;AAjGD,6FAAoE;AAiCpE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,KAAK,UAAU,YAAY,CAChC,MAA2B,EAC3B,MAA0B;IAE1B,+CAA+C;IAC/C,MAAM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Aa,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC/D;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CAgCjC"}
1
+ {"version":3,"file":"updateIssuerData.d.ts","sourceRoot":"","sources":["../../../src/functions/issuer/updateIssuerData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC/D;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CAqCjC"}
@@ -32,9 +32,15 @@ async function updateIssuerData(client, params) {
32
32
  }
33
33
  ]
34
34
  });
35
- return {
36
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
37
- updateId: response.transactionTree.updateId
38
- };
35
+ const event = response.transactionTree.eventsById[1];
36
+ if ('CreatedTreeEvent' in event) {
37
+ return {
38
+ contractId: event.CreatedTreeEvent.value.contractId,
39
+ updateId: response.transactionTree.updateId
40
+ };
41
+ }
42
+ else {
43
+ throw new Error('Expected CreatedTreeEvent not found');
44
+ }
39
45
  }
40
46
  //# sourceMappingURL=updateIssuerData.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"updateIssuerData.js","sourceRoot":"","sources":["../../../src/functions/issuer/updateIssuerData.ts"],"names":[],"mappings":";;AAoBA,4CAmCC;AAvDD,6FAAoE;AAcpE;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAA2B,EAC3B,MAA8B;IAE9B,qEAAqE;IACrE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gBAAgB;KACpC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC;IAE9E,mDAAmD;IACnD,MAAM,eAAe,GAAkD;QACrE,eAAe,EAAE,MAAM,CAAC,aAAa;KACtC,CAAC;IAEF,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU;oBAC1D,UAAU,EAAE,MAAM,CAAC,gBAAgB;oBACnC,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
1
+ {"version":3,"file":"updateIssuerData.js","sourceRoot":"","sources":["../../../src/functions/issuer/updateIssuerData.ts"],"names":[],"mappings":";;AAoBA,4CAwCC;AA5DD,6FAAoE;AAcpE;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAA2B,EAC3B,MAA8B;IAE9B,qEAAqE;IACrE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gBAAgB;KACpC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC;IAE9E,mDAAmD;IACnD,MAAM,eAAe,GAAkD;QACrE,eAAe,EAAE,MAAM,CAAC,aAAa;KACtC,CAAC;IAEF,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU;oBAC1D,UAAU,EAAE,MAAM,CAAC,gBAAgB;oBACnC,MAAM,EAAE,kBAAkB;oBAC1B,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-captable-protocol/canton",
3
- "version": "0.0.11",
3
+ "version": "0.0.13",
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",
@@ -18,8 +18,8 @@
18
18
  "dependencies": {
19
19
  "@daml/ledger": "^2.10.2",
20
20
  "@daml/types": "^2.10.2",
21
- "@fairmint/canton-node-sdk": "^0.0.78",
22
- "@fairmint/open-captable-protocol-daml-js": "^0.0.19"
21
+ "@fairmint/canton-node-sdk": "^0.0.79",
22
+ "@fairmint/open-captable-protocol-daml-js": "^0.0.22"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^24.2.0",
@@ -1,46 +0,0 @@
1
- import { ClientConfig } from '@fairmint/canton-node-sdk';
2
- import { AuthorizeIssuerParams, AuthorizeIssuerResult } from './functions/authorizeIssuer';
3
- import { CreateIssuerParams, CreateIssuerResult } from './functions/createIssuer';
4
- import { CreateCompanyValuationReportParams, CreateCompanyValuationReportResult } from './functions/createCompanyValuationReport';
5
- import { UpdateCompanyValuationParams, UpdateCompanyValuationResult } from './functions/updateCompanyValuation';
6
- import { ConfirmCurrentCompanyValuationReportParams, ConfirmCurrentCompanyValuationReportResult } from './functions/confirmCurrentCompanyValuationReport';
7
- import { AddObserversToCompanyValuationReportParams, AddObserversToCompanyValuationReportResult } from './functions/addObserversToCompanyValuationReport';
8
- export { AuthorizeIssuerParams, AuthorizeIssuerResult } from './functions/authorizeIssuer';
9
- export { CreateIssuerParams, CreateIssuerResult, IssuerAuthorizationContractDetails } from './functions/createIssuer';
10
- export { CreateCompanyValuationReportParams, CreateCompanyValuationReportResult } from './functions/createCompanyValuationReport';
11
- export { UpdateCompanyValuationParams, UpdateCompanyValuationResult } from './functions/updateCompanyValuation';
12
- export { ConfirmCurrentCompanyValuationReportParams, ConfirmCurrentCompanyValuationReportResult } from './functions/confirmCurrentCompanyValuationReport';
13
- export { AddObserversToCompanyValuationReportParams, AddObserversToCompanyValuationReportResult } from './functions/addObserversToCompanyValuationReport';
14
- export declare class OcpFactoryClient {
15
- private client;
16
- constructor(config?: ClientConfig);
17
- /**
18
- * Authorize an issuer using the OCP Factory contract
19
- * @param params - Parameters for authorizing an issuer
20
- * @returns Promise resolving to the result of the authorization
21
- */
22
- authorizeIssuer(params: AuthorizeIssuerParams): Promise<AuthorizeIssuerResult>;
23
- /**
24
- * Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
25
- * @param params - Parameters for creating an issuer
26
- * @returns Promise resolving to the result of the issuer creation
27
- */
28
- createIssuer(params: CreateIssuerParams): Promise<CreateIssuerResult>;
29
- /**
30
- * Create a CompanyValuationReport via OCP Factory
31
- */
32
- createCompanyValuationReport(params: CreateCompanyValuationReportParams): Promise<CreateCompanyValuationReportResult>;
33
- /**
34
- * Update the company valuation on a CompanyValuationReport
35
- */
36
- updateCompanyValuation(params: UpdateCompanyValuationParams): Promise<UpdateCompanyValuationResult>;
37
- /**
38
- * Confirm the current company valuation on a CompanyValuationReport
39
- */
40
- confirmCurrentCompanyValuationReport(params: ConfirmCurrentCompanyValuationReportParams): Promise<ConfirmCurrentCompanyValuationReportResult>;
41
- /**
42
- * Add observers to a CompanyValuationReport
43
- */
44
- addObserversToCompanyValuationReport(params: AddObserversToCompanyValuationReportParams): Promise<AddObserversToCompanyValuationReportResult>;
45
- }
46
- //# sourceMappingURL=OcpFactoryClient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OcpFactoryClient.d.ts","sourceRoot":"","sources":["../src/OcpFactoryClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAuB,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAmB,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC5G,OAAO,EAAgB,kBAAkB,EAAE,kBAAkB,EAAsC,MAAM,0BAA0B,CAAC;AACpI,OAAO,EAAgC,kCAAkC,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAChK,OAAO,EAA0B,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AACxI,OAAO,EAAwC,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAChM,OAAO,EAAwC,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAEhM,OAAO,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,6BAA6B,CAAC;AAC3F,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,kCAAkC,EAAE,MAAM,0BAA0B,CAAC;AACtH,OAAO,EAAE,kCAAkC,EAAE,kCAAkC,EAAE,MAAM,0CAA0C,CAAC;AAClI,OAAO,EAAE,4BAA4B,EAAE,4BAA4B,EAAE,MAAM,oCAAoC,CAAC;AAChH,OAAO,EAAE,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAC1J,OAAO,EAAE,0CAA0C,EAAE,0CAA0C,EAAE,MAAM,kDAAkD,CAAC;AAE1J,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAsB;gBAExB,MAAM,CAAC,EAAE,YAAY;IAIjC;;;;OAIG;IACG,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAIpF;;;;OAIG;IACG,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAI3E;;OAEG;IACG,4BAA4B,CAChC,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC;IAI9C;;OAEG;IACG,sBAAsB,CAC1B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC;IAIxC;;OAEG;IACG,oCAAoC,CACxC,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC;IAItD;;OAEG;IACG,oCAAoC,CACxC,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC;CAGvD"}
@@ -1,57 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.OcpFactoryClient = void 0;
4
- const canton_node_sdk_1 = require("@fairmint/canton-node-sdk");
5
- const authorizeIssuer_1 = require("./functions/authorizeIssuer");
6
- const createIssuer_1 = require("./functions/createIssuer");
7
- const createCompanyValuationReport_1 = require("./functions/createCompanyValuationReport");
8
- const updateCompanyValuation_1 = require("./functions/updateCompanyValuation");
9
- const confirmCurrentCompanyValuationReport_1 = require("./functions/confirmCurrentCompanyValuationReport");
10
- const addObserversToCompanyValuationReport_1 = require("./functions/addObserversToCompanyValuationReport");
11
- class OcpFactoryClient {
12
- constructor(config) {
13
- this.client = new canton_node_sdk_1.LedgerJsonApiClient(config);
14
- }
15
- /**
16
- * Authorize an issuer using the OCP Factory contract
17
- * @param params - Parameters for authorizing an issuer
18
- * @returns Promise resolving to the result of the authorization
19
- */
20
- async authorizeIssuer(params) {
21
- return (0, authorizeIssuer_1.authorizeIssuer)(this.client, params);
22
- }
23
- /**
24
- * Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
25
- * @param params - Parameters for creating an issuer
26
- * @returns Promise resolving to the result of the issuer creation
27
- */
28
- async createIssuer(params) {
29
- return (0, createIssuer_1.createIssuer)(this.client, params);
30
- }
31
- /**
32
- * Create a CompanyValuationReport via OCP Factory
33
- */
34
- async createCompanyValuationReport(params) {
35
- return (0, createCompanyValuationReport_1.createCompanyValuationReport)(this.client, params);
36
- }
37
- /**
38
- * Update the company valuation on a CompanyValuationReport
39
- */
40
- async updateCompanyValuation(params) {
41
- return (0, updateCompanyValuation_1.updateCompanyValuation)(this.client, params);
42
- }
43
- /**
44
- * Confirm the current company valuation on a CompanyValuationReport
45
- */
46
- async confirmCurrentCompanyValuationReport(params) {
47
- return (0, confirmCurrentCompanyValuationReport_1.confirmCurrentCompanyValuationReport)(this.client, params);
48
- }
49
- /**
50
- * Add observers to a CompanyValuationReport
51
- */
52
- async addObserversToCompanyValuationReport(params) {
53
- return (0, addObserversToCompanyValuationReport_1.addObserversToCompanyValuationReport)(this.client, params);
54
- }
55
- }
56
- exports.OcpFactoryClient = OcpFactoryClient;
57
- //# sourceMappingURL=OcpFactoryClient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"OcpFactoryClient.js","sourceRoot":"","sources":["../src/OcpFactoryClient.ts"],"names":[],"mappings":";;;AAAA,+DAA8E;AAC9E,iEAA4G;AAC5G,2DAAoI;AACpI,2FAAgK;AAChK,+EAAwI;AACxI,2GAAgM;AAChM,2GAAgM;AAShM,MAAa,gBAAgB;IAG3B,YAAY,MAAqB;QAC/B,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAmB,CAAC,MAAM,CAAC,CAAC;IAChD,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,eAAe,CAAC,MAA6B;QACjD,OAAO,IAAA,iCAAe,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC9C,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,YAAY,CAAC,MAA0B;QAC3C,OAAO,IAAA,2BAAY,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,4BAA4B,CAChC,MAA0C;QAE1C,OAAO,IAAA,2DAA4B,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,sBAAsB,CAC1B,MAAoC;QAEpC,OAAO,IAAA,+CAAsB,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrD,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oCAAoC,CACxC,MAAkD;QAElD,OAAO,IAAA,2EAAoC,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,oCAAoC,CACxC,MAAkD;QAElD,OAAO,IAAA,2EAAoC,EAAC,IAAI,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACnE,CAAC;CACF;AA5DD,4CA4DC"}
@@ -1,14 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- export interface AddObserversToCompanyValuationReportParams {
3
- companyValuationReportContractId: string;
4
- added: string[];
5
- }
6
- export interface AddObserversToCompanyValuationReportResult {
7
- contractId: string;
8
- updateId: string;
9
- }
10
- /**
11
- * Add observers to a CompanyValuationReport by exercising AddObservers.
12
- */
13
- export declare function addObserversToCompanyValuationReport(client: LedgerJsonApiClient, params: AddObserversToCompanyValuationReportParams): Promise<AddObserversToCompanyValuationReportResult>;
14
- //# sourceMappingURL=addObserversToCompanyValuationReport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addObserversToCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../src/functions/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;IACzC,KAAK,EAAE,MAAM,EAAE,CAAC;CACjB;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CA6BrD"}
@@ -1,35 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.addObserversToCompanyValuationReport = addObserversToCompanyValuationReport;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Add observers to a CompanyValuationReport by exercising AddObservers.
7
- */
8
- async function addObserversToCompanyValuationReport(client, params) {
9
- // Determine the acting party (system_operator) from the created event
10
- const eventsResponse = await client.getEventsByContractId({
11
- contractId: params.companyValuationReportContractId
12
- });
13
- const systemOperator = eventsResponse.created.createdEvent.createArgument.system_operator;
14
- const choiceArguments = {
15
- added: params.added
16
- };
17
- const response = await client.submitAndWaitForTransactionTree({
18
- actAs: [systemOperator],
19
- commands: [
20
- {
21
- ExerciseCommand: {
22
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.CompanyValuationReport.CompanyValuationReport.templateId,
23
- contractId: params.companyValuationReportContractId,
24
- choice: 'AddObservers',
25
- choiceArgument: choiceArguments
26
- }
27
- }
28
- ]
29
- });
30
- return {
31
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
32
- updateId: response.transactionTree.updateId
33
- };
34
- }
35
- //# sourceMappingURL=addObserversToCompanyValuationReport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"addObserversToCompanyValuationReport.js","sourceRoot":"","sources":["../../src/functions/addObserversToCompanyValuationReport.ts"],"names":[],"mappings":";;AAiBA,oFAgCC;AAjDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAA8D;QACjF,KAAK,EAAE,MAAM,CAAC,KAAK;KACpB,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,cAAc;oBACtB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
@@ -1,19 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- export interface AuthorizeIssuerParams {
3
- issuer: string;
4
- }
5
- export interface AuthorizeIssuerResult {
6
- contractId: string;
7
- updateId: string;
8
- createdEventBlob: string;
9
- synchronizerId: string;
10
- templateId: string;
11
- }
12
- /**
13
- * Authorize an issuer using the OCP Factory contract
14
- * @param client - The ledger JSON API client
15
- * @param params - Parameters for authorizing an issuer
16
- * @returns Promise resolving to the result of the authorization
17
- */
18
- export declare function authorizeIssuer(client: LedgerJsonApiClient, params: AuthorizeIssuerParams): Promise<AuthorizeIssuerResult>;
19
- //# sourceMappingURL=authorizeIssuer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorizeIssuer.d.ts","sourceRoot":"","sources":["../../src/functions/authorizeIssuer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAIhE,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAyChC"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.authorizeIssuer = authorizeIssuer;
7
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
8
- const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/ocp-factory-contract-id.json"));
9
- /**
10
- * Authorize an issuer using the OCP Factory contract
11
- * @param client - The ledger JSON API client
12
- * @param params - Parameters for authorizing an issuer
13
- * @returns Promise resolving to the result of the authorization
14
- */
15
- async function authorizeIssuer(client, params) {
16
- // Get the current network from the client
17
- const network = client.getNetwork();
18
- // Select the appropriate contract ID based on the network
19
- const networkData = ocp_factory_contract_id_json_1.default[network];
20
- if (!networkData) {
21
- throw new Error(`Unsupported network: ${network}`);
22
- }
23
- // Create the choice arguments for AuthorizeIssuer
24
- const choiceArguments = {
25
- issuer: params.issuer
26
- };
27
- // Submit the choice to the factory contract
28
- const response = await client.submitAndWaitForTransactionTree({
29
- commands: [
30
- {
31
- ExerciseCommand: {
32
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.OcpFactory.OcpFactory.templateId,
33
- contractId: networkData.ocpFactoryContractId,
34
- choice: 'AuthorizeIssuer',
35
- choiceArgument: choiceArguments
36
- }
37
- }
38
- ]
39
- });
40
- const issuerContractId = response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId;
41
- const issuerContractEvents = await client.getEventsByContractId({
42
- contractId: issuerContractId
43
- });
44
- return {
45
- contractId: issuerContractId,
46
- updateId: response.transactionTree.updateId,
47
- createdEventBlob: issuerContractEvents.created.createdEvent.createdEventBlob,
48
- synchronizerId: response.transactionTree.synchronizerId,
49
- templateId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.templateId
50
- };
51
- }
52
- //# sourceMappingURL=authorizeIssuer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"authorizeIssuer.js","sourceRoot":"","sources":["../../src/functions/authorizeIssuer.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Ac;QACvD,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;KACrF,CAAC;AACJ,CAAC"}
@@ -1,13 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- export interface ConfirmCurrentCompanyValuationReportParams {
3
- companyValuationReportContractId: string;
4
- }
5
- export interface ConfirmCurrentCompanyValuationReportResult {
6
- contractId: string;
7
- updateId: string;
8
- }
9
- /**
10
- * Confirm the current company valuation on a CompanyValuationReport by exercising ConfirmCurrent.
11
- */
12
- export declare function confirmCurrentCompanyValuationReport(client: LedgerJsonApiClient, params: ConfirmCurrentCompanyValuationReportParams): Promise<ConfirmCurrentCompanyValuationReportResult>;
13
- //# sourceMappingURL=confirmCurrentCompanyValuationReport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirmCurrentCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../src/functions/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0CAA0C;IACzD,gCAAgC,EAAE,MAAM,CAAC;CAC1C;AAED,MAAM,WAAW,0CAA0C;IACzD,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,oCAAoC,CACxD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0CAA0C,GACjD,OAAO,CAAC,0CAA0C,CAAC,CA2BrD"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.confirmCurrentCompanyValuationReport = confirmCurrentCompanyValuationReport;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Confirm the current company valuation on a CompanyValuationReport by exercising ConfirmCurrent.
7
- */
8
- async function confirmCurrentCompanyValuationReport(client, params) {
9
- // Determine the acting party (system_operator) from the created event
10
- const eventsResponse = await client.getEventsByContractId({
11
- contractId: params.companyValuationReportContractId
12
- });
13
- const systemOperator = eventsResponse.created.createdEvent.createArgument.system_operator;
14
- const choiceArguments = {};
15
- const response = await client.submitAndWaitForTransactionTree({
16
- actAs: [systemOperator],
17
- commands: [
18
- {
19
- ExerciseCommand: {
20
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.CompanyValuationReport.CompanyValuationReport.templateId,
21
- contractId: params.companyValuationReportContractId,
22
- choice: 'ConfirmCurrent',
23
- choiceArgument: choiceArguments
24
- }
25
- }
26
- ]
27
- });
28
- return {
29
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
30
- updateId: response.transactionTree.updateId
31
- };
32
- }
33
- //# sourceMappingURL=confirmCurrentCompanyValuationReport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"confirmCurrentCompanyValuationReport.js","sourceRoot":"","sources":["../../src/functions/confirmCurrentCompanyValuationReport.ts"],"names":[],"mappings":";;AAgBA,oFA8BC;AA9CD,6FAAoE;AAapE;;GAEG;AACI,KAAK,UAAU,oCAAoC,CACxD,MAA2B,EAC3B,MAAkD;IAElD,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAAgE,EAAE,CAAC;IAExF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,gBAAgB;oBACxB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
@@ -1,16 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- export interface CreateCompanyValuationReportParams {
3
- companyId: string;
4
- companyValuation: string | number;
5
- observers?: string[];
6
- }
7
- export interface CreateCompanyValuationReportResult {
8
- contractId: string;
9
- updateId: string;
10
- }
11
- /**
12
- * Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
13
- * on the OCP Factory contract.
14
- */
15
- export declare function createCompanyValuationReport(client: LedgerJsonApiClient, params: CreateCompanyValuationReportParams): Promise<CreateCompanyValuationReportResult>;
16
- //# sourceMappingURL=createCompanyValuationReport.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createCompanyValuationReport.d.ts","sourceRoot":"","sources":["../../src/functions/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;CACtB;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,CAgC7C"}
@@ -1,43 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.createCompanyValuationReport = createCompanyValuationReport;
7
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
8
- const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/ocp-factory-contract-id.json"));
9
- /**
10
- * Create a CompanyValuationReport by exercising the CreateCompanyValuationReport choice
11
- * on the OCP Factory contract.
12
- */
13
- async function createCompanyValuationReport(client, params) {
14
- const network = client.getNetwork();
15
- const networkData = ocp_factory_contract_id_json_1.default[network];
16
- if (!networkData) {
17
- throw new Error(`Unsupported network: ${network}`);
18
- }
19
- const choiceArguments = {
20
- company_id: params.companyId,
21
- company_valuation: typeof params.companyValuation === 'number'
22
- ? params.companyValuation.toString()
23
- : params.companyValuation,
24
- observers: params.observers ?? []
25
- };
26
- const response = await client.submitAndWaitForTransactionTree({
27
- commands: [
28
- {
29
- ExerciseCommand: {
30
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.OcpFactory.OcpFactory.templateId,
31
- contractId: networkData.ocpFactoryContractId,
32
- choice: 'CreateCompanyValuationReport',
33
- choiceArgument: choiceArguments
34
- }
35
- }
36
- ]
37
- });
38
- return {
39
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
40
- updateId: response.transactionTree.updateId
41
- };
42
- }
43
- //# sourceMappingURL=createCompanyValuationReport.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createCompanyValuationReport.js","sourceRoot":"","sources":["../../src/functions/createCompanyValuationReport.ts"],"names":[],"mappings":";;;;;AAoBA,oEAmCC;AAvDD,6FAAoE;AAEpE,yIAA0G;AAc1G;;;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;KAClC,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU;oBAClE,UAAU,EAAE,WAAW,CAAC,oBAAoB;oBAC5C,MAAM,EAAE,8BAA8B;oBACtC,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
@@ -1,58 +0,0 @@
1
- import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
3
- /**
4
- * Details about the IssuerAuthorization contract that need to be disclosed
5
- * when exercising the CreateIssuer choice. This is required for cross-domain
6
- * contract interactions in Canton.
7
- */
8
- export interface IssuerAuthorizationContractDetails {
9
- /** The contract ID of the IssuerAuthorization contract */
10
- contractId: string;
11
- /** The serialized created event blob of the contract */
12
- createdEventBlob: string;
13
- /** The synchronizer ID associated with the contract */
14
- synchronizerId: string;
15
- /** The template ID of the contract */
16
- templateId: string;
17
- }
18
- export interface CreateIssuerParams {
19
- /** Details of the IssuerAuthorization contract for disclosed contracts */
20
- issuerAuthorizationContractDetails: IssuerAuthorizationContractDetails;
21
- issuerParty: string;
22
- /** Issuer data to create */
23
- issuerData: Fairmint.OpenCapTable.OcfObjects.OcfIssuerData;
24
- }
25
- export interface CreateIssuerResult {
26
- contractId: string;
27
- updateId: string;
28
- }
29
- /**
30
- * Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
31
- *
32
- * This function requires the IssuerAuthorization 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 issuerAuthorizationContractDetails = {
38
- * contractId: "1234567890abcdef",
39
- * createdEventBlob: "serialized_contract_blob_here",
40
- * synchronizerId: "sync_id_here"
41
- * };
42
- *
43
- * const result = await createIssuer(client, {
44
- * issuerAuthorizationContractDetails,
45
- * issuerData: {
46
- * legal_name: "My Company Inc.",
47
- * country_of_formation: "US",
48
- * // ... other issuer data
49
- * }
50
- * });
51
- * ```
52
- *
53
- * @param client - The ledger JSON API client
54
- * @param params - Parameters for creating an issuer, including the IssuerAuthorization contract details
55
- * @returns Promise resolving to the result of the issuer creation
56
- */
57
- export declare function createIssuer(client: LedgerJsonApiClient, params: CreateIssuerParams): Promise<CreateIssuerResult>;
58
- //# sourceMappingURL=createIssuer.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createIssuer.d.ts","sourceRoot":"","sources":["../../src/functions/createIssuer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;;GAIG;AACH,MAAM,WAAW,kCAAkC;IACjD,0DAA0D;IAC1D,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,kBAAkB;IACjC,0EAA0E;IAC1E,kCAAkC,EAAE,kCAAkC,CAAC;IACvE,WAAW,EAAE,MAAM,CAAC;IACpB,4BAA4B;IAC5B,UAAU,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC5D;AAED,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAiC7B"}
@@ -1,65 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createIssuer = createIssuer;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Create an issuer by exercising the CreateIssuer choice on an IssuerAuthorization contract
7
- *
8
- * This function requires the IssuerAuthorization contract details to be provided for disclosed contracts,
9
- * which is necessary for cross-domain contract interactions in Canton.
10
- *
11
- * @example
12
- * ```typescript
13
- * const issuerAuthorizationContractDetails = {
14
- * contractId: "1234567890abcdef",
15
- * createdEventBlob: "serialized_contract_blob_here",
16
- * synchronizerId: "sync_id_here"
17
- * };
18
- *
19
- * const result = await createIssuer(client, {
20
- * issuerAuthorizationContractDetails,
21
- * issuerData: {
22
- * legal_name: "My Company Inc.",
23
- * country_of_formation: "US",
24
- * // ... other issuer data
25
- * }
26
- * });
27
- * ```
28
- *
29
- * @param client - The ledger JSON API client
30
- * @param params - Parameters for creating an issuer, including the IssuerAuthorization contract details
31
- * @returns Promise resolving to the result of the issuer creation
32
- */
33
- async function createIssuer(client, params) {
34
- // Create the choice arguments for CreateIssuer
35
- const choiceArguments = {
36
- issuer_data: params.issuerData
37
- };
38
- // Submit the choice to the IssuerAuthorization contract
39
- const response = await client.submitAndWaitForTransactionTree({
40
- actAs: [params.issuerParty],
41
- commands: [
42
- {
43
- ExerciseCommand: {
44
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.IssuerAuthorization.IssuerAuthorization.templateId,
45
- contractId: params.issuerAuthorizationContractDetails.contractId,
46
- choice: 'CreateIssuer',
47
- choiceArgument: choiceArguments
48
- }
49
- }
50
- ],
51
- disclosedContracts: [
52
- {
53
- templateId: params.issuerAuthorizationContractDetails.templateId,
54
- contractId: params.issuerAuthorizationContractDetails.contractId,
55
- createdEventBlob: params.issuerAuthorizationContractDetails.createdEventBlob,
56
- synchronizerId: params.issuerAuthorizationContractDetails.synchronizerId
57
- }
58
- ]
59
- });
60
- return {
61
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
62
- updateId: response.transactionTree.updateId
63
- };
64
- }
65
- //# sourceMappingURL=createIssuer.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"createIssuer.js","sourceRoot":"","sources":["../../src/functions/createIssuer.ts"],"names":[],"mappings":";;AA6DA,oCAoCC;AAjGD,6FAAoE;AAiCpE;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACI,KAAK,UAAU,YAAY,CAChC,MAA2B,EAC3B,MAA0B;IAE1B,+CAA+C;IAC/C,MAAM,eAAe,GAA2D;QAC9E,WAAW,EAAE,MAAM,CAAC,UAAU;KAC/B,CAAC;IAEF,wDAAwD;IACxD,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3B,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,mBAAmB,CAAC,mBAAmB,CAAC,UAAU;oBACpF,UAAU,EAAE,MAAM,CAAC,kCAAkC,CAAC,UAAU;oBAChE,MAAM,EAAE,cAAc;oBACtB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;QACD,kBAAkB,EAAE;YAClB;gBACE,UAAU,EAAE,MAAM,CAAC,kCAAkC,CAAC,UAAU;gBAChE,UAAU,EAAE,MAAM,CAAC,kCAAkC,CAAC,UAAU;gBAChE,gBAAgB,EAAE,MAAM,CAAC,kCAAkC,CAAC,gBAAgB;gBAC5E,cAAc,EAAE,MAAM,CAAC,kCAAkC,CAAC,cAAc;aACzE;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
@@ -1,14 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- export interface UpdateCompanyValuationParams {
3
- companyValuationReportContractId: string;
4
- newCompanyValuation: string | number;
5
- }
6
- export interface UpdateCompanyValuationResult {
7
- contractId: string;
8
- updateId: string;
9
- }
10
- /**
11
- * Update the company valuation on a CompanyValuationReport by exercising SetCompanyValuation.
12
- */
13
- export declare function updateCompanyValuation(client: LedgerJsonApiClient, params: UpdateCompanyValuationParams): Promise<UpdateCompanyValuationResult>;
14
- //# sourceMappingURL=updateCompanyValuation.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateCompanyValuation.d.ts","sourceRoot":"","sources":["../../src/functions/updateCompanyValuation.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,4BAA4B;IAC3C,gCAAgC,EAAE,MAAM,CAAC;IACzC,mBAAmB,EAAE,MAAM,GAAG,MAAM,CAAC;CACtC;AAED,MAAM,WAAW,4BAA4B;IAC3C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;GAEG;AACH,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CA+BvC"}
@@ -1,37 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateCompanyValuation = updateCompanyValuation;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Update the company valuation on a CompanyValuationReport by exercising SetCompanyValuation.
7
- */
8
- async function updateCompanyValuation(client, params) {
9
- // Determine the acting party (system_operator) from the created event
10
- const eventsResponse = await client.getEventsByContractId({
11
- contractId: params.companyValuationReportContractId
12
- });
13
- const systemOperator = eventsResponse.created.createdEvent.createArgument.system_operator;
14
- const choiceArguments = {
15
- new_company_valuation: typeof params.newCompanyValuation === 'number'
16
- ? params.newCompanyValuation.toString()
17
- : params.newCompanyValuation
18
- };
19
- const response = await client.submitAndWaitForTransactionTree({
20
- actAs: [systemOperator],
21
- commands: [
22
- {
23
- ExerciseCommand: {
24
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.CompanyValuationReport.CompanyValuationReport.templateId,
25
- contractId: params.companyValuationReportContractId,
26
- choice: 'SetCompanyValuation',
27
- choiceArgument: choiceArguments
28
- }
29
- }
30
- ]
31
- });
32
- return {
33
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
34
- updateId: response.transactionTree.updateId
35
- };
36
- }
37
- //# sourceMappingURL=updateCompanyValuation.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateCompanyValuation.js","sourceRoot":"","sources":["../../src/functions/updateCompanyValuation.ts"],"names":[],"mappings":";;AAiBA,wDAkCC;AAnDD,6FAAoE;AAcpE;;GAEG;AACI,KAAK,UAAU,sBAAsB,CAC1C,MAA2B,EAC3B,MAAoC;IAEpC,sEAAsE;IACtE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gCAAgC;KACpD,CAAC,CAAC;IACH,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,eAAe,CAAC;IAE1F,MAAM,eAAe,GAAqE;QACxF,qBAAqB,EAAE,OAAO,MAAM,CAAC,mBAAmB,KAAK,QAAQ;YACnE,CAAC,CAAC,MAAM,CAAC,mBAAmB,CAAC,QAAQ,EAAE;YACvC,CAAC,CAAC,MAAM,CAAC,mBAAmB;KAC/B,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,cAAc,CAAC;QACvB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,sBAAsB,CAAC,sBAAsB,CAAC,UAAU;oBAC1F,UAAU,EAAE,MAAM,CAAC,gCAAgC;oBACnD,MAAM,EAAE,qBAAqB;oBAC7B,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
@@ -1,18 +0,0 @@
1
- import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
3
- export interface UpdateIssuerDataParams {
4
- issuerContractId: string;
5
- newIssuerData: Fairmint.OpenCapTable.OcfObjects.OcfIssuerData;
6
- }
7
- export interface UpdateIssuerDataResult {
8
- contractId: string;
9
- updateId: string;
10
- }
11
- /**
12
- * Update issuer data by exercising the UpdateIssuerData choice on an Issuer contract
13
- * @param client - The ledger JSON API client
14
- * @param params - Parameters for updating issuer data
15
- * @returns Promise resolving to the result of the issuer data update
16
- */
17
- export declare function updateIssuerData(client: LedgerJsonApiClient, params: UpdateIssuerDataParams): Promise<UpdateIssuerDataResult>;
18
- //# sourceMappingURL=updateIssuerData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateIssuerData.d.ts","sourceRoot":"","sources":["../../src/functions/updateIssuerData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,aAAa,EAAE,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,aAAa,CAAC;CAC/D;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CAgCjC"}
@@ -1,40 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateIssuerData = updateIssuerData;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Update issuer data by exercising the UpdateIssuerData choice on an Issuer contract
7
- * @param client - The ledger JSON API client
8
- * @param params - Parameters for updating issuer data
9
- * @returns Promise resolving to the result of the issuer data update
10
- */
11
- async function updateIssuerData(client, params) {
12
- // Get the events for the Issuer contract to extract the issuer party
13
- const eventsResponse = await client.getEventsByContractId({
14
- contractId: params.issuerContractId
15
- });
16
- const issuerParty = eventsResponse.created.createdEvent.createArgument.issuer;
17
- // Create the choice arguments for UpdateIssuerData
18
- const choiceArguments = {
19
- new_issuer_data: params.newIssuerData
20
- };
21
- // Submit the choice to the Issuer contract
22
- const response = await client.submitAndWaitForTransactionTree({
23
- actAs: [issuerParty],
24
- commands: [
25
- {
26
- ExerciseCommand: {
27
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Issuer.Issuer.templateId,
28
- contractId: params.issuerContractId,
29
- choice: 'UpdateIssuerData',
30
- choiceArgument: choiceArguments
31
- }
32
- }
33
- ]
34
- });
35
- return {
36
- contractId: response.transactionTree.eventsById[1].CreatedTreeEvent.value.contractId,
37
- updateId: response.transactionTree.updateId
38
- };
39
- }
40
- //# sourceMappingURL=updateIssuerData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateIssuerData.js","sourceRoot":"","sources":["../../src/functions/updateIssuerData.ts"],"names":[],"mappings":";;AAoBA,4CAmCC;AAvDD,6FAAoE;AAcpE;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CACpC,MAA2B,EAC3B,MAA8B;IAE9B,qEAAqE;IACrE,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,gBAAgB;KACpC,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC,MAAM,CAAC;IAE9E,mDAAmD;IACnD,MAAM,eAAe,GAAkD;QACrE,eAAe,EAAE,MAAM,CAAC,aAAa;KACtC,CAAC;IAEF,2CAA2C;IAC3C,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,WAAW,CAAC;QACpB,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU;oBAC1D,UAAU,EAAE,MAAM,CAAC,gBAAgB;oBACnC,MAAM,EAAE,kBAAkB;oBAC1B,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,OAAO;QACL,UAAU,EAAE,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACpF,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}