@open-captable-protocol/canton 0.0.1 → 0.0.2

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,3 +1,4 @@
1
1
  export * from './authorizeIssuer';
2
2
  export * from './createIssuer';
3
+ export * from './updateIssuerData';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC"}
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./authorizeIssuer"), exports);
18
18
  __exportStar(require("./createIssuer"), exports);
19
+ __exportStar(require("./updateIssuerData"), exports);
19
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,iDAA+B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/functions/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,iDAA+B;AAC/B,qDAAmC"}
@@ -0,0 +1,18 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,40 @@
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
@@ -0,0 +1 @@
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,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.1",
3
+ "version": "0.0.2",
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.13"
22
+ "@fairmint/open-captable-protocol-daml-js": "^0.0.14"
23
23
  },
24
24
  "devDependencies": {
25
25
  "@types/node": "^24.2.0",