@open-captable-protocol/canton 0.2.4 → 0.2.5

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 (192) hide show
  1. package/dist/functions/convertible/acceptConvertible.d.ts +18 -0
  2. package/dist/functions/convertible/acceptConvertible.d.ts.map +1 -0
  3. package/dist/functions/convertible/acceptConvertible.js +31 -0
  4. package/dist/functions/convertible/acceptConvertible.js.map +1 -0
  5. package/dist/functions/convertible/cancelConvertible.d.ts +23 -0
  6. package/dist/functions/convertible/cancelConvertible.d.ts.map +1 -0
  7. package/dist/functions/convertible/cancelConvertible.js +37 -0
  8. package/dist/functions/convertible/cancelConvertible.js.map +1 -0
  9. package/dist/functions/convertible/convertConvertible.d.ts +18 -0
  10. package/dist/functions/convertible/convertConvertible.d.ts.map +1 -0
  11. package/dist/functions/convertible/convertConvertible.js +33 -0
  12. package/dist/functions/convertible/convertConvertible.js.map +1 -0
  13. package/dist/functions/convertible/getConvertibleAsOcf.d.ts +21 -0
  14. package/dist/functions/convertible/getConvertibleAsOcf.d.ts.map +1 -0
  15. package/dist/functions/convertible/getConvertibleAsOcf.js +24 -0
  16. package/dist/functions/convertible/getConvertibleAsOcf.js.map +1 -0
  17. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.d.ts +19 -0
  18. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.d.ts.map +1 -0
  19. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.js +21 -0
  20. package/dist/functions/convertible/getConvertibleConversionEventAsOcf.js.map +1 -0
  21. package/dist/functions/convertible/index.d.ts +9 -0
  22. package/dist/functions/convertible/index.d.ts.map +1 -0
  23. package/dist/functions/convertible/index.js +25 -0
  24. package/dist/functions/convertible/index.js.map +1 -0
  25. package/dist/functions/convertible/issueConvertible.d.ts +20 -0
  26. package/dist/functions/convertible/issueConvertible.d.ts.map +1 -0
  27. package/dist/functions/convertible/issueConvertible.js +46 -0
  28. package/dist/functions/convertible/issueConvertible.js.map +1 -0
  29. package/dist/functions/convertible/retractConvertible.d.ts +19 -0
  30. package/dist/functions/convertible/retractConvertible.d.ts.map +1 -0
  31. package/dist/functions/convertible/retractConvertible.js +32 -0
  32. package/dist/functions/convertible/retractConvertible.js.map +1 -0
  33. package/dist/functions/convertible/transferConvertible.d.ts +25 -0
  34. package/dist/functions/convertible/transferConvertible.d.ts.map +1 -0
  35. package/dist/functions/convertible/transferConvertible.js +45 -0
  36. package/dist/functions/convertible/transferConvertible.js.map +1 -0
  37. package/dist/functions/issuer/adjustAuthorizedShares.d.ts +20 -0
  38. package/dist/functions/issuer/adjustAuthorizedShares.d.ts.map +1 -0
  39. package/dist/functions/issuer/adjustAuthorizedShares.js +33 -0
  40. package/dist/functions/issuer/adjustAuthorizedShares.js.map +1 -0
  41. package/dist/functions/issuer/updateIssuerData.d.ts +50 -0
  42. package/dist/functions/issuer/updateIssuerData.d.ts.map +1 -0
  43. package/dist/functions/issuer/updateIssuerData.js +89 -0
  44. package/dist/functions/issuer/updateIssuerData.js.map +1 -0
  45. package/dist/functions/stakeholder/recordRelationshipChange.d.ts +20 -0
  46. package/dist/functions/stakeholder/recordRelationshipChange.d.ts.map +1 -0
  47. package/dist/functions/stakeholder/recordRelationshipChange.js +33 -0
  48. package/dist/functions/stakeholder/recordRelationshipChange.js.map +1 -0
  49. package/dist/functions/stakeholder/recordStatusChange.d.ts +19 -0
  50. package/dist/functions/stakeholder/recordStatusChange.d.ts.map +1 -0
  51. package/dist/functions/stakeholder/recordStatusChange.js +32 -0
  52. package/dist/functions/stakeholder/recordStatusChange.js.map +1 -0
  53. package/dist/functions/stakeholder/updateStakeholderData.d.ts +17 -0
  54. package/dist/functions/stakeholder/updateStakeholderData.d.ts.map +1 -0
  55. package/dist/functions/stakeholder/updateStakeholderData.js +59 -0
  56. package/dist/functions/stakeholder/updateStakeholderData.js.map +1 -0
  57. package/dist/functions/stockClass/adjustAuthorizedShares.d.ts +20 -0
  58. package/dist/functions/stockClass/adjustAuthorizedShares.d.ts.map +1 -0
  59. package/dist/functions/stockClass/adjustAuthorizedShares.js +28 -0
  60. package/dist/functions/stockClass/adjustAuthorizedShares.js.map +1 -0
  61. package/dist/functions/stockClass/adjustConversionRatio.d.ts +23 -0
  62. package/dist/functions/stockClass/adjustConversionRatio.d.ts.map +1 -0
  63. package/dist/functions/stockClass/adjustConversionRatio.js +39 -0
  64. package/dist/functions/stockClass/adjustConversionRatio.js.map +1 -0
  65. package/dist/functions/stockClass/consolidatePositions.d.ts +21 -0
  66. package/dist/functions/stockClass/consolidatePositions.d.ts.map +1 -0
  67. package/dist/functions/stockClass/consolidatePositions.js +34 -0
  68. package/dist/functions/stockClass/consolidatePositions.js.map +1 -0
  69. package/dist/functions/stockClass/issueStock.d.ts +19 -0
  70. package/dist/functions/stockClass/issueStock.d.ts.map +1 -0
  71. package/dist/functions/stockClass/issueStock.js +34 -0
  72. package/dist/functions/stockClass/issueStock.js.map +1 -0
  73. package/dist/functions/stockClass/reissueStock.d.ts +18 -0
  74. package/dist/functions/stockClass/reissueStock.d.ts.map +1 -0
  75. package/dist/functions/stockClass/reissueStock.js +35 -0
  76. package/dist/functions/stockClass/reissueStock.js.map +1 -0
  77. package/dist/functions/stockClass/repurchaseStock.d.ts +20 -0
  78. package/dist/functions/stockClass/repurchaseStock.d.ts.map +1 -0
  79. package/dist/functions/stockClass/repurchaseStock.js +33 -0
  80. package/dist/functions/stockClass/repurchaseStock.js.map +1 -0
  81. package/dist/functions/stockClass/splitStockClass.d.ts +18 -0
  82. package/dist/functions/stockClass/splitStockClass.d.ts.map +1 -0
  83. package/dist/functions/stockClass/splitStockClass.js +33 -0
  84. package/dist/functions/stockClass/splitStockClass.js.map +1 -0
  85. package/dist/functions/stockClass/updateStockClass.d.ts +51 -0
  86. package/dist/functions/stockClass/updateStockClass.d.ts.map +1 -0
  87. package/dist/functions/stockClass/updateStockClass.js +95 -0
  88. package/dist/functions/stockClass/updateStockClass.js.map +1 -0
  89. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.d.ts +14 -0
  90. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.d.ts.map +1 -0
  91. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.js +56 -0
  92. package/dist/functions/stockLegendTemplate/updateStockLegendTemplate.js.map +1 -0
  93. package/dist/functions/stockPlan/acceptGrant.d.ts +16 -0
  94. package/dist/functions/stockPlan/acceptGrant.d.ts.map +1 -0
  95. package/dist/functions/stockPlan/acceptGrant.js +31 -0
  96. package/dist/functions/stockPlan/acceptGrant.js.map +1 -0
  97. package/dist/functions/stockPlan/adjustPool.d.ts +20 -0
  98. package/dist/functions/stockPlan/adjustPool.d.ts.map +1 -0
  99. package/dist/functions/stockPlan/adjustPool.js +33 -0
  100. package/dist/functions/stockPlan/adjustPool.js.map +1 -0
  101. package/dist/functions/stockPlan/cancelGrant.d.ts +16 -0
  102. package/dist/functions/stockPlan/cancelGrant.d.ts.map +1 -0
  103. package/dist/functions/stockPlan/cancelGrant.js +31 -0
  104. package/dist/functions/stockPlan/cancelGrant.js.map +1 -0
  105. package/dist/functions/stockPlan/exerciseGrant.d.ts +20 -0
  106. package/dist/functions/stockPlan/exerciseGrant.d.ts.map +1 -0
  107. package/dist/functions/stockPlan/exerciseGrant.js +33 -0
  108. package/dist/functions/stockPlan/exerciseGrant.js.map +1 -0
  109. package/dist/functions/stockPlan/issuePlanSecurity.d.ts +27 -0
  110. package/dist/functions/stockPlan/issuePlanSecurity.d.ts.map +1 -0
  111. package/dist/functions/stockPlan/issuePlanSecurity.js +53 -0
  112. package/dist/functions/stockPlan/issuePlanSecurity.js.map +1 -0
  113. package/dist/functions/stockPlan/releaseGrant.d.ts +16 -0
  114. package/dist/functions/stockPlan/releaseGrant.d.ts.map +1 -0
  115. package/dist/functions/stockPlan/releaseGrant.js +31 -0
  116. package/dist/functions/stockPlan/releaseGrant.js.map +1 -0
  117. package/dist/functions/stockPlan/repriceGrant.d.ts +22 -0
  118. package/dist/functions/stockPlan/repriceGrant.d.ts.map +1 -0
  119. package/dist/functions/stockPlan/repriceGrant.js +38 -0
  120. package/dist/functions/stockPlan/repriceGrant.js.map +1 -0
  121. package/dist/functions/stockPlan/retractGrant.d.ts +16 -0
  122. package/dist/functions/stockPlan/retractGrant.d.ts.map +1 -0
  123. package/dist/functions/stockPlan/retractGrant.js +31 -0
  124. package/dist/functions/stockPlan/retractGrant.js.map +1 -0
  125. package/dist/functions/stockPlan/startVesting.d.ts +13 -0
  126. package/dist/functions/stockPlan/startVesting.d.ts.map +1 -0
  127. package/dist/functions/stockPlan/startVesting.js +28 -0
  128. package/dist/functions/stockPlan/startVesting.js.map +1 -0
  129. package/dist/functions/stockPlan/transferGrant.d.ts +21 -0
  130. package/dist/functions/stockPlan/transferGrant.d.ts.map +1 -0
  131. package/dist/functions/stockPlan/transferGrant.js +34 -0
  132. package/dist/functions/stockPlan/transferGrant.js.map +1 -0
  133. package/dist/functions/stockPlan/updateStockPlan.d.ts +24 -0
  134. package/dist/functions/stockPlan/updateStockPlan.d.ts.map +1 -0
  135. package/dist/functions/stockPlan/updateStockPlan.js +62 -0
  136. package/dist/functions/stockPlan/updateStockPlan.js.map +1 -0
  137. package/dist/functions/stockPosition/acceptTransfer.d.ts +16 -0
  138. package/dist/functions/stockPosition/acceptTransfer.d.ts.map +1 -0
  139. package/dist/functions/stockPosition/acceptTransfer.js +31 -0
  140. package/dist/functions/stockPosition/acceptTransfer.js.map +1 -0
  141. package/dist/functions/stockPosition/index.d.ts +5 -0
  142. package/dist/functions/stockPosition/index.d.ts.map +1 -0
  143. package/dist/functions/stockPosition/index.js +21 -0
  144. package/dist/functions/stockPosition/index.js.map +1 -0
  145. package/dist/functions/stockPosition/proposeTransfer.d.ts +17 -0
  146. package/dist/functions/stockPosition/proposeTransfer.d.ts.map +1 -0
  147. package/dist/functions/stockPosition/proposeTransfer.js +34 -0
  148. package/dist/functions/stockPosition/proposeTransfer.js.map +1 -0
  149. package/dist/functions/stockPosition/reduceQuantity.d.ts +12 -0
  150. package/dist/functions/stockPosition/reduceQuantity.d.ts.map +1 -0
  151. package/dist/functions/stockPosition/reduceQuantity.js +27 -0
  152. package/dist/functions/stockPosition/reduceQuantity.js.map +1 -0
  153. package/dist/functions/stockPosition/retractTransfer.d.ts +15 -0
  154. package/dist/functions/stockPosition/retractTransfer.d.ts.map +1 -0
  155. package/dist/functions/stockPosition/retractTransfer.js +28 -0
  156. package/dist/functions/stockPosition/retractTransfer.js.map +1 -0
  157. package/dist/functions/valuation/updateValuationData.d.ts +18 -0
  158. package/dist/functions/valuation/updateValuationData.d.ts.map +1 -0
  159. package/dist/functions/valuation/updateValuationData.js +58 -0
  160. package/dist/functions/valuation/updateValuationData.js.map +1 -0
  161. package/dist/functions/vestingTerms/updateVestingTerms.d.ts +18 -0
  162. package/dist/functions/vestingTerms/updateVestingTerms.d.ts.map +1 -0
  163. package/dist/functions/vestingTerms/updateVestingTerms.js +58 -0
  164. package/dist/functions/vestingTerms/updateVestingTerms.js.map +1 -0
  165. package/dist/functions/warrant/exerciseWarrant.d.ts +17 -0
  166. package/dist/functions/warrant/exerciseWarrant.d.ts.map +1 -0
  167. package/dist/functions/warrant/exerciseWarrant.js +32 -0
  168. package/dist/functions/warrant/exerciseWarrant.js.map +1 -0
  169. package/dist/functions/warrant/getWarrantAsOcf.d.ts +18 -0
  170. package/dist/functions/warrant/getWarrantAsOcf.d.ts.map +1 -0
  171. package/dist/functions/warrant/getWarrantAsOcf.js +21 -0
  172. package/dist/functions/warrant/getWarrantAsOcf.js.map +1 -0
  173. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.d.ts +19 -0
  174. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.d.ts.map +1 -0
  175. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.js +21 -0
  176. package/dist/functions/warrant/getWarrantExerciseEventAsOcf.js.map +1 -0
  177. package/dist/functions/warrant/index.d.ts +8 -0
  178. package/dist/functions/warrant/index.d.ts.map +1 -0
  179. package/dist/functions/warrant/index.js +24 -0
  180. package/dist/functions/warrant/index.js.map +1 -0
  181. package/dist/functions/warrant/issueWarrant.d.ts +25 -0
  182. package/dist/functions/warrant/issueWarrant.d.ts.map +1 -0
  183. package/dist/functions/warrant/issueWarrant.js +49 -0
  184. package/dist/functions/warrant/issueWarrant.js.map +1 -0
  185. package/dist/functions/warrant/transferWarrant.d.ts +17 -0
  186. package/dist/functions/warrant/transferWarrant.d.ts.map +1 -0
  187. package/dist/functions/warrant/transferWarrant.js +30 -0
  188. package/dist/functions/warrant/transferWarrant.js.map +1 -0
  189. package/dist/utils/typeConversions.d.ts.map +1 -1
  190. package/dist/utils/typeConversions.js +0 -2
  191. package/dist/utils/typeConversions.js.map +1 -1
  192. package/package.json +1 -1
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.cancelGrant = cancelGrant;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ /**
6
+ * Cancel a plan security grant by exercising the CancelGrant choice on PlanSecurityGrant
7
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/cancellation/EquityCompensationCancellation.schema.json
8
+ */
9
+ async function cancelGrant(client, params) {
10
+ const choiceArgs = {
11
+ date: `${params.date}T00:00:00.000Z`
12
+ };
13
+ const response = await client.submitAndWaitForTransactionTree({
14
+ actAs: [params.issuerParty],
15
+ commands: [
16
+ {
17
+ ExerciseCommand: {
18
+ templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityGrant.templateId,
19
+ contractId: params.planSecurityGrantContractId,
20
+ choice: 'CancelGrant',
21
+ choiceArgument: choiceArgs
22
+ }
23
+ }
24
+ ]
25
+ });
26
+ const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityCancellation.templateId);
27
+ if (!created)
28
+ throw new Error('PlanSecurityCancellation not found');
29
+ return { updateId: response.transactionTree.updateId, cancellationEventContractId: created.CreatedTreeEvent.value.contractId };
30
+ }
31
+ //# sourceMappingURL=cancelGrant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cancelGrant.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/cancelGrant.ts"],"names":[],"mappings":";;AAmBA,kCA6BC;AAhDD,6FAAoE;AAepE;;;GAGG;AACI,KAAK,UAAU,WAAW,CAC/B,MAA2B,EAC3B,MAAyB;IAEzB,MAAM,UAAU,GAAgD;QAC9D,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KACrC,CAAC;IAEF,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,SAAS,CAAC,iBAAiB,CAAC,UAAU;oBACxE,UAAU,EAAE,MAAM,CAAC,2BAA2B;oBAC9C,MAAM,EAAE,aAAa;oBACrB,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,SAAS,CAAC,wBAAwB,CAAC,UAAU,CAC5I,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAEpE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,2BAA2B,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AACjI,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
+ import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
3
+ import type { ContractId } from '@daml/types';
4
+ export interface ExerciseGrantParams {
5
+ planSecurityGrantContractId: string;
6
+ issuerParty: string;
7
+ stockClassContractId: ContractId<Fairmint.OpenCapTable.StockClass.StockClass>;
8
+ quantity: string | number;
9
+ date: string;
10
+ }
11
+ export interface ExerciseGrantResult {
12
+ updateId: string;
13
+ stockPositionContractId: string;
14
+ }
15
+ /**
16
+ * Exercise a plan security grant by exercising the ExerciseGrant choice on PlanSecurityGrant
17
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/exercise/PlanSecurityExercise.schema.json
18
+ */
19
+ export declare function exerciseGrant(client: LedgerJsonApiClient, params: ExerciseGrantParams): Promise<ExerciseGrantResult>;
20
+ //# sourceMappingURL=exerciseGrant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exerciseGrant.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/exerciseGrant.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAE9C,MAAM,WAAW,mBAAmB;IAClC,2BAA2B,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;IAC9E,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CA4B9B"}
@@ -0,0 +1,33 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.exerciseGrant = exerciseGrant;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ /**
6
+ * Exercise a plan security grant by exercising the ExerciseGrant choice on PlanSecurityGrant
7
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/exercise/PlanSecurityExercise.schema.json
8
+ */
9
+ async function exerciseGrant(client, params) {
10
+ const choiceArgs = {
11
+ stock_class: params.stockClassContractId,
12
+ quantity: typeof params.quantity === 'number' ? params.quantity.toString() : params.quantity,
13
+ date: `${params.date}T00:00:00.000Z`
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.StockPlan.PlanSecurityGrant.templateId,
21
+ contractId: params.planSecurityGrantContractId,
22
+ choice: 'ExerciseGrant',
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.StockClass.StockPosition.templateId);
29
+ if (!created)
30
+ throw new Error('StockPosition not found');
31
+ return { updateId: response.transactionTree.updateId, stockPositionContractId: created.CreatedTreeEvent.value.contractId };
32
+ }
33
+ //# sourceMappingURL=exerciseGrant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exerciseGrant.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/exerciseGrant.ts"],"names":[],"mappings":";;AAsBA,sCA+BC;AArDD,6FAAoE;AAkBpE;;;GAGG;AACI,KAAK,UAAU,aAAa,CACjC,MAA2B,EAC3B,MAA2B;IAE3B,MAAM,UAAU,GAAkD;QAChE,WAAW,EAAE,MAAM,CAAC,oBAAoB;QACxC,QAAQ,EAAE,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ;QAC5F,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KACrC,CAAC;IAEF,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,SAAS,CAAC,iBAAiB,CAAC,UAAU;oBACxE,UAAU,EAAE,MAAM,CAAC,2BAA2B;oBAC9C,MAAM,EAAE,eAAe;oBACvB,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,aAAa,CAAC,UAAU,CAClI,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;IAEzD,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,uBAAuB,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AAC7H,CAAC"}
@@ -0,0 +1,27 @@
1
+ import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
+ import { ContractDetails } from '../../types/contractDetails';
3
+ import { OcfEquityCompensationIssuanceData } from '../../types/native';
4
+ export interface IssuePlanSecurityParams {
5
+ stockPlanContractId: string;
6
+ featuredAppRightContractDetails: ContractDetails;
7
+ issuerParty: string;
8
+ stakeholderParty: string;
9
+ stockClassContractId: string;
10
+ vestingTermsContractId?: string;
11
+ issuanceData: OcfEquityCompensationIssuanceData;
12
+ }
13
+ export interface IssuePlanSecurityResult {
14
+ contractId: string;
15
+ updateId: string;
16
+ }
17
+ /**
18
+ * Issue an equity compensation plan security by exercising the IssuePlanSecurity choice on a StockPlan
19
+ *
20
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/issuance/EquityCompensationIssuance.schema.json
21
+ * - stockClassContractId: Class the security will ultimately exercise into
22
+ * - vestingTermsContractId (optional): Vesting terms to apply
23
+ * - issuanceData: compensation_type, quantity, optional exercise/base price, early_exercisable, vestings or vesting_terms_id,
24
+ * expiration_date, termination_exercise_windows, comments
25
+ */
26
+ export declare function issuePlanSecurity(client: LedgerJsonApiClient, params: IssuePlanSecurityParams): Promise<IssuePlanSecurityResult>;
27
+ //# sourceMappingURL=issuePlanSecurity.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issuePlanSecurity.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/issuePlanSecurity.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,iCAAiC,EAAE,MAAM,oBAAoB,CAAC;AAGvE,MAAM,WAAW,uBAAuB;IACtC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,+BAA+B,EAAE,eAAe,CAAC;IACjD,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE,MAAM,CAAC;IACzB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAChC,YAAY,EAAE,iCAAiC,CAAC;CACjD;AAED,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;GAQG;AACH,wBAAsB,iBAAiB,CACrC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,uBAAuB,GAC9B,OAAO,CAAC,uBAAuB,CAAC,CA0ClC"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.issuePlanSecurity = issuePlanSecurity;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ const findCreatedEvent_1 = require("../../utils/findCreatedEvent");
6
+ const typeConversions_1 = require("../../utils/typeConversions");
7
+ /**
8
+ * Issue an equity compensation plan security by exercising the IssuePlanSecurity choice on a StockPlan
9
+ *
10
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/issuance/EquityCompensationIssuance.schema.json
11
+ * - stockClassContractId: Class the security will ultimately exercise into
12
+ * - vestingTermsContractId (optional): Vesting terms to apply
13
+ * - issuanceData: compensation_type, quantity, optional exercise/base price, early_exercisable, vestings or vesting_terms_id,
14
+ * expiration_date, termination_exercise_windows, comments
15
+ */
16
+ async function issuePlanSecurity(client, params) {
17
+ const choiceArguments = {
18
+ stakeholder: params.stakeholderParty,
19
+ issuance_data: (0, typeConversions_1.equityCompIssuanceDataToDaml)(params.issuanceData),
20
+ stock_class: params.stockClassContractId,
21
+ vesting_terms: params.vestingTermsContractId ? { tag: 'Some', value: params.vestingTermsContractId } : null
22
+ };
23
+ const response = await client.submitAndWaitForTransactionTree({
24
+ actAs: [params.issuerParty],
25
+ commands: [
26
+ {
27
+ ExerciseCommand: {
28
+ templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.StockPlan.templateId,
29
+ contractId: params.stockPlanContractId,
30
+ choice: 'IssuePlanSecurity',
31
+ choiceArgument: choiceArguments
32
+ }
33
+ }
34
+ ],
35
+ disclosedContracts: [
36
+ {
37
+ templateId: params.featuredAppRightContractDetails.templateId,
38
+ contractId: params.featuredAppRightContractDetails.contractId,
39
+ createdEventBlob: params.featuredAppRightContractDetails.createdEventBlob,
40
+ synchronizerId: params.featuredAppRightContractDetails.synchronizerId
41
+ }
42
+ ]
43
+ });
44
+ const created = (0, findCreatedEvent_1.findCreatedEventByTemplateId)(response, open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityGrant.templateId);
45
+ if (!created) {
46
+ throw new Error('Expected CreatedTreeEvent not found');
47
+ }
48
+ return {
49
+ contractId: created.CreatedTreeEvent.value.contractId,
50
+ updateId: response.transactionTree.updateId
51
+ };
52
+ }
53
+ //# sourceMappingURL=issuePlanSecurity.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"issuePlanSecurity.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/issuePlanSecurity.ts"],"names":[],"mappings":";;AAgCA,8CA6CC;AA7ED,6FAAoE;AAGpE,mEAA4E;AAG5E,iEAA2E;AAiB3E;;;;;;;;GAQG;AACI,KAAK,UAAU,iBAAiB,CACrC,MAA2B,EAC3B,MAA+B;IAE/B,MAAM,eAAe,GAAsD;QACzE,WAAW,EAAE,MAAM,CAAC,gBAAgB;QACpC,aAAa,EAAE,IAAA,8CAA4B,EAAC,MAAM,CAAC,YAAY,CAAC;QAChE,WAAW,EAAE,MAAM,CAAC,oBAAoB;QACxC,aAAa,EAAE,MAAM,CAAC,sBAAsB,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,sBAAsB,EAAS,CAAC,CAAC,CAAC,IAAI;KAC5G,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,SAAS,CAAC,SAAS,CAAC,UAAU;oBAChE,UAAU,EAAE,MAAM,CAAC,mBAAmB;oBACtC,MAAM,EAAE,mBAAmB;oBAC3B,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,OAAO,GAAG,IAAA,+CAA4B,EAC1C,QAAQ,EACR,yCAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,iBAAiB,CAAC,UAAU,CAC7D,CAAC;IACF,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IACzD,CAAC;IAED,OAAO;QACL,UAAU,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU;QACrD,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ;KAC5C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
+ export interface ReleaseGrantParams {
3
+ planSecurityGrantContractId: string;
4
+ issuerParty: string;
5
+ date: string;
6
+ }
7
+ export interface ReleaseGrantResult {
8
+ updateId: string;
9
+ releaseEventContractId: string;
10
+ }
11
+ /**
12
+ * Release a plan security grant by exercising the ReleaseGrant choice on PlanSecurityGrant
13
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/release/EquityCompensationRelease.schema.json
14
+ */
15
+ export declare function releaseGrant(client: LedgerJsonApiClient, params: ReleaseGrantParams): Promise<ReleaseGrantResult>;
16
+ //# sourceMappingURL=releaseGrant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"releaseGrant.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/releaseGrant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,kBAAkB;IACjC,2BAA2B,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CA0B7B"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.releaseGrant = releaseGrant;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ /**
6
+ * Release a plan security grant by exercising the ReleaseGrant choice on PlanSecurityGrant
7
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/release/EquityCompensationRelease.schema.json
8
+ */
9
+ async function releaseGrant(client, params) {
10
+ const choiceArgs = {
11
+ date: `${params.date}T00:00:00.000Z`
12
+ };
13
+ const response = await client.submitAndWaitForTransactionTree({
14
+ actAs: [params.issuerParty],
15
+ commands: [
16
+ {
17
+ ExerciseCommand: {
18
+ templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityGrant.templateId,
19
+ contractId: params.planSecurityGrantContractId,
20
+ choice: 'ReleaseGrant',
21
+ choiceArgument: choiceArgs
22
+ }
23
+ }
24
+ ]
25
+ });
26
+ const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityRelease.templateId);
27
+ if (!created)
28
+ throw new Error('PlanSecurityRelease not found');
29
+ return { updateId: response.transactionTree.updateId, releaseEventContractId: created.CreatedTreeEvent.value.contractId };
30
+ }
31
+ //# sourceMappingURL=releaseGrant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"releaseGrant.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/releaseGrant.ts"],"names":[],"mappings":";;AAmBA,oCA6BC;AAhDD,6FAAoE;AAepE;;;GAGG;AACI,KAAK,UAAU,YAAY,CAChC,MAA2B,EAC3B,MAA0B;IAE1B,MAAM,UAAU,GAAiD;QAC/D,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KACrC,CAAC;IAEF,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,SAAS,CAAC,iBAAiB,CAAC,UAAU;oBACxE,UAAU,EAAE,MAAM,CAAC,2BAA2B;oBAC9C,MAAM,EAAE,cAAc;oBACtB,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,SAAS,CAAC,mBAAmB,CAAC,UAAU,CACvI,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;IAE/D,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,sBAAsB,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AAC5H,CAAC"}
@@ -0,0 +1,22 @@
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 RepriceGrantParams {
5
+ planSecurityContractId: ContractId<Fairmint.OpenCapTable.StockPlan.PlanSecurityGrant>;
6
+ issuerParty: string;
7
+ newExercisePrice: {
8
+ amount: string | number;
9
+ currency: string;
10
+ };
11
+ date: string;
12
+ }
13
+ export interface RepriceGrantResult {
14
+ updateId: string;
15
+ repricingEventContractId: string;
16
+ }
17
+ /**
18
+ * Reprice an equity compensation grant by adjusting its exercise price.
19
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/repricing/EquityCompensationRepricing.schema.json
20
+ */
21
+ export declare function repriceGrant(client: LedgerJsonApiClient, params: RepriceGrantParams): Promise<RepriceGrantResult>;
22
+ //# sourceMappingURL=repriceGrant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repriceGrant.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/repriceGrant.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,kBAAkB;IACjC,sBAAsB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACtF,WAAW,EAAE,MAAM,CAAC;IACpB,gBAAgB,EAAE;QAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,QAAQ,EAAE,MAAM,CAAA;KAAE,CAAC;IAChE,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,wBAAwB,EAAE,MAAM,CAAC;CAClC;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CAmC7B"}
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.repriceGrant = repriceGrant;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ /**
6
+ * Reprice an equity compensation grant by adjusting its exercise price.
7
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/repricing/EquityCompensationRepricing.schema.json
8
+ */
9
+ async function repriceGrant(client, params) {
10
+ const price = {
11
+ amount: typeof params.newExercisePrice.amount === 'number'
12
+ ? params.newExercisePrice.amount.toString()
13
+ : params.newExercisePrice.amount,
14
+ currency: params.newExercisePrice.currency,
15
+ };
16
+ const choiceArgs = {
17
+ new_exercise_price: price,
18
+ date: `${params.date}T00:00:00.000Z`,
19
+ };
20
+ const response = (await client.submitAndWaitForTransactionTree({
21
+ actAs: [params.issuerParty],
22
+ commands: [
23
+ {
24
+ ExerciseCommand: {
25
+ templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityGrant.templateId,
26
+ contractId: params.planSecurityContractId,
27
+ choice: 'Reprice',
28
+ choiceArgument: choiceArgs,
29
+ },
30
+ },
31
+ ],
32
+ }));
33
+ const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityRepricing.templateId);
34
+ if (!created)
35
+ throw new Error('PlanSecurityRepricing event not found');
36
+ return { updateId: response.transactionTree.updateId, repricingEventContractId: created.CreatedTreeEvent.value.contractId };
37
+ }
38
+ //# sourceMappingURL=repriceGrant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"repriceGrant.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/repriceGrant.ts"],"names":[],"mappings":";;AAqBA,oCAsCC;AA3DD,6FAAoE;AAiBpE;;;GAGG;AACI,KAAK,UAAU,YAAY,CAChC,MAA2B,EAC3B,MAA0B;IAE1B,MAAM,KAAK,GAA4C;QACrD,MAAM,EACJ,OAAO,MAAM,CAAC,gBAAgB,CAAC,MAAM,KAAK,QAAQ;YAChD,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM,CAAC,QAAQ,EAAE;YAC3C,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC,MAAM;QACpC,QAAQ,EAAE,MAAM,CAAC,gBAAgB,CAAC,QAAQ;KACpC,CAAC;IAET,MAAM,UAAU,GAA4C;QAC1D,kBAAkB,EAAE,KAAY;QAChC,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,SAAS,CAAC,iBAAiB,CAAC,UAAU;oBACxE,UAAU,EAAE,MAAM,CAAC,sBAAsB;oBACzC,MAAM,EAAE,SAAS;oBACjB,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,SAAS,CAAC,qBAAqB,CAAC,UAAU,CACzI,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,uCAAuC,CAAC,CAAC;IAEvE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,wBAAwB,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AAC9H,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
+ export interface RetractGrantParams {
3
+ planSecurityGrantContractId: string;
4
+ stakeholderParty: string;
5
+ date: string;
6
+ }
7
+ export interface RetractGrantResult {
8
+ updateId: string;
9
+ retractionEventContractId: string;
10
+ }
11
+ /**
12
+ * Retract a plan security grant by exercising the RetractGrant choice on PlanSecurityGrant
13
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/retraction/EquityCompensationRetraction.schema.json
14
+ */
15
+ export declare function retractGrant(client: LedgerJsonApiClient, params: RetractGrantParams): Promise<RetractGrantResult>;
16
+ //# sourceMappingURL=retractGrant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retractGrant.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/retractGrant.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,kBAAkB;IACjC,2BAA2B,EAAE,MAAM,CAAC;IACpC,gBAAgB,EAAE,MAAM,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,yBAAyB,EAAE,MAAM,CAAC;CACnC;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CA0B7B"}
@@ -0,0 +1,31 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.retractGrant = retractGrant;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ /**
6
+ * Retract a plan security grant by exercising the RetractGrant choice on PlanSecurityGrant
7
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/retraction/EquityCompensationRetraction.schema.json
8
+ */
9
+ async function retractGrant(client, params) {
10
+ const choiceArgs = {
11
+ date: `${params.date}T00:00:00.000Z`
12
+ };
13
+ const response = await client.submitAndWaitForTransactionTree({
14
+ actAs: [params.stakeholderParty],
15
+ commands: [
16
+ {
17
+ ExerciseCommand: {
18
+ templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityGrant.templateId,
19
+ contractId: params.planSecurityGrantContractId,
20
+ choice: 'RetractGrant',
21
+ choiceArgument: choiceArgs
22
+ }
23
+ }
24
+ ]
25
+ });
26
+ const created = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityRetraction.templateId);
27
+ if (!created)
28
+ throw new Error('PlanSecurityRetraction not found');
29
+ return { updateId: response.transactionTree.updateId, retractionEventContractId: created.CreatedTreeEvent.value.contractId };
30
+ }
31
+ //# sourceMappingURL=retractGrant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"retractGrant.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/retractGrant.ts"],"names":[],"mappings":";;AAmBA,oCA6BC;AAhDD,6FAAoE;AAepE;;;GAGG;AACI,KAAK,UAAU,YAAY,CAChC,MAA2B,EAC3B,MAA0B;IAE1B,MAAM,UAAU,GAAiD;QAC/D,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KACrC,CAAC;IAEF,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,+BAA+B,CAAC;QAC5D,KAAK,EAAE,CAAC,MAAM,CAAC,gBAAgB,CAAC;QAChC,QAAQ,EAAE;YACR;gBACE,eAAe,EAAE;oBACf,UAAU,EAAE,yCAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,iBAAiB,CAAC,UAAU;oBACxE,UAAU,EAAE,MAAM,CAAC,2BAA2B;oBAC9C,MAAM,EAAE,cAAc;oBACtB,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,SAAS,CAAC,sBAAsB,CAAC,UAAU,CAC1I,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,kCAAkC,CAAC,CAAC;IAElE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,yBAAyB,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AAC/H,CAAC"}
@@ -0,0 +1,13 @@
1
+ import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
+ export interface StartVestingParams {
3
+ planSecurityGrantContractId: string;
4
+ issuerParty: string;
5
+ vesting_condition_id: string;
6
+ date: string;
7
+ }
8
+ export interface StartVestingResult {
9
+ updateId: string;
10
+ vestingStartEventContractId: string;
11
+ }
12
+ export declare function startVesting(client: LedgerJsonApiClient, params: StartVestingParams): Promise<StartVestingResult>;
13
+ //# sourceMappingURL=startVesting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startVesting.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/startVesting.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,kBAAkB;IACjC,2BAA2B,EAAE,MAAM,CAAC;IACpC,WAAW,EAAE,MAAM,CAAC;IACpB,oBAAoB,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED,wBAAsB,YAAY,CAChC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,kBAAkB,GACzB,OAAO,CAAC,kBAAkB,CAAC,CA2B7B"}
@@ -0,0 +1,28 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.startVesting = startVesting;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ async function startVesting(client, params) {
6
+ const choiceArgs = {
7
+ vesting_condition_id: params.vesting_condition_id,
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.StockPlan.PlanSecurityGrant.templateId,
16
+ contractId: params.planSecurityGrantContractId,
17
+ choice: 'StartVesting',
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.StockPlan.PlanSecurityVestingStart.templateId);
24
+ if (!created)
25
+ throw new Error('PlanSecurityVestingStart not found');
26
+ return { updateId: response.transactionTree.updateId, vestingStartEventContractId: created.CreatedTreeEvent.value.contractId };
27
+ }
28
+ //# sourceMappingURL=startVesting.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"startVesting.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/startVesting.ts"],"names":[],"mappings":";;AAgBA,oCA8BC;AA9CD,6FAAoE;AAgB7D,KAAK,UAAU,YAAY,CAChC,MAA2B,EAC3B,MAA0B;IAE1B,MAAM,UAAU,GAAiD;QAC/D,oBAAoB,EAAE,MAAM,CAAC,oBAAoB;QACjD,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;KACrC,CAAC;IAEF,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,SAAS,CAAC,iBAAiB,CAAC,UAAU;oBACxE,UAAU,EAAE,MAAM,CAAC,2BAA2B;oBAC9C,MAAM,EAAE,cAAc;oBACtB,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,SAAS,CAAC,wBAAwB,CAAC,UAAU,CAC5I,CAAC;IAET,IAAI,CAAC,OAAO;QAAE,MAAM,IAAI,KAAK,CAAC,oCAAoC,CAAC,CAAC;IAEpE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,2BAA2B,EAAE,OAAO,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AACjI,CAAC"}
@@ -0,0 +1,21 @@
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 TransferGrantParams {
5
+ planSecurityContractId: ContractId<Fairmint.OpenCapTable.StockPlan.PlanSecurityGrant>;
6
+ issuerParty: string;
7
+ toOwner: string;
8
+ quantity: string | number;
9
+ date: string;
10
+ considerationText?: string;
11
+ }
12
+ export interface TransferGrantResult {
13
+ updateId: string;
14
+ transferEventContractId: string;
15
+ }
16
+ /**
17
+ * Record transfer of an equity compensation grant.
18
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/transfer/EquityCompensationTransfer.schema.json
19
+ */
20
+ export declare function transferGrant(client: LedgerJsonApiClient, params: TransferGrantParams): Promise<TransferGrantResult>;
21
+ //# sourceMappingURL=transferGrant.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transferGrant.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/transferGrant.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,mBAAmB;IAClC,sBAAsB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,iBAAiB,CAAC,CAAC;IACtF,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC5B;AAED,MAAM,WAAW,mBAAmB;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAsB,aAAa,CACjC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,mBAAmB,GAC1B,OAAO,CAAC,mBAAmB,CAAC,CA6B9B"}
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.transferGrant = transferGrant;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ /**
6
+ * Record transfer of an equity compensation grant.
7
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/transfer/EquityCompensationTransfer.schema.json
8
+ */
9
+ async function transferGrant(client, params) {
10
+ const choiceArgs = {
11
+ to_owner: params.toOwner,
12
+ quantity: typeof params.quantity === 'number' ? params.quantity.toString() : params.quantity,
13
+ date: `${params.date}T00:00:00.000Z`,
14
+ consideration_text: params.considerationText ? { tag: 'Some', value: params.considerationText } : 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.StockPlan.PlanSecurityGrant.templateId,
22
+ contractId: params.planSecurityContractId,
23
+ choice: 'TransferGrant',
24
+ choiceArgument: choiceArgs,
25
+ },
26
+ },
27
+ ],
28
+ }));
29
+ const createdEvent = Object.values(response.transactionTree.eventsById).find((e) => 'CreatedTreeEvent' in e && e.CreatedTreeEvent.value.templateId === open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.PlanSecurityTransferEvent.templateId);
30
+ if (!createdEvent)
31
+ throw new Error('PlanSecurityTransferEvent not found');
32
+ return { updateId: response.transactionTree.updateId, transferEventContractId: createdEvent.CreatedTreeEvent.value.contractId };
33
+ }
34
+ //# sourceMappingURL=transferGrant.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transferGrant.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/transferGrant.ts"],"names":[],"mappings":";;AAuBA,sCAgCC;AAvDD,6FAAoE;AAmBpE;;;GAGG;AACI,KAAK,UAAU,aAAa,CACjC,MAA2B,EAC3B,MAA2B;IAE3B,MAAM,UAAU,GAAkD;QAChE,QAAQ,EAAE,MAAM,CAAC,OAAO;QACxB,QAAQ,EAAE,OAAO,MAAM,CAAC,QAAQ,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,QAAQ;QAC5F,IAAI,EAAE,GAAG,MAAM,CAAC,IAAI,gBAAgB;QACpC,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,SAAS,CAAC,iBAAiB,CAAC,UAAU;oBACxE,UAAU,EAAE,MAAM,CAAC,sBAAsB;oBACzC,MAAM,EAAE,eAAe;oBACvB,cAAc,EAAE,UAAU;iBAC3B;aACF;SACF;KACF,CAAC,CAA4C,CAAC;IAE/C,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,UAAU,CAAC,CAAC,IAAI,CAC1E,CAAC,CAAM,EAAE,EAAE,CAAC,kBAAkB,IAAI,CAAC,IAAI,CAAC,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,KAAK,yCAAQ,CAAC,YAAY,CAAC,SAAS,CAAC,yBAAyB,CAAC,UAAU,CAC7I,CAAC;IAET,IAAI,CAAC,YAAY;QAAE,MAAM,IAAI,KAAK,CAAC,qCAAqC,CAAC,CAAC;IAE1E,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,eAAe,CAAC,QAAQ,EAAE,uBAAuB,EAAE,YAAY,CAAC,gBAAgB,CAAC,KAAK,CAAC,UAAU,EAAE,CAAC;AAClI,CAAC"}
@@ -0,0 +1,24 @@
1
+ import { Fairmint } from '@fairmint/open-captable-protocol-daml-js';
2
+ import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
3
+ import type { ContractId } from '@daml/types';
4
+ import { ContractDetails } from '../../types/contractDetails';
5
+ import { OcfStockPlanData } from '../../types/native';
6
+ export interface UpdateStockPlanParams {
7
+ stockPlanContractId: string;
8
+ featuredAppRightContractDetails: ContractDetails;
9
+ newPlanData: OcfStockPlanData;
10
+ newStockClassContractIds: ContractId<Fairmint.OpenCapTable.StockClass.StockClass>[];
11
+ }
12
+ export interface UpdateStockPlanResult {
13
+ contractId: string;
14
+ updateId: string;
15
+ }
16
+ /**
17
+ * Update a stock plan by exercising the UpdateStockPlan choice on a StockPlan contract
18
+ *
19
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/StockPlan.schema.json
20
+ * - newPlanData: fields per schema (plan_name, initial_shares_reserved, optional dates and behavior)
21
+ * - newStockClassContractIds: updated array of stock class contract IDs
22
+ */
23
+ export declare function updateStockPlan(client: LedgerJsonApiClient, params: UpdateStockPlanParams): Promise<UpdateStockPlanResult>;
24
+ //# sourceMappingURL=updateStockPlan.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateStockPlan.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPlan/updateStockPlan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,0CAA0C,CAAC;AACpE,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAEhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAGtD,MAAM,WAAW,qBAAqB;IACpC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,+BAA+B,EAAE,eAAe,CAAC;IACjD,WAAW,EAAE,gBAAgB,CAAC;IAC9B,wBAAwB,EAAE,UAAU,CAAC,QAAQ,CAAC,YAAY,CAAC,UAAU,CAAC,UAAU,CAAC,EAAE,CAAC;CACrF;AAED,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;CAClB;AAOD;;;;;;GAMG;AACH,wBAAsB,eAAe,CACnC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,qBAAqB,GAC5B,OAAO,CAAC,qBAAqB,CAAC,CA+ChC"}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.updateStockPlan = updateStockPlan;
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 a stock plan by exercising the UpdateStockPlan choice on a StockPlan contract
11
+ *
12
+ * Schema: https://schema.opencaptablecoalition.com/v/1.2.0/objects/StockPlan.schema.json
13
+ * - newPlanData: fields per schema (plan_name, initial_shares_reserved, optional dates and behavior)
14
+ * - newStockClassContractIds: updated array of stock class contract IDs
15
+ */
16
+ async function updateStockPlan(client, params) {
17
+ const eventsResponse = await client.getEventsByContractId({ contractId: params.stockPlanContractId });
18
+ if (!eventsResponse.created?.createdEvent?.createArgument) {
19
+ throw new Error('Invalid contract events response: missing created event or create argument');
20
+ }
21
+ const createArgument = eventsResponse.created.createdEvent.createArgument;
22
+ if (!hasIssuer(createArgument)) {
23
+ throw new Error('Issuer party not found in contract create argument');
24
+ }
25
+ const issuerParty = createArgument.issuer;
26
+ const choiceArguments = {
27
+ new_plan_data: (0, typeConversions_1.stockPlanDataToDaml)(params.newPlanData),
28
+ new_stock_classes: params.newStockClassContractIds
29
+ };
30
+ const response = await client.submitAndWaitForTransactionTree({
31
+ actAs: [issuerParty],
32
+ commands: [
33
+ {
34
+ ExerciseCommand: {
35
+ templateId: open_captable_protocol_daml_js_1.Fairmint.OpenCapTable.StockPlan.StockPlan.templateId,
36
+ contractId: params.stockPlanContractId,
37
+ choice: 'UpdateStockPlan',
38
+ choiceArgument: choiceArguments
39
+ }
40
+ }
41
+ ],
42
+ disclosedContracts: [
43
+ {
44
+ templateId: params.featuredAppRightContractDetails.templateId,
45
+ contractId: params.featuredAppRightContractDetails.contractId,
46
+ createdEventBlob: params.featuredAppRightContractDetails.createdEventBlob,
47
+ synchronizerId: params.featuredAppRightContractDetails.synchronizerId
48
+ }
49
+ ]
50
+ });
51
+ const event = response.transactionTree.eventsById[1];
52
+ if ('CreatedTreeEvent' in event) {
53
+ return {
54
+ contractId: event.CreatedTreeEvent.value.contractId,
55
+ updateId: response.transactionTree.updateId
56
+ };
57
+ }
58
+ else {
59
+ throw new Error('Expected CreatedTreeEvent not found');
60
+ }
61
+ }
62
+ //# sourceMappingURL=updateStockPlan.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateStockPlan.js","sourceRoot":"","sources":["../../../src/functions/stockPlan/updateStockPlan.ts"],"names":[],"mappings":";;AAgCA,0CAkDC;AAlFD,6FAAoE;AAMpE,iEAAkE;AAelE,SAAS,SAAS,CAAC,GAAY;IAC7B,OAAO,CAAC,CAAC,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAQ,GAAsB,CAAC,MAAM,KAAK,QAAQ,CAAC;AAChG,CAAC;AAED;;;;;;GAMG;AACI,KAAK,UAAU,eAAe,CACnC,MAA2B,EAC3B,MAA6B;IAE7B,MAAM,cAAc,GAAG,MAAM,MAAM,CAAC,qBAAqB,CAAC,EAAE,UAAU,EAAE,MAAM,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACtG,IAAI,CAAC,cAAc,CAAC,OAAO,EAAE,YAAY,EAAE,cAAc,EAAE,CAAC;QAC1D,MAAM,IAAI,KAAK,CAAC,4EAA4E,CAAC,CAAC;IAChG,CAAC;IACD,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,GAAoD;QACvE,aAAa,EAAE,IAAA,qCAAmB,EAAC,MAAM,CAAC,WAAW,CAAC;QACtD,iBAAiB,EAAE,MAAM,CAAC,wBAAwB;KACnD,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,SAAS,CAAC,SAAS,CAAC,UAAU;oBAChE,UAAU,EAAE,MAAM,CAAC,mBAAmB;oBACtC,MAAM,EAAE,iBAAiB;oBACzB,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"}
@@ -0,0 +1,16 @@
1
+ import { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
2
+ export interface AcceptTransferParams {
3
+ stockTransferProposalContractId: string;
4
+ issuerParty: string;
5
+ date: string;
6
+ }
7
+ export interface AcceptTransferResult {
8
+ updateId: string;
9
+ stockPositionContractId: string;
10
+ }
11
+ /**
12
+ * Accept a proposed stock transfer by exercising the AcceptTransfer choice on a StockTransferProposal
13
+ * @see https://schema.opencaptablecoalition.com/v/1.2.0/objects/transactions/transfer/StockTransfer.schema.json
14
+ */
15
+ export declare function acceptTransfer(client: LedgerJsonApiClient, params: AcceptTransferParams): Promise<AcceptTransferResult>;
16
+ //# sourceMappingURL=acceptTransfer.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"acceptTransfer.d.ts","sourceRoot":"","sources":["../../../src/functions/stockPosition/acceptTransfer.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAGhE,MAAM,WAAW,oBAAoB;IACnC,+BAA+B,EAAE,MAAM,CAAC;IACxC,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,uBAAuB,EAAE,MAAM,CAAC;CACjC;AAED;;;GAGG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,mBAAmB,EAC3B,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CA0B/B"}