@hyperscale0/hsx 1.0.0 → 2.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.
- package/CHANGELOG.md +15 -4
- package/README.md +58 -38
- package/dist/src/ast.d.ts +4 -2
- package/dist/src/ast.d.ts.map +1 -1
- package/dist/src/cli.d.ts +1 -1
- package/dist/src/cli.js.map +1 -1
- package/dist/src/compile.d.ts +8 -2
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +8 -1
- package/dist/src/compile.js.map +1 -1
- package/dist/src/cost.d.ts +3 -1
- package/dist/src/cost.d.ts.map +1 -1
- package/dist/src/cost.js +124 -94
- package/dist/src/cost.js.map +1 -1
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +89 -5
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/emit.d.ts +3 -1
- package/dist/src/emit.d.ts.map +1 -1
- package/dist/src/emit.js +27 -10
- package/dist/src/emit.js.map +1 -1
- package/dist/src/format.js.map +1 -1
- package/dist/src/index.d.ts +2 -2
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/ir.d.ts.map +1 -1
- package/dist/src/lex.d.ts.map +1 -1
- package/dist/src/lsp/server.js.map +1 -1
- package/dist/src/modules.js +7 -3
- package/dist/src/modules.js.map +1 -1
- package/dist/src/parse.js +3 -3
- package/dist/src/parse.js.map +1 -1
- package/dist/src/std-bundle.js +41 -41
- package/dist/src/std-bundle.js.map +1 -1
- package/dist/src/std-library.js +2 -2
- package/dist/src/typecheck.d.ts.map +1 -1
- package/dist/src/typecheck.js +859 -156
- package/dist/src/typecheck.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/README.md +10 -1
- package/docs/assets/hsx.svg +18 -0
- package/docs/guide/01-first-program.md +1 -1
- package/docs/guide/02-money.md +1 -1
- package/docs/guide/03-instruments.md +44 -3
- package/docs/guide/04-lifecycles.md +18 -3
- package/docs/guide/05-fees-and-splits.md +2 -2
- package/docs/guide/06-schedules.md +1 -1
- package/docs/guide/07-composition.md +8 -2
- package/docs/guide/08-writing-a-module.md +13 -2
- package/docs/guide/09-cost.md +3 -3
- package/docs/guide/10-diagnostics.md +1 -1
- package/docs/llms-full.txt +453 -190
- package/docs/llms.txt +2 -2
- package/docs/playground.md +4 -3
- package/docs/reference/cli.md +2 -2
- package/docs/reference/diagnostics.md +223 -37
- package/docs/reference/grammar.md +2 -2
- package/docs/reference/std/advance.md +2 -2
- package/docs/reference/std/cancellable_booking.md +10 -10
- package/docs/reference/std/captured_payment.md +14 -14
- package/docs/reference/std/conditional_disbursement.md +3 -3
- package/docs/reference/std/credit_facility.md +2 -2
- package/docs/reference/std/held_payment.md +37 -33
- package/docs/reference/std/instant_transfer.md +8 -8
- package/docs/reference/std/metered.md +2 -2
- package/docs/reference/std/pooled_split.md +2 -2
- package/docs/reference/std/premium_forward.md +13 -13
- package/docs/reference/std/reconciled_payout.md +2 -2
- package/docs/reference/std/recurring_collection.md +2 -2
- package/docs/reference/std/rotating_pool.md +2 -2
- package/docs/reference/std/scheduled.md +18 -18
- package/docs/reference/std/security_deposit.md +14 -14
- package/docs/reference/std/settlement_batch.md +2 -2
- package/docs/reference/std/swap.md +18 -18
- package/docs/reference/std/threshold_pool.md +2 -2
- package/docs/reference/std/weighted_distribution.md +2 -2
- package/docs/reference/types.md +1 -1
- package/docs/reference/udl-output.md +1 -1
- package/examples/01-first-program/README.md +1 -1
- package/examples/01-first-program/tip-jar.hsx +1 -1
- package/examples/02-imports-and-archetypes/photo-booth.hsx +1 -1
- package/examples/03-diagnostics/corner-shop-fixed.hsx +1 -1
- package/examples/03-diagnostics/corner-shop.hsx +1 -1
- package/examples/04-complete-product/study-hall.hsx +1 -1
- package/examples/05-watch-club/README.md +0 -3
- package/examples/05-watch-club/watch-club.hsx +1 -1
- package/examples/README.md +35 -4
- package/examples/advance/advance.hsx +1 -1
- package/examples/advance/advance.udl +10 -5
- package/examples/cancellable_booking/cancellable_booking.hsx +1 -1
- package/examples/cancellable_booking/cancellable_booking.udl +3 -1
- package/examples/captured_payment/captured_payment.hsx +1 -1
- package/examples/captured_payment/captured_payment.udl +4 -1
- package/examples/conditional_disbursement/conditional_disbursement.hsx +1 -1
- package/examples/conditional_disbursement/conditional_disbursement.udl +5 -3
- package/examples/cost-table.json +1602 -382
- package/examples/credit_facility/credit_facility.hsx +1 -1
- package/examples/credit_facility/credit_facility.udl +16 -9
- package/examples/held_payment/held_payment.hsx +1 -1
- package/examples/held_payment/held_payment.udl +38 -3
- package/examples/instant_transfer/instant_transfer.hsx +1 -1
- package/examples/instant_transfer/instant_transfer.udl +11 -5
- package/examples/metered/metered.hsx +1 -1
- package/examples/metered/metered.udl +4 -2
- package/examples/pooled_split/pooled_split.hsx +1 -1
- package/examples/pooled_split/pooled_split.udl +6 -3
- package/examples/premium_forward/premium_forward.hsx +1 -1
- package/examples/premium_forward/premium_forward.udl +10 -4
- package/examples/reconciled_payout/reconciled_payout.hsx +1 -1
- package/examples/reconciled_payout/reconciled_payout.udl +4 -2
- package/examples/recurring_collection/recurring_collection.hsx +1 -1
- package/examples/recurring_collection/recurring_collection.udl +12 -7
- package/examples/rotating_pool/rotating_pool.hsx +1 -1
- package/examples/rotating_pool/rotating_pool.udl +14 -4
- package/examples/scheduled/scheduled.hsx +1 -1
- package/examples/scheduled/scheduled.udl +9 -4
- package/examples/security_deposit/security_deposit.hsx +1 -1
- package/examples/security_deposit/security_deposit.udl +17 -3
- package/examples/settlement_batch/settlement_batch.hsx +1 -1
- package/examples/swap/swap.hsx +1 -1
- package/examples/swap/swap.udl +12 -6
- package/examples/threshold_pool/threshold_pool.hsx +1 -1
- package/examples/threshold_pool/threshold_pool.udl +4 -2
- package/examples/weighted_distribution/weighted_distribution.hsx +1 -1
- package/examples/weighted_distribution/weighted_distribution.udl +4 -2
- package/package.json +6 -5
- package/skills/hsx/SKILL.md +26 -26
- package/src/ast.ts +4 -2
- package/src/cli.ts +4 -4
- package/src/compile.ts +14 -3
- package/src/cost.ts +176 -104
- package/src/diagnostics.ts +89 -4
- package/src/emit.ts +32 -18
- package/src/index.ts +2 -1
- package/src/modules.ts +9 -3
- package/src/parse.ts +3 -3
- package/src/std-bundle.ts +41 -41
- package/src/std-library.ts +2 -2
- package/src/typecheck.ts +1147 -235
- package/src/version.ts +1 -1
- package/std/SEMANTICS.md +12 -3
- package/std/{settlements → money_flows}/advance.hsx +1 -1
- package/std/{settlements → money_flows}/cancellable_booking.hsx +4 -3
- package/std/{settlements → money_flows}/captured_payment.hsx +35 -6
- package/std/{settlements → money_flows}/conditional_disbursement.hsx +17 -16
- package/std/{settlements → money_flows}/credit_facility.hsx +1 -2
- package/std/{settlements → money_flows}/held_payment.hsx +59 -25
- package/std/money_flows/index.hsx +3 -0
- package/std/{settlements → money_flows}/instant_transfer.hsx +2 -3
- package/std/{settlements → money_flows}/metered.hsx +1 -1
- package/std/{settlements → money_flows}/pooled_split.hsx +3 -3
- package/std/{settlements → money_flows}/premium_forward.hsx +22 -23
- package/std/{settlements → money_flows}/reconciled_payout.hsx +3 -3
- package/std/{settlements → money_flows}/recurring_collection.hsx +1 -1
- package/std/{settlements → money_flows}/rotating_pool.hsx +8 -6
- package/std/{settlements → money_flows}/scheduled.hsx +22 -27
- package/std/{settlements → money_flows}/security_deposit.hsx +38 -14
- package/std/{settlements → money_flows}/settlement_batch.hsx +3 -3
- package/std/{settlements → money_flows}/swap.hsx +41 -16
- package/std/{settlements → money_flows}/threshold_pool.hsx +5 -5
- package/std/{settlements → money_flows}/weighted_distribution.hsx +6 -6
- package/docs/sessions/2026-09-02-two-instruments.hsx +0 -21
- package/docs/sessions/2026-09-02-two-instruments.md +0 -41
- package/std/settlements/index.hsx +0 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# held_payment
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/held_payment.hsx`](../../../std/money_flows/held_payment.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -31,34 +31,38 @@ Source: [`std/settlements/held_payment.hsx`](../../../std/settlements/held_payme
|
|
|
31
31
|
|
|
32
32
|
## Actions and clauses
|
|
33
33
|
|
|
34
|
-
| Action | Clauses lowered
|
|
35
|
-
| --------------------- |
|
|
36
|
-
| `fund_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
37
|
-
| `fund_piece_3` | `agent description`, `moves`, `steps`, `summary`
|
|
38
|
-
| `collect_service_fee` | `agent description`, `moves`, `steps`, `summary`
|
|
39
|
-
| `release_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
40
|
-
| `release_piece_3` | `agent description`, `moves`, `steps`, `summary`
|
|
41
|
-
| `refund_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
42
|
-
| `refund_piece_3` | `agent description`, `moves`, `steps`, `summary`
|
|
43
|
-
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary`
|
|
44
|
-
| `unfund_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
45
|
-
| `unfund_piece_3` | `agent description`, `moves`, `steps`, `summary`
|
|
46
|
-
| `create` | `agent description`, `moves`, `steps`, `summary`
|
|
47
|
-
| `fund_piece_1` | `agent description`, `moves`, `steps`, `summary`
|
|
48
|
-
| `release_name` | `agent description`, `deadline`, `
|
|
49
|
-
| `release_on_deadline` | `due`, `moves`, `steps`, `summary`
|
|
50
|
-
| `cancel` | `agent description`, `deadline`, `moves`, `steps`, `summary`
|
|
51
|
-
| `fund_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
52
|
-
| `release_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
53
|
-
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary`
|
|
54
|
-
| `fund_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
55
|
-
| `release_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
56
|
-
| `refund_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
57
|
-
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary`
|
|
58
|
-
| `abandon` | `agent description`, `moves`, `steps`, `summary`
|
|
59
|
-
| `
|
|
60
|
-
| `
|
|
61
|
-
| `
|
|
62
|
-
| `
|
|
63
|
-
| `
|
|
64
|
-
| `
|
|
34
|
+
| Action | Clauses lowered |
|
|
35
|
+
| --------------------- | ------------------------------------------------------------------------------------------------------ |
|
|
36
|
+
| `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
37
|
+
| `fund_piece_3` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
38
|
+
| `collect_service_fee` | `agent description`, `moves`, `steps`, `summary` |
|
|
39
|
+
| `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
40
|
+
| `release_piece_3` | `agent description`, `moves`, `steps`, `summary` |
|
|
41
|
+
| `refund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
42
|
+
| `refund_piece_3` | `agent description`, `moves`, `steps`, `summary` |
|
|
43
|
+
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
|
|
44
|
+
| `unfund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
45
|
+
| `unfund_piece_3` | `agent description`, `moves`, `steps`, `summary` |
|
|
46
|
+
| `create` | `agent description`, `moves`, `steps`, `summary` |
|
|
47
|
+
| `fund_piece_1` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
48
|
+
| `release_name` | `agent description`, `deadline`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
|
|
49
|
+
| `release_on_deadline` | `due`, `moves`, `steps`, `summary` |
|
|
50
|
+
| `cancel` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
|
|
51
|
+
| `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
52
|
+
| `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
53
|
+
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
|
|
54
|
+
| `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
55
|
+
| `release_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
56
|
+
| `refund_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
57
|
+
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
|
|
58
|
+
| `abandon` | `agent description`, `moves`, `steps`, `summary` |
|
|
59
|
+
| `dispute` | `agent description`, `description`, `moves`, `steps`, `summary` |
|
|
60
|
+
| `resume` | `agent description`, `description`, `moves`, `steps`, `summary` |
|
|
61
|
+
| `create` | `agent description`, `moves`, `steps`, `summary` |
|
|
62
|
+
| `fund` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
63
|
+
| `release_action` | `agent description`, `deadline`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
|
|
64
|
+
| `release_on_deadline` | `due`, `event name`, `moves`, `steps`, `summary` |
|
|
65
|
+
| `cancel` | `agent description`, `deadline`, `event name`, `moves`, `steps`, `summary` |
|
|
66
|
+
| `abandon` | `agent description`, `moves`, `steps`, `summary` |
|
|
67
|
+
| `dispute` | `agent description`, `description`, `moves`, `steps`, `summary` |
|
|
68
|
+
| `resume` | `agent description`, `description`, `moves`, `steps`, `summary` |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# instant_transfer
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/instant_transfer.hsx`](../../../std/money_flows/instant_transfer.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -22,9 +22,9 @@ None.
|
|
|
22
22
|
|
|
23
23
|
## Actions and clauses
|
|
24
24
|
|
|
25
|
-
| Action | Clauses lowered
|
|
26
|
-
| --------------------- |
|
|
27
|
-
| `create` | `agent description`, `moves`, `steps`, `summary`
|
|
28
|
-
| `pay_piece_1` | `agent description`, `moves`, `steps`, `summary` |
|
|
29
|
-
| `pay_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
30
|
-
| `collect_service_fee` | `agent description`, `moves`, `steps`, `summary`
|
|
25
|
+
| Action | Clauses lowered |
|
|
26
|
+
| --------------------- | ------------------------------------------------------------------------- |
|
|
27
|
+
| `create` | `agent description`, `moves`, `steps`, `summary` |
|
|
28
|
+
| `pay_piece_1` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
29
|
+
| `pay_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
30
|
+
| `collect_service_fee` | `agent description`, `moves`, `steps`, `summary` |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# metered
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/metered.hsx`](../../../std/money_flows/metered.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# pooled_split
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/pooled_split.hsx`](../../../std/money_flows/pooled_split.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# premium_forward
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/premium_forward.hsx`](../../../std/money_flows/premium_forward.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -26,14 +26,14 @@ Source: [`std/settlements/premium_forward.hsx`](../../../std/settlements/premium
|
|
|
26
26
|
|
|
27
27
|
## Actions and clauses
|
|
28
28
|
|
|
29
|
-
| Action | Clauses lowered
|
|
30
|
-
| ----------------- |
|
|
31
|
-
| `create` | `agent description`, `steps`, `summary`
|
|
32
|
-
| `fund_piece_1` | `agent description`, `moves`, `steps`, `summary`
|
|
33
|
-
| `fund_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
34
|
-
| `bind` | `agent description`, `
|
|
35
|
-
| `forward_piece_2` | `agent description`, `moves`, `steps`, `summary`
|
|
36
|
-
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary`
|
|
37
|
-
| `abandon` | `agent description`, `steps`, `summary`
|
|
38
|
-
| `endorsement` | `agent description`, `capture input`, `
|
|
39
|
-
| `lapse` | `due`, `steps`, `summary`
|
|
29
|
+
| Action | Clauses lowered |
|
|
30
|
+
| ----------------- | ------------------------------------------------------------------------------------------ |
|
|
31
|
+
| `create` | `agent description`, `steps`, `summary` |
|
|
32
|
+
| `fund_piece_1` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
33
|
+
| `fund_piece_2` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
34
|
+
| `bind` | `agent description`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
|
|
35
|
+
| `forward_piece_2` | `agent description`, `moves`, `steps`, `summary` |
|
|
36
|
+
| `unfund_piece_1` | `agent description`, `moves`, `steps`, `summary` |
|
|
37
|
+
| `abandon` | `agent description`, `steps`, `summary` |
|
|
38
|
+
| `endorsement` | `agent description`, `capture input`, `input`, `port`, `steps`, `summary` |
|
|
39
|
+
| `lapse` | `due`, `steps`, `summary` |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# reconciled_payout
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/reconciled_payout.hsx`](../../../std/money_flows/reconciled_payout.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# recurring_collection
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/recurring_collection.hsx`](../../../std/money_flows/recurring_collection.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# rotating_pool
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/rotating_pool.hsx`](../../../std/money_flows/rotating_pool.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# scheduled
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/scheduled.hsx`](../../../std/money_flows/scheduled.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -33,19 +33,19 @@ Source: [`std/settlements/scheduled.hsx`](../../../std/settlements/scheduled.hsx
|
|
|
33
33
|
|
|
34
34
|
## Actions and clauses
|
|
35
35
|
|
|
36
|
-
| Action | Clauses lowered
|
|
37
|
-
| ------------------- |
|
|
38
|
-
| `create` | `agent description`, `steps`, `summary`
|
|
39
|
-
| `create` | `agent description`, `moves`, `steps`, `summary`
|
|
40
|
-
| `approve` | `agent description`, `steps`, `summary`
|
|
41
|
-
| `advance` | `agent description`, `moves`, `steps`, `summary`
|
|
42
|
-
| `delinquent_action` | `due`, `sets at`, `steps`, `summary`
|
|
43
|
-
| `complete` | `due`, `steps`, `summary`
|
|
44
|
-
| `write_off` | `agent description`, `steps`, `summary`
|
|
45
|
-
| `create` | `agent description`, `steps`, `summary`
|
|
46
|
-
| `repay` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary`
|
|
47
|
-
| `refund` | `agent description`, `moves`, `steps`, `summary`
|
|
48
|
-
| `create` | `agent description`, `steps`, `summary`
|
|
49
|
-
| `open_period` | `due`, `steps`, `summary`
|
|
50
|
-
| `collect_period` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
|
|
51
|
-
| `until` | `agent description`, `capture input`, `
|
|
36
|
+
| Action | Clauses lowered |
|
|
37
|
+
| ------------------- | -------------------------------------------------------------------------------------------------------------------------- |
|
|
38
|
+
| `create` | `agent description`, `steps`, `summary` |
|
|
39
|
+
| `create` | `agent description`, `moves`, `steps`, `summary` |
|
|
40
|
+
| `approve` | `agent description`, `steps`, `summary` |
|
|
41
|
+
| `advance` | `agent description`, `moves`, `steps`, `summary` |
|
|
42
|
+
| `delinquent_action` | `due`, `sets at`, `steps`, `summary` |
|
|
43
|
+
| `complete` | `due`, `steps`, `summary` |
|
|
44
|
+
| `write_off` | `agent description`, `steps`, `summary` |
|
|
45
|
+
| `create` | `agent description`, `steps`, `summary` |
|
|
46
|
+
| `repay` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `steps`, `summary` |
|
|
47
|
+
| `refund` | `agent description`, `moves`, `steps`, `summary` |
|
|
48
|
+
| `create` | `agent description`, `steps`, `summary` |
|
|
49
|
+
| `open_period` | `due`, `steps`, `summary` |
|
|
50
|
+
| `collect_period` | `agent description`, `capture input`, `description`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
|
|
51
|
+
| `until` | `agent description`, `capture input`, `input`, `port`, `steps`, `summary` |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# security_deposit
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/security_deposit.hsx`](../../../std/money_flows/security_deposit.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -32,15 +32,15 @@ Source: [`std/settlements/security_deposit.hsx`](../../../std/settlements/securi
|
|
|
32
32
|
|
|
33
33
|
## Actions and clauses
|
|
34
34
|
|
|
35
|
-
| Action | Clauses lowered
|
|
36
|
-
| --------------- |
|
|
37
|
-
| `create` | `agent description`, `moves`, `steps`, `summary`
|
|
38
|
-
| `place_deposit` | `agent description`, `moves`, `steps`, `summary` |
|
|
39
|
-
| `claim_name` | `agent description`, `
|
|
40
|
-
| `return_name` | `agent description`, `moves`, `steps`, `summary`
|
|
41
|
-
| `create` | `agent description`, `deadline`, `moves`, `steps`, `summary`
|
|
42
|
-
| `fund` | `agent description`, `deadline`, `moves`, `sandbox failure point`, `steps`, `summary`
|
|
43
|
-
| `claim` | `agent description`, `capture input`, `deadline`, `decided amount`, `input`, `moves`, `port`, `steps`, `summary` |
|
|
44
|
-
| `return` | `agent description`, `deadline`, `moves`, `port`, `steps`, `summary`
|
|
45
|
-
| `expire` | `due`, `moves`, `steps`, `summary`
|
|
46
|
-
| `cancel` | `agent description`, `moves`, `steps`, `summary`
|
|
35
|
+
| Action | Clauses lowered |
|
|
36
|
+
| --------------- | ----------------------------------------------------------------------------------------------------------------------------------------- |
|
|
37
|
+
| `create` | `agent description`, `moves`, `steps`, `summary` |
|
|
38
|
+
| `place_deposit` | `agent description`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
39
|
+
| `claim_name` | `agent description`, `input`, `moves`, `port`, `steps`, `summary` |
|
|
40
|
+
| `return_name` | `agent description`, `capture input`, `input`, `moves`, `port`, `steps`, `summary` |
|
|
41
|
+
| `create` | `agent description`, `deadline`, `moves`, `steps`, `summary` |
|
|
42
|
+
| `fund` | `agent description`, `deadline`, `moves`, `sandbox failure point`, `steps`, `summary` |
|
|
43
|
+
| `claim` | `agent description`, `capture input`, `deadline`, `decided amount`, `input`, `moves`, `port`, `sandbox failure point`, `steps`, `summary` |
|
|
44
|
+
| `return` | `agent description`, `deadline`, `moves`, `port`, `steps`, `summary` |
|
|
45
|
+
| `expire` | `due`, `moves`, `steps`, `summary` |
|
|
46
|
+
| `cancel` | `agent description`, `moves`, `steps`, `summary` |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# settlement_batch
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/settlement_batch.hsx`](../../../std/money_flows/settlement_batch.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# swap
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/swap.hsx`](../../../std/money_flows/swap.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -28,19 +28,19 @@ Source: [`std/settlements/swap.hsx`](../../../std/settlements/swap.hsx)
|
|
|
28
28
|
|
|
29
29
|
## Actions and clauses
|
|
30
30
|
|
|
31
|
-
| Action | Clauses lowered
|
|
32
|
-
| --------- |
|
|
33
|
-
| `abandon` | `agent description`, `moves`, `public action`, `steps`, `summary`
|
|
34
|
-
| `cancel` | `agent description`, `moves`, `public action`, `steps`, `summary`
|
|
35
|
-
| `create` | `agent description`, `moves`, `public action`, `steps`, `summary`
|
|
36
|
-
| `dispute` | `agent description`, `deadline`, `moves`, `port`, `public action`, `steps`, `summary`
|
|
37
|
-
| `fund` | `agent description`, `moves`, `public action`, `steps`, `summary`
|
|
38
|
-
| `post` | `due`, `moves`, `steps`, `summary`
|
|
39
|
-
| `release` | `agent description`, `moves`, `port`, `public action`, `sets at`, `steps`, `summary`
|
|
40
|
-
| `create` | `agent description`, `moves`, `public action`, `steps`, `summary`
|
|
41
|
-
| `fund` | `agent description`, `event name`, `moves`, `public action`, `sandbox failure point`, `steps`, `summary`
|
|
42
|
-
| `release` | `agent description`, `event name`, `moves`, `port`, `public action`, `sandbox failure point`, `sets at`, `steps`, `summary`
|
|
43
|
-
| `post` | `due`, `event name`, `moves`, `steps`, `summary`
|
|
44
|
-
| `dispute` | `agent description`, `deadline`, `event name`, `moves`, `port`, `public action`, `steps`, `summary`
|
|
45
|
-
| `cancel` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary`
|
|
46
|
-
| `abandon` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary`
|
|
31
|
+
| Action | Clauses lowered |
|
|
32
|
+
| --------- | ----------------------------------------------------------------------------------------------------------------------------- |
|
|
33
|
+
| `abandon` | `agent description`, `moves`, `public action`, `steps`, `summary` |
|
|
34
|
+
| `cancel` | `agent description`, `moves`, `public action`, `steps`, `summary` |
|
|
35
|
+
| `create` | `agent description`, `moves`, `public action`, `steps`, `summary` |
|
|
36
|
+
| `dispute` | `agent description`, `capture input`, `deadline`, `input`, `moves`, `port`, `public action`, `steps`, `summary` |
|
|
37
|
+
| `fund` | `agent description`, `moves`, `public action`, `sandbox failure point`, `steps`, `summary` |
|
|
38
|
+
| `post` | `due`, `moves`, `steps`, `summary` |
|
|
39
|
+
| `release` | `agent description`, `moves`, `port`, `public action`, `sandbox failure point`, `sets at`, `steps`, `summary` |
|
|
40
|
+
| `create` | `agent description`, `moves`, `public action`, `steps`, `summary` |
|
|
41
|
+
| `fund` | `agent description`, `event name`, `moves`, `public action`, `sandbox failure point`, `steps`, `summary` |
|
|
42
|
+
| `release` | `agent description`, `event name`, `moves`, `port`, `public action`, `sandbox failure point`, `sets at`, `steps`, `summary` |
|
|
43
|
+
| `post` | `due`, `event name`, `moves`, `steps`, `summary` |
|
|
44
|
+
| `dispute` | `agent description`, `capture input`, `deadline`, `event name`, `input`, `moves`, `port`, `public action`, `steps`, `summary` |
|
|
45
|
+
| `cancel` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary` |
|
|
46
|
+
| `abandon` | `agent description`, `event name`, `moves`, `public action`, `steps`, `summary` |
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# threshold_pool
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/threshold_pool.hsx`](../../../std/money_flows/threshold_pool.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<!-- Generated by scripts/docs/build.ts for HSX
|
|
1
|
+
<!-- Generated by scripts/docs/build.ts for HSX 2.0.0. Do not edit. -->
|
|
2
2
|
|
|
3
3
|
# weighted_distribution
|
|
4
4
|
|
|
5
|
-
Source: [`std/
|
|
5
|
+
Source: [`std/money_flows/weighted_distribution.hsx`](../../../std/money_flows/weighted_distribution.hsx)
|
|
6
6
|
|
|
7
7
|
## Export
|
|
8
8
|
|
package/docs/reference/types.md
CHANGED
|
@@ -14,7 +14,7 @@ hsx build tip-jar.hsx # the compiled IR
|
|
|
14
14
|
name is `snake_case` and becomes the IR document's `product`; the title is
|
|
15
15
|
optional and is what people read.
|
|
16
16
|
|
|
17
|
-
**`import { instant_transfer } from "std/
|
|
17
|
+
**`import { instant_transfer } from "std/money_flows"`** brings in one settlement brick.
|
|
18
18
|
`"settlement"` is the only module there is, and it holds seventeen settlement
|
|
19
19
|
bricks. A brick you have not imported cannot be instantiated, so the imports
|
|
20
20
|
at the top tell you what shape of company this is before you read a line of it.
|
|
@@ -4,6 +4,3 @@ This reference program joins the algebra needed for one club product. It keeps
|
|
|
4
4
|
each watch attached to explicit sale, deposit, and trade rules. Membership due
|
|
5
5
|
dates open periods, while callers still author every money action. Seller
|
|
6
6
|
payouts close through stored provider evidence.
|
|
7
|
-
|
|
8
|
-
The acceptance proof lives in
|
|
9
|
-
`toolchain/system-tests/test/watch-club.acceptance.spec.ts`.
|
package/examples/README.md
CHANGED
|
@@ -1,12 +1,43 @@
|
|
|
1
1
|
# Examples
|
|
2
2
|
|
|
3
|
-
Each
|
|
3
|
+
Each money flow has its own directory with an HSX program, a
|
|
4
4
|
short lesson, and pinned canonical UDL bytes. The test suite reads the module
|
|
5
|
-
list from `std/
|
|
5
|
+
list from `std/money_flows`, compiles every program, and compares each emitted
|
|
6
6
|
document byte for byte.
|
|
7
7
|
|
|
8
|
-
The numbered examples
|
|
9
|
-
|
|
8
|
+
The numbered examples provide end-to-end walkthroughs:
|
|
9
|
+
|
|
10
|
+
- [01 · Your first program](01-first-program/README.md)
|
|
11
|
+
- [02 · Imports and modules](02-imports-and-archetypes/README.md)
|
|
12
|
+
- [03 · Diagnostics](03-diagnostics/README.md)
|
|
13
|
+
- [04 · Complete product](04-complete-product/README.md)
|
|
14
|
+
- [05 · Watch club](05-watch-club/README.md)
|
|
15
|
+
|
|
16
|
+
## Money flows
|
|
17
|
+
|
|
18
|
+
Each money flow has a runnable example directory:
|
|
19
|
+
|
|
20
|
+
- [advance](advance/README.md)
|
|
21
|
+
- [cancellable_booking](cancellable_booking/README.md)
|
|
22
|
+
- [captured_payment](captured_payment/README.md)
|
|
23
|
+
- [conditional_disbursement](conditional_disbursement/README.md)
|
|
24
|
+
- [credit_facility](credit_facility/README.md)
|
|
25
|
+
- [held_payment](held_payment/README.md)
|
|
26
|
+
- [instant_transfer](instant_transfer/README.md)
|
|
27
|
+
- [metered](metered/README.md)
|
|
28
|
+
- [pooled_split](pooled_split/README.md)
|
|
29
|
+
- [premium_forward](premium_forward/README.md)
|
|
30
|
+
- [reconciled_payout](reconciled_payout/README.md)
|
|
31
|
+
- [recurring_collection](recurring_collection/README.md)
|
|
32
|
+
- [rotating_pool](rotating_pool/README.md)
|
|
33
|
+
- [scheduled](scheduled/README.md)
|
|
34
|
+
- [security_deposit](security_deposit/README.md)
|
|
35
|
+
- [settlement_batch](settlement_batch/README.md)
|
|
36
|
+
- [swap](swap/README.md)
|
|
37
|
+
- [threshold_pool](threshold_pool/README.md)
|
|
38
|
+
- [weighted_distribution](weighted_distribution/README.md)
|
|
39
|
+
|
|
40
|
+
## Running an example
|
|
10
41
|
|
|
11
42
|
Run an example with the installed CLI:
|
|
12
43
|
|
|
@@ -215,7 +215,8 @@
|
|
|
215
215
|
"feeAmount": {
|
|
216
216
|
"description": "2.5% of principal, the funder's discount repaid on top of the advance",
|
|
217
217
|
"pattern": "^[1-9][0-9]{0,17}$",
|
|
218
|
-
"type": "string"
|
|
218
|
+
"type": "string",
|
|
219
|
+
"x-hyperscale-currency": "SAR"
|
|
219
220
|
},
|
|
220
221
|
"firstDueAt": {
|
|
221
222
|
"description": "Due date of the first repayment; repayment k falls P30D after its predecessor",
|
|
@@ -236,7 +237,8 @@
|
|
|
236
237
|
"principal": {
|
|
237
238
|
"description": "The advanced amount in SAR minor units, disbursed to the recipient up front",
|
|
238
239
|
"pattern": "^[1-9][0-9]{0,17}$",
|
|
239
|
-
"type": "string"
|
|
240
|
+
"type": "string",
|
|
241
|
+
"x-hyperscale-currency": "SAR"
|
|
240
242
|
},
|
|
241
243
|
"recipientAccountId": {
|
|
242
244
|
"description": "The recipient account",
|
|
@@ -252,17 +254,20 @@
|
|
|
252
254
|
"repayableAmount": {
|
|
253
255
|
"description": "principal + feeAmount: the total the repayment fields below partition exactly",
|
|
254
256
|
"pattern": "^[1-9][0-9]{0,17}$",
|
|
255
|
-
"type": "string"
|
|
257
|
+
"type": "string",
|
|
258
|
+
"x-hyperscale-currency": "SAR"
|
|
256
259
|
},
|
|
257
260
|
"repayment1Amount": {
|
|
258
261
|
"description": "Repayment 1 of 2 (carries the integer-division remainder): about 33.34% of repayableAmount, collected on its own stored-date anchor",
|
|
259
262
|
"pattern": "^[1-9][0-9]{0,17}$",
|
|
260
|
-
"type": "string"
|
|
263
|
+
"type": "string",
|
|
264
|
+
"x-hyperscale-currency": "SAR"
|
|
261
265
|
},
|
|
262
266
|
"repayment2Amount": {
|
|
263
267
|
"description": "Repayment 2 of 2: about 33.33% of repayableAmount, collected on its own stored-date anchor",
|
|
264
268
|
"pattern": "^[1-9][0-9]{0,17}$",
|
|
265
|
-
"type": "string"
|
|
269
|
+
"type": "string",
|
|
270
|
+
"x-hyperscale-currency": "SAR"
|
|
266
271
|
}
|
|
267
272
|
},
|
|
268
273
|
"id": "advance_payment",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
program cancellable_booking_example "Cancellable booking example"
|
|
2
|
-
import { cancellable_booking } from "std/
|
|
2
|
+
import { cancellable_booking } from "std/money_flows"
|
|
3
3
|
party guest: person
|
|
4
4
|
party studio: business
|
|
5
5
|
settlement studio_session = cancellable_booking {
|
|
@@ -275,6 +275,7 @@
|
|
|
275
275
|
}
|
|
276
276
|
],
|
|
277
277
|
"publicAction": "takeStudioSession",
|
|
278
|
+
"sandboxFailurePoint": "funding",
|
|
278
279
|
"steps": [],
|
|
279
280
|
"summary": "Take the booking price from the guest into the holding account"
|
|
280
281
|
}
|
|
@@ -303,7 +304,8 @@
|
|
|
303
304
|
"sessionPrice": {
|
|
304
305
|
"description": "Booking price in minor units, held away from both the guest and the studio until the booking ends",
|
|
305
306
|
"pattern": "^[1-9][0-9]{0,17}$",
|
|
306
|
-
"type": "string"
|
|
307
|
+
"type": "string",
|
|
308
|
+
"x-hyperscale-currency": "SAR"
|
|
307
309
|
},
|
|
308
310
|
"startsAt": {
|
|
309
311
|
"description": "When the booking starts; the cancellation penalty is priced against the time left before it",
|