@open-captable-protocol/canton 0.2.85 → 0.2.86

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 (188) hide show
  1. package/dist/OcpClient.d.ts +41 -15
  2. package/dist/OcpClient.d.ts.map +1 -1
  3. package/dist/OcpClient.js +109 -19
  4. package/dist/OcpClient.js.map +1 -1
  5. package/dist/functions/Subscriptions/activeSubscription/addFunds.d.ts +10 -0
  6. package/dist/functions/Subscriptions/activeSubscription/addFunds.d.ts.map +1 -0
  7. package/dist/functions/Subscriptions/activeSubscription/addFunds.js +29 -0
  8. package/dist/functions/Subscriptions/activeSubscription/addFunds.js.map +1 -0
  9. package/dist/functions/Subscriptions/activeSubscription/archiveInactiveSubscription.d.ts +7 -0
  10. package/dist/functions/Subscriptions/activeSubscription/archiveInactiveSubscription.d.ts.map +1 -0
  11. package/dist/functions/Subscriptions/activeSubscription/archiveInactiveSubscription.js +17 -0
  12. package/dist/functions/Subscriptions/activeSubscription/archiveInactiveSubscription.js.map +1 -0
  13. package/dist/functions/Subscriptions/activeSubscription/cancel.d.ts +11 -0
  14. package/dist/functions/Subscriptions/activeSubscription/cancel.d.ts.map +1 -0
  15. package/dist/functions/Subscriptions/activeSubscription/cancel.js +25 -0
  16. package/dist/functions/Subscriptions/activeSubscription/cancel.js.map +1 -0
  17. package/dist/functions/Subscriptions/activeSubscription/changeParty.d.ts +10 -0
  18. package/dist/functions/Subscriptions/activeSubscription/changeParty.d.ts.map +1 -0
  19. package/dist/functions/Subscriptions/activeSubscription/changeParty.js +19 -0
  20. package/dist/functions/Subscriptions/activeSubscription/changeParty.js.map +1 -0
  21. package/dist/functions/Subscriptions/activeSubscription/index.d.ts +18 -0
  22. package/dist/functions/Subscriptions/activeSubscription/index.d.ts.map +1 -0
  23. package/dist/functions/Subscriptions/activeSubscription/index.js +39 -0
  24. package/dist/functions/Subscriptions/activeSubscription/index.js.map +1 -0
  25. package/dist/functions/Subscriptions/{subscription → activeSubscription}/processFreeTrial.d.ts +5 -1
  26. package/dist/functions/Subscriptions/activeSubscription/processFreeTrial.d.ts.map +1 -0
  27. package/dist/functions/Subscriptions/{subscription → activeSubscription}/processFreeTrial.js +7 -3
  28. package/dist/functions/Subscriptions/activeSubscription/processFreeTrial.js.map +1 -0
  29. package/dist/functions/Subscriptions/activeSubscription/processPayment.d.ts +14 -0
  30. package/dist/functions/Subscriptions/activeSubscription/processPayment.d.ts.map +1 -0
  31. package/dist/functions/Subscriptions/activeSubscription/processPayment.js +30 -0
  32. package/dist/functions/Subscriptions/activeSubscription/processPayment.js.map +1 -0
  33. package/dist/functions/Subscriptions/activeSubscription/proposeChanges.d.ts +26 -0
  34. package/dist/functions/Subscriptions/activeSubscription/proposeChanges.d.ts.map +1 -0
  35. package/dist/functions/Subscriptions/activeSubscription/proposeChanges.js +73 -0
  36. package/dist/functions/Subscriptions/activeSubscription/proposeChanges.js.map +1 -0
  37. package/dist/functions/Subscriptions/activeSubscription/refund.d.ts +10 -0
  38. package/dist/functions/Subscriptions/activeSubscription/refund.d.ts.map +1 -0
  39. package/dist/functions/Subscriptions/activeSubscription/refund.js +24 -0
  40. package/dist/functions/Subscriptions/activeSubscription/refund.js.map +1 -0
  41. package/dist/functions/Subscriptions/activeSubscription/replaceLockedAmulet.d.ts +10 -0
  42. package/dist/functions/Subscriptions/activeSubscription/replaceLockedAmulet.d.ts.map +1 -0
  43. package/dist/functions/Subscriptions/activeSubscription/replaceLockedAmulet.js +25 -0
  44. package/dist/functions/Subscriptions/activeSubscription/replaceLockedAmulet.js.map +1 -0
  45. package/dist/functions/Subscriptions/activeSubscription/withdrawFunds.d.ts +9 -0
  46. package/dist/functions/Subscriptions/activeSubscription/withdrawFunds.d.ts.map +1 -0
  47. package/dist/functions/Subscriptions/activeSubscription/withdrawFunds.js +24 -0
  48. package/dist/functions/Subscriptions/activeSubscription/withdrawFunds.js.map +1 -0
  49. package/dist/functions/Subscriptions/index.d.ts +9 -3
  50. package/dist/functions/Subscriptions/index.d.ts.map +1 -1
  51. package/dist/functions/Subscriptions/index.js +29 -3
  52. package/dist/functions/Subscriptions/index.js.map +1 -1
  53. package/dist/functions/Subscriptions/partyMigrationProposal/approve.d.ts +7 -0
  54. package/dist/functions/Subscriptions/partyMigrationProposal/approve.d.ts.map +1 -0
  55. package/dist/functions/Subscriptions/partyMigrationProposal/approve.js +17 -0
  56. package/dist/functions/Subscriptions/partyMigrationProposal/approve.js.map +1 -0
  57. package/dist/functions/Subscriptions/partyMigrationProposal/archive.d.ts +8 -0
  58. package/dist/functions/Subscriptions/partyMigrationProposal/archive.d.ts.map +1 -0
  59. package/dist/functions/Subscriptions/partyMigrationProposal/archive.js +22 -0
  60. package/dist/functions/Subscriptions/partyMigrationProposal/archive.js.map +1 -0
  61. package/dist/functions/Subscriptions/partyMigrationProposal/index.d.ts +5 -0
  62. package/dist/functions/Subscriptions/partyMigrationProposal/index.d.ts.map +1 -0
  63. package/dist/functions/Subscriptions/{subscription → partyMigrationProposal}/index.js +4 -4
  64. package/dist/functions/Subscriptions/partyMigrationProposal/index.js.map +1 -0
  65. package/dist/functions/Subscriptions/partyMigrationProposal/migrateActiveSubscription.d.ts +8 -0
  66. package/dist/functions/Subscriptions/partyMigrationProposal/migrateActiveSubscription.d.ts.map +1 -0
  67. package/dist/functions/Subscriptions/partyMigrationProposal/migrateActiveSubscription.js +18 -0
  68. package/dist/functions/Subscriptions/partyMigrationProposal/migrateActiveSubscription.js.map +1 -0
  69. package/dist/functions/Subscriptions/partyMigrationProposal/migrateProposedSubscription.d.ts +8 -0
  70. package/dist/functions/Subscriptions/partyMigrationProposal/migrateProposedSubscription.d.ts.map +1 -0
  71. package/dist/functions/Subscriptions/partyMigrationProposal/migrateProposedSubscription.js +18 -0
  72. package/dist/functions/Subscriptions/partyMigrationProposal/migrateProposedSubscription.js.map +1 -0
  73. package/dist/functions/Subscriptions/proposedSubscription/approve.d.ts +7 -0
  74. package/dist/functions/Subscriptions/proposedSubscription/approve.d.ts.map +1 -0
  75. package/dist/functions/Subscriptions/proposedSubscription/approve.js +19 -0
  76. package/dist/functions/Subscriptions/proposedSubscription/approve.js.map +1 -0
  77. package/dist/functions/Subscriptions/proposedSubscription/changeParty.d.ts +10 -0
  78. package/dist/functions/Subscriptions/proposedSubscription/changeParty.d.ts.map +1 -0
  79. package/dist/functions/Subscriptions/proposedSubscription/changeParty.js +19 -0
  80. package/dist/functions/Subscriptions/proposedSubscription/changeParty.js.map +1 -0
  81. package/dist/functions/Subscriptions/proposedSubscription/editSubscriptionProposal.d.ts +27 -0
  82. package/dist/functions/Subscriptions/proposedSubscription/editSubscriptionProposal.d.ts.map +1 -0
  83. package/dist/functions/Subscriptions/proposedSubscription/editSubscriptionProposal.js +76 -0
  84. package/dist/functions/Subscriptions/proposedSubscription/editSubscriptionProposal.js.map +1 -0
  85. package/dist/functions/Subscriptions/proposedSubscription/index.d.ts +6 -0
  86. package/dist/functions/Subscriptions/proposedSubscription/index.d.ts.map +1 -0
  87. package/dist/functions/Subscriptions/proposedSubscription/index.js +22 -0
  88. package/dist/functions/Subscriptions/proposedSubscription/index.js.map +1 -0
  89. package/dist/functions/Subscriptions/proposedSubscription/startSubscription.d.ts +8 -0
  90. package/dist/functions/Subscriptions/proposedSubscription/startSubscription.d.ts.map +1 -0
  91. package/dist/functions/Subscriptions/proposedSubscription/startSubscription.js +27 -0
  92. package/dist/functions/Subscriptions/proposedSubscription/startSubscription.js.map +1 -0
  93. package/dist/functions/Subscriptions/proposedSubscription/withdraw.d.ts +8 -0
  94. package/dist/functions/Subscriptions/proposedSubscription/withdraw.d.ts.map +1 -0
  95. package/dist/functions/Subscriptions/proposedSubscription/withdraw.js +19 -0
  96. package/dist/functions/Subscriptions/proposedSubscription/withdraw.js.map +1 -0
  97. package/dist/functions/Subscriptions/subscriptionChangeProposal/apply.d.ts +8 -0
  98. package/dist/functions/Subscriptions/subscriptionChangeProposal/apply.d.ts.map +1 -0
  99. package/dist/functions/Subscriptions/subscriptionChangeProposal/apply.js +18 -0
  100. package/dist/functions/Subscriptions/subscriptionChangeProposal/apply.js.map +1 -0
  101. package/dist/functions/Subscriptions/subscriptionChangeProposal/approve.d.ts +7 -0
  102. package/dist/functions/Subscriptions/subscriptionChangeProposal/approve.d.ts.map +1 -0
  103. package/dist/functions/Subscriptions/subscriptionChangeProposal/approve.js +17 -0
  104. package/dist/functions/Subscriptions/subscriptionChangeProposal/approve.js.map +1 -0
  105. package/dist/functions/Subscriptions/subscriptionChangeProposal/index.d.ts +4 -0
  106. package/dist/functions/Subscriptions/subscriptionChangeProposal/index.d.ts.map +1 -0
  107. package/dist/functions/Subscriptions/{processorApprovedSubscriptionProposal → subscriptionChangeProposal}/index.js +3 -3
  108. package/dist/functions/Subscriptions/subscriptionChangeProposal/index.js.map +1 -0
  109. package/dist/functions/Subscriptions/subscriptionChangeProposal/reject.d.ts +8 -0
  110. package/dist/functions/Subscriptions/subscriptionChangeProposal/reject.d.ts.map +1 -0
  111. package/dist/functions/Subscriptions/subscriptionChangeProposal/reject.js +19 -0
  112. package/dist/functions/Subscriptions/subscriptionChangeProposal/reject.js.map +1 -0
  113. package/dist/functions/Subscriptions/subscriptionFactory/createSubscriptionProposal.d.ts +21 -12
  114. package/dist/functions/Subscriptions/subscriptionFactory/createSubscriptionProposal.d.ts.map +1 -1
  115. package/dist/functions/Subscriptions/subscriptionFactory/createSubscriptionProposal.js +40 -16
  116. package/dist/functions/Subscriptions/subscriptionFactory/createSubscriptionProposal.js.map +1 -1
  117. package/dist/functions/Subscriptions/types/lockFundsInput.d.ts +8 -0
  118. package/dist/functions/Subscriptions/types/lockFundsInput.d.ts.map +1 -0
  119. package/dist/functions/Subscriptions/types/lockFundsInput.js +3 -0
  120. package/dist/functions/Subscriptions/types/lockFundsInput.js.map +1 -0
  121. package/dist/functions/Subscriptions/utils/disclosedContracts.d.ts +14 -0
  122. package/dist/functions/Subscriptions/utils/disclosedContracts.d.ts.map +1 -0
  123. package/dist/functions/Subscriptions/utils/disclosedContracts.js +49 -0
  124. package/dist/functions/Subscriptions/utils/disclosedContracts.js.map +1 -0
  125. package/dist/functions/Subscriptions/utils/factoryContractId.d.ts +17 -0
  126. package/dist/functions/Subscriptions/utils/factoryContractId.d.ts.map +1 -0
  127. package/dist/functions/Subscriptions/utils/factoryContractId.js +23 -0
  128. package/dist/functions/Subscriptions/utils/factoryContractId.js.map +1 -0
  129. package/dist/functions/Subscriptions/utils/index.d.ts +4 -0
  130. package/dist/functions/Subscriptions/utils/index.d.ts.map +1 -0
  131. package/dist/functions/Subscriptions/{subscriptionProposal → utils}/index.js +3 -4
  132. package/dist/functions/Subscriptions/utils/index.js.map +1 -0
  133. package/dist/functions/Subscriptions/utils/paymentContext.d.ts +60 -0
  134. package/dist/functions/Subscriptions/utils/paymentContext.d.ts.map +1 -0
  135. package/dist/functions/Subscriptions/utils/paymentContext.js +157 -0
  136. package/dist/functions/Subscriptions/utils/paymentContext.js.map +1 -0
  137. package/package.json +9 -9
  138. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/index.d.ts +0 -4
  139. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/index.d.ts.map +0 -1
  140. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/index.js.map +0 -1
  141. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientAccept.d.ts +0 -6
  142. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientAccept.d.ts.map +0 -1
  143. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientAccept.js +0 -15
  144. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientAccept.js.map +0 -1
  145. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientReject.d.ts +0 -6
  146. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientReject.d.ts.map +0 -1
  147. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientReject.js +0 -15
  148. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientReject.js.map +0 -1
  149. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/subscriberWithdraw.d.ts +0 -6
  150. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/subscriberWithdraw.d.ts.map +0 -1
  151. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/subscriberWithdraw.js +0 -15
  152. package/dist/functions/Subscriptions/processorApprovedSubscriptionProposal/subscriberWithdraw.js.map +0 -1
  153. package/dist/functions/Subscriptions/subscription/cancelByRecipient.d.ts +0 -6
  154. package/dist/functions/Subscriptions/subscription/cancelByRecipient.d.ts.map +0 -1
  155. package/dist/functions/Subscriptions/subscription/cancelByRecipient.js +0 -15
  156. package/dist/functions/Subscriptions/subscription/cancelByRecipient.js.map +0 -1
  157. package/dist/functions/Subscriptions/subscription/cancelBySubscriber.d.ts +0 -6
  158. package/dist/functions/Subscriptions/subscription/cancelBySubscriber.d.ts.map +0 -1
  159. package/dist/functions/Subscriptions/subscription/cancelBySubscriber.js +0 -15
  160. package/dist/functions/Subscriptions/subscription/cancelBySubscriber.js.map +0 -1
  161. package/dist/functions/Subscriptions/subscription/index.d.ts +0 -5
  162. package/dist/functions/Subscriptions/subscription/index.d.ts.map +0 -1
  163. package/dist/functions/Subscriptions/subscription/index.js.map +0 -1
  164. package/dist/functions/Subscriptions/subscription/processFreeTrial.d.ts.map +0 -1
  165. package/dist/functions/Subscriptions/subscription/processFreeTrial.js.map +0 -1
  166. package/dist/functions/Subscriptions/subscription/processPayment.d.ts +0 -14
  167. package/dist/functions/Subscriptions/subscription/processPayment.d.ts.map +0 -1
  168. package/dist/functions/Subscriptions/subscription/processPayment.js +0 -30
  169. package/dist/functions/Subscriptions/subscription/processPayment.js.map +0 -1
  170. package/dist/functions/Subscriptions/subscriptionProposal/index.d.ts +0 -5
  171. package/dist/functions/Subscriptions/subscriptionProposal/index.d.ts.map +0 -1
  172. package/dist/functions/Subscriptions/subscriptionProposal/index.js.map +0 -1
  173. package/dist/functions/Subscriptions/subscriptionProposal/processorApprove.d.ts +0 -6
  174. package/dist/functions/Subscriptions/subscriptionProposal/processorApprove.d.ts.map +0 -1
  175. package/dist/functions/Subscriptions/subscriptionProposal/processorApprove.js +0 -15
  176. package/dist/functions/Subscriptions/subscriptionProposal/processorApprove.js.map +0 -1
  177. package/dist/functions/Subscriptions/subscriptionProposal/processorReject.d.ts +0 -6
  178. package/dist/functions/Subscriptions/subscriptionProposal/processorReject.d.ts.map +0 -1
  179. package/dist/functions/Subscriptions/subscriptionProposal/processorReject.js +0 -15
  180. package/dist/functions/Subscriptions/subscriptionProposal/processorReject.js.map +0 -1
  181. package/dist/functions/Subscriptions/subscriptionProposal/recipientReject.d.ts +0 -6
  182. package/dist/functions/Subscriptions/subscriptionProposal/recipientReject.d.ts.map +0 -1
  183. package/dist/functions/Subscriptions/subscriptionProposal/recipientReject.js +0 -15
  184. package/dist/functions/Subscriptions/subscriptionProposal/recipientReject.js.map +0 -1
  185. package/dist/functions/Subscriptions/subscriptionProposal/subscriberWithdraw.d.ts +0 -6
  186. package/dist/functions/Subscriptions/subscriptionProposal/subscriberWithdraw.d.ts.map +0 -1
  187. package/dist/functions/Subscriptions/subscriptionProposal/subscriberWithdraw.js +0 -15
  188. package/dist/functions/Subscriptions/subscriptionProposal/subscriberWithdraw.js.map +0 -1
@@ -0,0 +1,49 @@
1
+ "use strict";
2
+ /** Utilities for handling disclosed contracts in subscription workflows */
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getFactoryDisclosedContracts = getFactoryDisclosedContracts;
8
+ exports.getProposedSubscriptionDisclosedContracts = getProposedSubscriptionDisclosedContracts;
9
+ const subscriptions_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/subscriptions-factory-contract-id.json"));
10
+ /**
11
+ * Get disclosed contracts for the factory contract Reads from the pre-generated factory contract data for the client's
12
+ * network This allows parties that don't directly see the factory to exercise it
13
+ */
14
+ function getFactoryDisclosedContracts(client) {
15
+ const network = client.client.getNetwork();
16
+ const networkData = subscriptions_factory_contract_id_json_1.default[network];
17
+ if (!networkData) {
18
+ throw new Error(`Factory contract data not found for network "${network}". ` +
19
+ 'Please run the factory deployment script for this network first.');
20
+ }
21
+ if (!networkData.disclosedContract) {
22
+ throw new Error(`Disclosed contract data not found for network "${network}". ` +
23
+ 'The factory contract data may be outdated. Please re-run the factory deployment script.');
24
+ }
25
+ return [networkData.disclosedContract];
26
+ }
27
+ /**
28
+ * Get disclosed contracts for a ProposedSubscription contract This allows parties to exercise choices on the proposal
29
+ * when needed
30
+ */
31
+ async function getProposedSubscriptionDisclosedContracts(client, proposedSubscriptionContractId) {
32
+ const proposalEventsResponse = await client.client.getEventsByContractId({
33
+ contractId: proposedSubscriptionContractId,
34
+ readAs: [client.client.getPartyId()],
35
+ });
36
+ const createdEvent = proposalEventsResponse.created?.createdEvent;
37
+ if (!createdEvent || !proposalEventsResponse.created) {
38
+ throw new Error(`ProposedSubscription contract ${proposedSubscriptionContractId} not found`);
39
+ }
40
+ return [
41
+ {
42
+ templateId: createdEvent.templateId,
43
+ contractId: createdEvent.contractId,
44
+ createdEventBlob: createdEvent.createdEventBlob,
45
+ synchronizerId: proposalEventsResponse.created.synchronizerId,
46
+ },
47
+ ];
48
+ }
49
+ //# sourceMappingURL=disclosedContracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disclosedContracts.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/utils/disclosedContracts.ts"],"names":[],"mappings":";AAAA,2EAA2E;;;;;AAW3E,oEAqBC;AAMD,8FAuBC;AA1DD,6JAAyH;AAIzH;;;GAGG;AACH,SAAgB,4BAA4B,CAAC,MAAiB;IAC5D,MAAM,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;IAC3C,MAAM,WAAW,GAAG,gDAA0B,CAAC,OAAkD,CAEpF,CAAC;IAEd,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,KAAK,CACb,gDAAgD,OAAO,KAAK;YAC1D,kEAAkE,CACrE,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;QACnC,MAAM,IAAI,KAAK,CACb,kDAAkD,OAAO,KAAK;YAC5D,yFAAyF,CAC5F,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,yCAAyC,CAC7D,MAAiB,EACjB,8BAAsC;IAEtC,MAAM,sBAAsB,GAAG,MAAM,MAAM,CAAC,MAAM,CAAC,qBAAqB,CAAC;QACvE,UAAU,EAAE,8BAA8B;QAC1C,MAAM,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;KACrC,CAAC,CAAC;IAEH,MAAM,YAAY,GAAG,sBAAsB,CAAC,OAAO,EAAE,YAAY,CAAC;IAElE,IAAI,CAAC,YAAY,IAAI,CAAC,sBAAsB,CAAC,OAAO,EAAE,CAAC;QACrD,MAAM,IAAI,KAAK,CAAC,iCAAiC,8BAA8B,YAAY,CAAC,CAAC;IAC/F,CAAC;IAED,OAAO;QACL;YACE,UAAU,EAAE,YAAY,CAAC,UAAU;YACnC,UAAU,EAAE,YAAY,CAAC,UAAU;YACnC,gBAAgB,EAAE,YAAY,CAAC,gBAAgB;YAC/C,cAAc,EAAE,sBAAsB,CAAC,OAAO,CAAC,cAAc;SAC9D;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,17 @@
1
+ /** Utilities for retrieving subscription factory contract IDs */
2
+ import type { DisclosedContract } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
3
+ export type Network = 'devnet' | 'mainnet';
4
+ export interface FactoryContractInfo {
5
+ subscriptionsFactoryContractId: string;
6
+ templateId: string;
7
+ disclosedContract?: DisclosedContract;
8
+ }
9
+ /**
10
+ * Get the subscription factory contract ID for a given network
11
+ *
12
+ * @param network - The network to get the factory contract ID for ('devnet' or 'mainnet')
13
+ * @returns The factory contract information including contract ID and template ID
14
+ * @throws Error if the network is not found in the configuration
15
+ */
16
+ export declare function getFactoryContractId(network: Network): FactoryContractInfo;
17
+ //# sourceMappingURL=factoryContractId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factoryContractId.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/utils/factoryContractId.ts"],"names":[],"mappings":"AAAA,iEAAiE;AAEjE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kFAAkF,CAAC;AAG1H,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,SAAS,CAAC;AAE3C,MAAM,WAAW,mBAAmB;IAClC,8BAA8B,EAAE,MAAM,CAAC;IACvC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAQ1E"}
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /** Utilities for retrieving subscription factory contract IDs */
3
+ var __importDefault = (this && this.__importDefault) || function (mod) {
4
+ return (mod && mod.__esModule) ? mod : { "default": mod };
5
+ };
6
+ Object.defineProperty(exports, "__esModule", { value: true });
7
+ exports.getFactoryContractId = getFactoryContractId;
8
+ const subscriptions_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/subscriptions-factory-contract-id.json"));
9
+ /**
10
+ * Get the subscription factory contract ID for a given network
11
+ *
12
+ * @param network - The network to get the factory contract ID for ('devnet' or 'mainnet')
13
+ * @returns The factory contract information including contract ID and template ID
14
+ * @throws Error if the network is not found in the configuration
15
+ */
16
+ function getFactoryContractId(network) {
17
+ const config = subscriptions_factory_contract_id_json_1.default[network];
18
+ if (!config) {
19
+ throw new Error(`Subscription factory contract ID not found for network: ${network}`);
20
+ }
21
+ return config;
22
+ }
23
+ //# sourceMappingURL=factoryContractId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factoryContractId.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/utils/factoryContractId.ts"],"names":[],"mappings":";AAAA,iEAAiE;;;;;AAoBjE,oDAQC;AAzBD,6JAAyH;AAUzH;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,OAAgB;IACnD,MAAM,MAAM,GAAG,gDAA0B,CAAC,OAAO,CAAoC,CAAC;IAEtF,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,KAAK,CAAC,2DAA2D,OAAO,EAAE,CAAC,CAAC;IACxF,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './disclosedContracts';
2
+ export * from './factoryContractId';
3
+ export * from './paymentContext';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC"}
@@ -14,8 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./processorApprove"), exports);
18
- __exportStar(require("./processorReject"), exports);
19
- __exportStar(require("./recipientReject"), exports);
20
- __exportStar(require("./subscriberWithdraw"), exports);
17
+ __exportStar(require("./disclosedContracts"), exports);
18
+ __exportStar(require("./factoryContractId"), exports);
19
+ __exportStar(require("./paymentContext"), exports);
21
20
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,sDAAoC;AACpC,mDAAiC"}
@@ -0,0 +1,60 @@
1
+ /** Utilities for building payment context for subscription payments */
2
+ import type { ValidatorApiClient } from '@fairmint/canton-node-sdk';
3
+ import type { DisclosedContract } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
4
+ import type { OcpClient } from '../../../OcpClient';
5
+ export interface PaymentContext {
6
+ amuletRulesCid: string;
7
+ openMiningRoundCid: string;
8
+ featuredAppRight: string | null;
9
+ }
10
+ export interface PaymentContextWithDisclosedContracts {
11
+ paymentContext: PaymentContext;
12
+ disclosedContracts: DisclosedContract[];
13
+ }
14
+ export interface PaymentContextWithAmulets {
15
+ subscriberAmulets: string[];
16
+ amuletRulesCid: string;
17
+ openMiningRoundCid: string;
18
+ featuredAppRight?: string | null;
19
+ }
20
+ export interface PaymentContextWithAmuletsAndDisclosed {
21
+ paymentContext: PaymentContextWithAmulets;
22
+ disclosedContracts: DisclosedContract[];
23
+ }
24
+ /**
25
+ * Build payment context for processing subscription payments (no amulet inputs needed)
26
+ *
27
+ * Queries the ledger for:
28
+ *
29
+ * - AmuletRules contract
30
+ * - OpenMiningRound contract
31
+ * - FeaturedAppRight contract (if provider specified)
32
+ *
33
+ * Returns both the payment context and the disclosed contracts needed
34
+ *
35
+ * @param validatorClient - Validator API client for getting rules/rounds
36
+ * @param provider - Optional provider party ID to lookup featured app right
37
+ */
38
+ export declare function buildPaymentContext(validatorClient: ValidatorApiClient, provider?: string): Promise<PaymentContextWithDisclosedContracts>;
39
+ /**
40
+ * Build payment context with subscriber's amulets for initial subscription approval
41
+ *
42
+ * Queries the ledger for:
43
+ *
44
+ * - Subscriber's Amulet contracts (via Validator API)
45
+ * - AmuletRules contract
46
+ * - OpenMiningRound contract
47
+ * - FeaturedAppRight contract (if provider specified)
48
+ *
49
+ * Returns both the payment context and the disclosed contracts needed
50
+ *
51
+ * NOTE: The validatorClient must be authenticated as the subscriberParty
52
+ *
53
+ * @param ledgerClient - OCP client for querying contracts
54
+ * @param validatorClient - Validator API client authenticated as subscriber
55
+ * @param subscriberParty - Party ID of the subscriber (for validation only)
56
+ * @param maxAmuletInputs - Maximum number of Amulet contracts to use (default: 2)
57
+ * @param provider - Optional provider party ID to lookup featured app right
58
+ */
59
+ export declare function buildPaymentContextWithAmulets(ledgerClient: OcpClient, validatorClient: ValidatorApiClient, subscriberParty: string, maxAmuletInputs?: number, provider?: string): Promise<PaymentContextWithAmuletsAndDisclosed>;
60
+ //# sourceMappingURL=paymentContext.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentContext.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/utils/paymentContext.ts"],"names":[],"mappings":"AAAA,uEAAuE;AAEvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kFAAkF,CAAC;AAE1H,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AAEpD,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;CACjC;AAED,MAAM,WAAW,oCAAoC;IACnD,cAAc,EAAE,cAAc,CAAC;IAC/B,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,EAAE,MAAM,EAAE,CAAC;IAC5B,cAAc,EAAE,MAAM,CAAC;IACvB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,gBAAgB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAClC;AAED,MAAM,WAAW,qCAAqC;IACpD,cAAc,EAAE,yBAAyB,CAAC;IAC1C,kBAAkB,EAAE,iBAAiB,EAAE,CAAC;CACzC;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,mBAAmB,CACvC,eAAe,EAAE,kBAAkB,EACnC,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,oCAAoC,CAAC,CA+C/C;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,8BAA8B,CAClD,YAAY,EAAE,SAAS,EACvB,eAAe,EAAE,kBAAkB,EACnC,eAAe,EAAE,MAAM,EACvB,eAAe,SAAI,EACnB,QAAQ,CAAC,EAAE,MAAM,GAChB,OAAO,CAAC,qCAAqC,CAAC,CA8EhD"}
@@ -0,0 +1,157 @@
1
+ "use strict";
2
+ /** Utilities for building payment context for subscription payments */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.buildPaymentContext = buildPaymentContext;
5
+ exports.buildPaymentContextWithAmulets = buildPaymentContextWithAmulets;
6
+ const mining_rounds_1 = require("@fairmint/canton-node-sdk/build/src/utils/mining/mining-rounds");
7
+ /**
8
+ * Build payment context for processing subscription payments (no amulet inputs needed)
9
+ *
10
+ * Queries the ledger for:
11
+ *
12
+ * - AmuletRules contract
13
+ * - OpenMiningRound contract
14
+ * - FeaturedAppRight contract (if provider specified)
15
+ *
16
+ * Returns both the payment context and the disclosed contracts needed
17
+ *
18
+ * @param validatorClient - Validator API client for getting rules/rounds
19
+ * @param provider - Optional provider party ID to lookup featured app right
20
+ */
21
+ async function buildPaymentContext(validatorClient, provider) {
22
+ // Get AmuletRules contract
23
+ const amuletRulesResponse = await validatorClient.getAmuletRules();
24
+ const amuletRulesCid = amuletRulesResponse.amulet_rules.contract.contract_id;
25
+ const amuletRulesContract = {
26
+ templateId: amuletRulesResponse.amulet_rules.contract.template_id,
27
+ contractId: amuletRulesCid,
28
+ createdEventBlob: amuletRulesResponse.amulet_rules.contract.created_event_blob,
29
+ synchronizerId: amuletRulesResponse.amulet_rules.domain_id,
30
+ };
31
+ // Get OpenMiningRound contract
32
+ const miningRoundContext = await (0, mining_rounds_1.getCurrentMiningRoundContext)(validatorClient);
33
+ const openMiningRoundCid = miningRoundContext.openMiningRound;
34
+ const { openMiningRoundContract } = miningRoundContext;
35
+ // Get FeaturedAppRight contract if provider specified
36
+ let featuredAppRightCid = null;
37
+ const disclosedContracts = [amuletRulesContract, openMiningRoundContract];
38
+ if (provider) {
39
+ try {
40
+ const featuredAppRight = await validatorClient.lookupFeaturedAppRight({ partyId: provider });
41
+ if (featuredAppRight.featured_app_right) {
42
+ featuredAppRightCid = featuredAppRight.featured_app_right.contract_id;
43
+ // Add disclosed contract with synchronizer from amulet rules
44
+ disclosedContracts.push({
45
+ templateId: featuredAppRight.featured_app_right.template_id,
46
+ contractId: featuredAppRight.featured_app_right.contract_id,
47
+ createdEventBlob: featuredAppRight.featured_app_right.created_event_blob,
48
+ synchronizerId: amuletRulesResponse.amulet_rules.domain_id,
49
+ });
50
+ }
51
+ }
52
+ catch {
53
+ // If featured app right lookup fails, continue with null (optional)
54
+ // This is expected when the provider doesn't have a featured app right
55
+ }
56
+ }
57
+ return {
58
+ paymentContext: {
59
+ amuletRulesCid,
60
+ openMiningRoundCid,
61
+ featuredAppRight: featuredAppRightCid,
62
+ },
63
+ disclosedContracts,
64
+ };
65
+ }
66
+ /**
67
+ * Build payment context with subscriber's amulets for initial subscription approval
68
+ *
69
+ * Queries the ledger for:
70
+ *
71
+ * - Subscriber's Amulet contracts (via Validator API)
72
+ * - AmuletRules contract
73
+ * - OpenMiningRound contract
74
+ * - FeaturedAppRight contract (if provider specified)
75
+ *
76
+ * Returns both the payment context and the disclosed contracts needed
77
+ *
78
+ * NOTE: The validatorClient must be authenticated as the subscriberParty
79
+ *
80
+ * @param ledgerClient - OCP client for querying contracts
81
+ * @param validatorClient - Validator API client authenticated as subscriber
82
+ * @param subscriberParty - Party ID of the subscriber (for validation only)
83
+ * @param maxAmuletInputs - Maximum number of Amulet contracts to use (default: 2)
84
+ * @param provider - Optional provider party ID to lookup featured app right
85
+ */
86
+ async function buildPaymentContextWithAmulets(ledgerClient, validatorClient, subscriberParty, maxAmuletInputs = 2, provider) {
87
+ // Get subscriber's Amulet contracts via Validator API
88
+ // Note: validatorClient must be authenticated as subscriberParty
89
+ const amuletsResponse = await validatorClient.getAmulets();
90
+ const subscriberAmulets = amuletsResponse.amulets.map((amulet) => ({
91
+ contractId: amulet.contract.contract.contract_id,
92
+ templateId: amulet.contract.contract.template_id,
93
+ synchronizerId: amulet.contract.domain_id,
94
+ }));
95
+ if (subscriberAmulets.length === 0) {
96
+ throw new Error(`Subscriber ${subscriberParty} has no Amulet contracts`);
97
+ }
98
+ // Get disclosed contracts for each Amulet (getAmulets already includes created_event_blob)
99
+ const amuletsToDisclose = amuletsResponse.amulets.slice(0, maxAmuletInputs);
100
+ const amuletDisclosedContracts = amuletsToDisclose.map((amulet) => ({
101
+ templateId: amulet.contract.contract.template_id,
102
+ contractId: amulet.contract.contract.contract_id,
103
+ createdEventBlob: amulet.contract.contract.created_event_blob,
104
+ synchronizerId: amulet.contract.domain_id,
105
+ }));
106
+ // Get AmuletRules contract
107
+ const amuletRulesResponse = await validatorClient.getAmuletRules();
108
+ const amuletRulesCid = amuletRulesResponse.amulet_rules.contract.contract_id;
109
+ const amuletRulesContract = {
110
+ templateId: amuletRulesResponse.amulet_rules.contract.template_id,
111
+ contractId: amuletRulesCid,
112
+ createdEventBlob: amuletRulesResponse.amulet_rules.contract.created_event_blob,
113
+ synchronizerId: amuletRulesResponse.amulet_rules.domain_id,
114
+ };
115
+ // Get OpenMiningRound contract
116
+ const miningRoundContext = await (0, mining_rounds_1.getCurrentMiningRoundContext)(validatorClient);
117
+ const openMiningRoundCid = miningRoundContext.openMiningRound;
118
+ const { openMiningRoundContract } = miningRoundContext;
119
+ // Build payment context with amulets
120
+ const amuletInputs = subscriberAmulets.slice(0, maxAmuletInputs).map((a) => a.contractId);
121
+ // Get FeaturedAppRight contract if provider specified
122
+ let featuredAppRightCid = null;
123
+ const disclosedContracts = [
124
+ amuletRulesContract,
125
+ openMiningRoundContract,
126
+ ...amuletDisclosedContracts,
127
+ ];
128
+ if (provider) {
129
+ try {
130
+ const featuredAppRight = await validatorClient.lookupFeaturedAppRight({ partyId: provider });
131
+ if (featuredAppRight.featured_app_right) {
132
+ featuredAppRightCid = featuredAppRight.featured_app_right.contract_id;
133
+ // Add disclosed contract with synchronizer from amulet rules
134
+ disclosedContracts.push({
135
+ templateId: featuredAppRight.featured_app_right.template_id,
136
+ contractId: featuredAppRight.featured_app_right.contract_id,
137
+ createdEventBlob: featuredAppRight.featured_app_right.created_event_blob,
138
+ synchronizerId: amuletRulesResponse.amulet_rules.domain_id,
139
+ });
140
+ }
141
+ }
142
+ catch {
143
+ // If featured app right lookup fails, continue with null (optional)
144
+ // This is expected when the provider doesn't have a featured app right
145
+ }
146
+ }
147
+ return {
148
+ paymentContext: {
149
+ subscriberAmulets: amuletInputs,
150
+ amuletRulesCid,
151
+ openMiningRoundCid,
152
+ featuredAppRight: featuredAppRightCid,
153
+ },
154
+ disclosedContracts,
155
+ };
156
+ }
157
+ //# sourceMappingURL=paymentContext.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentContext.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/utils/paymentContext.ts"],"names":[],"mappings":";AAAA,uEAAuE;;AA4CvE,kDAkDC;AAsBD,wEAoFC;AApMD,kGAA8G;AA0B9G;;;;;;;;;;;;;GAaG;AACI,KAAK,UAAU,mBAAmB,CACvC,eAAmC,EACnC,QAAiB;IAEjB,2BAA2B;IAC3B,MAAM,mBAAmB,GAAG,MAAM,eAAe,CAAC,cAAc,EAAE,CAAC;IACnE,MAAM,cAAc,GAAG,mBAAmB,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW,CAAC;IAC7E,MAAM,mBAAmB,GAAG;QAC1B,UAAU,EAAE,mBAAmB,CAAC,YAAY,CAAC,QAAQ,CAAC,WAAW;QACjE,UAAU,EAAE,cAAc;QAC1B,gBAAgB,EAAE,mBAAmB,C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kB,CAAC,kBAAkB;oBACxE,cAAc,EAAE,mBAAmB,CAAC,YAAY,CAAC,SAAS;iBAC3D,CAAC,CAAC;YACL,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oEAAoE;YACpE,uEAAuE;QACzE,CAAC;IACH,CAAC;IAED,OAAO;QACL,cAAc,EAAE;YACd,iBAAiB,EAAE,YAAY;YAC/B,cAAc;YACd,kBAAkB;YAClB,gBAAgB,EAAE,mBAAmB;SACtC;QACD,kBAAkB;KACnB,CAAC;AACJ,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@open-captable-protocol/canton",
3
- "version": "0.2.85",
3
+ "version": "0.2.86",
4
4
  "description": "A TypeScript SDK for interacting with the Open CapTable Protocol (OCP) Factory contract on Canton blockchain",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
@@ -32,18 +32,18 @@
32
32
  "dependencies": {
33
33
  "@daml/ledger": "2.10.2",
34
34
  "@daml/types": "2.10.2",
35
- "@fairmint/canton-node-sdk": "0.0.101",
36
- "@fairmint/open-captable-protocol-daml-js": "0.2.14"
35
+ "@fairmint/canton-node-sdk": "0.0.102",
36
+ "@fairmint/open-captable-protocol-daml-js": "0.2.34"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@eslint/eslintrc": "^3.3.1",
40
40
  "@types/jest": "30.0.0",
41
- "@types/node": "24.6.2",
42
- "@typescript-eslint/eslint-plugin": "8.45.0",
43
- "@typescript-eslint/parser": "8.45.0",
41
+ "@types/node": "24.7.2",
42
+ "@typescript-eslint/eslint-plugin": "8.46.1",
43
+ "@typescript-eslint/parser": "8.46.1",
44
44
  "ajv": "8.17.1",
45
45
  "ajv-formats": "3.0.1",
46
- "eslint": "9.36.0",
46
+ "eslint": "9.37.0",
47
47
  "eslint-config-prettier": "10.1.8",
48
48
  "eslint-import-resolver-typescript": "4.4.4",
49
49
  "eslint-plugin-import": "2.32.0",
@@ -53,9 +53,9 @@
53
53
  "prettier-plugin-jsdoc": "1.3.3",
54
54
  "prettier-plugin-organize-imports": "4.3.0",
55
55
  "prettier-plugin-packagejson": "2.5.19",
56
- "ts-jest": "29.4.4",
56
+ "ts-jest": "29.4.5",
57
57
  "ts-node": "10.9.2",
58
- "typedoc": "0.28.13",
58
+ "typedoc": "0.28.14",
59
59
  "typescript": "5.9.3"
60
60
  },
61
61
  "publishConfig": {
@@ -1,4 +0,0 @@
1
- export * from './recipientAccept';
2
- export * from './recipientReject';
3
- export * from './subscriberWithdraw';
4
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,oDAAkC;AAClC,uDAAqC"}
@@ -1,6 +0,0 @@
1
- import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
- export interface ProcessorApprovedRecipientAcceptParams {
3
- approvedProposalContractId: string;
4
- }
5
- export declare function buildProcessorApprovedRecipientAcceptCommand(params: ProcessorApprovedRecipientAcceptParams): Command;
6
- //# sourceMappingURL=recipientAccept.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipientAccept.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientAccept.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,sCAAsC;IACrD,0BAA0B,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,4CAA4C,CAAC,MAAM,EAAE,sCAAsC,GAAG,OAAO,CAUpH"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildProcessorApprovedRecipientAcceptCommand = buildProcessorApprovedRecipientAcceptCommand;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- function buildProcessorApprovedRecipientAcceptCommand(params) {
6
- return {
7
- ExerciseCommand: {
8
- templateId: open_captable_protocol_daml_js_1.Fairmint.Subscriptions.ProcessorApprovedSubscriptionProposal.ProcessorApprovedSubscriptionProposal.templateId,
9
- contractId: params.approvedProposalContractId,
10
- choice: 'ProcessorApprovedSubscriptionProposal_RecipientAccept',
11
- choiceArgument: {},
12
- },
13
- };
14
- }
15
- //# sourceMappingURL=recipientAccept.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipientAccept.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientAccept.ts"],"names":[],"mappings":";;AAOA,oGAUC;AAhBD,6FAAoE;AAMpE,SAAgB,4CAA4C,CAAC,MAA8C;IACzG,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EACR,yCAAQ,CAAC,aAAa,CAAC,qCAAqC,CAAC,qCAAqC,CAAC,UAAU;YAC/G,UAAU,EAAE,MAAM,CAAC,0BAA0B;YAC7C,MAAM,EAAE,uDAAuD;YAC/D,cAAc,EAAE,EAAE;SACnB;KACF,CAAC;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
- export interface ProcessorApprovedRecipientRejectParams {
3
- approvedProposalContractId: string;
4
- }
5
- export declare function buildProcessorApprovedRecipientRejectCommand(params: ProcessorApprovedRecipientRejectParams): Command;
6
- //# sourceMappingURL=recipientReject.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipientReject.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientReject.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,sCAAsC;IACrD,0BAA0B,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,4CAA4C,CAAC,MAAM,EAAE,sCAAsC,GAAG,OAAO,CAUpH"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildProcessorApprovedRecipientRejectCommand = buildProcessorApprovedRecipientRejectCommand;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- function buildProcessorApprovedRecipientRejectCommand(params) {
6
- return {
7
- ExerciseCommand: {
8
- templateId: open_captable_protocol_daml_js_1.Fairmint.Subscriptions.ProcessorApprovedSubscriptionProposal.ProcessorApprovedSubscriptionProposal.templateId,
9
- contractId: params.approvedProposalContractId,
10
- choice: 'ProcessorApprovedSubscriptionProposal_RecipientReject',
11
- choiceArgument: {},
12
- },
13
- };
14
- }
15
- //# sourceMappingURL=recipientReject.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"recipientReject.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/recipientReject.ts"],"names":[],"mappings":";;AAOA,oGAUC;AAhBD,6FAAoE;AAMpE,SAAgB,4CAA4C,CAAC,MAA8C;IACzG,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EACR,yCAAQ,CAAC,aAAa,CAAC,qCAAqC,CAAC,qCAAqC,CAAC,UAAU;YAC/G,UAAU,EAAE,MAAM,CAAC,0BAA0B;YAC7C,MAAM,EAAE,uDAAuD;YAC/D,cAAc,EAAE,EAAE;SACnB;KACF,CAAC;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
- export interface ProcessorApprovedSubscriberWithdrawParams {
3
- approvedProposalContractId: string;
4
- }
5
- export declare function buildProcessorApprovedSubscriberWithdrawCommand(params: ProcessorApprovedSubscriberWithdrawParams): Command;
6
- //# sourceMappingURL=subscriberWithdraw.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriberWithdraw.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/subscriberWithdraw.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,yCAAyC;IACxD,0BAA0B,EAAE,MAAM,CAAC;CACpC;AAED,wBAAgB,+CAA+C,CAC7D,MAAM,EAAE,yCAAyC,GAChD,OAAO,CAUT"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildProcessorApprovedSubscriberWithdrawCommand = buildProcessorApprovedSubscriberWithdrawCommand;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- function buildProcessorApprovedSubscriberWithdrawCommand(params) {
6
- return {
7
- ExerciseCommand: {
8
- templateId: open_captable_protocol_daml_js_1.Fairmint.Subscriptions.ProcessorApprovedSubscriptionProposal.ProcessorApprovedSubscriptionProposal.templateId,
9
- contractId: params.approvedProposalContractId,
10
- choice: 'ProcessorApprovedSubscriptionProposal_SubscriberWithdraw',
11
- choiceArgument: {},
12
- },
13
- };
14
- }
15
- //# sourceMappingURL=subscriberWithdraw.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"subscriberWithdraw.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/processorApprovedSubscriptionProposal/subscriberWithdraw.ts"],"names":[],"mappings":";;AAOA,0GAYC;AAlBD,6FAAoE;AAMpE,SAAgB,+CAA+C,CAC7D,MAAiD;IAEjD,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EACR,yCAAQ,CAAC,aAAa,CAAC,qCAAqC,CAAC,qCAAqC,CAAC,UAAU;YAC/G,UAAU,EAAE,MAAM,CAAC,0BAA0B;YAC7C,MAAM,EAAE,0DAA0D;YAClE,cAAc,EAAE,EAAE;SACnB;KACF,CAAC;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
- export interface CancelByRecipientParams {
3
- subscriptionContractId: string;
4
- }
5
- export declare function buildCancelByRecipientCommand(params: CancelByRecipientParams): Command;
6
- //# sourceMappingURL=cancelByRecipient.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancelByRecipient.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/cancelByRecipient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,uBAAuB;IACtC,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,6BAA6B,CAAC,MAAM,EAAE,uBAAuB,GAAG,OAAO,CAStF"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildCancelByRecipientCommand = buildCancelByRecipientCommand;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- function buildCancelByRecipientCommand(params) {
6
- return {
7
- ExerciseCommand: {
8
- templateId: open_captable_protocol_daml_js_1.Fairmint.Subscriptions.Subscription.Subscription.templateId,
9
- contractId: params.subscriptionContractId,
10
- choice: 'Subscription_CancelByRecipient',
11
- choiceArgument: {},
12
- },
13
- };
14
- }
15
- //# sourceMappingURL=cancelByRecipient.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancelByRecipient.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/cancelByRecipient.ts"],"names":[],"mappings":";;AAOA,sEASC;AAfD,6FAAoE;AAMpE,SAAgB,6BAA6B,CAAC,MAA+B;IAC3E,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EAAE,yCAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU;YACvE,UAAU,EAAE,MAAM,CAAC,sBAAsB;YACzC,MAAM,EAAE,gCAAgC;YACxC,cAAc,EAAE,EAAE;SACnB;KACF,CAAC;AACJ,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
- export interface CancelBySubscriberParams {
3
- subscriptionContractId: string;
4
- }
5
- export declare function buildCancelBySubscriberCommand(params: CancelBySubscriberParams): Command;
6
- //# sourceMappingURL=cancelBySubscriber.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancelBySubscriber.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/cancelBySubscriber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,wBAAwB;IACvC,sBAAsB,EAAE,MAAM,CAAC;CAChC;AAED,wBAAgB,8BAA8B,CAAC,MAAM,EAAE,wBAAwB,GAAG,OAAO,CASxF"}
@@ -1,15 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.buildCancelBySubscriberCommand = buildCancelBySubscriberCommand;
4
- const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
- function buildCancelBySubscriberCommand(params) {
6
- return {
7
- ExerciseCommand: {
8
- templateId: open_captable_protocol_daml_js_1.Fairmint.Subscriptions.Subscription.Subscription.templateId,
9
- contractId: params.subscriptionContractId,
10
- choice: 'Subscription_CancelBySubscriber',
11
- choiceArgument: {},
12
- },
13
- };
14
- }
15
- //# sourceMappingURL=cancelBySubscriber.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"cancelBySubscriber.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/cancelBySubscriber.ts"],"names":[],"mappings":";;AAOA,wEASC;AAfD,6FAAoE;AAMpE,SAAgB,8BAA8B,CAAC,MAAgC;IAC7E,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EAAE,yCAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU;YACvE,UAAU,EAAE,MAAM,CAAC,sBAAsB;YACzC,MAAM,EAAE,iCAAiC;YACzC,cAAc,EAAE,EAAE;SACnB;KACF,CAAC;AACJ,CAAC"}
@@ -1,5 +0,0 @@
1
- export * from './cancelByRecipient';
2
- export * from './cancelBySubscriber';
3
- export * from './processFreeTrial';
4
- export * from './processPayment';
5
- //# sourceMappingURL=index.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAC;AACpC,cAAc,sBAAsB,CAAC;AACrC,cAAc,oBAAoB,CAAC;AACnC,cAAc,kBAAkB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,sDAAoC;AACpC,uDAAqC;AACrC,qDAAmC;AACnC,mDAAiC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"processFreeTrial.d.ts","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/processFreeTrial.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAIhH,MAAM,WAAW,sBAAsB;IACrC,sBAAsB,EAAE,MAAM,CAAC;IAC/B,gBAAgB,EAAE,MAAM,CAAC;CAC1B;AAED,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,sBAAsB,GAAG,OAAO,CAepF"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"processFreeTrial.js","sourceRoot":"","sources":["../../../../src/functions/Subscriptions/subscription/processFreeTrial.ts"],"names":[],"mappings":";;AASA,oEAeC;AAvBD,6FAAoE;AACpE,oEAA+D;AAO/D,SAAgB,4BAA4B,CAAC,MAA8B;IACzE,MAAM,eAAe,GAAsE;QACzF,gBAAgB,EAAE,IAAA,+BAAa,EAC7B,MAAM,CAAC,gBAAgB,CACiE;KAC3F,CAAC;IAEF,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EAAE,yCAAQ,CAAC,aAAa,CAAC,YAAY,CAAC,YAAY,CAAC,UAAU;YACvE,UAAU,EAAE,MAAM,CAAC,sBAAsB;YACzC,MAAM,EAAE,+BAA+B;YACvC,cAAc,EAAE,eAAe;SAChC;KACF,CAAC;AACJ,CAAC"}