@open-captable-protocol/canton 0.2.3 → 0.2.4

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 (205) hide show
  1. package/dist/functions/stockClass/index.d.ts.map +1 -1
  2. package/dist/functions/stockClass/index.js +0 -1
  3. package/dist/functions/stockClass/index.js.map +1 -1
  4. package/dist/functions/stockPlan/createStockPlan.d.ts +0 -4
  5. package/dist/functions/stockPlan/createStockPlan.d.ts.map +1 -1
  6. package/dist/functions/stockPlan/createStockPlan.js +0 -1
  7. package/dist/functions/stockPlan/createStockPlan.js.map +1 -1
  8. package/dist/types/native.d.ts +9 -0
  9. package/dist/types/native.d.ts.map +1 -1
  10. package/dist/utils/typeConversions.d.ts.map +1 -1
  11. package/dist/utils/typeConversions.js +45 -11
  12. package/dist/utils/typeConversions.js.map +1 -1
  13. package/package.json +3 -3
  14. package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.d.ts +0 -13
  15. package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.d.ts.map +0 -1
  16. package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.js +0 -38
  17. package/dist/functions/companyValuationReport/confirmCurrentCompanyValuationReport.js.map +0 -1
  18. package/dist/functions/convertible/acceptConvertible.d.ts +0 -18
  19. package/dist/functions/convertible/acceptConvertible.d.ts.map +0 -1
  20. package/dist/functions/convertible/acceptConvertible.js +0 -31
  21. package/dist/functions/convertible/acceptConvertible.js.map +0 -1
  22. package/dist/functions/convertible/cancelConvertible.d.ts +0 -23
  23. package/dist/functions/convertible/cancelConvertible.d.ts.map +0 -1
  24. package/dist/functions/convertible/cancelConvertible.js +0 -37
  25. package/dist/functions/convertible/cancelConvertible.js.map +0 -1
  26. package/dist/functions/convertible/convertConvertible.d.ts +0 -18
  27. package/dist/functions/convertible/convertConvertible.d.ts.map +0 -1
  28. package/dist/functions/convertible/convertConvertible.js +0 -33
  29. package/dist/functions/convertible/convertConvertible.js.map +0 -1
  30. package/dist/functions/convertible/getConvertibleAsOcf.d.ts +0 -21
  31. package/dist/functions/convertible/getConvertibleAsOcf.d.ts.map +0 -1
  32. package/dist/functions/convertible/getConvertibleAsOcf.js +0 -24
  33. package/dist/functions/convertible/getConvertibleAsOcf.js.map +0 -1
  34. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.d.ts +0 -19
  35. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.d.ts.map +0 -1
  36. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.js +0 -21
  37. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.js.map +0 -1
  38. package/dist/functions/convertible/index.d.ts +0 -9
  39. package/dist/functions/convertible/index.d.ts.map +0 -1
  40. package/dist/functions/convertible/index.js +0 -25
  41. package/dist/functions/convertible/index.js.map +0 -1
  42. package/dist/functions/convertible/issueConvertible.d.ts +0 -20
  43. package/dist/functions/convertible/issueConvertible.d.ts.map +0 -1
  44. package/dist/functions/convertible/issueConvertible.js +0 -46
  45. package/dist/functions/convertible/issueConvertible.js.map +0 -1
  46. package/dist/functions/convertible/retractConvertible.d.ts +0 -19
  47. package/dist/functions/convertible/retractConvertible.d.ts.map +0 -1
  48. package/dist/functions/convertible/retractConvertible.js +0 -32
  49. package/dist/functions/convertible/retractConvertible.js.map +0 -1
  50. package/dist/functions/convertible/transferConvertible.d.ts +0 -25
  51. package/dist/functions/convertible/transferConvertible.d.ts.map +0 -1
  52. package/dist/functions/convertible/transferConvertible.js +0 -45
  53. package/dist/functions/convertible/transferConvertible.js.map +0 -1
  54. package/dist/functions/issuer/adjustAuthorizedShares.d.ts +0 -20
  55. package/dist/functions/issuer/adjustAuthorizedShares.d.ts.map +0 -1
  56. package/dist/functions/issuer/adjustAuthorizedShares.js +0 -33
  57. package/dist/functions/issuer/adjustAuthorizedShares.js.map +0 -1
  58. package/dist/functions/issuer/updateIssuerData.d.ts +0 -50
  59. package/dist/functions/issuer/updateIssuerData.d.ts.map +0 -1
  60. package/dist/functions/issuer/updateIssuerData.js +0 -89
  61. package/dist/functions/issuer/updateIssuerData.js.map +0 -1
  62. package/dist/functions/stakeholder/recordRelationshipChange.d.ts +0 -20
  63. package/dist/functions/stakeholder/recordRelationshipChange.d.ts.map +0 -1
  64. package/dist/functions/stakeholder/recordRelationshipChange.js +0 -33
  65. package/dist/functions/stakeholder/recordRelationshipChange.js.map +0 -1
  66. package/dist/functions/stakeholder/recordStatusChange.d.ts +0 -19
  67. package/dist/functions/stakeholder/recordStatusChange.d.ts.map +0 -1
  68. package/dist/functions/stakeholder/recordStatusChange.js +0 -32
  69. package/dist/functions/stakeholder/recordStatusChange.js.map +0 -1
  70. package/dist/functions/stakeholder/updateStakeholderData.d.ts +0 -17
  71. package/dist/functions/stakeholder/updateStakeholderData.d.ts.map +0 -1
  72. package/dist/functions/stakeholder/updateStakeholderData.js +0 -59
  73. package/dist/functions/stakeholder/updateStakeholderData.js.map +0 -1
  74. package/dist/functions/stockClass/adjustAuthorizedShares.d.ts +0 -20
  75. package/dist/functions/stockClass/adjustAuthorizedShares.d.ts.map +0 -1
  76. package/dist/functions/stockClass/adjustAuthorizedShares.js +0 -28
  77. package/dist/functions/stockClass/adjustAuthorizedShares.js.map +0 -1
  78. package/dist/functions/stockClass/adjustConversionRatio.d.ts +0 -23
  79. package/dist/functions/stockClass/adjustConversionRatio.d.ts.map +0 -1
  80. package/dist/functions/stockClass/adjustConversionRatio.js +0 -39
  81. package/dist/functions/stockClass/adjustConversionRatio.js.map +0 -1
  82. package/dist/functions/stockClass/consolidatePositions.d.ts +0 -21
  83. package/dist/functions/stockClass/consolidatePositions.d.ts.map +0 -1
  84. package/dist/functions/stockClass/consolidatePositions.js +0 -34
  85. package/dist/functions/stockClass/consolidatePositions.js.map +0 -1
  86. package/dist/functions/stockClass/issueStock.d.ts +0 -19
  87. package/dist/functions/stockClass/issueStock.d.ts.map +0 -1
  88. package/dist/functions/stockClass/issueStock.js +0 -34
  89. package/dist/functions/stockClass/issueStock.js.map +0 -1
  90. package/dist/functions/stockClass/reissueStock.d.ts +0 -18
  91. package/dist/functions/stockClass/reissueStock.d.ts.map +0 -1
  92. package/dist/functions/stockClass/reissueStock.js +0 -35
  93. package/dist/functions/stockClass/reissueStock.js.map +0 -1
  94. package/dist/functions/stockClass/repurchaseStock.d.ts +0 -20
  95. package/dist/functions/stockClass/repurchaseStock.d.ts.map +0 -1
  96. package/dist/functions/stockClass/repurchaseStock.js +0 -33
  97. package/dist/functions/stockClass/repurchaseStock.js.map +0 -1
  98. package/dist/functions/stockClass/splitStockClass.d.ts +0 -18
  99. package/dist/functions/stockClass/splitStockClass.d.ts.map +0 -1
  100. package/dist/functions/stockClass/splitStockClass.js +0 -33
  101. package/dist/functions/stockClass/splitStockClass.js.map +0 -1
  102. package/dist/functions/stockClass/updateStockClass.d.ts +0 -51
  103. package/dist/functions/stockClass/updateStockClass.d.ts.map +0 -1
  104. package/dist/functions/stockClass/updateStockClass.js +0 -95
  105. package/dist/functions/stockClass/updateStockClass.js.map +0 -1
  106. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.d.ts +0 -14
  107. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.d.ts.map +0 -1
  108. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.js +0 -56
  109. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.js.map +0 -1
  110. package/dist/functions/stockPlan/acceptGrant.d.ts +0 -16
  111. package/dist/functions/stockPlan/acceptGrant.d.ts.map +0 -1
  112. package/dist/functions/stockPlan/acceptGrant.js +0 -31
  113. package/dist/functions/stockPlan/acceptGrant.js.map +0 -1
  114. package/dist/functions/stockPlan/adjustPool.d.ts +0 -20
  115. package/dist/functions/stockPlan/adjustPool.d.ts.map +0 -1
  116. package/dist/functions/stockPlan/adjustPool.js +0 -33
  117. package/dist/functions/stockPlan/adjustPool.js.map +0 -1
  118. package/dist/functions/stockPlan/cancelGrant.d.ts +0 -16
  119. package/dist/functions/stockPlan/cancelGrant.d.ts.map +0 -1
  120. package/dist/functions/stockPlan/cancelGrant.js +0 -31
  121. package/dist/functions/stockPlan/cancelGrant.js.map +0 -1
  122. package/dist/functions/stockPlan/exerciseGrant.d.ts +0 -20
  123. package/dist/functions/stockPlan/exerciseGrant.d.ts.map +0 -1
  124. package/dist/functions/stockPlan/exerciseGrant.js +0 -33
  125. package/dist/functions/stockPlan/exerciseGrant.js.map +0 -1
  126. package/dist/functions/stockPlan/issuePlanSecurity.d.ts +0 -27
  127. package/dist/functions/stockPlan/issuePlanSecurity.d.ts.map +0 -1
  128. package/dist/functions/stockPlan/issuePlanSecurity.js +0 -53
  129. package/dist/functions/stockPlan/issuePlanSecurity.js.map +0 -1
  130. package/dist/functions/stockPlan/releaseGrant.d.ts +0 -16
  131. package/dist/functions/stockPlan/releaseGrant.d.ts.map +0 -1
  132. package/dist/functions/stockPlan/releaseGrant.js +0 -31
  133. package/dist/functions/stockPlan/releaseGrant.js.map +0 -1
  134. package/dist/functions/stockPlan/repriceGrant.d.ts +0 -22
  135. package/dist/functions/stockPlan/repriceGrant.d.ts.map +0 -1
  136. package/dist/functions/stockPlan/repriceGrant.js +0 -38
  137. package/dist/functions/stockPlan/repriceGrant.js.map +0 -1
  138. package/dist/functions/stockPlan/retractGrant.d.ts +0 -16
  139. package/dist/functions/stockPlan/retractGrant.d.ts.map +0 -1
  140. package/dist/functions/stockPlan/retractGrant.js +0 -31
  141. package/dist/functions/stockPlan/retractGrant.js.map +0 -1
  142. package/dist/functions/stockPlan/startVesting.d.ts +0 -13
  143. package/dist/functions/stockPlan/startVesting.d.ts.map +0 -1
  144. package/dist/functions/stockPlan/startVesting.js +0 -28
  145. package/dist/functions/stockPlan/startVesting.js.map +0 -1
  146. package/dist/functions/stockPlan/transferGrant.d.ts +0 -21
  147. package/dist/functions/stockPlan/transferGrant.d.ts.map +0 -1
  148. package/dist/functions/stockPlan/transferGrant.js +0 -34
  149. package/dist/functions/stockPlan/transferGrant.js.map +0 -1
  150. package/dist/functions/stockPlan/updateStockPlan.d.ts +0 -24
  151. package/dist/functions/stockPlan/updateStockPlan.d.ts.map +0 -1
  152. package/dist/functions/stockPlan/updateStockPlan.js +0 -62
  153. package/dist/functions/stockPlan/updateStockPlan.js.map +0 -1
  154. package/dist/functions/stockPosition/acceptTransfer.d.ts +0 -16
  155. package/dist/functions/stockPosition/acceptTransfer.d.ts.map +0 -1
  156. package/dist/functions/stockPosition/acceptTransfer.js +0 -31
  157. package/dist/functions/stockPosition/acceptTransfer.js.map +0 -1
  158. package/dist/functions/stockPosition/index.d.ts +0 -1
  159. package/dist/functions/stockPosition/index.d.ts.map +0 -1
  160. package/dist/functions/stockPosition/index.js +0 -3
  161. package/dist/functions/stockPosition/index.js.map +0 -1
  162. package/dist/functions/stockPosition/proposeTransfer.d.ts +0 -17
  163. package/dist/functions/stockPosition/proposeTransfer.d.ts.map +0 -1
  164. package/dist/functions/stockPosition/proposeTransfer.js +0 -34
  165. package/dist/functions/stockPosition/proposeTransfer.js.map +0 -1
  166. package/dist/functions/stockPosition/reduceQuantity.d.ts +0 -12
  167. package/dist/functions/stockPosition/reduceQuantity.d.ts.map +0 -1
  168. package/dist/functions/stockPosition/reduceQuantity.js +0 -27
  169. package/dist/functions/stockPosition/reduceQuantity.js.map +0 -1
  170. package/dist/functions/stockPosition/retractTransfer.d.ts +0 -15
  171. package/dist/functions/stockPosition/retractTransfer.d.ts.map +0 -1
  172. package/dist/functions/stockPosition/retractTransfer.js +0 -28
  173. package/dist/functions/stockPosition/retractTransfer.js.map +0 -1
  174. package/dist/functions/valuation/updateValuationData.d.ts +0 -18
  175. package/dist/functions/valuation/updateValuationData.d.ts.map +0 -1
  176. package/dist/functions/valuation/updateValuationData.js +0 -58
  177. package/dist/functions/valuation/updateValuationData.js.map +0 -1
  178. package/dist/functions/vestingTerms/updateVestingTerms.d.ts +0 -18
  179. package/dist/functions/vestingTerms/updateVestingTerms.d.ts.map +0 -1
  180. package/dist/functions/vestingTerms/updateVestingTerms.js +0 -58
  181. package/dist/functions/vestingTerms/updateVestingTerms.js.map +0 -1
  182. package/dist/functions/warrant/exerciseWarrant.d.ts +0 -17
  183. package/dist/functions/warrant/exerciseWarrant.d.ts.map +0 -1
  184. package/dist/functions/warrant/exerciseWarrant.js +0 -32
  185. package/dist/functions/warrant/exerciseWarrant.js.map +0 -1
  186. package/dist/functions/warrant/getWarrantAsOcf.d.ts +0 -18
  187. package/dist/functions/warrant/getWarrantAsOcf.d.ts.map +0 -1
  188. package/dist/functions/warrant/getWarrantAsOcf.js +0 -21
  189. package/dist/functions/warrant/getWarrantAsOcf.js.map +0 -1
  190. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.d.ts +0 -19
  191. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.d.ts.map +0 -1
  192. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.js +0 -21
  193. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.js.map +0 -1
  194. package/dist/functions/warrant/index.d.ts +0 -8
  195. package/dist/functions/warrant/index.d.ts.map +0 -1
  196. package/dist/functions/warrant/index.js +0 -24
  197. package/dist/functions/warrant/index.js.map +0 -1
  198. package/dist/functions/warrant/issueWarrant.d.ts +0 -25
  199. package/dist/functions/warrant/issueWarrant.d.ts.map +0 -1
  200. package/dist/functions/warrant/issueWarrant.js +0 -49
  201. package/dist/functions/warrant/issueWarrant.js.map +0 -1
  202. package/dist/functions/warrant/transferWarrant.d.ts +0 -17
  203. package/dist/functions/warrant/transferWarrant.d.ts.map +0 -1
  204. package/dist/functions/warrant/transferWarrant.js +0 -30
  205. package/dist/functions/warrant/transferWarrant.js.map +0 -1
@@ -1,20 +0,0 @@
1
- import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
- import type { ContractId } from '@daml/types';
3
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
4
- export interface AdjustIssuerAuthorizedSharesParams {
5
- issuerContractId: ContractId<Fairmint.OpenCapTable.Issuer.Issuer>;
6
- issuerParty: string;
7
- newAuthorized: string | number;
8
- date: string;
9
- }
10
- export interface AdjustIssuerAuthorizedSharesResult {
11
- updateId: string;
12
- }
13
- /**
14
- * Adjust issuer-level authorized shares.
15
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/adjustment/IssuerAuthorizedSharesAdjustment.schema.json
16
- * - new_authorized: New authorized shares amount (numeric only)
17
- * - date: Effective date (YYYY-MM-DD)
18
- */
19
- export declare function adjustIssuerAuthorizedShares(client: LedgerJsonApiClient, params: AdjustIssuerAuthorizedSharesParams): Promise<AdjustIssuerAuthorizedSharesResult>;
20
- //# sourceMappingURL=adjustAuthorizedShares.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustAuthorizedShares.d.ts","sourceRoot":"","sources":["../../../src/functions/issuer/adjustAuthorizedShares.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,kCAAkC;IACjD,gBAAgB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;IAClE,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kCAAkC;IACjD,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,4BAA4B,CAChD,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kCAAkC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CAwB7C"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.adjustIssuerAuthorizedShares = adjustIssuerAuthorizedShares;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Adjust issuer-level authorized shares.
7
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/adjustment/IssuerAuthorizedSharesAdjustment.schema.json
8
- * - new_authorized: New authorized shares amount (numeric only)
9
- * - date: Effective date (YYYY-MM-DD)
10
- */
11
- async function adjustIssuerAuthorizedShares(client, params) {
12
- const choiceArgs = {
13
- new_authorized: typeof params.newAuthorized === 'number'
14
- ? params.newAuthorized.toString()
15
- : params.newAuthorized,
16
- date: `${params.date}T00:00:00.000Z`,
17
- };
18
- const response = (await client.submitAndWaitForTransactionTree({
19
- actAs: [params.issuerParty],
20
- commands: [
21
- {
22
- ExerciseCommand: {
23
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Issuer.Issuer.templateId,
24
- contractId: params.issuerContractId,
25
- choice: 'AdjustIssuerAuthorizedShares',
26
- choiceArgument: choiceArgs,
27
- },
28
- },
29
- ],
30
- }));
31
- return { updateId: response.transactionTree.updateId };
32
- }
33
- //# sourceMappingURL=adjustAuthorizedShares.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustAuthorizedShares.js","sourceRoot":"","sources":["../../../src/functions/issuer/adjustAuthorizedShares.ts"],"names":[],"mappings":";;AAsBA,oEA2BC;AAjDD,6FAAoE;AAgBpE;;;;;GAKG;AACI,KAAK,UAAU,4BAA4B,CAChD,MAA2B,EAC3B,MAA0C;IAE1C,MAAM,UAAU,GAA8D;QAC5E,cAAc,EACZ,OAAO,MAAM,CAAC,aAAa,KAAK,QAAQ;YACtC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE;YACjC,CAAC,CAAC,MAAM,CAAC,aAAa;QAC1B,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KAC9B,CAAC;IAET,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC7D,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3B,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,8BAA8B;oBACtC,cAAc,EAAE,UAAU;iBAC3B;aACF;SACF;KACF,CAAC,CAA4C,CAAC;IAE/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;AACzD,CAAC"}
@@ -1,50 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- import { ContractDetails } from '../../types/contractDetails';
3
- import { OcfIssuerData } from '../../types/native';
4
- export interface UpdateIssuerDataParams {
5
- issuerContractId: string;
6
- /** Details of the FeaturedAppRight contract for disclosed contracts */
7
- featuredAppRightContractDetails: ContractDetails;
8
- /**
9
- * New issuer data to apply to the contract
10
- * See schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/Issuer.schema.json
11
- * Field notes mirror the schema descriptions (legal_name, formation_date, country_of_formation, etc.)
12
- */
13
- newIssuerData: OcfIssuerData;
14
- }
15
- export interface UpdateIssuerDataResult {
16
- contractId: string;
17
- updateId: string;
18
- }
19
- /**
20
- * Update issuer data by exercising the UpdateIssuerData choice on an Issuer contract
21
- *
22
- * This function requires the FeaturedAppRight contract details to be provided for disclosed contracts,
23
- * which is necessary for cross-domain contract interactions in Canton.
24
- *
25
- * @example
26
- * ```typescript
27
- * const featuredAppRightContractDetails = {
28
- * contractId: "abcdef1234567890",
29
- * createdEventBlob: "serialized_featured_app_right_blob_here",
30
- * synchronizerId: "featured_sync_id_here",
31
- * templateId: "FeaturedAppRight:template:id:here"
32
- * };
33
- *
34
- * const result = await updateIssuerData(client, {
35
- * issuerContractId: "1234567890abcdef",
36
- * featuredAppRightContractDetails,
37
- * newIssuerData: {
38
- * legal_name: "Updated Company Inc.",
39
- * country_of_formation: "US",
40
- * // ... other updated issuer data
41
- * }
42
- * });
43
- * ```
44
- *
45
- * @param client - The ledger JSON API client
46
- * @param params - Parameters for updating issuer data, including the contract details for disclosed contracts
47
- * @returns Promise resolving to the result of the issuer data update
48
- */
49
- export declare function updateIssuerData(client: LedgerJsonApiClient, params: UpdateIssuerDataParams): Promise<UpdateIssuerDataResult>;
50
- //# sourceMappingURL=updateIssuerData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateIssuerData.d.ts","sourceRoot":"","sources":["../../../src/functions/issuer/updateIssuerData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAGnD,MAAM,WAAW,sBAAsB;IACrC,gBAAgB,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,+BAA+B,EAAE,eAAe,CAAC;IACjD;;;;OAIG;IACH,aAAa,EAAE,aAAa,CAAC;CAC9B;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAUD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,sBAAsB,GAC7B,OAAO,CAAC,sBAAsB,CAAC,CAqDjC"}
@@ -1,89 +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
- const typeConversions_1 = require("../../utils/typeConversions");
6
- function hasIssuer(arg) {
7
- return !!arg && typeof arg === 'object' && typeof arg.issuer === 'string';
8
- }
9
- /**
10
- * Update issuer data by exercising the UpdateIssuerData choice on an Issuer 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: "abcdef1234567890",
19
- * createdEventBlob: "serialized_featured_app_right_blob_here",
20
- * synchronizerId: "featured_sync_id_here",
21
- * templateId: "FeaturedAppRight:template:id:here"
22
- * };
23
- *
24
- * const result = await updateIssuerData(client, {
25
- * issuerContractId: "1234567890abcdef",
26
- * featuredAppRightContractDetails,
27
- * newIssuerData: {
28
- * legal_name: "Updated Company Inc.",
29
- * country_of_formation: "US",
30
- * // ... other updated issuer data
31
- * }
32
- * });
33
- * ```
34
- *
35
- * @param client - The ledger JSON API client
36
- * @param params - Parameters for updating issuer data, including the contract details for disclosed contracts
37
- * @returns Promise resolving to the result of the issuer data update
38
- */
39
- async function updateIssuerData(client, params) {
40
- // Get the events for the Issuer contract to extract the issuer party
41
- const eventsResponse = await client.getEventsByContractId({
42
- contractId: params.issuerContractId
43
- });
44
- if (!eventsResponse.created?.createdEvent?.createArgument) {
45
- throw new Error('Invalid contract events response: missing created event or create argument');
46
- }
47
- const createArgument = eventsResponse.created.createdEvent.createArgument;
48
- if (!hasIssuer(createArgument)) {
49
- throw new Error('Issuer party not found in contract create argument');
50
- }
51
- const issuerParty = createArgument.issuer;
52
- // Create the choice arguments for UpdateIssuerData
53
- const choiceArguments = {
54
- new_issuer_data: (0, typeConversions_1.issuerDataToDaml)(params.newIssuerData)
55
- };
56
- // Submit the choice to the Issuer contract
57
- const response = await client.submitAndWaitForTransactionTree({
58
- actAs: [issuerParty],
59
- commands: [
60
- {
61
- ExerciseCommand: {
62
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Issuer.Issuer.templateId,
63
- contractId: params.issuerContractId,
64
- choice: 'UpdateIssuerData',
65
- choiceArgument: choiceArguments
66
- }
67
- }
68
- ],
69
- disclosedContracts: [
70
- {
71
- templateId: params.featuredAppRightContractDetails.templateId,
72
- contractId: params.featuredAppRightContractDetails.contractId,
73
- createdEventBlob: params.featuredAppRightContractDetails.createdEventBlob,
74
- synchronizerId: params.featuredAppRightContractDetails.synchronizerId
75
- }
76
- ]
77
- });
78
- const event = response.transactionTree.eventsById[1];
79
- if ('CreatedTreeEvent' in event) {
80
- return {
81
- contractId: event.CreatedTreeEvent.value.contractId,
82
- updateId: response.transactionTree.updateId
83
- };
84
- }
85
- else {
86
- throw new Error('Expected CreatedTreeEvent not found');
87
- }
88
- }
89
- //# sourceMappingURL=updateIssuerData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateIssuerData.js","sourceRoot":"","sources":["../../../src/functions/issuer/updateIssuerData.ts"],"names":[],"mappings":";;AA8DA,4CAwDC;AAtHD,6FAAoE;AAKpE,iEAA+D;AAuB/D,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAQ,GAAiC,CAAC,MAAM,KAAK,QAAQ,CAAC;AAC3G,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;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,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC;IAC1E,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC;IAE1C,mDAAmD;IACnD,MAAM,eAAe,GAAkD;QACrE,eAAe,EAAE,IAAA,kCAAgB,EAAC,MAAM,CAAC,aAAa,CAAC;KACxD,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;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"}
@@ -1,20 +0,0 @@
1
- import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
- import type { ContractId } from '@daml/types';
3
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
4
- export interface RecordRelationshipChangeParams {
5
- stakeholderContractId: ContractId<Fairmint.OpenCapTable.Stakeholder.Stakeholder>;
6
- issuerParty: string;
7
- date: string;
8
- relationshipStarted?: Fairmint.OpenCapTable.Types.OcfStakeholderRelationshipType;
9
- relationshipEnded?: Fairmint.OpenCapTable.Types.OcfStakeholderRelationshipType;
10
- }
11
- export interface RecordRelationshipChangeResult {
12
- updateId: string;
13
- eventContractId: string;
14
- }
15
- /**
16
- * Record a stakeholder relationship change event.
17
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/change_event/StakeholderRelationshipChangeEvent.schema.json
18
- */
19
- export declare function recordRelationshipChange(client: LedgerJsonApiClient, params: RecordRelationshipChangeParams): Promise<RecordRelationshipChangeResult>;
20
- //# sourceMappingURL=recordRelationshipChange.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordRelationshipChange.d.ts","sourceRoot":"","sources":["../../../src/functions/stakeholder/recordRelationshipChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,8BAA8B;IAC7C,qBAAqB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,8BAA8B,CAAC;IACjF,iBAAiB,CAAC,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,8BAA8B,CAAC;CAChF;AAED,MAAM,WAAW,8BAA8B;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,8BAA8B,GACrC,OAAO,CAAC,8BAA8B,CAAC,CA4BzC"}
@@ -1,33 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.recordRelationshipChange = recordRelationshipChange;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Record a stakeholder relationship change event.
7
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/change_event/StakeholderRelationshipChangeEvent.schema.json
8
- */
9
- async function recordRelationshipChange(client, params) {
10
- const choiceArgs = {
11
- date: `${params.date}T00:00:00.000Z`,
12
- relationship_started: params.relationshipStarted ? { tag: 'Some', value: params.relationshipStarted } : null,
13
- relationship_ended: params.relationshipEnded ? { tag: 'Some', value: params.relationshipEnded } : null,
14
- };
15
- const response = (await client.submitAndWaitForTransactionTree({
16
- actAs: [params.issuerParty],
17
- commands: [
18
- {
19
- ExerciseCommand: {
20
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Stakeholder.Stakeholder.templateId,
21
- contractId: params.stakeholderContractId,
22
- choice: 'RecordRelationshipChange',
23
- choiceArgument: choiceArgs,
24
- },
25
- },
26
- ],
27
- }));
28
- const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Stakeholder.StakeholderRelationshipChangeEvent.templateId);
29
- if (!created)
30
- throw new Error('StakeholderRelationshipChangeEvent not found');
31
- return { updateId: response.transactionTree.updateId, eventContractId: created.CreatedTreeEvent.value.contractId };
32
- }
33
- //# sourceMappingURL=recordRelationshipChange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordRelationshipChange.js","sourceRoot":"","sources":["../../../src/functions/stakeholder/recordRelationshipChange.ts"],"names":[],"mappings":";;AAsBA,4DA+BC;AArDD,6FAAoE;AAkBpE;;;GAGG;AACI,KAAK,UAAU,wBAAwB,CAC5C,MAA2B,EAC3B,MAAsC;IAEtC,MAAM,UAAU,GAA+D;QAC7E,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;QACpC,oBAAoB,EAAE,MAAM,CAAC,mBAAmB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC,CAAC,IAAI;QAC5G,kBAAkB,EAAE,MAAM,CAAC,iBAAiB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAAC,IAAI;KAChG,CAAC;IAET,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC7D,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3B,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU;oBACpE,UAAU,EAAE,MAAM,CAAC,qBAAqB;oBACxC,MAAM,EAAE,0BAA0B;oBAClC,cAAc,EAAE,UAAU;iBAC3B;aACF;SACF;KACF,CAAC,CAA4C,CAAC;IAE/C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CACrE,CAAC,CAAM,EAAE,EAAE,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,KAAK,yCAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,kCAAkC,CAAC,UAAU,CACxJ,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAE9E,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AACrH,CAAC"}
@@ -1,19 +0,0 @@
1
- import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
- import type { ContractId } from '@daml/types';
3
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
4
- export interface RecordStatusChangeParams {
5
- stakeholderContractId: ContractId<Fairmint.OpenCapTable.Stakeholder.Stakeholder>;
6
- issuerParty: string;
7
- date: string;
8
- newStatus: Fairmint.OpenCapTable.Types.OcfStakeholderStatusType;
9
- }
10
- export interface RecordStatusChangeResult {
11
- updateId: string;
12
- eventContractId: string;
13
- }
14
- /**
15
- * Record a stakeholder status change event.
16
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/change_event/StakeholderStatusChangeEvent.schema.json
17
- */
18
- export declare function recordStatusChange(client: LedgerJsonApiClient, params: RecordStatusChangeParams): Promise<RecordStatusChangeResult>;
19
- //# sourceMappingURL=recordStatusChange.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordStatusChange.d.ts","sourceRoot":"","sources":["../../../src/functions/stakeholder/recordStatusChange.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,wBAAwB;IACvC,qBAAqB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC;IACjF,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,QAAQ,CAAC,YAAY,CAAC,KAAK,CAAC,wBAAwB,CAAC;CACjE;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,CAAC;CACzB;AAED;;;GAGG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,wBAAwB,CAAC,CA2BnC"}
@@ -1,32 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.recordStatusChange = recordStatusChange;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Record a stakeholder status change event.
7
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/change_event/StakeholderStatusChangeEvent.schema.json
8
- */
9
- async function recordStatusChange(client, params) {
10
- const choiceArgs = {
11
- date: `${params.date}T00:00:00.000Z`,
12
- new_status: params.newStatus,
13
- };
14
- const response = (await client.submitAndWaitForTransactionTree({
15
- actAs: [params.issuerParty],
16
- commands: [
17
- {
18
- ExerciseCommand: {
19
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Stakeholder.Stakeholder.templateId,
20
- contractId: params.stakeholderContractId,
21
- choice: 'RecordStatusChange',
22
- choiceArgument: choiceArgs,
23
- },
24
- },
25
- ],
26
- }));
27
- const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Stakeholder.StakeholderStatusChangeEvent.templateId);
28
- if (!created)
29
- throw new Error('StakeholderStatusChangeEvent not found');
30
- return { updateId: response.transactionTree.updateId, eventContractId: created.CreatedTreeEvent.value.contractId };
31
- }
32
- //# sourceMappingURL=recordStatusChange.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recordStatusChange.js","sourceRoot":"","sources":["../../../src/functions/stakeholder/recordStatusChange.ts"],"names":[],"mappings":";;AAqBA,gDA8BC;AAnDD,6FAAoE;AAiBpE;;;GAGG;AACI,KAAK,UAAU,kBAAkB,CACtC,MAA2B,EAC3B,MAAgC;IAEhC,MAAM,UAAU,GAAyD;QACvE,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;QACpC,UAAU,EAAE,MAAM,CAAC,SAAgB;KAC7B,CAAC;IAET,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC7D,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3B,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,WAAW,CAAC,UAAU;oBACpE,UAAU,EAAE,MAAM,CAAC,qBAAqB;oBACxC,MAAM,EAAE,oBAAoB;oBAC5B,cAAc,EAAE,UAAU;iBAC3B;aACF;SACF;KACF,CAAC,CAA4C,CAAC;IAE/C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CACrE,CAAC,CAAM,EAAE,EAAE,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,KAAK,yCAAQ,CAAC,YAAY,CAAC,WAAW,CAAC,4BAA4B,CAAC,UAAU,CAClJ,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;IAExE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,eAAe,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AACrH,CAAC"}
@@ -1,17 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- import { ContractDetails } from '../../types/contractDetails';
3
- import { OcfStakeholderData } from '../../types/native';
4
- export interface UpdateStakeholderDataParams {
5
- stakeholderContractId: string;
6
- featuredAppRightContractDetails: ContractDetails;
7
- newStakeholderData: OcfStakeholderData;
8
- }
9
- export interface UpdateStakeholderDataResult {
10
- contractId: string;
11
- updateId: string;
12
- }
13
- /**
14
- * Update stakeholder data by exercising the UpdateStakeholderData choice on a Stakeholder contract
15
- */
16
- export declare function updateStakeholderData(client: LedgerJsonApiClient, params: UpdateStakeholderDataParams): Promise<UpdateStakeholderDataResult>;
17
- //# sourceMappingURL=updateStakeholderData.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateStakeholderData.d.ts","sourceRoot":"","sources":["../../../src/functions/stakeholder/updateStakeholderData.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AAGxD,MAAM,WAAW,2BAA2B;IAC1C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,+BAA+B,EAAE,eAAe,CAAC;IACjD,kBAAkB,EAAE,kBAAkB,CAAC;CACxC;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAUD;;GAEG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,2BAA2B,CAAC,CAkDtC"}
@@ -1,59 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateStakeholderData = updateStakeholderData;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- const typeConversions_1 = require("../../utils/typeConversions");
6
- function hasIssuer(arg) {
7
- return !!arg && typeof arg === 'object' && typeof arg.issuer === 'string';
8
- }
9
- /**
10
- * Update stakeholder data by exercising the UpdateStakeholderData choice on a Stakeholder contract
11
- */
12
- async function updateStakeholderData(client, params) {
13
- const eventsResponse = await client.getEventsByContractId({
14
- contractId: params.stakeholderContractId
15
- });
16
- if (!eventsResponse.created?.createdEvent?.createArgument) {
17
- throw new Error('Invalid contract events response: missing created event or create argument');
18
- }
19
- const createArgument = eventsResponse.created.createdEvent.createArgument;
20
- if (!hasIssuer(createArgument)) {
21
- throw new Error('Issuer party not found in contract create argument');
22
- }
23
- const issuerParty = createArgument.issuer;
24
- const choiceArguments = {
25
- new_stakeholder_data: (0, typeConversions_1.stakeholderDataToDaml)(params.newStakeholderData)
26
- };
27
- const response = await client.submitAndWaitForTransactionTree({
28
- actAs: [issuerParty],
29
- commands: [
30
- {
31
- ExerciseCommand: {
32
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.Stakeholder.Stakeholder.templateId,
33
- contractId: params.stakeholderContractId,
34
- choice: 'UpdateStakeholderData',
35
- choiceArgument: choiceArguments
36
- }
37
- }
38
- ],
39
- disclosedContracts: [
40
- {
41
- templateId: params.featuredAppRightContractDetails.templateId,
42
- contractId: params.featuredAppRightContractDetails.contractId,
43
- createdEventBlob: params.featuredAppRightContractDetails.createdEventBlob,
44
- synchronizerId: params.featuredAppRightContractDetails.synchronizerId
45
- }
46
- ]
47
- });
48
- const event = response.transactionTree.eventsById[1];
49
- if ('CreatedTreeEvent' in event) {
50
- return {
51
- contractId: event.CreatedTreeEvent.value.contractId,
52
- updateId: response.transactionTree.updateId
53
- };
54
- }
55
- else {
56
- throw new Error('Expected CreatedTreeEvent not found');
57
- }
58
- }
59
- //# sourceMappingURL=updateStakeholderData.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"updateStakeholderData.js","sourceRoot":"","sources":["../../../src/functions/stakeholder/updateStakeholderData.ts"],"names":[],"mappings":";;AA6BA,sDAqDC;AAlFD,6FAAoE;AAKpE,iEAAoE;AAiBpE,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAQ,GAAsC,CAAC,MAAM,KAAK,QAAQ,CAAC;AAChH,CAAC;AAED;;GAEG;AACI,KAAK,UAAU,qBAAqB,CACzC,MAA2B,EAC3B,MAAmC;IAEnC,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC;QACxD,UAAU,EAAE,MAAM,CAAC,qBAAqB;KACzC,CAAC,CAAC;IAEH,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAChG,CAAC;IAED,MAAM,cAAc,GAAG,cAAc,CAAC,OAAO,CAAC,YAAY,CAAC,cAAc,CAAC;IAC1E,IAAI,CAAC,SAAS,CAAC,cAAc,CAAC,EAAE,CAAC;QAC/B,MAAM,IAAI,KAAK,CAAC,oDAAoD,CAAC,CAAC;IACxE,CAAC;IACD,MAAM,WAAW,GAAG,cAAc,CAAC,MAAM,CAAC;IAE1C,MAAM,eAAe,GAA4D;QAC/E,oBAAoB,EAAE,IAAA,uCAAqB,EAAC,MAAM,CAAC,kBAAkB,CAAC;KACvE,CAAC;IAEF,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,WAAW,CAAC,WAAW,CAAC,UAAU;oBACpE,UAAU,EAAE,MAAM,CAAC,qBAAqB;oBACxC,MAAM,EAAE,uBAAuB;oBAC/B,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"}
@@ -1,20 +0,0 @@
1
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
- /**
3
- * Adjust authorized shares for a stock class.
4
- *
5
- * Schema reference: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/adjustment/StockClassAuthorizedSharesAdjustment.schema.json
6
- * - new_authorized: New authorized shares amount (must be >= issued_shares and numeric for adjustable classes)
7
- * - date: Transaction date (YYYY-MM-DD)
8
- */
9
- export interface AdjustAuthorizedSharesParams {
10
- stockClassContractId: string;
11
- issuerParty: string;
12
- newAuthorized: string | number;
13
- date: string;
14
- }
15
- export interface AdjustAuthorizedSharesResult {
16
- updateId: string;
17
- updatedStockClassContractId: string;
18
- }
19
- export declare function adjustAuthorizedShares(client: LedgerJsonApiClient, params: AdjustAuthorizedSharesParams): Promise<AdjustAuthorizedSharesResult>;
20
- //# sourceMappingURL=adjustAuthorizedShares.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustAuthorizedShares.d.ts","sourceRoot":"","sources":["../../../src/functions/stockClass/adjustAuthorizedShares.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE;;;;;;GAMG;AACH,MAAM,WAAW,4BAA4B;IAC3C,oBAAoB,EAAE,MAAM,CAAC;IAC7B,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;IAC/B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,4BAA4B;IAC3C,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED,wBAAsB,sBAAsB,CAC1C,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,4BAA4B,GACnC,OAAO,CAAC,4BAA4B,CAAC,CA2BvC"}
@@ -1,28 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.adjustAuthorizedShares = adjustAuthorizedShares;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- async function adjustAuthorizedShares(client, params) {
6
- const choiceArgs = {
7
- new_authorized: typeof params.newAuthorized === 'number' ? params.newAuthorized.toString() : params.newAuthorized,
8
- date: `${params.date}T00:00:00.000Z`
9
- };
10
- const response = await client.submitAndWaitForTransactionTree({
11
- actAs: [params.issuerParty],
12
- commands: [
13
- {
14
- ExerciseCommand: {
15
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockClass.StockClass.templateId,
16
- contractId: params.stockClassContractId,
17
- choice: 'AdjustAuthorizedShares',
18
- choiceArgument: choiceArgs
19
- }
20
- }
21
- ]
22
- });
23
- const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockClass.StockClass.templateId);
24
- if (!created)
25
- throw new Error('Updated StockClass not found');
26
- return { updateId: response.transactionTree.updateId, updatedStockClassContractId: created.CreatedTreeEvent.value.contractId };
27
- }
28
- //# sourceMappingURL=adjustAuthorizedShares.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustAuthorizedShares.js","sourceRoot":"","sources":["../../../src/functions/stockClass/adjustAuthorizedShares.ts"],"names":[],"mappings":";;AAuBA,wDA8BC;AArDD,6FAAoE;AAuB7D,KAAK,UAAU,sBAAsB,CAC1C,MAA2B,EAC3B,MAAoC;IAEpC,MAAM,UAAU,GAA4D;QAC1E,cAAc,EAAE,OAAO,MAAM,CAAC,aAAa,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,aAAa;QACjH,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KAC9B,CAAC;IAET,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,UAAU,CAAC,UAAU,CAAC,UAAU;oBAClE,UAAU,EAAE,MAAM,CAAC,oBAAoB;oBACvC,MAAM,EAAE,wBAAwB;oBAChC,cAAc,EAAE,UAAU;iBAC3B;aACF;SACF;KACF,CAA4C,CAAC;IAE9C,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CACrE,CAAC,CAAM,EAAE,EAAE,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,KAAK,yCAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU,CAC/H,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,8BAA8B,CAAC,CAAC;IAE9D,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,2BAA2B,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AACjI,CAAC"}
@@ -1,23 +0,0 @@
1
- import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
- import type { ContractId } from '@daml/types';
3
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
4
- export interface AdjustConversionRatioParams {
5
- stockClassContractId: ContractId<Fairmint.OpenCapTable.StockClass.StockClass>;
6
- issuerParty: string;
7
- newRatio: {
8
- numerator: string | number;
9
- denominator: string | number;
10
- };
11
- date: string;
12
- }
13
- export interface AdjustConversionRatioResult {
14
- updateId: string;
15
- }
16
- /**
17
- * Adjust the ratio for a stock class ratio-based conversion mechanism.
18
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/adjustment/StockClassConversionRatioAdjustment.schema.json
19
- * - new_ratio_conversion_mechanism.ratio: New ratio to apply (numerator/denominator both > 0)
20
- * - date: Effective date (YYYY-MM-DD)
21
- */
22
- export declare function adjustConversionRatio(client: LedgerJsonApiClient, params: AdjustConversionRatioParams): Promise<AdjustConversionRatioResult>;
23
- //# sourceMappingURL=adjustConversionRatio.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustConversionRatio.d.ts","sourceRoot":"","sources":["../../../src/functions/stockClass/adjustConversionRatio.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,2BAA2B;IAC1C,oBAAoB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE;QAAE,SAAS,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACvE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,2BAA2B,GAClC,OAAO,CAAC,2BAA2B,CAAC,CAgCtC"}
@@ -1,39 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.adjustConversionRatio = adjustConversionRatio;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Adjust the ratio for a stock class ratio-based conversion mechanism.
7
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/adjustment/StockClassConversionRatioAdjustment.schema.json
8
- * - new_ratio_conversion_mechanism.ratio: New ratio to apply (numerator/denominator both > 0)
9
- * - date: Effective date (YYYY-MM-DD)
10
- */
11
- async function adjustConversionRatio(client, params) {
12
- const ratio = {
13
- numerator: typeof params.newRatio.numerator === 'number'
14
- ? params.newRatio.numerator.toString()
15
- : params.newRatio.numerator,
16
- denominator: typeof params.newRatio.denominator === 'number'
17
- ? params.newRatio.denominator.toString()
18
- : params.newRatio.denominator,
19
- };
20
- const choiceArgs = {
21
- new_ratio: ratio,
22
- date: `${params.date}T00:00:00.000Z`,
23
- };
24
- const response = (await client.submitAndWaitForTransactionTree({
25
- actAs: [params.issuerParty],
26
- commands: [
27
- {
28
- ExerciseCommand: {
29
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockClass.StockClass.templateId,
30
- contractId: params.stockClassContractId,
31
- choice: 'AdjustConversionRatio',
32
- choiceArgument: choiceArgs,
33
- },
34
- },
35
- ],
36
- }));
37
- return { updateId: response.transactionTree.updateId };
38
- }
39
- //# sourceMappingURL=adjustConversionRatio.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"adjustConversionRatio.js","sourceRoot":"","sources":["../../../src/functions/stockClass/adjustConversionRatio.ts"],"names":[],"mappings":";;AAsBA,sDAmCC;AAzDD,6FAAoE;AAgBpE;;;;;GAKG;AACI,KAAK,UAAU,qBAAqB,CACzC,MAA2B,EAC3B,MAAmC;IAEnC,MAAM,KAAK,GAAyC;QAClD,SAAS,EACP,OAAO,MAAM,CAAC,QAAQ,CAAC,SAAS,KAAK,QAAQ;YAC3C,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS,CAAC,QAAQ,EAAE;YACtC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,SAAS;QAC/B,WAAW,EACT,OAAO,MAAM,CAAC,QAAQ,CAAC,WAAW,KAAK,QAAQ;YAC7C,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW,CAAC,QAAQ,EAAE;YACxC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,WAAW;KAC3B,CAAC;IAET,MAAM,UAAU,GAA2D;QACzE,SAAS,EAAE,KAAY;QACvB,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KAC9B,CAAC;IAET,MAAM,QAAQ,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC7D,KAAK,EAAE,CAAC,MAAM,CAAC,WAAW,CAAC;QAC3B,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,UAAU;oBAClE,UAAU,EAAE,MAAM,CAAC,oBAAoB;oBACvC,MAAM,EAAE,uBAAuB;oBAC/B,cAAc,EAAE,UAAU;iBAC3B;aACF;SACF;KACF,CAAC,CAA4C,CAAC;IAE/C,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,CAAC;AACzD,CAAC"}
@@ -1,21 +0,0 @@
1
- import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
- import type { ContractId } from '@daml/types';
3
- import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
4
- export interface ConsolidatePositionsParams {
5
- stockClassContractId: ContractId<Fairmint.OpenCapTable.StockClass.StockClass>;
6
- issuerParty: string;
7
- owner: string;
8
- positions: string[];
9
- date: string;
10
- reasonText?: string;
11
- }
12
- export interface ConsolidatePositionsResult {
13
- updateId: string;
14
- resultingPositionContractId: string;
15
- }
16
- /**
17
- * Consolidate multiple stock positions of the same owner into one.
18
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/consolidation/StockConsolidation.schema.json
19
- */
20
- export declare function consolidatePositions(client: LedgerJsonApiClient, params: ConsolidatePositionsParams): Promise<ConsolidatePositionsResult>;
21
- //# sourceMappingURL=consolidatePositions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"consolidatePositions.d.ts","sourceRoot":"","sources":["../../../src/functions/stockClass/consolidatePositions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,0BAA0B;IACzC,oBAAoB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9E,WAAW,EAAE,MAAM,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAAC,0BAA0B,CAAC,CA6BrC"}
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.consolidatePositions = consolidatePositions;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- /**
6
- * Consolidate multiple stock positions of the same owner into one.
7
- * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/consolidation/StockConsolidation.schema.json
8
- */
9
- async function consolidatePositions(client, params) {
10
- const choiceArgs = {
11
- owner: params.owner,
12
- positions: params.positions,
13
- date: `${params.date}T00:00:00.000Z`,
14
- reason_text: params.reasonText ? { tag: 'Some', value: params.reasonText } : null,
15
- };
16
- const response = (await client.submitAndWaitForTransactionTree({
17
- actAs: [params.issuerParty],
18
- commands: [
19
- {
20
- ExerciseCommand: {
21
- templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockClass.StockClass.templateId,
22
- contractId: params.stockClassContractId,
23
- choice: 'ConsolidatePositions',
24
- choiceArgument: choiceArgs,
25
- },
26
- },
27
- ],
28
- }));
29
- const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockClass.StockPosition.templateId);
30
- if (!created)
31
- throw new Error('Resulting StockPosition not found');
32
- return { updateId: response.transactionTree.updateId, resultingPositionContractId: created.CreatedTreeEvent.value.contractId };
33
- }
34
- //# sourceMappingURL=consolidatePositions.js.map