@fairmint/canton-fairmint-sdk 0.0.58 → 0.0.60

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 (241) hide show
  1. package/dist/clients/json-api/sdkHelper.js +1 -1
  2. package/dist/clients/shared/runtime.d.ts.map +1 -1
  3. package/dist/clients/shared/runtime.js +4 -7
  4. package/dist/clients/shared/runtime.js.map +1 -1
  5. package/dist/extensions/CantonPaymentsExtension.d.ts +34 -0
  6. package/dist/extensions/CantonPaymentsExtension.d.ts.map +1 -0
  7. package/dist/extensions/CantonPaymentsExtension.js +23 -0
  8. package/dist/extensions/CantonPaymentsExtension.js.map +1 -0
  9. package/dist/extensions/PaymentStreamsExtension.d.ts +71 -0
  10. package/dist/extensions/PaymentStreamsExtension.d.ts.map +1 -0
  11. package/dist/extensions/PaymentStreamsExtension.js +55 -0
  12. package/dist/extensions/PaymentStreamsExtension.js.map +1 -0
  13. package/dist/extensions/index.d.ts +3 -0
  14. package/dist/extensions/index.d.ts.map +1 -0
  15. package/dist/extensions/index.js +8 -0
  16. package/dist/extensions/index.js.map +1 -0
  17. package/dist/fairmintOcpClient.d.ts +48 -0
  18. package/dist/fairmintOcpClient.d.ts.map +1 -0
  19. package/dist/fairmintOcpClient.js +52 -0
  20. package/dist/fairmintOcpClient.js.map +1 -0
  21. package/dist/functions/CantonPayments/airdrop/addObserversToAirdrop.d.ts +8 -0
  22. package/dist/functions/CantonPayments/airdrop/addObserversToAirdrop.d.ts.map +1 -0
  23. package/dist/functions/CantonPayments/airdrop/addObserversToAirdrop.js +18 -0
  24. package/dist/functions/CantonPayments/airdrop/addObserversToAirdrop.js.map +1 -0
  25. package/dist/functions/CantonPayments/airdrop/createAirdrop.d.ts +13 -0
  26. package/dist/functions/CantonPayments/airdrop/createAirdrop.d.ts.map +1 -0
  27. package/dist/functions/CantonPayments/airdrop/createAirdrop.js +23 -0
  28. package/dist/functions/CantonPayments/airdrop/createAirdrop.js.map +1 -0
  29. package/dist/functions/CantonPayments/airdrop/executeAirdrop.d.ts +20 -0
  30. package/dist/functions/CantonPayments/airdrop/executeAirdrop.d.ts.map +1 -0
  31. package/dist/functions/CantonPayments/airdrop/executeAirdrop.js +31 -0
  32. package/dist/functions/CantonPayments/airdrop/executeAirdrop.js.map +1 -0
  33. package/dist/functions/CantonPayments/airdrop/index.d.ts +6 -0
  34. package/dist/functions/CantonPayments/airdrop/index.d.ts.map +1 -0
  35. package/dist/functions/CantonPayments/airdrop/index.js +22 -0
  36. package/dist/functions/CantonPayments/airdrop/index.js.map +1 -0
  37. package/dist/functions/CantonPayments/airdrop/joinAirdrop.d.ts +14 -0
  38. package/dist/functions/CantonPayments/airdrop/joinAirdrop.d.ts.map +1 -0
  39. package/dist/functions/CantonPayments/airdrop/joinAirdrop.js +36 -0
  40. package/dist/functions/CantonPayments/airdrop/joinAirdrop.js.map +1 -0
  41. package/dist/functions/CantonPayments/airdrop/updateAirdropConfig.d.ts +8 -0
  42. package/dist/functions/CantonPayments/airdrop/updateAirdropConfig.d.ts.map +1 -0
  43. package/dist/functions/CantonPayments/airdrop/updateAirdropConfig.js +22 -0
  44. package/dist/functions/CantonPayments/airdrop/updateAirdropConfig.js.map +1 -0
  45. package/dist/functions/CantonPayments/index.d.ts +3 -0
  46. package/dist/functions/CantonPayments/index.d.ts.map +1 -0
  47. package/dist/functions/CantonPayments/index.js +19 -0
  48. package/dist/functions/CantonPayments/index.js.map +1 -0
  49. package/dist/functions/CantonPayments/simpleAirdrop/archiveSimpleAirdrop.d.ts +6 -0
  50. package/dist/functions/CantonPayments/simpleAirdrop/archiveSimpleAirdrop.d.ts.map +1 -0
  51. package/dist/functions/CantonPayments/simpleAirdrop/archiveSimpleAirdrop.js +15 -0
  52. package/dist/functions/CantonPayments/simpleAirdrop/archiveSimpleAirdrop.js.map +1 -0
  53. package/dist/functions/CantonPayments/simpleAirdrop/createSimpleAirdrop.d.ts +12 -0
  54. package/dist/functions/CantonPayments/simpleAirdrop/createSimpleAirdrop.d.ts.map +1 -0
  55. package/dist/functions/CantonPayments/simpleAirdrop/createSimpleAirdrop.js +21 -0
  56. package/dist/functions/CantonPayments/simpleAirdrop/createSimpleAirdrop.js.map +1 -0
  57. package/dist/functions/CantonPayments/simpleAirdrop/executeSimpleAirdrop.d.ts +14 -0
  58. package/dist/functions/CantonPayments/simpleAirdrop/executeSimpleAirdrop.d.ts.map +1 -0
  59. package/dist/functions/CantonPayments/simpleAirdrop/executeSimpleAirdrop.js +26 -0
  60. package/dist/functions/CantonPayments/simpleAirdrop/executeSimpleAirdrop.js.map +1 -0
  61. package/dist/functions/CantonPayments/simpleAirdrop/index.d.ts +4 -0
  62. package/dist/functions/CantonPayments/simpleAirdrop/index.d.ts.map +1 -0
  63. package/dist/functions/CantonPayments/simpleAirdrop/index.js +20 -0
  64. package/dist/functions/CantonPayments/simpleAirdrop/index.js.map +1 -0
  65. package/dist/functions/CouponMinter/canMintCouponsNow.d.ts +56 -0
  66. package/dist/functions/CouponMinter/canMintCouponsNow.d.ts.map +1 -0
  67. package/dist/functions/CouponMinter/canMintCouponsNow.js +89 -0
  68. package/dist/functions/CouponMinter/canMintCouponsNow.js.map +1 -0
  69. package/dist/functions/CouponMinter/index.d.ts +3 -0
  70. package/dist/functions/CouponMinter/index.d.ts.map +1 -0
  71. package/dist/functions/CouponMinter/index.js +12 -0
  72. package/dist/functions/CouponMinter/index.js.map +1 -0
  73. package/dist/functions/CouponMinter/waitUntilCanMint.d.ts +176 -0
  74. package/dist/functions/CouponMinter/waitUntilCanMint.d.ts.map +1 -0
  75. package/dist/functions/CouponMinter/waitUntilCanMint.js +235 -0
  76. package/dist/functions/CouponMinter/waitUntilCanMint.js.map +1 -0
  77. package/dist/functions/PaymentStreams/activePaymentStream/addFunds.d.ts +10 -0
  78. package/dist/functions/PaymentStreams/activePaymentStream/addFunds.d.ts.map +1 -0
  79. package/dist/functions/PaymentStreams/activePaymentStream/addFunds.js +30 -0
  80. package/dist/functions/PaymentStreams/activePaymentStream/addFunds.js.map +1 -0
  81. package/dist/functions/PaymentStreams/activePaymentStream/archiveInactivePaymentStream.d.ts +7 -0
  82. package/dist/functions/PaymentStreams/activePaymentStream/archiveInactivePaymentStream.d.ts.map +1 -0
  83. package/dist/functions/PaymentStreams/activePaymentStream/archiveInactivePaymentStream.js +18 -0
  84. package/dist/functions/PaymentStreams/activePaymentStream/archiveInactivePaymentStream.js.map +1 -0
  85. package/dist/functions/PaymentStreams/activePaymentStream/cancel.d.ts +10 -0
  86. package/dist/functions/PaymentStreams/activePaymentStream/cancel.d.ts.map +1 -0
  87. package/dist/functions/PaymentStreams/activePaymentStream/cancel.js +22 -0
  88. package/dist/functions/PaymentStreams/activePaymentStream/cancel.js.map +1 -0
  89. package/dist/functions/PaymentStreams/activePaymentStream/changeParty.d.ts +10 -0
  90. package/dist/functions/PaymentStreams/activePaymentStream/changeParty.d.ts.map +1 -0
  91. package/dist/functions/PaymentStreams/activePaymentStream/changeParty.js +20 -0
  92. package/dist/functions/PaymentStreams/activePaymentStream/changeParty.js.map +1 -0
  93. package/dist/functions/PaymentStreams/activePaymentStream/index.d.ts +19 -0
  94. package/dist/functions/PaymentStreams/activePaymentStream/index.d.ts.map +1 -0
  95. package/dist/functions/PaymentStreams/activePaymentStream/index.js +39 -0
  96. package/dist/functions/PaymentStreams/activePaymentStream/index.js.map +1 -0
  97. package/dist/functions/PaymentStreams/activePaymentStream/processFreeTrial.d.ts +8 -0
  98. package/dist/functions/PaymentStreams/activePaymentStream/processFreeTrial.d.ts.map +1 -0
  99. package/dist/functions/PaymentStreams/activePaymentStream/processFreeTrial.js +21 -0
  100. package/dist/functions/PaymentStreams/activePaymentStream/processFreeTrial.js.map +1 -0
  101. package/dist/functions/PaymentStreams/activePaymentStream/processPayment.d.ts +11 -0
  102. package/dist/functions/PaymentStreams/activePaymentStream/processPayment.d.ts.map +1 -0
  103. package/dist/functions/PaymentStreams/activePaymentStream/processPayment.js +28 -0
  104. package/dist/functions/PaymentStreams/activePaymentStream/processPayment.js.map +1 -0
  105. package/dist/functions/PaymentStreams/activePaymentStream/proposeChanges.d.ts +26 -0
  106. package/dist/functions/PaymentStreams/activePaymentStream/proposeChanges.d.ts.map +1 -0
  107. package/dist/functions/PaymentStreams/activePaymentStream/proposeChanges.js +72 -0
  108. package/dist/functions/PaymentStreams/activePaymentStream/proposeChanges.js.map +1 -0
  109. package/dist/functions/PaymentStreams/activePaymentStream/refund.d.ts +10 -0
  110. package/dist/functions/PaymentStreams/activePaymentStream/refund.d.ts.map +1 -0
  111. package/dist/functions/PaymentStreams/activePaymentStream/refund.js +25 -0
  112. package/dist/functions/PaymentStreams/activePaymentStream/refund.js.map +1 -0
  113. package/dist/functions/PaymentStreams/activePaymentStream/replaceLockedAmulet.d.ts +10 -0
  114. package/dist/functions/PaymentStreams/activePaymentStream/replaceLockedAmulet.d.ts.map +1 -0
  115. package/dist/functions/PaymentStreams/activePaymentStream/replaceLockedAmulet.js +26 -0
  116. package/dist/functions/PaymentStreams/activePaymentStream/replaceLockedAmulet.js.map +1 -0
  117. package/dist/functions/PaymentStreams/activePaymentStream/withdrawFunds.d.ts +9 -0
  118. package/dist/functions/PaymentStreams/activePaymentStream/withdrawFunds.d.ts.map +1 -0
  119. package/dist/functions/PaymentStreams/activePaymentStream/withdrawFunds.js +25 -0
  120. package/dist/functions/PaymentStreams/activePaymentStream/withdrawFunds.js.map +1 -0
  121. package/dist/functions/PaymentStreams/index.d.ts +17 -0
  122. package/dist/functions/PaymentStreams/index.d.ts.map +1 -0
  123. package/dist/functions/PaymentStreams/index.js +58 -0
  124. package/dist/functions/PaymentStreams/index.js.map +1 -0
  125. package/dist/functions/PaymentStreams/partyMigrationProposal/approve.d.ts +7 -0
  126. package/dist/functions/PaymentStreams/partyMigrationProposal/approve.d.ts.map +1 -0
  127. package/dist/functions/PaymentStreams/partyMigrationProposal/approve.js +18 -0
  128. package/dist/functions/PaymentStreams/partyMigrationProposal/approve.js.map +1 -0
  129. package/dist/functions/PaymentStreams/partyMigrationProposal/archive.d.ts +8 -0
  130. package/dist/functions/PaymentStreams/partyMigrationProposal/archive.d.ts.map +1 -0
  131. package/dist/functions/PaymentStreams/partyMigrationProposal/archive.js +20 -0
  132. package/dist/functions/PaymentStreams/partyMigrationProposal/archive.js.map +1 -0
  133. package/dist/functions/PaymentStreams/partyMigrationProposal/index.d.ts +5 -0
  134. package/dist/functions/PaymentStreams/partyMigrationProposal/index.d.ts.map +1 -0
  135. package/dist/functions/PaymentStreams/partyMigrationProposal/index.js +21 -0
  136. package/dist/functions/PaymentStreams/partyMigrationProposal/index.js.map +1 -0
  137. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateActivePaymentStream.d.ts +8 -0
  138. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateActivePaymentStream.d.ts.map +1 -0
  139. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateActivePaymentStream.js +19 -0
  140. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateActivePaymentStream.js.map +1 -0
  141. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateProposedPaymentStream.d.ts +8 -0
  142. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateProposedPaymentStream.d.ts.map +1 -0
  143. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateProposedPaymentStream.js +19 -0
  144. package/dist/functions/PaymentStreams/partyMigrationProposal/migrateProposedPaymentStream.js.map +1 -0
  145. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/apply.d.ts +8 -0
  146. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/apply.d.ts.map +1 -0
  147. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/apply.js +19 -0
  148. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/apply.js.map +1 -0
  149. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/approve.d.ts +7 -0
  150. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/approve.d.ts.map +1 -0
  151. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/approve.js +18 -0
  152. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/approve.js.map +1 -0
  153. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/index.d.ts +4 -0
  154. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/index.d.ts.map +1 -0
  155. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/index.js +20 -0
  156. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/index.js.map +1 -0
  157. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/reject.d.ts +8 -0
  158. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/reject.d.ts.map +1 -0
  159. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/reject.js +20 -0
  160. package/dist/functions/PaymentStreams/paymentStreamChangeProposal/reject.js.map +1 -0
  161. package/dist/functions/PaymentStreams/paymentStreamFactory/createPaymentStreamProposal.d.ts +10 -0
  162. package/dist/functions/PaymentStreams/paymentStreamFactory/createPaymentStreamProposal.d.ts.map +1 -0
  163. package/dist/functions/PaymentStreams/paymentStreamFactory/createPaymentStreamProposal.js +22 -0
  164. package/dist/functions/PaymentStreams/paymentStreamFactory/createPaymentStreamProposal.js.map +1 -0
  165. package/dist/functions/PaymentStreams/paymentStreamFactory/index.d.ts +2 -0
  166. package/dist/functions/PaymentStreams/paymentStreamFactory/index.d.ts.map +1 -0
  167. package/dist/functions/PaymentStreams/paymentStreamFactory/index.js +18 -0
  168. package/dist/functions/PaymentStreams/paymentStreamFactory/index.js.map +1 -0
  169. package/dist/functions/PaymentStreams/proposedPaymentStream/approve.d.ts +7 -0
  170. package/dist/functions/PaymentStreams/proposedPaymentStream/approve.d.ts.map +1 -0
  171. package/dist/functions/PaymentStreams/proposedPaymentStream/approve.js +19 -0
  172. package/dist/functions/PaymentStreams/proposedPaymentStream/approve.js.map +1 -0
  173. package/dist/functions/PaymentStreams/proposedPaymentStream/changeParty.d.ts +10 -0
  174. package/dist/functions/PaymentStreams/proposedPaymentStream/changeParty.d.ts.map +1 -0
  175. package/dist/functions/PaymentStreams/proposedPaymentStream/changeParty.js +20 -0
  176. package/dist/functions/PaymentStreams/proposedPaymentStream/changeParty.js.map +1 -0
  177. package/dist/functions/PaymentStreams/proposedPaymentStream/editPaymentStreamProposal.d.ts +27 -0
  178. package/dist/functions/PaymentStreams/proposedPaymentStream/editPaymentStreamProposal.d.ts.map +1 -0
  179. package/dist/functions/PaymentStreams/proposedPaymentStream/editPaymentStreamProposal.js +75 -0
  180. package/dist/functions/PaymentStreams/proposedPaymentStream/editPaymentStreamProposal.js.map +1 -0
  181. package/dist/functions/PaymentStreams/proposedPaymentStream/index.d.ts +6 -0
  182. package/dist/functions/PaymentStreams/proposedPaymentStream/index.d.ts.map +1 -0
  183. package/dist/functions/PaymentStreams/proposedPaymentStream/index.js +22 -0
  184. package/dist/functions/PaymentStreams/proposedPaymentStream/index.js.map +1 -0
  185. package/dist/functions/PaymentStreams/proposedPaymentStream/startPaymentStream.d.ts +8 -0
  186. package/dist/functions/PaymentStreams/proposedPaymentStream/startPaymentStream.d.ts.map +1 -0
  187. package/dist/functions/PaymentStreams/proposedPaymentStream/startPaymentStream.js +28 -0
  188. package/dist/functions/PaymentStreams/proposedPaymentStream/startPaymentStream.js.map +1 -0
  189. package/dist/functions/PaymentStreams/proposedPaymentStream/withdraw.d.ts +8 -0
  190. package/dist/functions/PaymentStreams/proposedPaymentStream/withdraw.d.ts.map +1 -0
  191. package/dist/functions/PaymentStreams/proposedPaymentStream/withdraw.js +20 -0
  192. package/dist/functions/PaymentStreams/proposedPaymentStream/withdraw.js.map +1 -0
  193. package/dist/functions/PaymentStreams/types/activePaymentStream.d.ts +64 -0
  194. package/dist/functions/PaymentStreams/types/activePaymentStream.d.ts.map +1 -0
  195. package/dist/functions/PaymentStreams/types/activePaymentStream.js +52 -0
  196. package/dist/functions/PaymentStreams/types/activePaymentStream.js.map +1 -0
  197. package/dist/functions/PaymentStreams/types/index.d.ts +6 -0
  198. package/dist/functions/PaymentStreams/types/index.d.ts.map +1 -0
  199. package/dist/functions/PaymentStreams/types/index.js +22 -0
  200. package/dist/functions/PaymentStreams/types/index.js.map +1 -0
  201. package/dist/functions/PaymentStreams/types/lockFundsInput.d.ts +8 -0
  202. package/dist/functions/PaymentStreams/types/lockFundsInput.d.ts.map +1 -0
  203. package/dist/functions/PaymentStreams/types/lockFundsInput.js +3 -0
  204. package/dist/functions/PaymentStreams/types/lockFundsInput.js.map +1 -0
  205. package/dist/functions/PaymentStreams/types/partyRole.d.ts +3 -0
  206. package/dist/functions/PaymentStreams/types/partyRole.d.ts.map +1 -0
  207. package/dist/functions/PaymentStreams/types/partyRole.js +3 -0
  208. package/dist/functions/PaymentStreams/types/partyRole.js.map +1 -0
  209. package/dist/functions/PaymentStreams/types/paymentStreamProposalInput.d.ts +37 -0
  210. package/dist/functions/PaymentStreams/types/paymentStreamProposalInput.d.ts.map +1 -0
  211. package/dist/functions/PaymentStreams/types/paymentStreamProposalInput.js +4 -0
  212. package/dist/functions/PaymentStreams/types/paymentStreamProposalInput.js.map +1 -0
  213. package/dist/functions/PaymentStreams/types/proposedPaymentStream.d.ts +81 -0
  214. package/dist/functions/PaymentStreams/types/proposedPaymentStream.d.ts.map +1 -0
  215. package/dist/functions/PaymentStreams/types/proposedPaymentStream.js +51 -0
  216. package/dist/functions/PaymentStreams/types/proposedPaymentStream.js.map +1 -0
  217. package/dist/functions/PaymentStreams/utils/disclosedContracts.d.ts +14 -0
  218. package/dist/functions/PaymentStreams/utils/disclosedContracts.d.ts.map +1 -0
  219. package/dist/functions/PaymentStreams/utils/disclosedContracts.js +53 -0
  220. package/dist/functions/PaymentStreams/utils/disclosedContracts.js.map +1 -0
  221. package/dist/functions/PaymentStreams/utils/factoryContractId.d.ts +17 -0
  222. package/dist/functions/PaymentStreams/utils/factoryContractId.d.ts.map +1 -0
  223. package/dist/functions/PaymentStreams/utils/factoryContractId.js +27 -0
  224. package/dist/functions/PaymentStreams/utils/factoryContractId.js.map +1 -0
  225. package/dist/functions/PaymentStreams/utils/index.d.ts +4 -0
  226. package/dist/functions/PaymentStreams/utils/index.d.ts.map +1 -0
  227. package/dist/functions/PaymentStreams/utils/index.js +20 -0
  228. package/dist/functions/PaymentStreams/utils/index.js.map +1 -0
  229. package/dist/functions/PaymentStreams/utils/paymentContext.d.ts +61 -0
  230. package/dist/functions/PaymentStreams/utils/paymentContext.d.ts.map +1 -0
  231. package/dist/functions/PaymentStreams/utils/paymentContext.js +209 -0
  232. package/dist/functions/PaymentStreams/utils/paymentContext.js.map +1 -0
  233. package/dist/functions/PaymentStreams/utils/paymentStreamDamlCodec.d.ts +75 -0
  234. package/dist/functions/PaymentStreams/utils/paymentStreamDamlCodec.d.ts.map +1 -0
  235. package/dist/functions/PaymentStreams/utils/paymentStreamDamlCodec.js +81 -0
  236. package/dist/functions/PaymentStreams/utils/paymentStreamDamlCodec.js.map +1 -0
  237. package/dist/index.d.ts +5 -0
  238. package/dist/index.d.ts.map +1 -1
  239. package/dist/index.js +8 -0
  240. package/dist/index.js.map +1 -1
  241. package/package.json +20 -20
@@ -0,0 +1,14 @@
1
+ import { type CommandWithDisclosedContracts } from '@open-captable-protocol/canton';
2
+ export interface AirdropContractDetails {
3
+ templateId: string;
4
+ contractId: string;
5
+ createdEventBlob: string;
6
+ synchronizerId: string;
7
+ }
8
+ export interface JoinAirdropParams {
9
+ airdropContractId: string;
10
+ actor: string;
11
+ airdropContractDetails: AirdropContractDetails;
12
+ }
13
+ export declare function buildJoinAirdropCommand(params: JoinAirdropParams): CommandWithDisclosedContracts;
14
+ //# sourceMappingURL=joinAirdrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joinAirdrop.d.ts","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/airdrop/joinAirdrop.ts"],"names":[],"mappings":"AAKA,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,gCAAgC,CAAC;AAExC,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,gBAAgB,EAAE,MAAM,CAAC;IACzB,cAAc,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,iBAAiB;IAChC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,KAAK,EAAE,MAAM,CAAC;IACd,sBAAsB,EAAE,sBAAsB,CAAC;CAChD;AAED,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,iBAAiB,GACxB,6BAA6B,CAoC/B"}
@@ -0,0 +1,36 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildJoinAirdropCommand = buildJoinAirdropCommand;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ const canton_1 = require("@open-captable-protocol/canton");
6
+ function buildJoinAirdropCommand(params) {
7
+ if (params.airdropContractId !== params.airdropContractDetails.contractId) {
8
+ throw new canton_1.OcpValidationError('JoinAirdropParams', `airdropContractId (${params.airdropContractId}) must equal airdropContractDetails.contractId (${params.airdropContractDetails.contractId})`, {
9
+ code: canton_1.OcpErrorCodes.INVALID_FORMAT,
10
+ receivedValue: {
11
+ airdropContractId: params.airdropContractId,
12
+ detailsContractId: params.airdropContractDetails.contractId,
13
+ },
14
+ });
15
+ }
16
+ const command = {
17
+ ExerciseCommand: {
18
+ templateId: open_captable_protocol_daml_js_1.CantonPayments.Airdrop.Airdrop.Airdrop.templateId,
19
+ contractId: params.airdropContractDetails.contractId,
20
+ choice: 'Airdrop_Join',
21
+ choiceArgument: {
22
+ actor: params.actor,
23
+ },
24
+ },
25
+ };
26
+ const disclosedContracts = [
27
+ {
28
+ templateId: params.airdropContractDetails.templateId,
29
+ contractId: params.airdropContractDetails.contractId,
30
+ createdEventBlob: params.airdropContractDetails.createdEventBlob,
31
+ synchronizerId: params.airdropContractDetails.synchronizerId,
32
+ },
33
+ ];
34
+ return { command, disclosedContracts };
35
+ }
36
+ //# sourceMappingURL=joinAirdrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"joinAirdrop.js","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/airdrop/joinAirdrop.ts"],"names":[],"mappings":";;AAwBA,0DAsCC;AA1DD,6FAA0E;AAC1E,2DAIwC;AAexC,SAAgB,uBAAuB,CACrC,MAAyB;IAEzB,IAAI,MAAM,CAAC,iBAAiB,KAAK,MAAM,CAAC,sBAAsB,CAAC,UAAU,EAAE,CAAC;QAC1E,MAAM,IAAI,2BAAkB,CAC1B,mBAAmB,EACnB,sBAAsB,MAAM,CAAC,iBAAiB,mDAAmD,MAAM,CAAC,sBAAsB,CAAC,UAAU,GAAG,EAC5I;YACE,IAAI,EAAE,sBAAa,CAAC,cAAc;YAClC,aAAa,EAAE;gBACb,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;gBAC3C,iBAAiB,EAAE,MAAM,CAAC,sBAAsB,CAAC,UAAU;aAC5D;SACF,CACF,CAAC;IACJ,CAAC;IAED,MAAM,OAAO,GAAY;QACvB,eAAe,EAAE;YACf,UAAU,EAAE,+CAAc,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU;YAC7D,UAAU,EAAE,MAAM,CAAC,sBAAsB,CAAC,UAAU;YACpD,MAAM,EAAE,cAAc;YACtB,cAAc,EAAE;gBACd,KAAK,EAAE,MAAM,CAAC,KAAK;aACpB;SACF;KACF,CAAC;IAEF,MAAM,kBAAkB,GAAwB;QAC9C;YACE,UAAU,EAAE,MAAM,CAAC,sBAAsB,CAAC,UAAU;YACpD,UAAU,EAAE,MAAM,CAAC,sBAAsB,CAAC,UAAU;YACpD,gBAAgB,EAAE,MAAM,CAAC,sBAAsB,CAAC,gBAAgB;YAChE,cAAc,EAAE,MAAM,CAAC,sBAAsB,CAAC,cAAc;SAC7D;KACF,CAAC;IAEF,OAAO,EAAE,OAAO,EAAE,kBAAkB,EAAE,CAAC;AACzC,CAAC"}
@@ -0,0 +1,8 @@
1
+ import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
+ import type { AirdropConfig } from './createAirdrop';
3
+ export interface UpdateAirdropConfigParams {
4
+ airdropContractId: string;
5
+ newConfig: AirdropConfig;
6
+ }
7
+ export declare function buildUpdateAirdropConfigCommand(params: UpdateAirdropConfigParams): Command;
8
+ //# sourceMappingURL=updateAirdropConfig.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateAirdropConfig.d.ts","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/airdrop/updateAirdropConfig.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAEhH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,MAAM,WAAW,yBAAyB;IACxC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,aAAa,CAAC;CAC1B;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAgBT"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildUpdateAirdropConfigCommand = buildUpdateAirdropConfigCommand;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ function buildUpdateAirdropConfigCommand(params) {
6
+ return {
7
+ ExerciseCommand: {
8
+ templateId: open_captable_protocol_daml_js_1.CantonPayments.Airdrop.Airdrop.Airdrop.templateId,
9
+ contractId: params.airdropContractId,
10
+ choice: 'Airdrop_UpdateConfig',
11
+ choiceArgument: {
12
+ newConfig: {
13
+ sender: params.newConfig.sender,
14
+ featuredAppRight: params.newConfig.featuredAppRight,
15
+ amuletRulesCid: params.newConfig.amuletRulesCid,
16
+ dso: params.newConfig.dso,
17
+ },
18
+ },
19
+ },
20
+ };
21
+ }
22
+ //# sourceMappingURL=updateAirdropConfig.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"updateAirdropConfig.js","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/airdrop/updateAirdropConfig.ts"],"names":[],"mappings":";;AASA,0EAkBC;AA1BD,6FAA0E;AAQ1E,SAAgB,+BAA+B,CAC7C,MAAiC;IAEjC,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EAAE,+CAAc,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,UAAU;YAC7D,UAAU,EAAE,MAAM,CAAC,iBAAiB;YACpC,MAAM,EAAE,sBAAsB;YAC9B,cAAc,EAAE;gBACd,SAAS,EAAE;oBACT,MAAM,EAAE,MAAM,CAAC,SAAS,CAAC,MAAM;oBAC/B,gBAAgB,EAAE,MAAM,CAAC,SAAS,CAAC,gBAAgB;oBACnD,cAAc,EAAE,MAAM,CAAC,SAAS,CAAC,cAAc;oBAC/C,GAAG,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG;iBAC1B;aACF;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,3 @@
1
+ export * from './airdrop';
2
+ export * from './simpleAirdrop';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functions/CantonPayments/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,iBAAiB,CAAC"}
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./airdrop"), exports);
18
+ __exportStar(require("./simpleAirdrop"), exports);
19
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/functions/CantonPayments/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B;AAC1B,kDAAgC"}
@@ -0,0 +1,6 @@
1
+ import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
+ export interface ArchiveSimpleAirdropParams {
3
+ airdropContractId: string;
4
+ }
5
+ export declare function buildArchiveSimpleAirdropCommand(params: ArchiveSimpleAirdropParams): Command;
6
+ //# sourceMappingURL=archiveSimpleAirdrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archiveSimpleAirdrop.d.ts","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/archiveSimpleAirdrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAST"}
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildArchiveSimpleAirdropCommand = buildArchiveSimpleAirdropCommand;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ function buildArchiveSimpleAirdropCommand(params) {
6
+ return {
7
+ ExerciseCommand: {
8
+ templateId: open_captable_protocol_daml_js_1.CantonPayments.Airdrop.SimpleAirdrop.SimpleAirdrop.templateId,
9
+ contractId: params.airdropContractId,
10
+ choice: 'Archive',
11
+ choiceArgument: {},
12
+ },
13
+ };
14
+ }
15
+ //# sourceMappingURL=archiveSimpleAirdrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"archiveSimpleAirdrop.js","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/archiveSimpleAirdrop.ts"],"names":[],"mappings":";;AAOA,4EAWC;AAjBD,6FAA0E;AAM1E,SAAgB,gCAAgC,CAC9C,MAAkC;IAElC,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EAAE,+CAAc,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,UAAU;YACzE,UAAU,EAAE,MAAM,CAAC,iBAAiB;YACpC,MAAM,EAAE,SAAS;YACjB,cAAc,EAAE,EAAE;SACnB;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,12 @@
1
+ import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
+ export interface SimpleAirdropConfig {
3
+ sender: string;
4
+ featuredAppRight: string | null;
5
+ amuletRulesCid: string;
6
+ dso: string;
7
+ }
8
+ export interface CreateSimpleAirdropParams {
9
+ config: SimpleAirdropConfig;
10
+ }
11
+ export declare function buildCreateSimpleAirdropCommand(params: CreateSimpleAirdropParams): Command;
12
+ //# sourceMappingURL=createSimpleAirdrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSimpleAirdrop.d.ts","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/createSimpleAirdrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,mBAAmB;IAClC,MAAM,EAAE,MAAM,CAAC;IACf,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,cAAc,EAAE,MAAM,CAAC;IACvB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,yBAAyB;IACxC,MAAM,EAAE,mBAAmB,CAAC;CAC7B;AAED,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,yBAAyB,GAChC,OAAO,CAgBT"}
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildCreateSimpleAirdropCommand = buildCreateSimpleAirdropCommand;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ function buildCreateSimpleAirdropCommand(params) {
6
+ const airdropData = {
7
+ config: {
8
+ sender: params.config.sender,
9
+ featuredAppRight: params.config.featuredAppRight,
10
+ amuletRulesCid: params.config.amuletRulesCid,
11
+ dso: params.config.dso,
12
+ },
13
+ };
14
+ return {
15
+ CreateCommand: {
16
+ templateId: open_captable_protocol_daml_js_1.CantonPayments.Airdrop.SimpleAirdrop.SimpleAirdrop.templateId,
17
+ createArguments: airdropData,
18
+ },
19
+ };
20
+ }
21
+ //# sourceMappingURL=createSimpleAirdrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createSimpleAirdrop.js","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/createSimpleAirdrop.ts"],"names":[],"mappings":";;AAcA,0EAkBC;AA/BD,6FAA0E;AAa1E,SAAgB,+BAA+B,CAC7C,MAAiC;IAEjC,MAAM,WAAW,GAAG;QAClB,MAAM,EAAE;YACN,MAAM,EAAE,MAAM,CAAC,MAAM,CAAC,MAAM;YAC5B,gBAAgB,EAAE,MAAM,CAAC,MAAM,CAAC,gBAAgB;YAChD,cAAc,EAAE,MAAM,CAAC,MAAM,CAAC,cAAc;YAC5C,GAAG,EAAE,MAAM,CAAC,MAAM,CAAC,GAAG;SACvB;KACF,CAAC;IAEF,OAAO;QACL,aAAa,EAAE;YACb,UAAU,EAAE,+CAAc,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,UAAU;YACzE,eAAe,EAAE,WAAW;SAC7B;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ import type { Command } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
2
+ export interface RecipientSpec {
3
+ transferPreapprovalCid: string;
4
+ numberOfTransfers: number;
5
+ }
6
+ export interface ExecuteSimpleAirdropParams {
7
+ airdropContractId: string;
8
+ recipientSpecs: RecipientSpec[];
9
+ initialAmuletInputs: string[];
10
+ openMiningRoundCid: string;
11
+ amountPerTransfer: string | number;
12
+ }
13
+ export declare function buildExecuteSimpleAirdropCommand(params: ExecuteSimpleAirdropParams): Command;
14
+ //# sourceMappingURL=executeSimpleAirdrop.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeSimpleAirdrop.d.ts","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/executeSimpleAirdrop.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kFAAkF,CAAC;AAGhH,MAAM,WAAW,aAAa;IAC5B,sBAAsB,EAAE,MAAM,CAAC;IAC/B,iBAAiB,EAAE,MAAM,CAAC;CAC3B;AAED,MAAM,WAAW,0BAA0B;IACzC,iBAAiB,EAAE,MAAM,CAAC;IAC1B,cAAc,EAAE,aAAa,EAAE,CAAC;IAChC,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,iBAAiB,EAAE,MAAM,GAAG,MAAM,CAAC;CACpC;AAED,wBAAgB,gCAAgC,CAC9C,MAAM,EAAE,0BAA0B,GACjC,OAAO,CAsBT"}
@@ -0,0 +1,26 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildExecuteSimpleAirdropCommand = buildExecuteSimpleAirdropCommand;
4
+ const open_captable_protocol_daml_js_1 = require("@fairmint/open-captable-protocol-daml-js");
5
+ function buildExecuteSimpleAirdropCommand(params) {
6
+ const recipientSpecs = params.recipientSpecs.map(spec => ({
7
+ transferPreapprovalCid: spec.transferPreapprovalCid,
8
+ numberOfTransfers: spec.numberOfTransfers,
9
+ }));
10
+ return {
11
+ ExerciseCommand: {
12
+ templateId: open_captable_protocol_daml_js_1.CantonPayments.Airdrop.SimpleAirdrop.SimpleAirdrop.templateId,
13
+ contractId: params.airdropContractId,
14
+ choice: 'SimpleAirdrop_Execute',
15
+ choiceArgument: {
16
+ recipientSpecs,
17
+ initialAmuletInputs: params.initialAmuletInputs,
18
+ openMiningRoundCid: params.openMiningRoundCid,
19
+ amountPerTransfer: typeof params.amountPerTransfer === 'number'
20
+ ? params.amountPerTransfer.toString()
21
+ : params.amountPerTransfer,
22
+ },
23
+ },
24
+ };
25
+ }
26
+ //# sourceMappingURL=executeSimpleAirdrop.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"executeSimpleAirdrop.js","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/executeSimpleAirdrop.ts"],"names":[],"mappings":";;AAgBA,4EAwBC;AAvCD,6FAA0E;AAe1E,SAAgB,gCAAgC,CAC9C,MAAkC;IAElC,MAAM,cAAc,GAAG,MAAM,CAAC,cAAc,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxD,sBAAsB,EAAE,IAAI,CAAC,sBAAsB;QACnD,iBAAiB,EAAE,IAAI,CAAC,iBAAiB;KAC1C,CAAC,CAAC,CAAC;IAEJ,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EAAE,+CAAc,CAAC,OAAO,CAAC,aAAa,CAAC,aAAa,CAAC,UAAU;YACzE,UAAU,EAAE,MAAM,CAAC,iBAAiB;YACpC,MAAM,EAAE,uBAAuB;YAC/B,cAAc,EAAE;gBACd,cAAc;gBACd,mBAAmB,EAAE,MAAM,CAAC,mBAAmB;gBAC/C,kBAAkB,EAAE,MAAM,CAAC,kBAAkB;gBAC7C,iBAAiB,EACf,OAAO,MAAM,CAAC,iBAAiB,KAAK,QAAQ;oBAC1C,CAAC,CAAC,MAAM,CAAC,iBAAiB,CAAC,QAAQ,EAAE;oBACrC,CAAC,CAAC,MAAM,CAAC,iBAAiB;aAC/B;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,4 @@
1
+ export * from './archiveSimpleAirdrop';
2
+ export * from './createSimpleAirdrop';
3
+ export * from './executeSimpleAirdrop';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AACtC,cAAc,wBAAwB,CAAC"}
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./archiveSimpleAirdrop"), exports);
18
+ __exportStar(require("./createSimpleAirdrop"), exports);
19
+ __exportStar(require("./executeSimpleAirdrop"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/CantonPayments/simpleAirdrop/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,yDAAuC;AACvC,wDAAsC;AACtC,yDAAuC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * Client-side helper to check if coupon minting is allowed based on TPS rate limits.
3
+ *
4
+ * This utility allows callers to check rate limits before submitting a MintCoupons transaction to the ledger, avoiding
5
+ * unnecessary transaction failures.
6
+ */
7
+ /** Result of checking if minting is allowed. */
8
+ export type CanMintResult = {
9
+ canMint: true;
10
+ } | {
11
+ canMint: false;
12
+ waitMs: number;
13
+ };
14
+ /** Last mint information from the CouponMinter contract. */
15
+ export interface LastMint {
16
+ /** DAML timestamp in ISO 8601 format (e.g., "2026-01-13T12:00:00.000000Z") */
17
+ time: string;
18
+ /** Number of coupons minted in the last transaction */
19
+ count: number;
20
+ }
21
+ /** Relevant fields from the CouponMinter contract payload. */
22
+ export interface CouponMinterPayload {
23
+ /** The operator party controlling this minter */
24
+ operator: string;
25
+ /** Maximum transactions per second, or null if rate limiting is disabled */
26
+ maxTps: string | null;
27
+ /** Information about the last mint operation, or null if no mints have occurred */
28
+ lastMint: LastMint | null;
29
+ }
30
+ /**
31
+ * Checks if minting coupons is currently allowed based on the TPS rate limit configuration.
32
+ *
33
+ * The rate limit formula from the DAML contract is:
34
+ *
35
+ * minIntervalMicros = (lastMint.count * 1_000_000) / maxTps;
36
+ *
37
+ * If enough time has elapsed since the last mint, minting is allowed. Otherwise, returns the number of milliseconds to
38
+ * wait before minting is allowed.
39
+ *
40
+ * @example
41
+ * ```typescript
42
+ * const result = canMintCouponsNow(couponMinterPayload);
43
+ * if (result.canMint) {
44
+ * await mintCoupons(...);
45
+ * } else {
46
+ * console.log(`Rate limited. Waiting ${result.waitMs}ms...`);
47
+ * await sleep(result.waitMs);
48
+ * }
49
+ * ```
50
+ *
51
+ * @param payload - The CouponMinter contract payload
52
+ * @param now - Optional current time for testing (defaults to new Date())
53
+ * @returns {canMint: true} If minting is allowed, or { canMint: false, waitMs: number } with the wait time
54
+ */
55
+ export declare function canMintCouponsNow(payload: CouponMinterPayload, now?: Date): CanMintResult;
56
+ //# sourceMappingURL=canMintCouponsNow.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canMintCouponsNow.d.ts","sourceRoot":"","sources":["../../../src/functions/CouponMinter/canMintCouponsNow.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,gDAAgD;AAChD,MAAM,MAAM,aAAa,GACrB;IAAE,OAAO,EAAE,IAAI,CAAA;CAAE,GACjB;IAAE,OAAO,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC;AAEvC,4DAA4D;AAC5D,MAAM,WAAW,QAAQ;IACvB,8EAA8E;IAC9E,IAAI,EAAE,MAAM,CAAC;IACb,uDAAuD;IACvD,KAAK,EAAE,MAAM,CAAC;CACf;AAED,8DAA8D;AAC9D,MAAM,WAAW,mBAAmB;IAClC,iDAAiD;IACjD,QAAQ,EAAE,MAAM,CAAC;IACjB,4EAA4E;IAC5E,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,mFAAmF;IACnF,QAAQ,EAAE,QAAQ,GAAG,IAAI,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,iBAAiB,CAC/B,OAAO,EAAE,mBAAmB,EAC5B,GAAG,CAAC,EAAE,IAAI,GACT,aAAa,CA0Ef"}
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ /**
3
+ * Client-side helper to check if coupon minting is allowed based on TPS rate limits.
4
+ *
5
+ * This utility allows callers to check rate limits before submitting a MintCoupons transaction to the ledger, avoiding
6
+ * unnecessary transaction failures.
7
+ */
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ exports.canMintCouponsNow = canMintCouponsNow;
10
+ const canton_1 = require("@open-captable-protocol/canton");
11
+ /**
12
+ * Checks if minting coupons is currently allowed based on the TPS rate limit configuration.
13
+ *
14
+ * The rate limit formula from the DAML contract is:
15
+ *
16
+ * minIntervalMicros = (lastMint.count * 1_000_000) / maxTps;
17
+ *
18
+ * If enough time has elapsed since the last mint, minting is allowed. Otherwise, returns the number of milliseconds to
19
+ * wait before minting is allowed.
20
+ *
21
+ * @example
22
+ * ```typescript
23
+ * const result = canMintCouponsNow(couponMinterPayload);
24
+ * if (result.canMint) {
25
+ * await mintCoupons(...);
26
+ * } else {
27
+ * console.log(`Rate limited. Waiting ${result.waitMs}ms...`);
28
+ * await sleep(result.waitMs);
29
+ * }
30
+ * ```
31
+ *
32
+ * @param payload - The CouponMinter contract payload
33
+ * @param now - Optional current time for testing (defaults to new Date())
34
+ * @returns {canMint: true} If minting is allowed, or { canMint: false, waitMs: number } with the wait time
35
+ */
36
+ function canMintCouponsNow(payload, now) {
37
+ // No rate limit configured - always allow minting
38
+ if (payload.maxTps === null || payload.maxTps === undefined) {
39
+ return { canMint: true };
40
+ }
41
+ // No previous mint - always allow minting
42
+ if (payload.lastMint === null || payload.lastMint === undefined) {
43
+ return { canMint: true };
44
+ }
45
+ // Parse maxTps
46
+ const maxTps = Number(payload.maxTps);
47
+ if (!Number.isFinite(maxTps) || maxTps <= 0) {
48
+ throw new canton_1.OcpValidationError('payload.maxTps', `Invalid maxTps value: "${payload.maxTps}". Expected a positive number.`, {
49
+ code: canton_1.OcpErrorCodes.INVALID_FORMAT,
50
+ expectedType: 'positive number',
51
+ receivedValue: payload.maxTps,
52
+ });
53
+ }
54
+ const { time: lastMintTime, count: lastMintCount } = payload.lastMint;
55
+ if (!Number.isFinite(lastMintCount) || lastMintCount < 0) {
56
+ throw new canton_1.OcpValidationError('payload.lastMint.count', `Invalid lastMint.count: ${String(lastMintCount)}. Expected a non-negative finite number.`, {
57
+ code: canton_1.OcpErrorCodes.INVALID_FORMAT,
58
+ expectedType: 'non-negative number',
59
+ receivedValue: lastMintCount,
60
+ });
61
+ }
62
+ if (lastMintCount <= 0) {
63
+ return { canMint: true };
64
+ }
65
+ // Calculate required wait time in microseconds
66
+ // Formula: minIntervalMicros = lastMint.count * 1_000_000 / maxTps
67
+ const minIntervalMicros = (lastMintCount * 1000000) / maxTps;
68
+ // Parse the DAML timestamp
69
+ const lastMintDate = new Date(lastMintTime);
70
+ if (isNaN(lastMintDate.getTime())) {
71
+ throw new canton_1.OcpValidationError('payload.lastMint.time', `Invalid lastMint.time format: "${lastMintTime}". Expected ISO 8601 timestamp.`, {
72
+ code: canton_1.OcpErrorCodes.INVALID_FORMAT,
73
+ expectedType: 'ISO 8601 timestamp',
74
+ receivedValue: lastMintTime,
75
+ });
76
+ }
77
+ // Calculate elapsed time in microseconds
78
+ const currentTime = now ?? new Date();
79
+ const elapsedMicros = (currentTime.getTime() - lastMintDate.getTime()) * 1000;
80
+ // Check if enough time has elapsed
81
+ if (elapsedMicros >= minIntervalMicros) {
82
+ return { canMint: true };
83
+ }
84
+ // Calculate remaining wait time in milliseconds
85
+ const remainingMicros = minIntervalMicros - elapsedMicros;
86
+ const waitMs = Math.ceil(remainingMicros / 1000);
87
+ return { canMint: false, waitMs };
88
+ }
89
+ //# sourceMappingURL=canMintCouponsNow.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"canMintCouponsNow.js","sourceRoot":"","sources":["../../../src/functions/CouponMinter/canMintCouponsNow.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;AAuDH,8CA6EC;AAlID,2DAGwC;AAyBxC;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,SAAgB,iBAAiB,CAC/B,OAA4B,EAC5B,GAAU;IAEV,kDAAkD;IAClD,IAAI,OAAO,CAAC,MAAM,KAAK,IAAI,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;QAC5D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,0CAA0C;IAC1C,IAAI,OAAO,CAAC,QAAQ,KAAK,IAAI,IAAI,OAAO,CAAC,QAAQ,KAAK,SAAS,EAAE,CAAC;QAChE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,eAAe;IACf,MAAM,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;IACtC,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,CAAC,EAAE,CAAC;QAC5C,MAAM,IAAI,2BAAkB,CAC1B,gBAAgB,EAChB,0BAA0B,OAAO,CAAC,MAAM,gCAAgC,EACxE;YACE,IAAI,EAAE,sBAAa,CAAC,cAAc;YAClC,YAAY,EAAE,iBAAiB;YAC/B,aAAa,EAAE,OAAO,CAAC,MAAM;SAC9B,CACF,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,aAAa,EAAE,GAAG,OAAO,CAAC,QAAQ,CAAC;IAEtE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,aAAa,CAAC,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;QACzD,MAAM,IAAI,2BAAkB,CAC1B,wBAAwB,EACxB,2BAA2B,MAAM,CAAC,aAAa,CAAC,0CAA0C,EAC1F;YACE,IAAI,EAAE,sBAAa,CAAC,cAAc;YAClC,YAAY,EAAE,qBAAqB;YACnC,aAAa,EAAE,aAAa;SAC7B,CACF,CAAC;IACJ,CAAC;IACD,IAAI,aAAa,IAAI,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,+CAA+C;IAC/C,mEAAmE;IACnE,MAAM,iBAAiB,GAAG,CAAC,aAAa,GAAG,OAAS,CAAC,GAAG,MAAM,CAAC;IAE/D,2BAA2B;IAC3B,MAAM,YAAY,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,CAAC;IAC5C,IAAI,KAAK,CAAC,YAAY,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC;QAClC,MAAM,IAAI,2BAAkB,CAC1B,uBAAuB,EACvB,kCAAkC,YAAY,iCAAiC,EAC/E;YACE,IAAI,EAAE,sBAAa,CAAC,cAAc;YAClC,YAAY,EAAE,oBAAoB;YAClC,aAAa,EAAE,YAAY;SAC5B,CACF,CAAC;IACJ,CAAC;IAED,yCAAyC;IACzC,MAAM,WAAW,GAAG,GAAG,IAAI,IAAI,IAAI,EAAE,CAAC;IACtC,MAAM,aAAa,GAAG,CAAC,WAAW,CAAC,OAAO,EAAE,GAAG,YAAY,CAAC,OAAO,EAAE,CAAC,GAAG,IAAI,CAAC;IAE9E,mCAAmC;IACnC,IAAI,aAAa,IAAI,iBAAiB,EAAE,CAAC;QACvC,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;IAED,gDAAgD;IAChD,MAAM,eAAe,GAAG,iBAAiB,GAAG,aAAa,CAAC;IAC1D,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC,CAAC;IAEjD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;AACpC,CAAC"}
@@ -0,0 +1,3 @@
1
+ export { canMintCouponsNow, type CanMintResult, type CouponMinterPayload, type LastMint, } from './canMintCouponsNow';
2
+ export { WaitAbortedError, WaitTimeoutError, getRateLimitStatus, mintWithRateLimit, waitUntilCanMint, type MintWithRateLimitOptions, type MintWithRateLimitResult, type WaitUntilCanMintOptions, } from './waitUntilCanMint';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/functions/CouponMinter/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,iBAAiB,EACjB,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACxB,KAAK,QAAQ,GACd,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,gBAAgB,EAChB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAC5B,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC"}
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.waitUntilCanMint = exports.mintWithRateLimit = exports.getRateLimitStatus = exports.WaitTimeoutError = exports.WaitAbortedError = exports.canMintCouponsNow = void 0;
4
+ var canMintCouponsNow_1 = require("./canMintCouponsNow");
5
+ Object.defineProperty(exports, "canMintCouponsNow", { enumerable: true, get: function () { return canMintCouponsNow_1.canMintCouponsNow; } });
6
+ var waitUntilCanMint_1 = require("./waitUntilCanMint");
7
+ Object.defineProperty(exports, "WaitAbortedError", { enumerable: true, get: function () { return waitUntilCanMint_1.WaitAbortedError; } });
8
+ Object.defineProperty(exports, "WaitTimeoutError", { enumerable: true, get: function () { return waitUntilCanMint_1.WaitTimeoutError; } });
9
+ Object.defineProperty(exports, "getRateLimitStatus", { enumerable: true, get: function () { return waitUntilCanMint_1.getRateLimitStatus; } });
10
+ Object.defineProperty(exports, "mintWithRateLimit", { enumerable: true, get: function () { return waitUntilCanMint_1.mintWithRateLimit; } });
11
+ Object.defineProperty(exports, "waitUntilCanMint", { enumerable: true, get: function () { return waitUntilCanMint_1.waitUntilCanMint; } });
12
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/functions/CouponMinter/index.ts"],"names":[],"mappings":";;;AAAA,yDAK6B;AAJ3B,sHAAA,iBAAiB,OAAA;AAKnB,uDAS4B;AAR1B,oHAAA,gBAAgB,OAAA;AAChB,oHAAA,gBAAgB,OAAA;AAChB,sHAAA,kBAAkB,OAAA;AAClB,qHAAA,iBAAiB,OAAA;AACjB,oHAAA,gBAAgB,OAAA"}