@hyperscale0/hsx 5.7.0 → 6.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 +32 -0
- package/README.md +3 -4
- package/bin/hsx.ts +0 -5
- package/dist/bin/hsx.d.ts +0 -4
- package/dist/bin/hsx.d.ts.map +1 -1
- package/dist/bin/hsx.js +0 -4
- package/dist/bin/hsx.js.map +1 -1
- package/dist/src/compile.d.ts.map +1 -1
- package/dist/src/compile.js +278 -35
- package/dist/src/compile.js.map +1 -1
- package/dist/src/diagnostics.d.ts +2 -0
- package/dist/src/diagnostics.d.ts.map +1 -1
- package/dist/src/diagnostics.js +23 -0
- package/dist/src/diagnostics.js.map +1 -1
- package/dist/src/examples-bundle.d.ts.map +1 -1
- package/dist/src/examples-bundle.js +0 -1
- package/dist/src/examples-bundle.js.map +1 -1
- package/dist/src/headers.d.ts +1 -1
- package/dist/src/headers.d.ts.map +1 -1
- package/dist/src/headers.js +0 -1
- package/dist/src/headers.js.map +1 -1
- package/dist/src/std-bundle.d.ts.map +1 -1
- package/dist/src/std-bundle.js +3 -4
- package/dist/src/std-bundle.js.map +1 -1
- package/dist/src/version.d.ts +1 -1
- package/dist/src/version.js +1 -1
- package/docs/README.md +16 -19
- package/package.json +5 -6
- package/src/compile.ts +363 -48
- package/src/diagnostics.ts +34 -0
- package/src/examples-bundle.ts +0 -1
- package/src/headers.ts +0 -1
- package/src/std-bundle.ts +3 -4
- package/src/version.ts +1 -1
- package/std/financing.hsx +3 -1
- package/std/marketplace.hsx +3 -9
- package/std/reporting.hsx +105 -676
- package/docs/examples.md +0 -22
- package/docs/headers.md +0 -46
- package/examples/travel.hsx +0 -29
- package/std/travel.hsx +0 -123
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const HSX_VERSION = "
|
|
1
|
+
export const HSX_VERSION = "6.0.0";
|
package/std/financing.hsx
CHANGED
|
@@ -10,6 +10,8 @@ header financing
|
|
|
10
10
|
// it tops up only the missing down payment, without advancing lender principal.
|
|
11
11
|
// Disburse still collects any missing down payment, activates slices, and confirms
|
|
12
12
|
// the fully funded hold. Existing escrow credit counts once toward the down payment.
|
|
13
|
+
// Disburse first credits an active marketplace.reservation on the same hold,
|
|
14
|
+
// so list the plan in its converters; the deposit then counts as escrow credit.
|
|
13
15
|
// Borrower-directed disbursement excludes collect_down_payment. A down_payment
|
|
14
16
|
// there reduces principal but does not collect cash. Price is subject metadata,
|
|
15
17
|
// not the borrower limit. The escrow payer and price must match the plan.
|
|
@@ -82,7 +84,7 @@ instrument installments(months: integer(1, 366), charge_limit: integer(1, 3) = 3
|
|
|
82
84
|
requires self.portfolioLimit in [approved]
|
|
83
85
|
when disburse_to is funds {
|
|
84
86
|
requires self.funds in [pending]
|
|
85
|
-
invoke: [{ reference: self.id, action: fund_down_payment, input: {} }]
|
|
87
|
+
invoke: [{ selection: { instrument: all(marketplace.reservation), reference: "funds", anchor: self.funds, states: [active], limit: 1 }, action: credit, input: { funds: { field: self.funds }, contribution: { field: self.downPayment } } }, { reference: self.id, action: fund_down_payment, input: {} }]
|
|
86
88
|
}
|
|
87
89
|
when disburse_to is borrower { moves self.principal from self.capital to self.borrower economics { purpose: principal, sourceParty: capital } }
|
|
88
90
|
invoke: [{ selection: { instrument: slice, reference: "plan", anchor: self.id, states: [draft], limit: 366, order: [position] }, action: activate, input: {} }]
|
package/std/marketplace.hsx
CHANGED
|
@@ -9,8 +9,8 @@ header marketplace
|
|
|
9
9
|
// verify_return and refund aliases. Refund needs disputed -> return_verified,
|
|
10
10
|
// with payee evidence, then returns the full price to payer; accept pays payee.
|
|
11
11
|
// A reservation holds its own deposit. Activate requires an active listing and
|
|
12
|
-
// no placed order.
|
|
13
|
-
//
|
|
12
|
+
// no placed order. Only a declared converter may invoke credit. A financing
|
|
13
|
+
// plan on the same hold credits it when the lender disburses. Credit consumes the
|
|
14
14
|
// deposit once, credits at most the contribution, and returns excess to buyer.
|
|
15
15
|
// Expose cancel, seller_cancel or operator_cancel for the intended actors.
|
|
16
16
|
// Buyer cancel and expiry use configured refund percentages; seller/operator
|
|
@@ -64,7 +64,7 @@ instrument order(listing: ref<marketplace.listing>, buyer: party) {
|
|
|
64
64
|
action cancel { from: [quoted, placed], to: cancelled, actor: { party: buyer } }
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
instrument reservation(listing: ref<marketplace.listing>, funds: ref<escrow.hold>,
|
|
67
|
+
instrument reservation(listing: ref<marketplace.listing>, funds: ref<escrow.hold>, converters: ref[], buyer: party, seller: party, expires_after: duration = 48h, deposit: money = 1000 SAR, cancellation_refund: percent = 100%, expiry_refund: percent = 100%, retained_to: party = programOperator, operator: party = programOperator, competing_quotes: enum(allowed, blocked) = allowed) {
|
|
68
68
|
revisioned: true
|
|
69
69
|
summary: "Exclusive timed listing hold with explicit deposit credit and refund."
|
|
70
70
|
fields {
|
|
@@ -82,12 +82,6 @@ instrument reservation(listing: ref<marketplace.listing>, funds: ref<escrow.hold
|
|
|
82
82
|
requires count of { instrument: all(marketplace.order), reference: "listing", anchor: self.listing, states: [placed, fulfilled], limit: 366 } == 0
|
|
83
83
|
moves self.deposit from self.buyer to self.held economics { purpose: principal, sourceParty: buyer }
|
|
84
84
|
}
|
|
85
|
-
action convert_financed {
|
|
86
|
-
from: active, to: active, actor: { party: buyer }, deadline: { at: self.expiresAt }
|
|
87
|
-
input { plan: ref<plans> }
|
|
88
|
-
requires input.plan.funds == self.funds; requires input.plan.borrower == self.buyer
|
|
89
|
-
invoke: [{ reference: input.plan, action: disburse, input: {} }]
|
|
90
|
-
}
|
|
91
85
|
action convert_cash {
|
|
92
86
|
from: active, to: active, actor: { party: buyer }, deadline: { at: self.expiresAt }
|
|
93
87
|
invoke: [{ reference: self.funds, action: fund, input: {} }]
|