@open-captable-protocol/canton 0.0.2 → 0.0.3

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 +1 @@
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;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAwBhC"}
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;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CAiChC"}
@@ -13,6 +13,13 @@ const ocp_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-c
13
13
  * @returns Promise resolving to the result of the authorization
14
14
  */
15
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
+ }
16
23
  // Create the choice arguments for AuthorizeIssuer
17
24
  const choiceArguments = {
18
25
  issuer: params.issuer
@@ -23,7 +30,7 @@ async function authorizeIssuer(client, params) {
23
30
  {
24
31
  ExerciseCommand: {
25
32
  templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.OcpFactory.OcpFactory.templateId,
26
- contractId: ocp_factory_contract_id_json_1.default.ocpFactoryContractId,
33
+ contractId: networkData.ocpFactoryContractId,
27
34
  choice: 'AuthorizeIssuer',
28
35
  choiceArgument: choiceArguments
29
36
  }
@@ -1 +1 @@
1
- {"version":3,"file":"authorizeIssuer.js","sourceRoot":"","sources":["../../src/functions/authorizeIssuer.ts"],"names":[],"mappings":";;;;;AAoBA,0CA2BC;AA/CD,6FAAoE;AAEpE,yIAA0G;AAY1G;;;;;GAKG;AACI,KAAK,UAAU,eAAe,CACnC,MAA2B,EAC3B,MAA6B;IAE7B,kDAAkD;IAClD,MAAM,eAAe,GAAqD;QACxE,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;IAEF,4CAA4C;IAC5C,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,sCAAqB,CAAC,oBAAoB;oBACtD,MAAM,EAAE,iBAAiB;oBACzB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA8C,CAAC;IAEhD,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":"authorizeIssuer.js","sourceRoot":"","sources":["../../src/functions/authorizeIssuer.ts"],"names":[],"mappings":";;;;;AAoBA,0CAoCC;AAxDD,6FAAoE;AAEpE,yIAA0G;AAY1G;;;;;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;QACjB,MAAM,IAAI,KAAK,CAAC,wBAAwB,OAAO,EAAE,CAAC,CAAC;IACrD,CAAC;IAED,kDAAkD;IAClD,MAAM,eAAe,GAAqD;QACxE,MAAM,EAAE,MAAM,CAAC,MAAM;KACtB,CAAC;IAEF,4CAA4C;IAC5C,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,iBAAiB;oBACzB,cAAc,EAAE,eAAe;iBAChC;aACF;SACF;KACF,CAA8C,CAAC;IAEhD,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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-captable-protocol/canton",
3
- "version": "0.0.2",
3
+ "version": "0.0.3",
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",
@@ -19,7 +19,7 @@
19
19
  "@daml/ledger": "^2.10.2",
20
20
  "@daml/types": "^2.10.2",
21
21
  "@fairmint/canton-node-sdk": "^0.0.65",
22
- "@fairmint/open-captable-protocol-daml-js": "^0.0.14"
22
+ "@fairmint/open-captable-protocol-daml-js": "^0.0.15"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^24.2.0",