@fairmint/canton-fairmint-sdk 0.0.56 → 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 +15 -13
  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 @@
1
+ {"version":3,"file":"withdraw.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/proposedPaymentStream/withdraw.ts"],"names":[],"mappings":";;AASA,8FAkBC;AA1BD,6FAA0E;AAQ1E,SAAgB,yCAAyC,CACvD,MAA2C;IAE3C,MAAM,cAAc,GAAG;QACrB,KAAK,EAAE,MAAM,CAAC,KAAK;QACnB,WAAW,EAAE,MAAM,CAAC,WAAW,IAAI,IAAI;KACxC,CAAC;IAEF,OAAO;QACL,eAAe,EAAE;YACf,UAAU,EACR,+CAAc,CAAC,aAAa,CAAC,qBAAqB,CAAC,qBAAqB;iBACrE,UAAU;YACf,UAAU,EAAE,MAAM,CAAC,+BAA+B;YAClD,MAAM,EAAE,gCAAgC;YACxC,cAAc;SACf;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,64 @@
1
+ /** Type definitions for ActivePaymentStream contracts */
2
+ export interface PaymentStreamAmount {
3
+ tag: 'AmuletAmount' | 'USDAmount';
4
+ value: string;
5
+ }
6
+ export interface PaymentStreamDetails {
7
+ payer: string;
8
+ recipient: string;
9
+ recipientPaymentPerDay: PaymentStreamAmount;
10
+ processorPaymentPerDay: PaymentStreamAmount | null;
11
+ freeTrialExpiration: string | null;
12
+ prepayWindow: {
13
+ microseconds: string;
14
+ };
15
+ paymentsEndAt: string | null;
16
+ provider: string;
17
+ appRewardBeneficiaries: Array<{
18
+ party: string;
19
+ weight: string;
20
+ }>;
21
+ description: string;
22
+ metadata: Record<string, string>;
23
+ observers: string[];
24
+ }
25
+ export interface ProcessorContext {
26
+ processor: string;
27
+ dso: string;
28
+ }
29
+ export interface PaymentStreamStats {
30
+ roundsProcessed: string;
31
+ totalPaidByPayerCC: string;
32
+ totalPaidByPayerUSD: string;
33
+ totalReceivedByRecipientCC: string;
34
+ totalReceivedByRecipientUSD: string;
35
+ totalReceivedByProcessorCC: string;
36
+ totalReceivedByProcessorUSD: string;
37
+ }
38
+ export interface ActivePaymentStreamPayload {
39
+ paymentStream: PaymentStreamDetails;
40
+ processorContext: ProcessorContext;
41
+ processedAndPaidUntil: string;
42
+ lockedAmuletCid: string;
43
+ stats: PaymentStreamStats;
44
+ }
45
+ export interface ActivePaymentStreamContract {
46
+ contractId: string;
47
+ payload: ActivePaymentStreamPayload;
48
+ }
49
+ /**
50
+ * Check if a paymentStream is ready for processing based on the processing period
51
+ *
52
+ * @param paymentStream - The active paymentStream contract
53
+ * @param processingPeriodSeconds - The processing period in seconds
54
+ * @returns True if the paymentStream is ready for processing
55
+ */
56
+ export declare function isPaymentStreamReadyForProcessing(paymentStream: ActivePaymentStreamContract, processingPeriodSeconds: number): boolean;
57
+ /**
58
+ * Convert seconds to microseconds string for DAML RelTime
59
+ *
60
+ * @param seconds - Number of seconds
61
+ * @returns Microseconds as a string
62
+ */
63
+ export declare function secondsToMicroseconds(seconds: number | string): string;
64
+ //# sourceMappingURL=activePaymentStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activePaymentStream.d.ts","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/activePaymentStream.ts"],"names":[],"mappings":"AAAA,yDAAyD;AAOzD,MAAM,WAAW,mBAAmB;IAClC,GAAG,EAAE,cAAc,GAAG,WAAW,CAAC;IAClC,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,oBAAoB;IACnC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,sBAAsB,EAAE,mBAAmB,CAAC;IAC5C,sBAAsB,EAAE,mBAAmB,GAAG,IAAI,CAAC;IACnD,mBAAmB,EAAE,MAAM,GAAG,IAAI,CAAC;IACnC,YAAY,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;IAC7B,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,EAAE,KAAK,CAAC;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACjE,WAAW,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACjC,SAAS,EAAE,MAAM,EAAE,CAAC;CACrB;AAED,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,CAAC;IACxB,kBAAkB,EAAE,MAAM,CAAC;IAC3B,mBAAmB,EAAE,MAAM,CAAC;IAC5B,0BAA0B,EAAE,MAAM,CAAC;IACnC,2BAA2B,EAAE,MAAM,CAAC;IACpC,0BAA0B,EAAE,MAAM,CAAC;IACnC,2BAA2B,EAAE,MAAM,CAAC;CACrC;AAED,MAAM,WAAW,0BAA0B;IACzC,aAAa,EAAE,oBAAoB,CAAC;IACpC,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,qBAAqB,EAAE,MAAM,CAAC;IAC9B,eAAe,EAAE,MAAM,CAAC;IACxB,KAAK,EAAE,kBAAkB,CAAC;CAC3B;AAED,MAAM,WAAW,2BAA2B;IAC1C,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,0BAA0B,CAAC;CACrC;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,aAAa,EAAE,2BAA2B,EAC1C,uBAAuB,EAAE,MAAM,GAC9B,OAAO,CAsCT;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,GAAG,MAAM,CAQtE"}
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ /** Type definitions for ActivePaymentStream contracts */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.isPaymentStreamReadyForProcessing = isPaymentStreamReadyForProcessing;
5
+ exports.secondsToMicroseconds = secondsToMicroseconds;
6
+ const canton_1 = require("@open-captable-protocol/canton");
7
+ /**
8
+ * Check if a paymentStream is ready for processing based on the processing period
9
+ *
10
+ * @param paymentStream - The active paymentStream contract
11
+ * @param processingPeriodSeconds - The processing period in seconds
12
+ * @returns True if the paymentStream is ready for processing
13
+ */
14
+ function isPaymentStreamReadyForProcessing(paymentStream, processingPeriodSeconds) {
15
+ if (!Number.isFinite(processingPeriodSeconds) ||
16
+ !Number.isInteger(processingPeriodSeconds)) {
17
+ throw new TypeError(`processingPeriodSeconds must be a finite integer, got ${String(processingPeriodSeconds)}`);
18
+ }
19
+ // If processedAndPaidUntil is undefined or empty, the paymentStream hasn't been processed yet
20
+ if (!paymentStream.payload.processedAndPaidUntil) {
21
+ return true;
22
+ }
23
+ // Convert ISO timestamp to microseconds
24
+ const processedUntilDate = new Date(paymentStream.payload.processedAndPaidUntil);
25
+ const processedUntilMs = processedUntilDate.getTime();
26
+ if (Number.isNaN(processedUntilMs)) {
27
+ throw new canton_1.OcpValidationError('paymentStream.payload.processedAndPaidUntil', `Invalid processedAndPaidUntil timestamp: ${paymentStream.payload.processedAndPaidUntil}`, {
28
+ code: canton_1.OcpErrorCodes.INVALID_FORMAT,
29
+ expectedType: 'ISO 8601 timestamp',
30
+ receivedValue: paymentStream.payload.processedAndPaidUntil,
31
+ });
32
+ }
33
+ const processedUntilMicros = BigInt(processedUntilMs) * BigInt(1000);
34
+ const currentTimestamp = BigInt(Date.now() * 1000);
35
+ const processingPeriodMicros = BigInt(processingPeriodSeconds) * BigInt(1000000);
36
+ const nextPaymentDue = processedUntilMicros + processingPeriodMicros;
37
+ return currentTimestamp >= nextPaymentDue;
38
+ }
39
+ /**
40
+ * Convert seconds to microseconds string for DAML RelTime
41
+ *
42
+ * @param seconds - Number of seconds
43
+ * @returns Microseconds as a string
44
+ */
45
+ function secondsToMicroseconds(seconds) {
46
+ const n = typeof seconds === 'string' ? Number(seconds) : seconds;
47
+ if (!Number.isFinite(n) || !Number.isInteger(n)) {
48
+ throw new TypeError(`seconds must be a finite integer (whole seconds), got ${String(seconds)}`);
49
+ }
50
+ return (BigInt(n) * BigInt(1000000)).toString();
51
+ }
52
+ //# sourceMappingURL=activePaymentStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"activePaymentStream.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/activePaymentStream.ts"],"names":[],"mappings":";AAAA,yDAAyD;;AA8DzD,8EAyCC;AAQD,sDAQC;AArHD,2DAGwC;AAkDxC;;;;;;GAMG;AACH,SAAgB,iCAAiC,CAC/C,aAA0C,EAC1C,uBAA+B;IAE/B,IACE,CAAC,MAAM,CAAC,QAAQ,CAAC,uBAAuB,CAAC;QACzC,CAAC,MAAM,CAAC,SAAS,CAAC,uBAAuB,CAAC,EAC1C,CAAC;QACD,MAAM,IAAI,SAAS,CACjB,yDAAyD,MAAM,CAAC,uBAAuB,CAAC,EAAE,CAC3F,CAAC;IACJ,CAAC;IAED,8FAA8F;IAC9F,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,qBAAqB,EAAE,CAAC;QACjD,OAAO,IAAI,CAAC;IACd,CAAC;IAED,wCAAwC;IACxC,MAAM,kBAAkB,GAAG,IAAI,IAAI,CACjC,aAAa,CAAC,OAAO,CAAC,qBAAqB,CAC5C,CAAC;IACF,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,OAAO,EAAE,CAAC;IACtD,IAAI,MAAM,CAAC,KAAK,CAAC,gBAAgB,CAAC,EAAE,CAAC;QACnC,MAAM,IAAI,2BAAkB,CAC1B,6CAA6C,EAC7C,4CAA4C,aAAa,CAAC,OAAO,CAAC,qBAAqB,EAAE,EACzF;YACE,IAAI,EAAE,sBAAa,CAAC,cAAc;YAClC,YAAY,EAAE,oBAAoB;YAClC,aAAa,EAAE,aAAa,CAAC,OAAO,CAAC,qBAAqB;SAC3D,CACF,CAAC;IACJ,CAAC;IACD,MAAM,oBAAoB,GAAG,MAAM,CAAC,gBAAgB,CAAC,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC;IACrE,MAAM,gBAAgB,GAAG,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,CAAC;IACnD,MAAM,sBAAsB,GAC1B,MAAM,CAAC,uBAAuB,CAAC,GAAG,MAAM,CAAC,OAAS,CAAC,CAAC;IACtD,MAAM,cAAc,GAAG,oBAAoB,GAAG,sBAAsB,CAAC;IAErE,OAAO,gBAAgB,IAAI,cAAc,CAAC;AAC5C,CAAC;AAED;;;;;GAKG;AACH,SAAgB,qBAAqB,CAAC,OAAwB;IAC5D,MAAM,CAAC,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;IAClE,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QAChD,MAAM,IAAI,SAAS,CACjB,yDAAyD,MAAM,CAAC,OAAO,CAAC,EAAE,CAC3E,CAAC;IACJ,CAAC;IACD,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,MAAM,CAAC,OAAS,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;AACpD,CAAC"}
@@ -0,0 +1,6 @@
1
+ export * from './activePaymentStream';
2
+ export * from './lockFundsInput';
3
+ export * from './partyRole';
4
+ export * from './paymentStreamProposalInput';
5
+ export * from './proposedPaymentStream';
6
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,uBAAuB,CAAC;AACtC,cAAc,kBAAkB,CAAC;AACjC,cAAc,aAAa,CAAC;AAC5B,cAAc,8BAA8B,CAAC;AAC7C,cAAc,yBAAyB,CAAC"}
@@ -0,0 +1,22 @@
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("./activePaymentStream"), exports);
18
+ __exportStar(require("./lockFundsInput"), exports);
19
+ __exportStar(require("./partyRole"), exports);
20
+ __exportStar(require("./paymentStreamProposalInput"), exports);
21
+ __exportStar(require("./proposedPaymentStream"), exports);
22
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wDAAsC;AACtC,mDAAiC;AACjC,8CAA4B;AAC5B,+DAA6C;AAC7C,0DAAwC"}
@@ -0,0 +1,8 @@
1
+ import type { PaymentContext } from '../utils/paymentContext';
2
+ /** Input for locking funds in a paymentStream Used when creating or adding funds to a paymentStream */
3
+ export interface LockFundsInput {
4
+ amuletInputs: string[];
5
+ amountToLock: string;
6
+ paymentContext: PaymentContext;
7
+ }
8
+ //# sourceMappingURL=lockFundsInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockFundsInput.d.ts","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/lockFundsInput.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAE9D,uGAAuG;AACvG,MAAM,WAAW,cAAc;IAC7B,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IACrB,cAAc,EAAE,cAAc,CAAC;CAChC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=lockFundsInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"lockFundsInput.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/lockFundsInput.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ /** Party slot for change-party choices on payment stream templates. */
2
+ export type PartyRole = 'Payer' | 'Recipient' | 'Processor';
3
+ //# sourceMappingURL=partyRole.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partyRole.d.ts","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/partyRole.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,WAAW,GAAG,WAAW,CAAC"}
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=partyRole.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"partyRole.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/partyRole.ts"],"names":[],"mappings":""}
@@ -0,0 +1,37 @@
1
+ /** Input formats for payment stream proposals (before DAML conversion). */
2
+ export type PaymentStreamAmountInput = {
3
+ type: 'AMULET';
4
+ amount: string | number;
5
+ } | {
6
+ type: 'USD';
7
+ amount: string | number;
8
+ };
9
+ /** Wall-clock boundary; serialized as ISO-8601 in DAML. */
10
+ export type PaymentStreamPreciseTimeInput = {
11
+ type: 'PRECISE';
12
+ value: Date;
13
+ };
14
+ /** Relative offset as microsecond string (DAML RelTime-style). */
15
+ export type PaymentStreamRelativeTimeInput = {
16
+ type: 'RELATIVE';
17
+ value: string;
18
+ };
19
+ export type PaymentStreamTimeInput = PaymentStreamPreciseTimeInput | PaymentStreamRelativeTimeInput;
20
+ export interface PaymentStreamProposalInput {
21
+ payer: string;
22
+ recipient: string;
23
+ provider: string;
24
+ appRewardBeneficiaries?: Array<{
25
+ beneficiary: string;
26
+ weight: string;
27
+ }>;
28
+ freeTrialExpiration?: PaymentStreamTimeInput;
29
+ recipientPaymentPerDay: PaymentStreamAmountInput;
30
+ processorPaymentPerDay?: PaymentStreamAmountInput | null;
31
+ prepayWindow: string;
32
+ paymentsEndAt?: PaymentStreamTimeInput;
33
+ description?: string;
34
+ metadata?: Record<string, string>;
35
+ observers?: string[];
36
+ }
37
+ //# sourceMappingURL=paymentStreamProposalInput.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentStreamProposalInput.d.ts","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/paymentStreamProposalInput.ts"],"names":[],"mappings":"AAAA,2EAA2E;AAE3E,MAAM,MAAM,wBAAwB,GAChC;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,GAC3C;IAAE,IAAI,EAAE,KAAK,CAAC;IAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAE7C,2DAA2D;AAC3D,MAAM,MAAM,6BAA6B,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,KAAK,EAAE,IAAI,CAAA;CAAE,CAAC;AAE7E,kEAAkE;AAClE,MAAM,MAAM,8BAA8B,GAAG;IAC3C,IAAI,EAAE,UAAU,CAAC;IACjB,KAAK,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAC9B,6BAA6B,GAC7B,8BAA8B,CAAC;AAEnC,MAAM,WAAW,0BAA0B;IACzC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,CAAC,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACxE,mBAAmB,CAAC,EAAE,sBAAsB,CAAC;IAC7C,sBAAsB,EAAE,wBAAwB,CAAC;IACjD,sBAAsB,CAAC,EAAE,wBAAwB,GAAG,IAAI,CAAC;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,CAAC,EAAE,sBAAsB,CAAC;IACvC,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IAClC,SAAS,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB"}
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ /** Input formats for payment stream proposals (before DAML conversion). */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ //# sourceMappingURL=paymentStreamProposalInput.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paymentStreamProposalInput.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/paymentStreamProposalInput.ts"],"names":[],"mappings":";AAAA,2EAA2E"}
@@ -0,0 +1,81 @@
1
+ /** Type definitions for ProposedPaymentStream contracts */
2
+ export interface PaymentStreamProposal {
3
+ payer: string;
4
+ recipient: string;
5
+ provider: string;
6
+ recipientPaymentPerDay: {
7
+ tag: 'AmuletAmount' | 'USDAmount';
8
+ value: string;
9
+ };
10
+ processorPaymentPerDay: {
11
+ tag: 'AmuletAmount' | 'USDAmount';
12
+ value: string;
13
+ } | null;
14
+ prepayWindow: {
15
+ microseconds: string;
16
+ };
17
+ paymentsEndAt: {
18
+ tag: 'PreciseTime' | 'RelativeTime';
19
+ value: string;
20
+ } | null;
21
+ freeTrialExpiration: {
22
+ tag: 'PreciseTime' | 'RelativeTime';
23
+ value: string;
24
+ } | null;
25
+ appRewardBeneficiaries: Array<{
26
+ beneficiary: string;
27
+ weight: string;
28
+ }>;
29
+ observers: string[];
30
+ description?: string;
31
+ metadata?: Record<string, string>;
32
+ }
33
+ export interface Approvals {
34
+ payerApproved: boolean;
35
+ recipientApproved: boolean;
36
+ processorApproved: boolean;
37
+ }
38
+ export interface ProposedPaymentStreamPayload {
39
+ paymentStreamProposal: PaymentStreamProposal;
40
+ processorContext: {
41
+ processor: string;
42
+ dso: string;
43
+ };
44
+ approvals: Approvals;
45
+ }
46
+ export interface ProposedPaymentStreamContract {
47
+ contractId: string;
48
+ payload: ProposedPaymentStreamPayload;
49
+ }
50
+ /**
51
+ * Check if a proposed paymentStream is pending recipient approval
52
+ *
53
+ * @param proposal - The proposed paymentStream contract
54
+ * @param recipientPartyId - The recipient party ID to check
55
+ * @returns True if the proposal is pending the recipient's approval
56
+ */
57
+ export declare function isProposalPendingRecipientApproval(proposal: ProposedPaymentStreamContract, recipientPartyId: string): boolean;
58
+ /**
59
+ * Check if a proposed paymentStream is pending payer approval
60
+ *
61
+ * @param proposal - The proposed paymentStream contract
62
+ * @param payerPartyId - The payer party ID to check
63
+ * @returns True if the proposal is pending the payer's approval
64
+ */
65
+ export declare function isProposalPendingPayerApproval(proposal: ProposedPaymentStreamContract, payerPartyId: string): boolean;
66
+ /**
67
+ * Check if a proposed paymentStream is pending processor approval
68
+ *
69
+ * @param proposal - The proposed paymentStream contract
70
+ * @param processorPartyId - The processor party ID to check
71
+ * @returns True if the proposal is pending the processor's approval
72
+ */
73
+ export declare function isProposalPendingProcessorApproval(proposal: ProposedPaymentStreamContract, processorPartyId: string): boolean;
74
+ /**
75
+ * Whether the recipient and processor have both approved the proposal (payer approval is tracked separately).
76
+ *
77
+ * @param proposal - The proposed paymentStream contract
78
+ * @returns True if recipient and processor approvals are true
79
+ */
80
+ export declare function areAllNonPayerPartiesApproved(proposal: ProposedPaymentStreamContract): boolean;
81
+ //# sourceMappingURL=proposedPaymentStream.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposedPaymentStream.d.ts","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/proposedPaymentStream.ts"],"names":[],"mappings":"AAAA,2DAA2D;AAE3D,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,QAAQ,EAAE,MAAM,CAAC;IACjB,sBAAsB,EAAE;QACtB,GAAG,EAAE,cAAc,GAAG,WAAW,CAAC;QAClC,KAAK,EAAE,MAAM,CAAC;KACf,CAAC;IACF,sBAAsB,EAAE;QACtB,GAAG,EAAE,cAAc,GAAG,WAAW,CAAC;QAClC,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT,YAAY,EAAE;QAAE,YAAY,EAAE,MAAM,CAAA;KAAE,CAAC;IACvC,aAAa,EAAE;QACb,GAAG,EAAE,aAAa,GAAG,cAAc,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT,mBAAmB,EAAE;QACnB,GAAG,EAAE,aAAa,GAAG,cAAc,CAAC;QACpC,KAAK,EAAE,MAAM,CAAC;KACf,GAAG,IAAI,CAAC;IACT,sBAAsB,EAAE,KAAK,CAAC;QAAE,WAAW,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACvE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACnC;AAED,MAAM,WAAW,SAAS;IACxB,aAAa,EAAE,OAAO,CAAC;IACvB,iBAAiB,EAAE,OAAO,CAAC;IAC3B,iBAAiB,EAAE,OAAO,CAAC;CAC5B;AAED,MAAM,WAAW,4BAA4B;IAC3C,qBAAqB,EAAE,qBAAqB,CAAC;IAC7C,gBAAgB,EAAE;QAChB,SAAS,EAAE,MAAM,CAAC;QAClB,GAAG,EAAE,MAAM,CAAC;KACb,CAAC;IACF,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,MAAM,WAAW,6BAA6B;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,OAAO,EAAE,4BAA4B,CAAC;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,6BAA6B,EACvC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAKT;AAED;;;;;;GAMG;AACH,wBAAgB,8BAA8B,CAC5C,QAAQ,EAAE,6BAA6B,EACvC,YAAY,EAAE,MAAM,GACnB,OAAO,CAKT;AAED;;;;;;GAMG;AACH,wBAAgB,kCAAkC,CAChD,QAAQ,EAAE,6BAA6B,EACvC,gBAAgB,EAAE,MAAM,GACvB,OAAO,CAKT;AAED;;;;;GAKG;AACH,wBAAgB,6BAA6B,CAC3C,QAAQ,EAAE,6BAA6B,GACtC,OAAO,CAKT"}
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /** Type definitions for ProposedPaymentStream contracts */
3
+ Object.defineProperty(exports, "__esModule", { value: true });
4
+ exports.isProposalPendingRecipientApproval = isProposalPendingRecipientApproval;
5
+ exports.isProposalPendingPayerApproval = isProposalPendingPayerApproval;
6
+ exports.isProposalPendingProcessorApproval = isProposalPendingProcessorApproval;
7
+ exports.areAllNonPayerPartiesApproved = areAllNonPayerPartiesApproved;
8
+ /**
9
+ * Check if a proposed paymentStream is pending recipient approval
10
+ *
11
+ * @param proposal - The proposed paymentStream contract
12
+ * @param recipientPartyId - The recipient party ID to check
13
+ * @returns True if the proposal is pending the recipient's approval
14
+ */
15
+ function isProposalPendingRecipientApproval(proposal, recipientPartyId) {
16
+ return (proposal.payload.paymentStreamProposal.recipient === recipientPartyId &&
17
+ !proposal.payload.approvals.recipientApproved);
18
+ }
19
+ /**
20
+ * Check if a proposed paymentStream is pending payer approval
21
+ *
22
+ * @param proposal - The proposed paymentStream contract
23
+ * @param payerPartyId - The payer party ID to check
24
+ * @returns True if the proposal is pending the payer's approval
25
+ */
26
+ function isProposalPendingPayerApproval(proposal, payerPartyId) {
27
+ return (proposal.payload.paymentStreamProposal.payer === payerPartyId &&
28
+ !proposal.payload.approvals.payerApproved);
29
+ }
30
+ /**
31
+ * Check if a proposed paymentStream is pending processor approval
32
+ *
33
+ * @param proposal - The proposed paymentStream contract
34
+ * @param processorPartyId - The processor party ID to check
35
+ * @returns True if the proposal is pending the processor's approval
36
+ */
37
+ function isProposalPendingProcessorApproval(proposal, processorPartyId) {
38
+ return (proposal.payload.processorContext.processor === processorPartyId &&
39
+ !proposal.payload.approvals.processorApproved);
40
+ }
41
+ /**
42
+ * Whether the recipient and processor have both approved the proposal (payer approval is tracked separately).
43
+ *
44
+ * @param proposal - The proposed paymentStream contract
45
+ * @returns True if recipient and processor approvals are true
46
+ */
47
+ function areAllNonPayerPartiesApproved(proposal) {
48
+ return (proposal.payload.approvals.recipientApproved &&
49
+ proposal.payload.approvals.processorApproved);
50
+ }
51
+ //# sourceMappingURL=proposedPaymentStream.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"proposedPaymentStream.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/types/proposedPaymentStream.ts"],"names":[],"mappings":";AAAA,2DAA2D;;AAwD3D,gFAQC;AASD,wEAQC;AASD,gFAQC;AAQD,sEAOC;AAhED;;;;;;GAMG;AACH,SAAgB,kCAAkC,CAChD,QAAuC,EACvC,gBAAwB;IAExB,OAAO,CACL,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC,SAAS,KAAK,gBAAgB;QACrE,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAC9C,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,8BAA8B,CAC5C,QAAuC,EACvC,YAAoB;IAEpB,OAAO,CACL,QAAQ,CAAC,OAAO,CAAC,qBAAqB,CAAC,KAAK,KAAK,YAAY;QAC7D,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,aAAa,CAC1C,CAAC;AACJ,CAAC;AAED;;;;;;GAMG;AACH,SAAgB,kCAAkC,CAChD,QAAuC,EACvC,gBAAwB;IAExB,OAAO,CACL,QAAQ,CAAC,OAAO,CAAC,gBAAgB,CAAC,SAAS,KAAK,gBAAgB;QAChE,CAAC,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAC9C,CAAC;AACJ,CAAC;AAED;;;;;GAKG;AACH,SAAgB,6BAA6B,CAC3C,QAAuC;IAEvC,OAAO,CACL,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,iBAAiB;QAC5C,QAAQ,CAAC,OAAO,CAAC,SAAS,CAAC,iBAAiB,CAC7C,CAAC;AACJ,CAAC"}
@@ -0,0 +1,14 @@
1
+ /** Utilities for handling disclosed contracts in paymentStream workflows */
2
+ import type { LedgerJsonApiClient } from '@fairmint/canton-node-sdk';
3
+ import type { DisclosedContract } from '@fairmint/canton-node-sdk/build/src/clients/ledger-json-api/schemas/api/commands';
4
+ /**
5
+ * Get disclosed contracts for the factory contract Reads from the pre-generated factory contract data for the client's
6
+ * network This allows parties that don't directly see the factory to exercise it
7
+ */
8
+ export declare function getFactoryDisclosedContracts(ledgerClient: LedgerJsonApiClient): DisclosedContract[];
9
+ /**
10
+ * Get disclosed contracts for a ProposedPaymentStream contract This allows parties to exercise choices on the proposal
11
+ * when needed
12
+ */
13
+ export declare function getProposedPaymentStreamDisclosedContracts(ledgerClient: LedgerJsonApiClient, proposedPaymentStreamContractId: string, readAs?: string[]): Promise<DisclosedContract[]>;
14
+ //# sourceMappingURL=disclosedContracts.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disclosedContracts.d.ts","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/utils/disclosedContracts.ts"],"names":[],"mappings":"AAAA,4EAA4E;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kFAAkF,CAAC;AAS1H;;;GAGG;AACH,wBAAgB,4BAA4B,CAC1C,YAAY,EAAE,mBAAmB,GAChC,iBAAiB,EAAE,CAyBrB;AAED;;;GAGG;AACH,wBAAsB,0CAA0C,CAC9D,YAAY,EAAE,mBAAmB,EACjC,+BAA+B,EAAE,MAAM,EACvC,MAAM,CAAC,EAAE,MAAM,EAAE,GAChB,OAAO,CAAC,iBAAiB,EAAE,CAAC,CA0B9B"}
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ /** Utilities for handling disclosed contracts in paymentStream 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.getProposedPaymentStreamDisclosedContracts = getProposedPaymentStreamDisclosedContracts;
9
+ const paymentStreams_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/paymentStreams-factory-contract-id.json"));
10
+ const canton_1 = require("@open-captable-protocol/canton");
11
+ /**
12
+ * Get disclosed contracts for the factory contract Reads from the pre-generated factory contract data for the client's
13
+ * network This allows parties that don't directly see the factory to exercise it
14
+ */
15
+ function getFactoryDisclosedContracts(ledgerClient) {
16
+ const network = ledgerClient.getNetwork();
17
+ const networkData = paymentStreams_factory_contract_id_json_1.default[network];
18
+ if (!networkData) {
19
+ throw new canton_1.OcpValidationError('network', `Factory contract data not found for network "${network}". ` +
20
+ 'Please run the factory deployment script for this network first.', { code: canton_1.OcpErrorCodes.INVALID_FORMAT, receivedValue: network });
21
+ }
22
+ if (!networkData.disclosedContract) {
23
+ throw new canton_1.OcpValidationError('network.disclosedContract', `Disclosed contract data not found for network "${network}". ` +
24
+ 'The factory contract data may be outdated. Please re-run the factory deployment script.', { code: canton_1.OcpErrorCodes.REQUIRED_FIELD_MISSING });
25
+ }
26
+ return [networkData.disclosedContract];
27
+ }
28
+ /**
29
+ * Get disclosed contracts for a ProposedPaymentStream contract This allows parties to exercise choices on the proposal
30
+ * when needed
31
+ */
32
+ async function getProposedPaymentStreamDisclosedContracts(ledgerClient, proposedPaymentStreamContractId, readAs) {
33
+ const proposalEventsResponse = await ledgerClient.getEventsByContractId({
34
+ contractId: proposedPaymentStreamContractId,
35
+ readAs: readAs ?? [ledgerClient.getPartyId()],
36
+ });
37
+ const createdEvent = proposalEventsResponse.created?.createdEvent;
38
+ if (!createdEvent || !proposalEventsResponse.created) {
39
+ throw new canton_1.OcpContractError(`ProposedPaymentStream contract ${proposedPaymentStreamContractId} not found`, {
40
+ contractId: proposedPaymentStreamContractId,
41
+ code: canton_1.OcpErrorCodes.CONTRACT_NOT_FOUND,
42
+ });
43
+ }
44
+ return [
45
+ {
46
+ templateId: createdEvent.templateId,
47
+ contractId: createdEvent.contractId,
48
+ createdEventBlob: createdEvent.createdEventBlob,
49
+ synchronizerId: proposalEventsResponse.created.synchronizerId,
50
+ },
51
+ ];
52
+ }
53
+ //# sourceMappingURL=disclosedContracts.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"disclosedContracts.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/utils/disclosedContracts.ts"],"names":[],"mappings":";AAAA,4EAA4E;;;;;AAgB5E,oEA2BC;AAMD,gGA8BC;AA3ED,+JAA2H;AAC3H,2DAIwC;AAGxC;;;GAGG;AACH,SAAgB,4BAA4B,CAC1C,YAAiC;IAEjC,MAAM,OAAO,GAAG,YAAY,CAAC,UAAU,EAAE,CAAC;IAC1C,MAAM,WAAW,GAAG,iDAA2B,CAC7C,OAAmD,CACjB,CAAC;IAErC,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,MAAM,IAAI,2BAAkB,CAC1B,SAAS,EACT,gDAAgD,OAAO,KAAK;YAC1D,kEAAkE,EACpE,EAAE,IAAI,EAAE,sBAAa,CAAC,cAAc,EAAE,aAAa,EAAE,OAAO,EAAE,CAC/D,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,WAAW,CAAC,iBAAiB,EAAE,CAAC;QACnC,MAAM,IAAI,2BAAkB,CAC1B,2BAA2B,EAC3B,kDAAkD,OAAO,KAAK;YAC5D,yFAAyF,EAC3F,EAAE,IAAI,EAAE,sBAAa,CAAC,sBAAsB,EAAE,CAC/C,CAAC;IACJ,CAAC;IAED,OAAO,CAAC,WAAW,CAAC,iBAAiB,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,0CAA0C,CAC9D,YAAiC,EACjC,+BAAuC,EACvC,MAAiB;IAEjB,MAAM,sBAAsB,GAAG,MAAM,YAAY,CAAC,qBAAqB,CAAC;QACtE,UAAU,EAAE,+BAA+B;QAC3C,MAAM,EAAE,MAAM,IAAI,CAAC,YAAY,CAAC,UAAU,EAAE,CAAC;KAC9C,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,yBAAgB,CACxB,kCAAkC,+BAA+B,YAAY,EAC7E;YACE,UAAU,EAAE,+BAA+B;YAC3C,IAAI,EAAE,sBAAa,CAAC,kBAAkB;SACvC,CACF,CAAC;IACJ,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 paymentStream 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' | 'staging';
4
+ export interface FactoryContractInfo {
5
+ paymentStreamsFactoryContractId: string;
6
+ templateId: string;
7
+ disclosedContract?: DisclosedContract;
8
+ }
9
+ /**
10
+ * Get the paymentStream factory contract ID for a given network
11
+ *
12
+ * @param network - The network to get the factory contract ID for ('devnet', 'mainnet', or 'staging')
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/PaymentStreams/utils/factoryContractId.ts"],"names":[],"mappings":"AAAA,kEAAkE;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,kFAAkF,CAAC;AAO1H,MAAM,MAAM,OAAO,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AAEvD,MAAM,WAAW,mBAAmB;IAClC,+BAA+B,EAAE,MAAM,CAAC;IACxC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,iBAAiB,CAAC;CACvC;AAED;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,OAAO,EAAE,OAAO,GAAG,mBAAmB,CAiB1E"}
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /** Utilities for retrieving paymentStream 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 paymentStreams_factory_contract_id_json_1 = __importDefault(require("@fairmint/open-captable-protocol-daml-js/paymentStreams-factory-contract-id.json"));
9
+ const canton_1 = require("@open-captable-protocol/canton");
10
+ /**
11
+ * Get the paymentStream factory contract ID for a given network
12
+ *
13
+ * @param network - The network to get the factory contract ID for ('devnet', 'mainnet', or 'staging')
14
+ * @returns The factory contract information including contract ID and template ID
15
+ * @throws Error if the network is not found in the configuration
16
+ */
17
+ function getFactoryContractId(network) {
18
+ const config = paymentStreams_factory_contract_id_json_1.default[network];
19
+ if (!config) {
20
+ throw new canton_1.OcpValidationError('network', `PaymentStream factory contract ID not found for network: ${network}`, {
21
+ code: canton_1.OcpErrorCodes.INVALID_FORMAT,
22
+ receivedValue: network,
23
+ });
24
+ }
25
+ return config;
26
+ }
27
+ //# sourceMappingURL=factoryContractId.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factoryContractId.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/utils/factoryContractId.ts"],"names":[],"mappings":";AAAA,kEAAkE;;;;;AAwBlE,oDAiBC;AAtCD,+JAA2H;AAC3H,2DAGwC;AAUxC;;;;;;GAMG;AACH,SAAgB,oBAAoB,CAAC,OAAgB;IACnD,MAAM,MAAM,GACV,iDACD,CAAC,OAAO,CAAoC,CAAC;IAE9C,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,MAAM,IAAI,2BAAkB,CAC1B,SAAS,EACT,4DAA4D,OAAO,EAAE,EACrE;YACE,IAAI,EAAE,sBAAa,CAAC,cAAc;YAClC,aAAa,EAAE,OAAO;SACvB,CACF,CAAC;IACJ,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/PaymentStreams/utils/index.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC;AACrC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,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("./disclosedContracts"), exports);
18
+ __exportStar(require("./factoryContractId"), exports);
19
+ __exportStar(require("./paymentContext"), exports);
20
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/functions/PaymentStreams/utils/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,sDAAoC;AACpC,mDAAiC"}