@hyperscale0/udl 2.6.1 → 3.0.1

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 (213) hide show
  1. package/CHANGELOG.md +4 -328
  2. package/LICENSING.md +1 -2
  3. package/README.md +3 -114
  4. package/TRADEMARKS.md +2 -2
  5. package/dist/diagnostics.d.ts +21 -201
  6. package/dist/diagnostics.d.ts.map +1 -1
  7. package/dist/diagnostics.js +29 -193
  8. package/dist/diagnostics.js.map +1 -1
  9. package/dist/evolution.d.ts +3 -132
  10. package/dist/evolution.d.ts.map +1 -1
  11. package/dist/evolution.js +29 -633
  12. package/dist/evolution.js.map +1 -1
  13. package/dist/finance.d.ts +5 -72
  14. package/dist/finance.d.ts.map +1 -1
  15. package/dist/finance.js +233 -737
  16. package/dist/finance.js.map +1 -1
  17. package/dist/index.d.ts +7 -18
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +7 -12
  20. package/dist/index.js.map +1 -1
  21. package/dist/instrument-references.d.ts.map +1 -1
  22. package/dist/instrument-references.js +3 -2
  23. package/dist/instrument-references.js.map +1 -1
  24. package/dist/schema.d.ts +2079 -4564
  25. package/dist/schema.d.ts.map +1 -1
  26. package/dist/schema.js +270 -1609
  27. package/dist/schema.js.map +1 -1
  28. package/dist/validation.d.ts +8 -104
  29. package/dist/validation.d.ts.map +1 -1
  30. package/dist/validation.js +653 -3271
  31. package/dist/validation.js.map +1 -1
  32. package/docs/README.md +148 -14
  33. package/package.json +7 -11
  34. package/spec/README.md +152 -164
  35. package/spec/darb.udl.json +249 -0
  36. package/spec/udl.schema.json +4104 -3202
  37. package/src/diagnostics.ts +51 -246
  38. package/src/evolution.ts +39 -1045
  39. package/src/finance.ts +287 -1127
  40. package/src/index.ts +18 -142
  41. package/src/instrument-references.ts +3 -2
  42. package/src/schema.ts +285 -1843
  43. package/src/validation.ts +870 -5611
  44. package/conformance/README.md +0 -82
  45. package/conformance/evolution/action-contract.expected.json +0 -10
  46. package/conformance/evolution/action-contract.live.udl +0 -44
  47. package/conformance/evolution/action-contract.next.udl +0 -45
  48. package/conformance/evolution/product-identity.expected.json +0 -10
  49. package/conformance/evolution/product-identity.live.udl +0 -55
  50. package/conformance/evolution/product-identity.next.udl +0 -55
  51. package/conformance/evolution/version-required.expected.json +0 -10
  52. package/conformance/evolution/version-required.live.udl +0 -55
  53. package/conformance/evolution/version-required.next.udl +0 -58
  54. package/conformance/invalid/action-without-transition.expected.json +0 -10
  55. package/conformance/invalid/action-without-transition.udl +0 -60
  56. package/conformance/invalid/agent-description-too-long.expected.json +0 -10
  57. package/conformance/invalid/agent-description-too-long.udl +0 -57
  58. package/conformance/invalid/blank-title.expected.json +0 -10
  59. package/conformance/invalid/blank-title.udl +0 -54
  60. package/conformance/invalid/call-binds-results.expected.json +0 -10
  61. package/conformance/invalid/call-binds-results.udl +0 -314
  62. package/conformance/invalid/call-unknown-action.expected.json +0 -10
  63. package/conformance/invalid/call-unknown-action.udl +0 -314
  64. package/conformance/invalid/composition-dial-duplicate-key.expected.json +0 -10
  65. package/conformance/invalid/composition-dial-duplicate-key.udl +0 -73
  66. package/conformance/invalid/depth-budget.expected.json +0 -10
  67. package/conformance/invalid/depth-budget.udl +0 -49
  68. package/conformance/invalid/duplicate-subject.expected.json +0 -10
  69. package/conformance/invalid/duplicate-subject.udl +0 -230
  70. package/conformance/invalid/forged-effects.expected.json +0 -10
  71. package/conformance/invalid/forged-effects.udl +0 -76
  72. package/conformance/invalid/format-version.expected.json +0 -10
  73. package/conformance/invalid/format-version.udl +0 -54
  74. package/conformance/invalid/instrument-id-not-snake-case.expected.json +0 -10
  75. package/conformance/invalid/instrument-id-not-snake-case.udl +0 -54
  76. package/conformance/invalid/invalid-aggregate-gate-shape.expected.json +0 -10
  77. package/conformance/invalid/invalid-aggregate-gate-shape.udl +0 -1819
  78. package/conformance/invalid/invalid-check-duration.expected.json +0 -10
  79. package/conformance/invalid/invalid-check-duration.udl +0 -219
  80. package/conformance/invalid/invalid-dial-anchor.expected.json +0 -10
  81. package/conformance/invalid/invalid-dial-anchor.udl +0 -219
  82. package/conformance/invalid/invalid-exception-parent-ref.expected.json +0 -10
  83. package/conformance/invalid/invalid-exception-parent-ref.udl +0 -2487
  84. package/conformance/invalid/invalid-exposure-shape.expected.json +0 -10
  85. package/conformance/invalid/invalid-exposure-shape.udl +0 -1819
  86. package/conformance/invalid/invalid-journeys.expected.json +0 -10
  87. package/conformance/invalid/invalid-journeys.udl +0 -77
  88. package/conformance/invalid/invalid-remainder.expected.json +0 -10
  89. package/conformance/invalid/invalid-remainder.udl +0 -220
  90. package/conformance/invalid/invalid-schema-keyword.expected.json +0 -10
  91. package/conformance/invalid/invalid-schema-keyword.udl +0 -220
  92. package/conformance/invalid/invalid-utf8.expected.json +0 -10
  93. package/conformance/invalid/invalid-utf8.udl +0 -1
  94. package/conformance/invalid/leaf-effect-mismatch.expected.json +0 -10
  95. package/conformance/invalid/leaf-effect-mismatch.udl +0 -314
  96. package/conformance/invalid/malformed-json.expected.json +0 -10
  97. package/conformance/invalid/malformed-json.udl +0 -1
  98. package/conformance/invalid/missing-create-action.expected.json +0 -10
  99. package/conformance/invalid/missing-create-action.udl +0 -48
  100. package/conformance/invalid/missing-exception-amount-field.expected.json +0 -10
  101. package/conformance/invalid/missing-exception-amount-field.udl +0 -2487
  102. package/conformance/invalid/missing-exception-contract.expected.json +0 -14
  103. package/conformance/invalid/missing-exception-contract.udl +0 -2523
  104. package/conformance/invalid/missing-exception-reason-field.expected.json +0 -10
  105. package/conformance/invalid/missing-exception-reason-field.udl +0 -2487
  106. package/conformance/invalid/not-an-object.expected.json +0 -10
  107. package/conformance/invalid/not-an-object.udl +0 -1
  108. package/conformance/invalid/payout-reconcile-not-a-bank-debit.expected.json +0 -10
  109. package/conformance/invalid/payout-reconcile-not-a-bank-debit.udl +0 -259
  110. package/conformance/invalid/piece-plan-without-partition.expected.json +0 -10
  111. package/conformance/invalid/piece-plan-without-partition.udl +0 -305
  112. package/conformance/invalid/private-action-independent-approval.expected.json +0 -10
  113. package/conformance/invalid/private-action-independent-approval.udl +0 -314
  114. package/conformance/invalid/quote-freeze-set-incomplete.expected.json +0 -10
  115. package/conformance/invalid/quote-freeze-set-incomplete.udl +0 -261
  116. package/conformance/invalid/quote-named-reference-gate.expected.json +0 -10
  117. package/conformance/invalid/quote-named-reference-gate.udl +0 -50
  118. package/conformance/invalid/reconcile-named-reference-gate.expected.json +0 -10
  119. package/conformance/invalid/reconcile-named-reference-gate.udl +0 -50
  120. package/conformance/invalid/unfund-order-not-reversed.expected.json +0 -10
  121. package/conformance/invalid/unfund-order-not-reversed.udl +0 -314
  122. package/conformance/invalid/unknown-key.expected.json +0 -10
  123. package/conformance/invalid/unknown-key.udl +0 -55
  124. package/conformance/invalid/unknown-reference-gate-field.expected.json +0 -10
  125. package/conformance/invalid/unknown-reference-gate-field.udl +0 -1819
  126. package/conformance/invalid/unknown-required-field.expected.json +0 -10
  127. package/conformance/invalid/unknown-required-field.udl +0 -220
  128. package/conformance/invalid/unreachable-state.expected.json +0 -10
  129. package/conformance/invalid/unreachable-state.udl +0 -55
  130. package/conformance/invalid/wrong-exception-amount-field.expected.json +0 -10
  131. package/conformance/invalid/wrong-exception-amount-field.udl +0 -2487
  132. package/conformance/invalid/wrong-exception-reason-field.expected.json +0 -10
  133. package/conformance/invalid/wrong-exception-reason-field.udl +0 -2487
  134. package/conformance/valid/agent-description.expected.json +0 -6
  135. package/conformance/valid/agent-description.udl +0 -66
  136. package/conformance/valid/attested.expected.json +0 -6
  137. package/conformance/valid/attested.udl +0 -251
  138. package/conformance/valid/cards.expected.json +0 -6
  139. package/conformance/valid/cards.udl +0 -1579
  140. package/conformance/valid/commerce-escrow.expected.json +0 -6
  141. package/conformance/valid/commerce-escrow.udl +0 -1512
  142. package/conformance/valid/compiled-crowdfunding.expected.json +0 -6
  143. package/conformance/valid/compiled-crowdfunding.udl +0 -1843
  144. package/conformance/valid/compiled-watch-club.expected.json +0 -6
  145. package/conformance/valid/compiled-watch-club.udl +0 -2486
  146. package/conformance/valid/complete-contract.expected.json +0 -6
  147. package/conformance/valid/complete-contract.udl +0 -218
  148. package/conformance/valid/effect-signatures.expected.json +0 -6
  149. package/conformance/valid/effect-signatures.udl +0 -75
  150. package/conformance/valid/hand-edited.expected.json +0 -6
  151. package/conformance/valid/hand-edited.udl +0 -1
  152. package/conformance/valid/insured-car-marketplace.expected.json +0 -6
  153. package/conformance/valid/insured-car-marketplace.udl +0 -1050
  154. package/conformance/valid/insured-travel.expected.json +0 -6
  155. package/conformance/valid/insured-travel.udl +0 -3469
  156. package/conformance/valid/minimal.expected.json +0 -6
  157. package/conformance/valid/minimal.udl +0 -62
  158. package/conformance/valid/piece-plan-calls.expected.json +0 -6
  159. package/conformance/valid/piece-plan-calls.udl +0 -314
  160. package/conformance/valid/protection.expected.json +0 -6
  161. package/conformance/valid/protection.udl +0 -1551
  162. package/conformance/valid/string-escaping.expected.json +0 -6
  163. package/conformance/valid/string-escaping.udl +0 -54
  164. package/conformance/valid/vocabulary.expected.json +0 -6
  165. package/conformance/valid/vocabulary.udl +0 -2012
  166. package/dist/allocation.d.ts +0 -60
  167. package/dist/allocation.d.ts.map +0 -1
  168. package/dist/allocation.js +0 -177
  169. package/dist/allocation.js.map +0 -1
  170. package/dist/check-profiles.d.ts +0 -57
  171. package/dist/check-profiles.d.ts.map +0 -1
  172. package/dist/check-profiles.js +0 -62
  173. package/dist/check-profiles.js.map +0 -1
  174. package/dist/distribution.d.ts +0 -15
  175. package/dist/distribution.d.ts.map +0 -1
  176. package/dist/distribution.js +0 -49
  177. package/dist/distribution.js.map +0 -1
  178. package/dist/effects.d.ts +0 -58
  179. package/dist/effects.d.ts.map +0 -1
  180. package/dist/effects.js +0 -1126
  181. package/dist/effects.js.map +0 -1
  182. package/dist/reference.d.ts +0 -3
  183. package/dist/reference.d.ts.map +0 -1
  184. package/dist/reference.js +0 -28
  185. package/dist/reference.js.map +0 -1
  186. package/dist/vocabulary.d.ts +0 -23
  187. package/dist/vocabulary.d.ts.map +0 -1
  188. package/dist/vocabulary.js +0 -1052
  189. package/dist/vocabulary.js.map +0 -1
  190. package/docs/funding-custody.md +0 -165
  191. package/docs/guide/01-a-document.md +0 -37
  192. package/docs/guide/02-money-steps.md +0 -23
  193. package/docs/guide/03-laws.md +0 -18
  194. package/docs/guide/04-fees-and-remainder.md +0 -36
  195. package/docs/guide/05-checks-updates-dials.md +0 -7
  196. package/docs/guide/06-effects.md +0 -11
  197. package/docs/guide/07-evolution.md +0 -11
  198. package/docs/guide/08-implementing.md +0 -13
  199. package/docs/guide/09-schedules-and-allocation.md +0 -132
  200. package/docs/llms-full.txt +0 -2008
  201. package/docs/llms.txt +0 -14
  202. package/docs/piece-plans.md +0 -148
  203. package/docs/reference/canonical.md +0 -16
  204. package/docs/reference/clauses.md +0 -1585
  205. package/docs/reference/cli.md +0 -24
  206. package/docs/reference/diagnostics.md +0 -38
  207. package/skills/udl/SKILL.md +0 -28
  208. package/src/allocation.ts +0 -259
  209. package/src/check-profiles.ts +0 -80
  210. package/src/distribution.ts +0 -61
  211. package/src/effects.ts +0 -1920
  212. package/src/reference.ts +0 -31
  213. package/src/vocabulary.ts +0 -1635
@@ -1,2012 +0,0 @@
1
- {
2
- "instruments": [
3
- {
4
- "actionOrder": [
5
- "payoff",
6
- "write_off",
7
- "create",
8
- "close"
9
- ],
10
- "actions": {
11
- "close": {
12
- "agentDescription": "Close when the declared count and schedule hold.",
13
- "cascade": [
14
- {
15
- "action": "close",
16
- "inputField": "sliceIds",
17
- "instrumentId": "slice"
18
- }
19
- ],
20
- "effects": {
21
- "decides": [
22
- {
23
- "signature": "decides.cascade_transition",
24
- "source": "cascade[0]"
25
- }
26
- ],
27
- "reads": [
28
- {
29
- "signature": "reads.requires_aggregate",
30
- "source": "requiresAggregate"
31
- }
32
- ]
33
- },
34
- "moves": [],
35
- "publicAction": "closeCover",
36
- "requiresAggregate": [
37
- {
38
- "check": {
39
- "kind": "count_at_least",
40
- "targetField": "minimumMissed"
41
- },
42
- "instrumentId": "slice",
43
- "over": "children",
44
- "refField": "coverId",
45
- "statuses": [
46
- "closed"
47
- ]
48
- },
49
- {
50
- "check": {
51
- "field": "dueAt",
52
- "kind": "ordered",
53
- "positionField": "position"
54
- },
55
- "instrumentId": "slice",
56
- "over": "children",
57
- "refField": "coverId",
58
- "statuses": [
59
- "open"
60
- ]
61
- },
62
- {
63
- "check": {
64
- "amounts": [
65
- {
66
- "amountField": "principal",
67
- "totalField": "principal"
68
- },
69
- {
70
- "amountField": "profit",
71
- "totalField": "profit"
72
- }
73
- ],
74
- "dateField": "dueAt",
75
- "datesField": "dates",
76
- "kind": "schedule",
77
- "positionField": "position",
78
- "remainder": "first"
79
- },
80
- "instrumentId": "slice",
81
- "over": "children",
82
- "refField": "coverId",
83
- "statuses": [
84
- "open"
85
- ]
86
- }
87
- ],
88
- "steps": [],
89
- "summary": "Close instrument"
90
- },
91
- "create": {
92
- "agentDescription": "Record the signed cover terms.",
93
- "moves": [],
94
- "publicAction": "createCover",
95
- "requiresExposure": [
96
- {
97
- "amountField": "principal",
98
- "anchorField": "limitId",
99
- "capField": "cap",
100
- "capOnAnchor": true,
101
- "childInstrumentId": "cover",
102
- "measure": {
103
- "allocation": "principal"
104
- },
105
- "statuses": [
106
- "open"
107
- ]
108
- }
109
- ],
110
- "steps": [],
111
- "summary": "Create instrument"
112
- },
113
- "payoff": {
114
- "agentDescription": "Compute this obligation's payoff from its remaining balances.",
115
- "allocate": {
116
- "capture": "payoffReceipt",
117
- "mode": "payoff",
118
- "paymentIdentityField": "paymentIdentity",
119
- "sourceAccountField": "payerAccount"
120
- },
121
- "effects": {
122
- "decides": [
123
- {
124
- "signature": "decides.allocation",
125
- "source": "allocate"
126
- }
127
- ],
128
- "moves": [
129
- {
130
- "signature": "moves.allocation",
131
- "source": "allocate"
132
- }
133
- ]
134
- },
135
- "input": {
136
- "additionalProperties": false,
137
- "properties": {
138
- "payerAccount": {
139
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
140
- "type": "string"
141
- },
142
- "paymentIdentity": {
143
- "minLength": 1,
144
- "type": "string"
145
- }
146
- },
147
- "required": [
148
- "payerAccount",
149
- "paymentIdentity"
150
- ],
151
- "type": "object"
152
- },
153
- "moves": [],
154
- "publicAction": "payoffCover",
155
- "steps": [],
156
- "summary": "Payoff instrument"
157
- },
158
- "write_off": {
159
- "agentDescription": "Cancel this obligation without cash.",
160
- "allocate": {
161
- "capture": "loss",
162
- "mode": "write_off"
163
- },
164
- "effects": {
165
- "decides": [
166
- {
167
- "signature": "decides.allocation",
168
- "source": "allocate"
169
- }
170
- ]
171
- },
172
- "moves": [],
173
- "publicAction": "writeOffCover",
174
- "steps": [],
175
- "summary": "Write Off instrument"
176
- }
177
- },
178
- "agentDescription": "Freeze the signed dates and amounts before admitting slices.",
179
- "allocation": {
180
- "buckets": [
181
- {
182
- "key": "principal",
183
- "source": {
184
- "amountField": "principal",
185
- "destinationField": "receiver",
186
- "from": "slice"
187
- }
188
- },
189
- {
190
- "key": "profit",
191
- "source": {
192
- "amountField": "profit",
193
- "destinationField": "receiver",
194
- "from": "slice"
195
- }
196
- },
197
- {
198
- "key": "cost",
199
- "source": {
200
- "amountField": "amount",
201
- "destinationField": "receiver",
202
- "from": "children",
203
- "parameters": {
204
- "cost": true
205
- },
206
- "refField": "sliceId",
207
- "statuses": [
208
- "open"
209
- ],
210
- "template": "assessment"
211
- }
212
- }
213
- ],
214
- "dueField": "dueAt",
215
- "earningRuleField": "earningRule",
216
- "positionField": "position",
217
- "sliceInstrumentId": "slice",
218
- "sliceRefField": "coverId",
219
- "sliceStatuses": [
220
- "open"
221
- ]
222
- },
223
- "dateOrder": [
224
- {
225
- "afterField": "end",
226
- "beforeField": "start",
227
- "operator": "<"
228
- }
229
- ],
230
- "fields": {
231
- "currency": {
232
- "description": "ISO 4217 currency code",
233
- "maxLength": 3,
234
- "minLength": 3,
235
- "pattern": "^[A-Z]{3}$",
236
- "type": "string"
237
- },
238
- "dates": {
239
- "items": {
240
- "format": "hyperscale-date-time",
241
- "type": "string"
242
- },
243
- "maxItems": 366,
244
- "minItems": 1,
245
- "type": "array"
246
- },
247
- "earningRule": {
248
- "enum": [
249
- "per_slice_on_due",
250
- "on_disbursement"
251
- ],
252
- "type": "string"
253
- },
254
- "end": {
255
- "format": "hyperscale-date-time",
256
- "type": "string"
257
- },
258
- "limitId": {
259
- "pattern": "^lim_(sandbox|live)_[a-z0-9]{8,64}$",
260
- "type": "string"
261
- },
262
- "minimumMissed": {
263
- "maximum": 1,
264
- "minimum": 1,
265
- "type": "integer"
266
- },
267
- "principal": {
268
- "pattern": "^[1-9][0-9]{0,17}$",
269
- "type": "string",
270
- "x-hyperscale-currency": "SAR"
271
- },
272
- "profit": {
273
- "pattern": "^[1-9][0-9]{0,17}$",
274
- "type": "string",
275
- "x-hyperscale-currency": "SAR"
276
- },
277
- "start": {
278
- "format": "hyperscale-date-time",
279
- "type": "string"
280
- }
281
- },
282
- "id": "cover",
283
- "idPrefix": "cvr",
284
- "lifecycle": {
285
- "initial": "open",
286
- "states": [
287
- "open",
288
- "closed"
289
- ],
290
- "transitions": {
291
- "close": {
292
- "from": [
293
- "open"
294
- ],
295
- "to": "closed"
296
- },
297
- "payoff": {
298
- "from": [
299
- "open"
300
- ],
301
- "to": "closed"
302
- },
303
- "write_off": {
304
- "from": [
305
- "open"
306
- ],
307
- "to": "closed"
308
- }
309
- }
310
- },
311
- "required": [
312
- "limitId",
313
- "start",
314
- "end",
315
- "minimumMissed",
316
- "principal",
317
- "profit",
318
- "dates",
319
- "earningRule",
320
- "currency"
321
- ],
322
- "summary": "Cover instrument",
323
- "title": "Cover"
324
- },
325
- {
326
- "actionOrder": [
327
- "create",
328
- "close"
329
- ],
330
- "actions": {
331
- "close": {
332
- "due": {
333
- "field": "dueAt",
334
- "offset": {
335
- "field": "grace"
336
- }
337
- },
338
- "effects": {
339
- "decides": [
340
- {
341
- "signature": "decides.allocation",
342
- "source": "requiresAllocation"
343
- },
344
- {
345
- "signature": "decides.referenced_transition",
346
- "source": "transitionsRefs[0]"
347
- }
348
- ],
349
- "schedules": [
350
- {
351
- "signature": "schedules.due",
352
- "source": "due"
353
- }
354
- ]
355
- },
356
- "moves": [],
357
- "requiresAllocation": {
358
- "buckets": [
359
- "principal",
360
- "profit"
361
- ],
362
- "check": "settled",
363
- "refField": "coverId",
364
- "slice": "self"
365
- },
366
- "steps": [],
367
- "summary": "Close instrument",
368
- "transitionsRefs": [
369
- {
370
- "action": "close",
371
- "field": "coverId"
372
- }
373
- ]
374
- },
375
- "create": {
376
- "agentDescription": "Check both signed bounds and the assessment kind.",
377
- "effects": {
378
- "reads": [
379
- {
380
- "signature": "reads.requires_refs",
381
- "source": "requiresRefs"
382
- }
383
- ]
384
- },
385
- "moves": [],
386
- "publicAction": "createSlice",
387
- "requiresRefs": [
388
- {
389
- "dateComparison": {
390
- "localPath": "fields.start",
391
- "operator": ">=",
392
- "referencedPath": "fields.start"
393
- },
394
- "field": "coverId",
395
- "statuses": [
396
- "open"
397
- ],
398
- "unique": {
399
- "byFields": [
400
- "kind"
401
- ],
402
- "namespace": "assessment"
403
- }
404
- },
405
- {
406
- "dateComparison": {
407
- "localPath": "fields.end",
408
- "operator": "<=",
409
- "referencedPath": "fields.end"
410
- },
411
- "field": "coverId",
412
- "statuses": [
413
- "open"
414
- ]
415
- }
416
- ],
417
- "steps": [],
418
- "summary": "Create instrument"
419
- }
420
- },
421
- "agentDescription": "Keep one premium and its signed interval.",
422
- "derivedAmounts": [
423
- {
424
- "field": "commission",
425
- "rounding": "floor",
426
- "rule": {
427
- "bps": {
428
- "field": "rate"
429
- },
430
- "kind": "percentage_of"
431
- },
432
- "sourceField": "premium"
433
- },
434
- {
435
- "field": "charge",
436
- "rounding": "floor",
437
- "rule": {
438
- "capField": "cap",
439
- "kind": "minimum"
440
- },
441
- "sourceField": "cost"
442
- }
443
- ],
444
- "fields": {
445
- "cap": {
446
- "pattern": "^[1-9][0-9]{0,17}$",
447
- "type": "string",
448
- "x-hyperscale-currency": "SAR"
449
- },
450
- "charge": {
451
- "pattern": "^(0|[1-9][0-9]{0,17})$",
452
- "type": "string",
453
- "x-hyperscale-currency": "SAR"
454
- },
455
- "commission": {
456
- "pattern": "^(0|[1-9][0-9]{0,17})$",
457
- "type": "string",
458
- "x-hyperscale-currency": "SAR"
459
- },
460
- "cost": {
461
- "pattern": "^[1-9][0-9]{0,17}$",
462
- "type": "string",
463
- "x-hyperscale-currency": "SAR"
464
- },
465
- "coverId": {
466
- "pattern": "^cvr_(sandbox|live)_[a-z0-9]{8,64}$",
467
- "type": "string"
468
- },
469
- "currency": {
470
- "description": "ISO 4217 currency code",
471
- "maxLength": 3,
472
- "minLength": 3,
473
- "pattern": "^[A-Z]{3}$",
474
- "type": "string"
475
- },
476
- "dueAt": {
477
- "format": "hyperscale-date-time",
478
- "type": "string"
479
- },
480
- "end": {
481
- "format": "hyperscale-date-time",
482
- "type": "string"
483
- },
484
- "grace": {
485
- "enum": [
486
- "P3D",
487
- "P7D"
488
- ],
489
- "type": "string"
490
- },
491
- "kind": {
492
- "enum": [
493
- "fine",
494
- "cost"
495
- ],
496
- "type": "string"
497
- },
498
- "position": {
499
- "maximum": 366,
500
- "minimum": 1,
501
- "type": "integer"
502
- },
503
- "premium": {
504
- "pattern": "^[1-9][0-9]{0,17}$",
505
- "type": "string",
506
- "x-hyperscale-currency": "SAR"
507
- },
508
- "principal": {
509
- "pattern": "^[1-9][0-9]{0,17}$",
510
- "type": "string",
511
- "x-hyperscale-currency": "SAR"
512
- },
513
- "profit": {
514
- "pattern": "^[1-9][0-9]{0,17}$",
515
- "type": "string",
516
- "x-hyperscale-currency": "SAR"
517
- },
518
- "rate": {
519
- "maximum": 1000,
520
- "minimum": 500,
521
- "type": "integer"
522
- },
523
- "receiver": {
524
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
525
- "type": "string"
526
- },
527
- "start": {
528
- "format": "hyperscale-date-time",
529
- "type": "string"
530
- }
531
- },
532
- "id": "slice",
533
- "idPrefix": "slc",
534
- "lifecycle": {
535
- "initial": "open",
536
- "states": [
537
- "open",
538
- "closed"
539
- ],
540
- "transitions": {
541
- "close": {
542
- "from": [
543
- "open"
544
- ],
545
- "to": "closed"
546
- }
547
- }
548
- },
549
- "required": [
550
- "coverId",
551
- "start",
552
- "end",
553
- "dueAt",
554
- "position",
555
- "principal",
556
- "profit",
557
- "premium",
558
- "cost",
559
- "cap",
560
- "rate",
561
- "grace",
562
- "kind",
563
- "receiver",
564
- "currency"
565
- ],
566
- "summary": "Slice instrument",
567
- "title": "Slice"
568
- },
569
- {
570
- "actionOrder": [
571
- "create",
572
- "close"
573
- ],
574
- "actions": {
575
- "close": {
576
- "agentDescription": "Close this claim.",
577
- "moves": [],
578
- "publicAction": "closeClaim",
579
- "steps": [],
580
- "summary": "Close coverId"
581
- },
582
- "create": {
583
- "agentDescription": "Read the cover's due premiums under the admission clock.",
584
- "effects": {
585
- "reads": [
586
- {
587
- "signature": "reads.requires_aggregate",
588
- "source": "requiresAggregate"
589
- }
590
- ]
591
- },
592
- "moves": [],
593
- "publicAction": "createClaim",
594
- "requiresAggregate": [
595
- {
596
- "anchorField": "coverId",
597
- "check": {
598
- "kind": "count_exactly",
599
- "value": 0
600
- },
601
- "dueBefore": {
602
- "field": "dueAt"
603
- },
604
- "instrumentId": "slice",
605
- "over": "siblings",
606
- "refField": "coverId",
607
- "statuses": [
608
- "open"
609
- ]
610
- }
611
- ],
612
- "steps": [],
613
- "summary": "Create coverId"
614
- }
615
- },
616
- "agentDescription": "Refuse a claim while a sibling premium is unpaid past due.",
617
- "fields": {
618
- "coverId": {
619
- "pattern": "^cvr_(sandbox|live)_[a-z0-9]{8,64}$",
620
- "type": "string"
621
- }
622
- },
623
- "id": "claim",
624
- "idPrefix": "clm",
625
- "lifecycle": {
626
- "initial": "open",
627
- "states": [
628
- "open",
629
- "closed"
630
- ],
631
- "transitions": {
632
- "close": {
633
- "from": [
634
- "open"
635
- ],
636
- "to": "closed"
637
- }
638
- }
639
- },
640
- "required": [
641
- "coverId"
642
- ],
643
- "summary": "Claim instrument",
644
- "title": "Claim"
645
- },
646
- {
647
- "actionOrder": [
648
- "create",
649
- "close"
650
- ],
651
- "actions": {
652
- "close": {
653
- "agentDescription": "Allocate this payment to outstanding debt once.",
654
- "allocate": {
655
- "amountField": "amount",
656
- "capture": "allocationReceipt",
657
- "mode": "payment",
658
- "paymentIdentityField": "paymentIdentity",
659
- "refField": "coverId",
660
- "sourceAccountField": "payer"
661
- },
662
- "effects": {
663
- "decides": [
664
- {
665
- "signature": "decides.allocation",
666
- "source": "allocate"
667
- }
668
- ],
669
- "moves": [
670
- {
671
- "signature": "moves.allocation",
672
- "source": "allocate"
673
- }
674
- ]
675
- },
676
- "moves": [],
677
- "publicAction": "closePayment",
678
- "steps": [],
679
- "summary": "Close instrument"
680
- },
681
- "create": {
682
- "agentDescription": "Record one payment identity.",
683
- "moves": [],
684
- "publicAction": "createPayment",
685
- "steps": [],
686
- "summary": "Create instrument"
687
- }
688
- },
689
- "agentDescription": "Allocate one identified payment through the obligation's bucket rules.",
690
- "fields": {
691
- "amount": {
692
- "pattern": "^[1-9][0-9]{0,17}$",
693
- "type": "string",
694
- "x-hyperscale-currency": "SAR"
695
- },
696
- "coverId": {
697
- "pattern": "^cvr_(sandbox|live)_[a-z0-9]{8,64}$",
698
- "type": "string"
699
- },
700
- "currency": {
701
- "description": "ISO 4217 currency code",
702
- "maxLength": 3,
703
- "minLength": 3,
704
- "pattern": "^[A-Z]{3}$",
705
- "type": "string"
706
- },
707
- "payer": {
708
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
709
- "type": "string"
710
- },
711
- "paymentIdentity": {
712
- "maxLength": 128,
713
- "minLength": 1,
714
- "type": "string"
715
- }
716
- },
717
- "id": "payment",
718
- "idPrefix": "pmt",
719
- "lifecycle": {
720
- "initial": "open",
721
- "states": [
722
- "open",
723
- "closed"
724
- ],
725
- "transitions": {
726
- "close": {
727
- "from": [
728
- "open"
729
- ],
730
- "to": "closed"
731
- }
732
- }
733
- },
734
- "required": [
735
- "coverId",
736
- "amount",
737
- "payer",
738
- "paymentIdentity",
739
- "currency"
740
- ],
741
- "summary": "Payment instrument",
742
- "title": "Payment"
743
- },
744
- {
745
- "actionOrder": [
746
- "create",
747
- "fund",
748
- "refund",
749
- "release"
750
- ],
751
- "actions": {
752
- "create": {
753
- "agentDescription": "Open the held account for these contributions.",
754
- "moves": [],
755
- "publicAction": "createJoinedSettlement",
756
- "steps": [
757
- {
758
- "bind": {
759
- "currency": {
760
- "from": "const",
761
- "value": "SAR"
762
- },
763
- "productId": {
764
- "from": "instance",
765
- "path": "productId"
766
- }
767
- },
768
- "capture": {
769
- "hold": "accountId"
770
- },
771
- "operation": "account.escrow.provision"
772
- }
773
- ],
774
- "summary": "Create instrument"
775
- },
776
- "fund": {
777
- "agentDescription": "Fund all contributions together.",
778
- "contributionStage": {
779
- "accountPath": "refs.hold",
780
- "stage": "fund"
781
- },
782
- "effects": {
783
- "moves": [
784
- {
785
- "signature": "moves.transfer.internal",
786
- "source": "contributionStage"
787
- }
788
- ]
789
- },
790
- "moves": [],
791
- "publicAction": "fundJoinedSettlement",
792
- "steps": [],
793
- "summary": "Fund instrument"
794
- },
795
- "refund": {
796
- "agentDescription": "Refund all contributions to their original accounts.",
797
- "contributionStage": {
798
- "accountPath": "refs.hold",
799
- "stage": "refund"
800
- },
801
- "effects": {
802
- "moves": [
803
- {
804
- "signature": "moves.transfer.internal",
805
- "source": "contributionStage"
806
- }
807
- ]
808
- },
809
- "moves": [],
810
- "publicAction": "refundJoinedSettlement",
811
- "steps": [],
812
- "summary": "Refund instrument"
813
- },
814
- "release": {
815
- "agentDescription": "Release the complete seller, fee and tax partition.",
816
- "effects": {
817
- "moves": [
818
- {
819
- "signature": "moves.transfer.internal",
820
- "source": "moves[0]"
821
- },
822
- {
823
- "signature": "moves.transfer.internal",
824
- "source": "moves[1]"
825
- },
826
- {
827
- "signature": "moves.transfer.internal",
828
- "source": "moves[2]"
829
- }
830
- ]
831
- },
832
- "moves": [
833
- {
834
- "bind": {
835
- "amount": {
836
- "from": "instance",
837
- "path": "fields.sellerNet"
838
- },
839
- "currency": {
840
- "from": "const",
841
- "value": "SAR"
842
- },
843
- "destinationAccountId": {
844
- "from": "instance",
845
- "path": "fields.seller"
846
- },
847
- "productId": {
848
- "from": "instance",
849
- "path": "productId"
850
- },
851
- "sourceAccountId": {
852
- "from": "instance",
853
- "path": "refs.hold"
854
- }
855
- },
856
- "key": "net",
857
- "operation": "internal_transfer.create"
858
- },
859
- {
860
- "bind": {
861
- "amount": {
862
- "from": "instance",
863
- "path": "fields.sellerFee"
864
- },
865
- "currency": {
866
- "from": "const",
867
- "value": "SAR"
868
- },
869
- "destinationAccountId": {
870
- "from": "instance",
871
- "path": "fields.feeAccount"
872
- },
873
- "productId": {
874
- "from": "instance",
875
- "path": "productId"
876
- },
877
- "sourceAccountId": {
878
- "from": "instance",
879
- "path": "refs.hold"
880
- }
881
- },
882
- "key": "fee",
883
- "operation": "internal_transfer.create"
884
- },
885
- {
886
- "bind": {
887
- "amount": {
888
- "from": "instance",
889
- "path": "fields.tax"
890
- },
891
- "currency": {
892
- "from": "const",
893
- "value": "SAR"
894
- },
895
- "destinationAccountId": {
896
- "from": "instance",
897
- "path": "fields.taxAccount"
898
- },
899
- "productId": {
900
- "from": "instance",
901
- "path": "productId"
902
- },
903
- "sourceAccountId": {
904
- "from": "instance",
905
- "path": "refs.hold"
906
- }
907
- },
908
- "key": "tax",
909
- "operation": "internal_transfer.create"
910
- }
911
- ],
912
- "publicAction": "releaseJoinedSettlement",
913
- "steps": [],
914
- "summary": "Release instrument"
915
- }
916
- },
917
- "agentDescription": "Fund one held balance from an immutable list and refund each origin.",
918
- "contributions": {
919
- "accountKey": "origin",
920
- "amountKey": "amount",
921
- "field": "contributions",
922
- "totalField": "price"
923
- },
924
- "fields": {
925
- "buyerPart": {
926
- "pattern": "^[1-9][0-9]{0,17}$",
927
- "type": "string",
928
- "x-hyperscale-currency": "SAR"
929
- },
930
- "contributions": {
931
- "items": {
932
- "additionalProperties": false,
933
- "properties": {
934
- "amount": {
935
- "pattern": "^[1-9][0-9]{0,17}$",
936
- "type": "string",
937
- "x-hyperscale-currency": "SAR"
938
- },
939
- "origin": {
940
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
941
- "type": "string"
942
- }
943
- },
944
- "required": [
945
- "amount",
946
- "origin"
947
- ],
948
- "type": "object"
949
- },
950
- "maxItems": 256,
951
- "minItems": 1,
952
- "type": "array"
953
- },
954
- "currency": {
955
- "const": "SAR",
956
- "type": "string"
957
- },
958
- "feeAccount": {
959
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
960
- "type": "string"
961
- },
962
- "funderPart": {
963
- "pattern": "^[1-9][0-9]{0,17}$",
964
- "type": "string",
965
- "x-hyperscale-currency": "SAR"
966
- },
967
- "price": {
968
- "pattern": "^[1-9][0-9]{0,17}$",
969
- "type": "string",
970
- "x-hyperscale-currency": "SAR"
971
- },
972
- "seller": {
973
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
974
- "type": "string"
975
- },
976
- "sellerFee": {
977
- "pattern": "^[1-9][0-9]{0,17}$",
978
- "type": "string",
979
- "x-hyperscale-currency": "SAR"
980
- },
981
- "sellerNet": {
982
- "pattern": "^[1-9][0-9]{0,17}$",
983
- "type": "string",
984
- "x-hyperscale-currency": "SAR"
985
- },
986
- "tax": {
987
- "pattern": "^[1-9][0-9]{0,17}$",
988
- "type": "string",
989
- "x-hyperscale-currency": "SAR"
990
- },
991
- "taxAccount": {
992
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
993
- "type": "string"
994
- }
995
- },
996
- "id": "joined_settlement",
997
- "idPrefix": "stlm",
998
- "lifecycle": {
999
- "initial": "created",
1000
- "states": [
1001
- "created",
1002
- "funded",
1003
- "refunded",
1004
- "released"
1005
- ],
1006
- "transitions": {
1007
- "fund": {
1008
- "from": [
1009
- "created"
1010
- ],
1011
- "to": "funded"
1012
- },
1013
- "refund": {
1014
- "from": [
1015
- "funded"
1016
- ],
1017
- "to": "refunded"
1018
- },
1019
- "release": {
1020
- "from": [
1021
- "funded"
1022
- ],
1023
- "to": "released"
1024
- }
1025
- }
1026
- },
1027
- "partitions": [
1028
- {
1029
- "pieceFields": [
1030
- "buyerPart",
1031
- "funderPart"
1032
- ],
1033
- "totalField": "price"
1034
- },
1035
- {
1036
- "pieceFields": [
1037
- "sellerNet",
1038
- "sellerFee",
1039
- "tax"
1040
- ],
1041
- "totalField": "price"
1042
- }
1043
- ],
1044
- "required": [
1045
- "price",
1046
- "buyerPart",
1047
- "funderPart",
1048
- "sellerNet",
1049
- "sellerFee",
1050
- "tax",
1051
- "seller",
1052
- "feeAccount",
1053
- "taxAccount",
1054
- "currency",
1055
- "contributions"
1056
- ],
1057
- "summary": "Joined Settlement instrument",
1058
- "title": "Joined Settlement"
1059
- },
1060
- {
1061
- "actionOrder": [
1062
- "create",
1063
- "close"
1064
- ],
1065
- "actions": {
1066
- "close": {
1067
- "agentDescription": "Pay the positive remaining balance.",
1068
- "effects": {
1069
- "moves": [
1070
- {
1071
- "signature": "moves.transfer.internal",
1072
- "source": "moves[0]"
1073
- }
1074
- ]
1075
- },
1076
- "moves": [
1077
- {
1078
- "bind": {
1079
- "amount": {
1080
- "from": "instance",
1081
- "path": "refs.remaining"
1082
- },
1083
- "currency": {
1084
- "from": "const",
1085
- "value": "SAR"
1086
- },
1087
- "destinationAccountId": {
1088
- "from": "instance",
1089
- "path": "fields.receiver"
1090
- },
1091
- "productId": {
1092
- "from": "instance",
1093
- "path": "productId"
1094
- },
1095
- "sourceAccountId": {
1096
- "from": "instance",
1097
- "path": "fields.payer"
1098
- }
1099
- },
1100
- "key": "pay",
1101
- "operation": "internal_transfer.create"
1102
- }
1103
- ],
1104
- "publicAction": "closePayoffRemainder",
1105
- "remainder": {
1106
- "amountRef": "remaining",
1107
- "onZero": "refuse",
1108
- "subtractPaths": [
1109
- "fields.paid",
1110
- "fields.rebate"
1111
- ],
1112
- "totalPath": "fields.total"
1113
- },
1114
- "steps": [],
1115
- "summary": "Close instrument"
1116
- },
1117
- "create": {
1118
- "agentDescription": "Record immutable balances.",
1119
- "moves": [],
1120
- "publicAction": "createPayoffRemainder",
1121
- "steps": [],
1122
- "summary": "Create instrument"
1123
- }
1124
- },
1125
- "agentDescription": "Subtract paid principal and cancelled profit from a fixed total.",
1126
- "fields": {
1127
- "currency": {
1128
- "const": "SAR",
1129
- "type": "string"
1130
- },
1131
- "paid": {
1132
- "pattern": "^[1-9][0-9]{0,17}$",
1133
- "type": "string",
1134
- "x-hyperscale-currency": "SAR"
1135
- },
1136
- "payer": {
1137
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1138
- "type": "string"
1139
- },
1140
- "rebate": {
1141
- "pattern": "^[1-9][0-9]{0,17}$",
1142
- "type": "string",
1143
- "x-hyperscale-currency": "SAR"
1144
- },
1145
- "receiver": {
1146
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1147
- "type": "string"
1148
- },
1149
- "total": {
1150
- "pattern": "^[1-9][0-9]{0,17}$",
1151
- "type": "string",
1152
- "x-hyperscale-currency": "SAR"
1153
- }
1154
- },
1155
- "id": "payoff_remainder",
1156
- "idPrefix": "rem",
1157
- "lifecycle": {
1158
- "initial": "open",
1159
- "states": [
1160
- "open",
1161
- "closed"
1162
- ],
1163
- "transitions": {
1164
- "close": {
1165
- "from": [
1166
- "open"
1167
- ],
1168
- "to": "closed"
1169
- }
1170
- }
1171
- },
1172
- "parties": {
1173
- "payer": "payer",
1174
- "receiver": "receiver"
1175
- },
1176
- "required": [
1177
- "payer",
1178
- "receiver",
1179
- "total",
1180
- "paid",
1181
- "rebate",
1182
- "currency"
1183
- ],
1184
- "summary": "Payoff Remainder instrument",
1185
- "title": "Payoff Remainder"
1186
- },
1187
- {
1188
- "actionOrder": [
1189
- "create",
1190
- "close"
1191
- ],
1192
- "actions": {
1193
- "close": {
1194
- "agentDescription": "Refund the recorded assessment allocation once.",
1195
- "allocate": {
1196
- "action": "close",
1197
- "assessmentField": "assessment",
1198
- "capture": "refundReceipt",
1199
- "mode": "refund",
1200
- "refField": "paymentId"
1201
- },
1202
- "effects": {
1203
- "decides": [
1204
- {
1205
- "signature": "decides.allocation",
1206
- "source": "allocate"
1207
- }
1208
- ],
1209
- "moves": [
1210
- {
1211
- "signature": "moves.allocation",
1212
- "source": "allocate"
1213
- }
1214
- ]
1215
- },
1216
- "moves": [],
1217
- "publicAction": "closeAllocationRefund",
1218
- "steps": [],
1219
- "summary": "Close instrument"
1220
- },
1221
- "create": {
1222
- "agentDescription": "Identify the original payment receipt.",
1223
- "moves": [],
1224
- "publicAction": "createAllocationRefund",
1225
- "steps": [],
1226
- "summary": "Create instrument"
1227
- }
1228
- },
1229
- "agentDescription": "Refund one previously recorded allocation to its original payer.",
1230
- "fields": {
1231
- "assessment": {
1232
- "maxLength": 128,
1233
- "minLength": 1,
1234
- "type": "string"
1235
- },
1236
- "paymentId": {
1237
- "pattern": "^pmt_(sandbox|live)_[a-z0-9]{8,64}$",
1238
- "type": "string"
1239
- }
1240
- },
1241
- "id": "allocation_refund",
1242
- "idPrefix": "arfn",
1243
- "lifecycle": {
1244
- "initial": "open",
1245
- "states": [
1246
- "open",
1247
- "closed"
1248
- ],
1249
- "transitions": {
1250
- "close": {
1251
- "from": [
1252
- "open"
1253
- ],
1254
- "to": "closed"
1255
- }
1256
- }
1257
- },
1258
- "required": [
1259
- "paymentId",
1260
- "assessment"
1261
- ],
1262
- "summary": "Allocation Refund instrument",
1263
- "title": "Allocation Refund"
1264
- },
1265
- {
1266
- "actionOrder": [
1267
- "create",
1268
- "close"
1269
- ],
1270
- "actions": {
1271
- "close": {
1272
- "agentDescription": "Close the limit without releasing its subject claim.",
1273
- "moves": [],
1274
- "publicAction": "closeLimit",
1275
- "steps": [],
1276
- "summary": "Close instrument"
1277
- },
1278
- "create": {
1279
- "agentDescription": "Claim this borrower and currency once.",
1280
- "effects": {
1281
- "decides": [
1282
- {
1283
- "signature": "decides.subject_unique",
1284
- "source": "unique"
1285
- }
1286
- ]
1287
- },
1288
- "moves": [],
1289
- "publicAction": "createLimit",
1290
- "steps": [],
1291
- "summary": "Create instrument",
1292
- "unique": {
1293
- "byFields": [
1294
- "borrower",
1295
- "currency"
1296
- ],
1297
- "namespace": "borrower_limit"
1298
- }
1299
- }
1300
- },
1301
- "agentDescription": "Keep one permanent cap per borrower and currency.",
1302
- "fields": {
1303
- "borrower": {
1304
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1305
- "type": "string"
1306
- },
1307
- "cap": {
1308
- "pattern": "^[1-9][0-9]{0,17}$",
1309
- "type": "string",
1310
- "x-hyperscale-currency": "SAR"
1311
- },
1312
- "currency": {
1313
- "const": "SAR",
1314
- "type": "string"
1315
- }
1316
- },
1317
- "id": "limit",
1318
- "idPrefix": "lim",
1319
- "lifecycle": {
1320
- "initial": "open",
1321
- "states": [
1322
- "open",
1323
- "closed"
1324
- ],
1325
- "transitions": {
1326
- "close": {
1327
- "from": [
1328
- "open"
1329
- ],
1330
- "to": "closed"
1331
- }
1332
- }
1333
- },
1334
- "required": [
1335
- "borrower",
1336
- "currency",
1337
- "cap"
1338
- ],
1339
- "summary": "Limit instrument",
1340
- "title": "Limit"
1341
- },
1342
- {
1343
- "actionOrder": [
1344
- "collect",
1345
- "refund",
1346
- "create"
1347
- ],
1348
- "actions": {
1349
- "collect": {
1350
- "agentDescription": "Collect this assessment's remaining balance.",
1351
- "allocate": {
1352
- "amountField": "amount",
1353
- "assessment": "self",
1354
- "capture": "collectionReceipt",
1355
- "mode": "payment",
1356
- "paymentIdentityField": "paymentIdentity",
1357
- "refField": "coverId",
1358
- "sourceAccountField": "receiver"
1359
- },
1360
- "effects": {
1361
- "decides": [
1362
- {
1363
- "signature": "decides.allocation",
1364
- "source": "allocate"
1365
- }
1366
- ],
1367
- "moves": [
1368
- {
1369
- "signature": "moves.allocation",
1370
- "source": "allocate"
1371
- }
1372
- ]
1373
- },
1374
- "input": {
1375
- "additionalProperties": false,
1376
- "properties": {
1377
- "paymentIdentity": {
1378
- "minLength": 1,
1379
- "type": "string"
1380
- }
1381
- },
1382
- "required": [
1383
- "paymentIdentity"
1384
- ],
1385
- "type": "object"
1386
- },
1387
- "moves": [],
1388
- "publicAction": "collectFirstCost",
1389
- "steps": [],
1390
- "summary": "Collect instrument"
1391
- },
1392
- "create": {
1393
- "agentDescription": "Record the assessment.",
1394
- "moves": [],
1395
- "publicAction": "createFirstCost",
1396
- "steps": [],
1397
- "summary": "Create instrument"
1398
- },
1399
- "refund": {
1400
- "agentDescription": "Reverse this record's prior collection.",
1401
- "allocate": {
1402
- "action": "collect",
1403
- "capture": "refundReceipt",
1404
- "mode": "refund"
1405
- },
1406
- "effects": {
1407
- "decides": [
1408
- {
1409
- "signature": "decides.allocation",
1410
- "source": "allocate"
1411
- }
1412
- ],
1413
- "moves": [
1414
- {
1415
- "signature": "moves.allocation",
1416
- "source": "allocate"
1417
- }
1418
- ]
1419
- },
1420
- "moves": [],
1421
- "publicAction": "refundFirstCost",
1422
- "steps": [],
1423
- "summary": "Refund instrument"
1424
- }
1425
- },
1426
- "agentDescription": "One assessment selected by template and bound kind.",
1427
- "fields": {
1428
- "amount": {
1429
- "pattern": "^[1-9][0-9]{0,17}$",
1430
- "type": "string",
1431
- "x-hyperscale-currency": "SAR"
1432
- },
1433
- "coverId": {
1434
- "pattern": "^cvr_(sandbox|live)_[a-z0-9]{8,64}$",
1435
- "type": "string"
1436
- },
1437
- "currency": {
1438
- "description": "ISO 4217 currency code",
1439
- "maxLength": 3,
1440
- "minLength": 3,
1441
- "pattern": "^[A-Z]{3}$",
1442
- "type": "string"
1443
- },
1444
- "receiver": {
1445
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1446
- "type": "string"
1447
- },
1448
- "sliceId": {
1449
- "pattern": "^slc_(sandbox|live)_[a-z0-9]{8,64}$",
1450
- "type": "string"
1451
- }
1452
- },
1453
- "id": "first_cost",
1454
- "idPrefix": "fc",
1455
- "lifecycle": {
1456
- "initial": "open",
1457
- "states": [
1458
- "open",
1459
- "paid",
1460
- "refunded"
1461
- ],
1462
- "transitions": {
1463
- "collect": {
1464
- "from": [
1465
- "open"
1466
- ],
1467
- "to": "paid"
1468
- },
1469
- "refund": {
1470
- "from": [
1471
- "paid"
1472
- ],
1473
- "to": "refunded"
1474
- }
1475
- }
1476
- },
1477
- "required": [
1478
- "sliceId",
1479
- "coverId",
1480
- "amount",
1481
- "receiver",
1482
- "currency"
1483
- ],
1484
- "summary": "First Cost instrument",
1485
- "templateBinding": {
1486
- "id": "assessment",
1487
- "parameters": {
1488
- "cost": true
1489
- }
1490
- },
1491
- "title": "First Cost"
1492
- },
1493
- {
1494
- "actionOrder": [
1495
- "collect",
1496
- "refund",
1497
- "create"
1498
- ],
1499
- "actions": {
1500
- "collect": {
1501
- "agentDescription": "Collect this assessment's remaining balance.",
1502
- "allocate": {
1503
- "amountField": "amount",
1504
- "assessment": "self",
1505
- "capture": "collectionReceipt",
1506
- "mode": "payment",
1507
- "paymentIdentityField": "paymentIdentity",
1508
- "refField": "coverId",
1509
- "sourceAccountField": "receiver"
1510
- },
1511
- "effects": {
1512
- "decides": [
1513
- {
1514
- "signature": "decides.allocation",
1515
- "source": "allocate"
1516
- }
1517
- ],
1518
- "moves": [
1519
- {
1520
- "signature": "moves.allocation",
1521
- "source": "allocate"
1522
- }
1523
- ]
1524
- },
1525
- "input": {
1526
- "additionalProperties": false,
1527
- "properties": {
1528
- "paymentIdentity": {
1529
- "minLength": 1,
1530
- "type": "string"
1531
- }
1532
- },
1533
- "required": [
1534
- "paymentIdentity"
1535
- ],
1536
- "type": "object"
1537
- },
1538
- "moves": [],
1539
- "publicAction": "collectSecondCost",
1540
- "steps": [],
1541
- "summary": "Collect instrument"
1542
- },
1543
- "create": {
1544
- "agentDescription": "Record the assessment.",
1545
- "moves": [],
1546
- "publicAction": "createSecondCost",
1547
- "steps": [],
1548
- "summary": "Create instrument"
1549
- },
1550
- "refund": {
1551
- "agentDescription": "Reverse this record's prior collection.",
1552
- "allocate": {
1553
- "action": "collect",
1554
- "capture": "refundReceipt",
1555
- "mode": "refund"
1556
- },
1557
- "effects": {
1558
- "decides": [
1559
- {
1560
- "signature": "decides.allocation",
1561
- "source": "allocate"
1562
- }
1563
- ],
1564
- "moves": [
1565
- {
1566
- "signature": "moves.allocation",
1567
- "source": "allocate"
1568
- }
1569
- ]
1570
- },
1571
- "moves": [],
1572
- "publicAction": "refundSecondCost",
1573
- "steps": [],
1574
- "summary": "Refund instrument"
1575
- }
1576
- },
1577
- "agentDescription": "One assessment selected by template and bound kind.",
1578
- "fields": {
1579
- "amount": {
1580
- "pattern": "^[1-9][0-9]{0,17}$",
1581
- "type": "string",
1582
- "x-hyperscale-currency": "SAR"
1583
- },
1584
- "coverId": {
1585
- "pattern": "^cvr_(sandbox|live)_[a-z0-9]{8,64}$",
1586
- "type": "string"
1587
- },
1588
- "currency": {
1589
- "description": "ISO 4217 currency code",
1590
- "maxLength": 3,
1591
- "minLength": 3,
1592
- "pattern": "^[A-Z]{3}$",
1593
- "type": "string"
1594
- },
1595
- "receiver": {
1596
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1597
- "type": "string"
1598
- },
1599
- "sliceId": {
1600
- "pattern": "^slc_(sandbox|live)_[a-z0-9]{8,64}$",
1601
- "type": "string"
1602
- }
1603
- },
1604
- "id": "second_cost",
1605
- "idPrefix": "sc",
1606
- "lifecycle": {
1607
- "initial": "open",
1608
- "states": [
1609
- "open",
1610
- "paid",
1611
- "refunded"
1612
- ],
1613
- "transitions": {
1614
- "collect": {
1615
- "from": [
1616
- "open"
1617
- ],
1618
- "to": "paid"
1619
- },
1620
- "refund": {
1621
- "from": [
1622
- "paid"
1623
- ],
1624
- "to": "refunded"
1625
- }
1626
- }
1627
- },
1628
- "required": [
1629
- "sliceId",
1630
- "coverId",
1631
- "amount",
1632
- "receiver",
1633
- "currency"
1634
- ],
1635
- "summary": "Second Cost instrument",
1636
- "templateBinding": {
1637
- "id": "assessment",
1638
- "parameters": {
1639
- "cost": true
1640
- }
1641
- },
1642
- "title": "Second Cost"
1643
- },
1644
- {
1645
- "actionOrder": [
1646
- "close",
1647
- "create"
1648
- ],
1649
- "actions": {
1650
- "close": {
1651
- "agentDescription": "Close the assessment.",
1652
- "moves": [],
1653
- "publicAction": "closeFineOnly",
1654
- "steps": [],
1655
- "summary": "Close instrument"
1656
- },
1657
- "create": {
1658
- "agentDescription": "Record the assessment.",
1659
- "moves": [],
1660
- "publicAction": "createFineOnly",
1661
- "steps": [],
1662
- "summary": "Create instrument"
1663
- }
1664
- },
1665
- "agentDescription": "One assessment selected by template and bound kind.",
1666
- "fields": {
1667
- "amount": {
1668
- "pattern": "^[1-9][0-9]{0,17}$",
1669
- "type": "string",
1670
- "x-hyperscale-currency": "SAR"
1671
- },
1672
- "coverId": {
1673
- "pattern": "^cvr_(sandbox|live)_[a-z0-9]{8,64}$",
1674
- "type": "string"
1675
- },
1676
- "currency": {
1677
- "description": "ISO 4217 currency code",
1678
- "maxLength": 3,
1679
- "minLength": 3,
1680
- "pattern": "^[A-Z]{3}$",
1681
- "type": "string"
1682
- },
1683
- "receiver": {
1684
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1685
- "type": "string"
1686
- },
1687
- "sliceId": {
1688
- "pattern": "^slc_(sandbox|live)_[a-z0-9]{8,64}$",
1689
- "type": "string"
1690
- }
1691
- },
1692
- "id": "fine_only",
1693
- "idPrefix": "fo",
1694
- "lifecycle": {
1695
- "initial": "open",
1696
- "states": [
1697
- "open",
1698
- "closed"
1699
- ],
1700
- "transitions": {
1701
- "close": {
1702
- "from": [
1703
- "open"
1704
- ],
1705
- "to": "closed"
1706
- }
1707
- }
1708
- },
1709
- "required": [
1710
- "sliceId",
1711
- "coverId",
1712
- "amount",
1713
- "receiver",
1714
- "currency"
1715
- ],
1716
- "summary": "Fine Only instrument",
1717
- "templateBinding": {
1718
- "id": "assessment",
1719
- "parameters": {
1720
- "cost": false
1721
- }
1722
- },
1723
- "title": "Fine Only"
1724
- },
1725
- {
1726
- "actionOrder": [
1727
- "create",
1728
- "close"
1729
- ],
1730
- "actions": {
1731
- "close": {
1732
- "agentDescription": "Record the custody transition.",
1733
- "funding": {
1734
- "capture": "snapshot",
1735
- "collectAction": "collect",
1736
- "destinationAccountField": "fundingAccount",
1737
- "obligationField": "obligationId",
1738
- "principalField": "principal",
1739
- "sourceAccountPath": "refs.escrow",
1740
- "terms": {
1741
- "currency": "currency",
1742
- "principal": "principal"
1743
- },
1744
- "ticketAccountField": "wallet",
1745
- "ticketAmountField": "amount",
1746
- "ticketInstrumentId": "ticket",
1747
- "ticketInvestorField": "investor",
1748
- "ticketRefField": "roundId",
1749
- "ticketStatus": "open"
1750
- },
1751
- "moves": [],
1752
- "steps": [],
1753
- "summary": "Record custody"
1754
- },
1755
- "create": {
1756
- "agentDescription": "Record the custody transition.",
1757
- "moves": [],
1758
- "steps": [
1759
- {
1760
- "bind": {
1761
- "currency": {
1762
- "from": "instance",
1763
- "path": "fields.currency"
1764
- },
1765
- "owner.id": {
1766
- "from": "instance",
1767
- "path": "productId"
1768
- },
1769
- "owner.type": {
1770
- "from": "const",
1771
- "value": "product"
1772
- },
1773
- "productId": {
1774
- "from": "instance",
1775
- "path": "productId"
1776
- },
1777
- "role": {
1778
- "from": "const",
1779
- "value": "product_escrow"
1780
- }
1781
- },
1782
- "capture": {
1783
- "escrow": "accountId"
1784
- },
1785
- "operation": "account.escrow.provision"
1786
- }
1787
- ],
1788
- "summary": "Record custody"
1789
- }
1790
- },
1791
- "agentDescription": "Bind frozen tickets to one obligation and its receipts.",
1792
- "fields": {
1793
- "currency": {
1794
- "const": "SAR",
1795
- "type": "string"
1796
- },
1797
- "fundingAccount": {
1798
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1799
- "type": "string"
1800
- },
1801
- "maximumTicket": {
1802
- "pattern": "^[1-9][0-9]{0,17}$",
1803
- "type": "string",
1804
- "x-hyperscale-currency": "SAR"
1805
- },
1806
- "minimumTicket": {
1807
- "pattern": "^[1-9][0-9]{0,17}$",
1808
- "type": "string",
1809
- "x-hyperscale-currency": "SAR"
1810
- },
1811
- "obligationId": {
1812
- "pattern": "^cvr_(sandbox|live)_[a-z0-9]{8,64}$",
1813
- "type": "string"
1814
- },
1815
- "principal": {
1816
- "pattern": "^[1-9][0-9]{0,17}$",
1817
- "type": "string",
1818
- "x-hyperscale-currency": "SAR"
1819
- }
1820
- },
1821
- "id": "round",
1822
- "idPrefix": "rnd",
1823
- "lifecycle": {
1824
- "initial": "open",
1825
- "states": [
1826
- "open",
1827
- "closed"
1828
- ],
1829
- "transitions": {
1830
- "close": {
1831
- "from": [
1832
- "open"
1833
- ],
1834
- "to": "closed"
1835
- }
1836
- }
1837
- },
1838
- "required": [
1839
- "obligationId",
1840
- "principal",
1841
- "minimumTicket",
1842
- "maximumTicket",
1843
- "fundingAccount",
1844
- "currency"
1845
- ],
1846
- "summary": "Frozen investor custody",
1847
- "title": "round"
1848
- },
1849
- {
1850
- "actionOrder": [
1851
- "create",
1852
- "collect"
1853
- ],
1854
- "actions": {
1855
- "collect": {
1856
- "agentDescription": "Record the custody transition.",
1857
- "engineOwned": true,
1858
- "moves": [],
1859
- "steps": [],
1860
- "summary": "Record custody"
1861
- },
1862
- "create": {
1863
- "agentDescription": "Record the custody transition.",
1864
- "moves": [],
1865
- "requiresExposure": [
1866
- {
1867
- "amountField": "amount",
1868
- "anchorField": "roundId",
1869
- "capField": "maximumTicket",
1870
- "capOnAnchor": true,
1871
- "childInstrumentId": "ticket",
1872
- "groupField": "investor",
1873
- "minimumField": "minimumTicket",
1874
- "statuses": [
1875
- "open"
1876
- ]
1877
- }
1878
- ],
1879
- "steps": [],
1880
- "summary": "Record custody"
1881
- }
1882
- },
1883
- "agentDescription": "Bind frozen tickets to one obligation and its receipts.",
1884
- "fields": {
1885
- "amount": {
1886
- "pattern": "^[1-9][0-9]{0,17}$",
1887
- "type": "string",
1888
- "x-hyperscale-currency": "SAR"
1889
- },
1890
- "currency": {
1891
- "const": "SAR",
1892
- "type": "string"
1893
- },
1894
- "investor": {
1895
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1896
- "type": "string"
1897
- },
1898
- "roundId": {
1899
- "pattern": "^rnd_(sandbox|live)_[a-z0-9]{8,64}$",
1900
- "type": "string"
1901
- },
1902
- "wallet": {
1903
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1904
- "type": "string"
1905
- }
1906
- },
1907
- "id": "ticket",
1908
- "idPrefix": "tkt",
1909
- "lifecycle": {
1910
- "initial": "open",
1911
- "states": [
1912
- "open",
1913
- "closed"
1914
- ],
1915
- "transitions": {
1916
- "collect": {
1917
- "from": [
1918
- "open"
1919
- ],
1920
- "to": "closed"
1921
- }
1922
- }
1923
- },
1924
- "required": [
1925
- "roundId",
1926
- "amount",
1927
- "investor",
1928
- "wallet",
1929
- "currency"
1930
- ],
1931
- "summary": "Frozen investor custody",
1932
- "title": "ticket"
1933
- },
1934
- {
1935
- "actionOrder": [
1936
- "create"
1937
- ],
1938
- "actions": {
1939
- "create": {
1940
- "agentDescription": "Record the custody transition.",
1941
- "moves": [],
1942
- "receiptDistribution": {
1943
- "capture": "receipt",
1944
- "feeAccountField": "fee",
1945
- "feeBps": 100,
1946
- "mode": "cash",
1947
- "receiptField": "receiptId",
1948
- "receiptPath": "refs.allocationReceipt",
1949
- "residualAccountField": "residual",
1950
- "roundField": "roundId",
1951
- "snapshotRef": "snapshot",
1952
- "taxAccountField": "tax",
1953
- "vatBps": 1500
1954
- },
1955
- "steps": [],
1956
- "summary": "Record custody"
1957
- }
1958
- },
1959
- "agentDescription": "Bind frozen tickets to one obligation and its receipts.",
1960
- "fields": {
1961
- "currency": {
1962
- "const": "SAR",
1963
- "type": "string"
1964
- },
1965
- "fee": {
1966
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1967
- "type": "string"
1968
- },
1969
- "receiptId": {
1970
- "pattern": "^pmt_(sandbox|live)_[a-z0-9]{8,64}$",
1971
- "type": "string"
1972
- },
1973
- "residual": {
1974
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1975
- "type": "string"
1976
- },
1977
- "roundId": {
1978
- "pattern": "^rnd_(sandbox|live)_[a-z0-9]{8,64}$",
1979
- "type": "string"
1980
- },
1981
- "tax": {
1982
- "pattern": "^acct_(sandbox|live)_[a-z0-9]{8,64}$",
1983
- "type": "string"
1984
- }
1985
- },
1986
- "id": "distribution",
1987
- "idPrefix": "dst",
1988
- "lifecycle": {
1989
- "initial": "open",
1990
- "states": [
1991
- "open"
1992
- ],
1993
- "transitions": {}
1994
- },
1995
- "required": [
1996
- "roundId",
1997
- "receiptId",
1998
- "fee",
1999
- "tax",
2000
- "residual",
2001
- "currency"
2002
- ],
2003
- "summary": "Frozen investor custody",
2004
- "title": "distribution"
2005
- }
2006
- ],
2007
- "product": "vocabulary",
2008
- "subjects": [],
2009
- "title": "Vocabulary witnesses",
2010
- "udl": 1,
2011
- "version": 1
2012
- }