@hyperscale0/hsx 2.4.1 → 3.0.0

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 (249) hide show
  1. package/CHANGELOG.md +2 -408
  2. package/README.md +3 -92
  3. package/dist/src/ast.d.ts +99 -310
  4. package/dist/src/ast.d.ts.map +1 -1
  5. package/dist/src/ast.js +16 -69
  6. package/dist/src/ast.js.map +1 -1
  7. package/dist/src/cli.d.ts +6 -19
  8. package/dist/src/cli.d.ts.map +1 -1
  9. package/dist/src/cli.js +76 -315
  10. package/dist/src/cli.js.map +1 -1
  11. package/dist/src/compile.d.ts +23 -73
  12. package/dist/src/compile.d.ts.map +1 -1
  13. package/dist/src/compile.js +1113 -148
  14. package/dist/src/compile.js.map +1 -1
  15. package/dist/src/cost.d.ts +8 -77
  16. package/dist/src/cost.d.ts.map +1 -1
  17. package/dist/src/cost.js +13 -422
  18. package/dist/src/cost.js.map +1 -1
  19. package/dist/src/format.d.ts +8 -7
  20. package/dist/src/format.d.ts.map +1 -1
  21. package/dist/src/format.js +9 -175
  22. package/dist/src/format.js.map +1 -1
  23. package/dist/src/headers.d.ts +35 -0
  24. package/dist/src/headers.d.ts.map +1 -0
  25. package/dist/src/headers.js +108 -0
  26. package/dist/src/headers.js.map +1 -0
  27. package/dist/src/index.d.ts +6 -12
  28. package/dist/src/index.d.ts.map +1 -1
  29. package/dist/src/index.js +4 -9
  30. package/dist/src/index.js.map +1 -1
  31. package/dist/src/lex.d.ts +8 -28
  32. package/dist/src/lex.d.ts.map +1 -1
  33. package/dist/src/lex.js +88 -146
  34. package/dist/src/lex.js.map +1 -1
  35. package/dist/src/parse.d.ts +4 -17
  36. package/dist/src/parse.d.ts.map +1 -1
  37. package/dist/src/parse.js +402 -1040
  38. package/dist/src/parse.js.map +1 -1
  39. package/dist/src/std-bundle.d.ts.map +1 -1
  40. package/dist/src/std-bundle.js +12 -20
  41. package/dist/src/std-bundle.js.map +1 -1
  42. package/dist/src/std-library.d.ts +1 -1
  43. package/dist/src/std-library.d.ts.map +1 -1
  44. package/dist/src/std-library.js +1 -5
  45. package/dist/src/std-library.js.map +1 -1
  46. package/dist/src/tunables.d.ts +7 -0
  47. package/dist/src/tunables.d.ts.map +1 -0
  48. package/dist/src/tunables.js +26 -0
  49. package/dist/src/tunables.js.map +1 -0
  50. package/dist/src/version.d.ts +2 -4
  51. package/dist/src/version.d.ts.map +1 -1
  52. package/dist/src/version.js +2 -4
  53. package/dist/src/version.js.map +1 -1
  54. package/docs/README.md +179 -41
  55. package/docs/headers.md +44 -0
  56. package/examples/cost-table.json +99 -751
  57. package/examples/library.hsx +59 -0
  58. package/package.json +9 -17
  59. package/src/ast.ts +82 -441
  60. package/src/cli.ts +77 -362
  61. package/src/compile.ts +1535 -247
  62. package/src/cost.ts +28 -671
  63. package/src/format.ts +12 -256
  64. package/src/headers.ts +126 -0
  65. package/src/index.ts +7 -39
  66. package/src/lex.ts +99 -195
  67. package/src/parse.ts +403 -1209
  68. package/src/std-bundle.ts +12 -20
  69. package/src/std-library.ts +2 -7
  70. package/src/tunables.ts +31 -0
  71. package/src/version.ts +2 -5
  72. package/std/approvals.hsx +17 -0
  73. package/std/cards.hsx +63 -0
  74. package/std/collections.hsx +31 -0
  75. package/std/escrow.hsx +43 -0
  76. package/std/financing.hsx +372 -0
  77. package/std/insurance.hsx +59 -0
  78. package/std/lending.hsx +115 -0
  79. package/std/marketplace.hsx +24 -0
  80. package/std/money.hsx +195 -0
  81. package/std/savings.hsx +44 -0
  82. package/std/travel.hsx +98 -0
  83. package/std/wallet.hsx +41 -0
  84. package/dist/src/diagnostics.d.ts +0 -13
  85. package/dist/src/diagnostics.d.ts.map +0 -1
  86. package/dist/src/diagnostics.js +0 -587
  87. package/dist/src/diagnostics.js.map +0 -1
  88. package/dist/src/emit.d.ts +0 -51
  89. package/dist/src/emit.d.ts.map +0 -1
  90. package/dist/src/emit.js +0 -192
  91. package/dist/src/emit.js.map +0 -1
  92. package/dist/src/entry-overrides.d.ts +0 -58
  93. package/dist/src/entry-overrides.d.ts.map +0 -1
  94. package/dist/src/entry-overrides.js +0 -284
  95. package/dist/src/entry-overrides.js.map +0 -1
  96. package/dist/src/ir.d.ts +0 -73
  97. package/dist/src/ir.d.ts.map +0 -1
  98. package/dist/src/ir.js +0 -15
  99. package/dist/src/ir.js.map +0 -1
  100. package/dist/src/limits.d.ts +0 -23
  101. package/dist/src/limits.d.ts.map +0 -1
  102. package/dist/src/limits.js +0 -23
  103. package/dist/src/limits.js.map +0 -1
  104. package/dist/src/lsp/server.d.ts +0 -32
  105. package/dist/src/lsp/server.d.ts.map +0 -1
  106. package/dist/src/lsp/server.js +0 -391
  107. package/dist/src/lsp/server.js.map +0 -1
  108. package/dist/src/modules.d.ts +0 -38
  109. package/dist/src/modules.d.ts.map +0 -1
  110. package/dist/src/modules.js +0 -372
  111. package/dist/src/modules.js.map +0 -1
  112. package/dist/src/typecheck.d.ts +0 -8
  113. package/dist/src/typecheck.d.ts.map +0 -1
  114. package/dist/src/typecheck.js +0 -4160
  115. package/dist/src/typecheck.js.map +0 -1
  116. package/docs/guide/01-first-program.md +0 -24
  117. package/docs/guide/02-money.md +0 -25
  118. package/docs/guide/03-instruments.md +0 -93
  119. package/docs/guide/04-lifecycles.md +0 -40
  120. package/docs/guide/05-fees-and-splits.md +0 -45
  121. package/docs/guide/06-schedules.md +0 -26
  122. package/docs/guide/07-composition.md +0 -52
  123. package/docs/guide/08-writing-a-module.md +0 -85
  124. package/docs/guide/09-cost.md +0 -24
  125. package/docs/guide/10-diagnostics.md +0 -27
  126. package/docs/llms-full.txt +0 -3684
  127. package/docs/llms.txt +0 -44
  128. package/docs/piece-plans.md +0 -120
  129. package/docs/playground.md +0 -55
  130. package/docs/reference/cli.md +0 -36
  131. package/docs/reference/diagnostics.md +0 -901
  132. package/docs/reference/grammar.md +0 -38
  133. package/docs/reference/std/advance.md +0 -112
  134. package/docs/reference/std/cancellable_booking.md +0 -159
  135. package/docs/reference/std/captured_payment.md +0 -115
  136. package/docs/reference/std/conditional_disbursement.md +0 -101
  137. package/docs/reference/std/credit_facility.md +0 -108
  138. package/docs/reference/std/held_payment.md +0 -173
  139. package/docs/reference/std/instant_transfer.md +0 -97
  140. package/docs/reference/std/metered.md +0 -89
  141. package/docs/reference/std/pooled_split.md +0 -95
  142. package/docs/reference/std/premium_forward.md +0 -119
  143. package/docs/reference/std/reconciled_payout.md +0 -103
  144. package/docs/reference/std/rotating_pool.md +0 -130
  145. package/docs/reference/std/scheduled.md +0 -136
  146. package/docs/reference/std/security_deposit.md +0 -138
  147. package/docs/reference/std/settlement_batch.md +0 -123
  148. package/docs/reference/std/swap.md +0 -133
  149. package/docs/reference/std/threshold_pool.md +0 -138
  150. package/docs/reference/std/weighted_distribution.md +0 -135
  151. package/docs/reference/types.md +0 -61
  152. package/docs/reference/udl-output.md +0 -13
  153. package/examples/01-first-program/README.md +0 -45
  154. package/examples/01-first-program/tip-jar.hsx +0 -17
  155. package/examples/02-imports-and-modules/README.md +0 -96
  156. package/examples/02-imports-and-modules/photo-booth.hsx +0 -37
  157. package/examples/03-diagnostics/README.md +0 -68
  158. package/examples/03-diagnostics/corner-shop-fixed.hsx +0 -22
  159. package/examples/03-diagnostics/corner-shop.hsx +0 -19
  160. package/examples/04-complete-product/README.md +0 -84
  161. package/examples/04-complete-product/study-hall.hsx +0 -67
  162. package/examples/05-authored-instrument/README.md +0 -5
  163. package/examples/05-authored-instrument/payment.hsx +0 -37
  164. package/examples/05-watch-club/README.md +0 -6
  165. package/examples/05-watch-club/watch-club.hsx +0 -123
  166. package/examples/README.md +0 -48
  167. package/examples/advance/README.md +0 -3
  168. package/examples/advance/advance.hsx +0 -13
  169. package/examples/advance/advance.udl +0 -367
  170. package/examples/cancellable_booking/README.md +0 -3
  171. package/examples/cancellable_booking/cancellable_booking.hsx +0 -14
  172. package/examples/cancellable_booking/cancellable_booking.udl +0 -413
  173. package/examples/captured_payment/README.md +0 -3
  174. package/examples/captured_payment/captured_payment.hsx +0 -17
  175. package/examples/captured_payment/captured_payment.udl +0 -686
  176. package/examples/conditional_disbursement/README.md +0 -3
  177. package/examples/conditional_disbursement/conditional_disbursement.hsx +0 -15
  178. package/examples/conditional_disbursement/conditional_disbursement.udl +0 -418
  179. package/examples/credit_facility/README.md +0 -3
  180. package/examples/credit_facility/credit_facility.hsx +0 -24
  181. package/examples/credit_facility/credit_facility.udl +0 -1396
  182. package/examples/held_payment/README.md +0 -3
  183. package/examples/held_payment/held_payment.hsx +0 -13
  184. package/examples/held_payment/held_payment.udl +0 -569
  185. package/examples/instant_transfer/README.md +0 -3
  186. package/examples/instant_transfer/instant_transfer.hsx +0 -16
  187. package/examples/instant_transfer/instant_transfer.udl +0 -376
  188. package/examples/metered/README.md +0 -3
  189. package/examples/metered/metered.hsx +0 -13
  190. package/examples/metered/metered.udl +0 -253
  191. package/examples/pooled_split/README.md +0 -3
  192. package/examples/pooled_split/pooled_split.hsx +0 -15
  193. package/examples/pooled_split/pooled_split.udl +0 -432
  194. package/examples/premium_forward/README.md +0 -3
  195. package/examples/premium_forward/premium_forward.hsx +0 -19
  196. package/examples/premium_forward/premium_forward.udl +0 -604
  197. package/examples/reconciled_payout/README.md +0 -3
  198. package/examples/reconciled_payout/reconciled_payout.hsx +0 -13
  199. package/examples/reconciled_payout/reconciled_payout.udl +0 -312
  200. package/examples/rotating_pool/README.md +0 -3
  201. package/examples/rotating_pool/rotating_pool.hsx +0 -18
  202. package/examples/rotating_pool/rotating_pool.udl +0 -4370
  203. package/examples/scheduled/README.md +0 -3
  204. package/examples/scheduled/scheduled.hsx +0 -12
  205. package/examples/scheduled/scheduled.udl +0 -355
  206. package/examples/security_deposit/README.md +0 -3
  207. package/examples/security_deposit/security_deposit.hsx +0 -21
  208. package/examples/security_deposit/security_deposit.udl +0 -320
  209. package/examples/settlement_batch/README.md +0 -3
  210. package/examples/settlement_batch/settlement_batch.hsx +0 -19
  211. package/examples/settlement_batch/settlement_batch.udl +0 -757
  212. package/examples/swap/README.md +0 -3
  213. package/examples/swap/swap.hsx +0 -19
  214. package/examples/swap/swap.udl +0 -892
  215. package/examples/threshold_pool/README.md +0 -3
  216. package/examples/threshold_pool/threshold_pool.hsx +0 -16
  217. package/examples/threshold_pool/threshold_pool.udl +0 -680
  218. package/examples/weighted_distribution/README.md +0 -3
  219. package/examples/weighted_distribution/weighted_distribution.hsx +0 -20
  220. package/examples/weighted_distribution/weighted_distribution.udl +0 -348
  221. package/skills/hsx/SKILL.md +0 -449
  222. package/src/diagnostics.ts +0 -620
  223. package/src/emit.ts +0 -282
  224. package/src/entry-overrides.ts +0 -428
  225. package/src/ir.ts +0 -113
  226. package/src/limits.ts +0 -22
  227. package/src/lsp/server.ts +0 -460
  228. package/src/modules.ts +0 -452
  229. package/src/typecheck.ts +0 -5515
  230. package/std/SEMANTICS.md +0 -44
  231. package/std/money_flows/advance.hsx +0 -235
  232. package/std/money_flows/cancellable_booking.hsx +0 -402
  233. package/std/money_flows/captured_payment.hsx +0 -220
  234. package/std/money_flows/conditional_disbursement.hsx +0 -226
  235. package/std/money_flows/credit_facility.hsx +0 -214
  236. package/std/money_flows/held_payment.hsx +0 -812
  237. package/std/money_flows/index.hsx +0 -4
  238. package/std/money_flows/instant_transfer.hsx +0 -231
  239. package/std/money_flows/metered.hsx +0 -104
  240. package/std/money_flows/pooled_split.hsx +0 -109
  241. package/std/money_flows/premium_forward.hsx +0 -307
  242. package/std/money_flows/reconciled_payout.hsx +0 -119
  243. package/std/money_flows/rotating_pool.hsx +0 -305
  244. package/std/money_flows/scheduled.hsx +0 -599
  245. package/std/money_flows/security_deposit.hsx +0 -248
  246. package/std/money_flows/settlement_batch.hsx +0 -173
  247. package/std/money_flows/swap.hsx +0 -1192
  248. package/std/money_flows/threshold_pool.hsx +0 -307
  249. package/std/money_flows/weighted_distribution.hsx +0 -237
@@ -1,686 +0,0 @@
1
- {
2
- "instruments": [
3
- {
4
- "actionOrder": [
5
- "create",
6
- "authorize",
7
- "capture",
8
- "capture_more",
9
- "settle",
10
- "void",
11
- "expire",
12
- "settle_on_expiry",
13
- "correct_capture",
14
- "reverse_capture"
15
- ],
16
- "actions": {
17
- "authorize": {
18
- "agentDescription": "Reserve the authorizedAmount against the payer in the payee's favor until reserveUntil. The payment must be created. The money is held, not paid: capture and settle post it, void and expiry release it.",
19
- "effects": {
20
- "holds": [
21
- {
22
- "signature": "holds.reserve",
23
- "source": "moves[0]"
24
- }
25
- ],
26
- "moves": [
27
- {
28
- "signature": "moves.transfer.internal",
29
- "source": "moves[0]"
30
- }
31
- ]
32
- },
33
- "moves": [
34
- {
35
- "bind": {
36
- "amount": {
37
- "from": "instance",
38
- "path": "fields.authorizedAmount"
39
- },
40
- "currency": {
41
- "from": "const",
42
- "value": "SAR"
43
- },
44
- "destinationAccountId": {
45
- "from": "instance",
46
- "path": "fields.payeeAccountId"
47
- },
48
- "metadata.instrumentId": {
49
- "from": "const",
50
- "value": "card_payment"
51
- },
52
- "metadata.instrumentInstanceId": {
53
- "from": "instance",
54
- "path": "instrumentInstanceId"
55
- },
56
- "metadata.phase": {
57
- "from": "const",
58
- "value": "authorize"
59
- },
60
- "productId": {
61
- "from": "instance",
62
- "path": "productId"
63
- },
64
- "sourceAccountId": {
65
- "from": "instance",
66
- "path": "fields.payerAccountId"
67
- }
68
- },
69
- "capture": {
70
- "authorizeReservationTransferId": "transferId"
71
- },
72
- "key": "reservation",
73
- "operation": "internal_transfer.reserve"
74
- }
75
- ],
76
- "publicAction": "authorizeCardPayment",
77
- "sandboxFailurePoint": "funding",
78
- "steps": [],
79
- "summary": "Reserve the authorizedAmount until reserveUntil"
80
- },
81
- "capture": {
82
- "agentDescription": "Post the first capture slice out of the live reservation. The payment must be authorized and the caller passes captureAmount in minor units. The slice settles for good and void can no longer release the reservation. Call before reserveUntil.",
83
- "deadline": {
84
- "field": "reserveUntil"
85
- },
86
- "effects": {
87
- "moves": [
88
- {
89
- "signature": "moves.transfer.internal",
90
- "source": "moves[0]"
91
- }
92
- ],
93
- "schedules": [
94
- {
95
- "signature": "schedules.deadline",
96
- "source": "deadline"
97
- }
98
- ]
99
- },
100
- "input": {
101
- "additionalProperties": false,
102
- "properties": {
103
- "captureAmount": {
104
- "description": "Positive partial capture amount in minor units",
105
- "pattern": "^[1-9][0-9]{0,17}$",
106
- "type": "string"
107
- }
108
- },
109
- "required": [
110
- "captureAmount"
111
- ],
112
- "type": "object"
113
- },
114
- "moves": [
115
- {
116
- "bind": {
117
- "amount": {
118
- "from": "input",
119
- "path": "captureAmount"
120
- },
121
- "currency": {
122
- "from": "instance",
123
- "path": "fields.currency"
124
- },
125
- "postMode": {
126
- "from": "const",
127
- "value": "partial_only"
128
- },
129
- "transferId": {
130
- "from": "instance",
131
- "path": "refs.authorizeReservationTransferId"
132
- }
133
- },
134
- "capture": {
135
- "capturedAmount": "postedAmount"
136
- },
137
- "key": "post",
138
- "operation": "internal_transfer.post"
139
- }
140
- ],
141
- "publicAction": "captureCardPayment",
142
- "sandboxFailurePoint": "release",
143
- "steps": [],
144
- "summary": "Post one strict partial capture slice"
145
- },
146
- "capture_more": {
147
- "agentDescription": "Post another capture slice out of a partly captured reservation. Call this only after capture took the first slice. Each slice settles for good, and the uncaptured remainder still releases at reserveUntil.",
148
- "deadline": {
149
- "field": "reserveUntil"
150
- },
151
- "effects": {
152
- "moves": [
153
- {
154
- "signature": "moves.transfer.internal",
155
- "source": "moves[0]"
156
- }
157
- ],
158
- "schedules": [
159
- {
160
- "signature": "schedules.deadline",
161
- "source": "deadline"
162
- }
163
- ]
164
- },
165
- "input": {
166
- "additionalProperties": false,
167
- "properties": {
168
- "captureAmount": {
169
- "description": "Positive partial capture amount in minor units",
170
- "pattern": "^[1-9][0-9]{0,17}$",
171
- "type": "string"
172
- }
173
- },
174
- "required": [
175
- "captureAmount"
176
- ],
177
- "type": "object"
178
- },
179
- "moves": [
180
- {
181
- "bind": {
182
- "amount": {
183
- "from": "input",
184
- "path": "captureAmount"
185
- },
186
- "currency": {
187
- "from": "instance",
188
- "path": "fields.currency"
189
- },
190
- "postMode": {
191
- "from": "const",
192
- "value": "partial_only"
193
- },
194
- "transferId": {
195
- "from": "instance",
196
- "path": "refs.authorizeReservationTransferId"
197
- }
198
- },
199
- "capture": {
200
- "capturedAmount": "postedAmount"
201
- },
202
- "key": "post",
203
- "operation": "internal_transfer.post"
204
- }
205
- ],
206
- "publicAction": "captureMoreCardPayment",
207
- "steps": [],
208
- "summary": "Post another strict partial capture slice"
209
- },
210
- "correct_capture": {
211
- "agentDescription": "Return the whole captured amount to the payer after the payment settled. Only a settled payment corrects, and only the party the product authorized may call it. The money moves back and there is no undo.",
212
- "effects": {
213
- "decides": [
214
- {
215
- "signature": "decides.tenant_port",
216
- "source": "port"
217
- }
218
- ],
219
- "moves": [
220
- {
221
- "signature": "moves.transfer.internal",
222
- "source": "moves[0]"
223
- }
224
- ]
225
- },
226
- "moves": [
227
- {
228
- "bind": {
229
- "amount": {
230
- "from": "instance",
231
- "path": "refs.capturedAmount"
232
- },
233
- "currency": {
234
- "from": "const",
235
- "value": "SAR"
236
- },
237
- "destinationAccountId": {
238
- "from": "instance",
239
- "path": "fields.payerAccountId"
240
- },
241
- "metadata.clawbackOfTransferId": {
242
- "from": "instance",
243
- "path": "refs.authorizeReservationTransferId"
244
- },
245
- "metadata.instrumentId": {
246
- "from": "const",
247
- "value": "card_payment"
248
- },
249
- "metadata.instrumentInstanceId": {
250
- "from": "instance",
251
- "path": "instrumentInstanceId"
252
- },
253
- "metadata.phase": {
254
- "from": "const",
255
- "value": "correct_capture"
256
- },
257
- "productId": {
258
- "from": "instance",
259
- "path": "productId"
260
- },
261
- "sourceAccountId": {
262
- "from": "instance",
263
- "path": "fields.payeeAccountId"
264
- }
265
- },
266
- "capture": {
267
- "correctCaptureTransferTransferId": "transferId"
268
- },
269
- "key": "transfer",
270
- "operation": "internal_transfer.create"
271
- }
272
- ],
273
- "port": {
274
- "allowedParties": [
275
- "beneficiary"
276
- ]
277
- },
278
- "publicAction": "correctCaptureCardPayment",
279
- "steps": [],
280
- "summary": "Return the full captured amount on payee correction"
281
- },
282
- "create": {
283
- "agentDescription": "Open the payment row before anything is reserved. The caller supplies the authorizedAmount, the currency, and both party accounts. This reserves nothing, call authorize next.",
284
- "moves": [],
285
- "publicAction": "createCardPayment",
286
- "steps": [],
287
- "summary": "Create a card payment"
288
- },
289
- "expire": {
290
- "due": {
291
- "field": "reserveUntil"
292
- },
293
- "effects": {
294
- "moves": [
295
- {
296
- "signature": "moves.transfer.internal",
297
- "source": "moves[0]"
298
- }
299
- ],
300
- "schedules": [
301
- {
302
- "signature": "schedules.due",
303
- "source": "due"
304
- }
305
- ]
306
- },
307
- "moves": [
308
- {
309
- "bind": {
310
- "reason": {
311
- "from": "const",
312
- "value": "Uncaptured reservation expired"
313
- },
314
- "transferId": {
315
- "from": "instance",
316
- "path": "refs.authorizeReservationTransferId"
317
- }
318
- },
319
- "key": "void",
320
- "operation": "internal_transfer.void"
321
- }
322
- ],
323
- "steps": [],
324
- "summary": "Release an uncaptured reservation at expiry"
325
- },
326
- "reverse_capture": {
327
- "agentDescription": "Return the whole captured amount to the payer on an external reversal. The payment must be settled and the call must land before reversalUntil. The caller passes externalReference, which stays in the receipt. There is no undo.",
328
- "captureInput": {
329
- "externalReference": "externalReference"
330
- },
331
- "deadline": {
332
- "field": "reversalUntil"
333
- },
334
- "effects": {
335
- "decides": [
336
- {
337
- "signature": "decides.tenant_port",
338
- "source": "port"
339
- }
340
- ],
341
- "moves": [
342
- {
343
- "signature": "moves.transfer.internal",
344
- "source": "moves[0]"
345
- }
346
- ],
347
- "schedules": [
348
- {
349
- "signature": "schedules.deadline",
350
- "source": "deadline"
351
- }
352
- ]
353
- },
354
- "input": {
355
- "additionalProperties": false,
356
- "properties": {
357
- "externalReference": {
358
- "description": "Required decision reference retained in the operation receipt",
359
- "maxLength": 180,
360
- "minLength": 1,
361
- "type": "string"
362
- }
363
- },
364
- "required": [
365
- "externalReference"
366
- ],
367
- "type": "object"
368
- },
369
- "moves": [
370
- {
371
- "bind": {
372
- "amount": {
373
- "from": "instance",
374
- "path": "refs.capturedAmount"
375
- },
376
- "currency": {
377
- "from": "const",
378
- "value": "SAR"
379
- },
380
- "destinationAccountId": {
381
- "from": "instance",
382
- "path": "fields.payerAccountId"
383
- },
384
- "metadata.clawbackOfTransferId": {
385
- "from": "instance",
386
- "path": "refs.authorizeReservationTransferId"
387
- },
388
- "metadata.instrumentId": {
389
- "from": "const",
390
- "value": "card_payment"
391
- },
392
- "metadata.instrumentInstanceId": {
393
- "from": "instance",
394
- "path": "instrumentInstanceId"
395
- },
396
- "metadata.phase": {
397
- "from": "const",
398
- "value": "reverse_capture"
399
- },
400
- "productId": {
401
- "from": "instance",
402
- "path": "productId"
403
- },
404
- "sourceAccountId": {
405
- "from": "instance",
406
- "path": "fields.payeeAccountId"
407
- }
408
- },
409
- "capture": {
410
- "reverseCaptureTransferTransferId": "transferId"
411
- },
412
- "key": "transfer",
413
- "operation": "internal_transfer.create"
414
- }
415
- ],
416
- "port": {
417
- "allowedParties": [
418
- "beneficiary"
419
- ]
420
- },
421
- "publicAction": "reverseCaptureCardPayment",
422
- "steps": [],
423
- "summary": "Return the full captured amount on an external reversal"
424
- },
425
- "settle": {
426
- "agentDescription": "Post the whole reserved remainder and finish the payment. The payment must be authorized or partly captured. The money settles and the external reversal window opens on reversalUntil.",
427
- "deadline": {
428
- "field": "reserveUntil"
429
- },
430
- "effects": {
431
- "moves": [
432
- {
433
- "signature": "moves.transfer.internal",
434
- "source": "moves[0]"
435
- }
436
- ],
437
- "schedules": [
438
- {
439
- "signature": "schedules.deadline",
440
- "source": "deadline"
441
- }
442
- ]
443
- },
444
- "moves": [
445
- {
446
- "bind": {
447
- "transferId": {
448
- "from": "instance",
449
- "path": "refs.authorizeReservationTransferId"
450
- }
451
- },
452
- "capture": {
453
- "capturedAmount": "postedAmount"
454
- },
455
- "key": "post",
456
- "operation": "internal_transfer.post"
457
- }
458
- ],
459
- "publicAction": "settleCardPayment",
460
- "setsAt": {
461
- "field": "reversalUntil",
462
- "offset": "P14D"
463
- },
464
- "steps": [],
465
- "summary": "Post the full reserved remainder and settle"
466
- },
467
- "settle_on_expiry": {
468
- "due": {
469
- "field": "reserveUntil"
470
- },
471
- "effects": {
472
- "moves": [
473
- {
474
- "signature": "moves.transfer.internal",
475
- "source": "moves[0]"
476
- }
477
- ],
478
- "schedules": [
479
- {
480
- "signature": "schedules.due",
481
- "source": "due"
482
- }
483
- ]
484
- },
485
- "moves": [
486
- {
487
- "bind": {
488
- "reason": {
489
- "from": "const",
490
- "value": "Uncaptured remainder released at expiry"
491
- },
492
- "transferId": {
493
- "from": "instance",
494
- "path": "refs.authorizeReservationTransferId"
495
- }
496
- },
497
- "key": "void",
498
- "operation": "internal_transfer.void"
499
- }
500
- ],
501
- "setsAt": {
502
- "field": "reversalUntil",
503
- "offset": "P14D"
504
- },
505
- "steps": [],
506
- "summary": "Release the uncaptured remainder and settle captured slices"
507
- },
508
- "void": {
509
- "agentDescription": "Release the reservation whole and cancel the payment. Only an authorized reservation with nothing captured can void. Once any slice is captured, settle it or let it expire instead.",
510
- "effects": {
511
- "moves": [
512
- {
513
- "signature": "moves.transfer.internal",
514
- "source": "moves[0]"
515
- }
516
- ]
517
- },
518
- "moves": [
519
- {
520
- "bind": {
521
- "reason": {
522
- "from": "const",
523
- "value": "Reservation voided before any capture"
524
- },
525
- "transferId": {
526
- "from": "instance",
527
- "path": "refs.authorizeReservationTransferId"
528
- }
529
- },
530
- "key": "void",
531
- "operation": "internal_transfer.void"
532
- }
533
- ],
534
- "publicAction": "voidCardPayment",
535
- "steps": [],
536
- "summary": "Release an entirely uncaptured reservation"
537
- }
538
- },
539
- "agentDescription": "Reach for captured payment when the payee reserves against the payer first and then takes the money in slices before reserveUntil. Pick instant transfer when the whole amount moves at once, and deposit when the reservation is claimed or returned whole.",
540
- "description": "Payer reservation captured by the payee in slices within a fixed window",
541
- "fields": {
542
- "authorizedAmount": {
543
- "description": "Maximum captured amount in SAR minor units",
544
- "pattern": "^[1-9][0-9]{0,17}$",
545
- "type": "string",
546
- "x-hyperscale-currency": "SAR"
547
- },
548
- "currency": {
549
- "description": "ISO 4217 currency code",
550
- "maxLength": 3,
551
- "minLength": 3,
552
- "pattern": "^[A-Z]{3}$",
553
- "type": "string"
554
- },
555
- "payeeAccountId": {
556
- "description": "The payee account",
557
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
558
- "type": "string",
559
- "x-hyperscale-reference-filter": {
560
- "column": "role",
561
- "values": [
562
- "customer_balance"
563
- ]
564
- }
565
- },
566
- "payerAccountId": {
567
- "description": "The payer account",
568
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
569
- "type": "string",
570
- "x-hyperscale-reference-filter": {
571
- "column": "role",
572
- "values": [
573
- "customer_balance"
574
- ]
575
- }
576
- },
577
- "reserveUntil": {
578
- "description": "Reservation expiry that releases any uncaptured remainder",
579
- "format": "hyperscale-date-time",
580
- "type": "string"
581
- },
582
- "reversalUntil": {
583
- "description": "Machine-owned external reversal cutoff anchored when settlement completes",
584
- "format": "hyperscale-date-time",
585
- "type": "string"
586
- }
587
- },
588
- "id": "card_payment",
589
- "idPrefix": "cp",
590
- "lifecycle": {
591
- "initial": "created",
592
- "states": [
593
- "created",
594
- "authorized",
595
- "partially_captured",
596
- "settled",
597
- "voided",
598
- "expired",
599
- "corrected",
600
- "reversed"
601
- ],
602
- "transitions": {
603
- "authorize": {
604
- "from": [
605
- "created"
606
- ],
607
- "to": "authorized"
608
- },
609
- "capture": {
610
- "from": [
611
- "authorized"
612
- ],
613
- "to": "partially_captured"
614
- },
615
- "capture_more": {
616
- "from": [
617
- "partially_captured"
618
- ],
619
- "to": "partially_captured"
620
- },
621
- "correct_capture": {
622
- "from": [
623
- "settled"
624
- ],
625
- "to": "corrected"
626
- },
627
- "expire": {
628
- "from": [
629
- "authorized"
630
- ],
631
- "to": "expired"
632
- },
633
- "reverse_capture": {
634
- "from": [
635
- "settled"
636
- ],
637
- "to": "reversed"
638
- },
639
- "settle": {
640
- "from": [
641
- "authorized",
642
- "partially_captured"
643
- ],
644
- "to": "settled"
645
- },
646
- "settle_on_expiry": {
647
- "from": [
648
- "partially_captured"
649
- ],
650
- "to": "settled"
651
- },
652
- "void": {
653
- "from": [
654
- "authorized"
655
- ],
656
- "to": "voided"
657
- }
658
- }
659
- },
660
- "parties": {
661
- "beneficiary": "payeeAccountId",
662
- "payer": "payerAccountId"
663
- },
664
- "required": [
665
- "payerAccountId",
666
- "payeeAccountId",
667
- "authorizedAmount",
668
- "reserveUntil",
669
- "currency"
670
- ],
671
- "summary": "Capture reservation from payer to payee",
672
- "templateBinding": {
673
- "id": "captured_payment",
674
- "parameters": {
675
- "derivedAmount": false
676
- }
677
- },
678
- "title": "Card payment"
679
- }
680
- ],
681
- "product": "captured_payment_example",
682
- "subjects": [],
683
- "title": "Captured payment example",
684
- "udl": 1,
685
- "version": 1
686
- }
@@ -1,3 +0,0 @@
1
- # conditional_disbursement
2
-
3
- This example applies the `conditional_disbursement` standard-library module. Its sibling UDL file pins the canonical compiler output byte for byte. The company and parties are invented.