@xyo-network/payment-payload-plugins 7.0.3 → 7.0.4
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/dist/neutral/index.d.ts +1 -11
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +2 -1298
- package/dist/neutral/index.mjs.map +4 -4
- package/package.json +24 -21
- package/dist/neutral/Amount/Iso4217Currency.d.ts +0 -14
- package/dist/neutral/Amount/Iso4217Currency.d.ts.map +0 -1
- package/dist/neutral/Amount/Payload.d.ts +0 -68
- package/dist/neutral/Amount/Payload.d.ts.map +0 -1
- package/dist/neutral/Amount/index.d.ts +0 -3
- package/dist/neutral/Amount/index.d.ts.map +0 -1
- package/dist/neutral/Billing/Address/Address.d.ts +0 -112
- package/dist/neutral/Billing/Address/Address.d.ts.map +0 -1
- package/dist/neutral/Billing/Address/Schema.d.ts +0 -5
- package/dist/neutral/Billing/Address/Schema.d.ts.map +0 -1
- package/dist/neutral/Billing/Address/index.d.ts +0 -3
- package/dist/neutral/Billing/Address/index.d.ts.map +0 -1
- package/dist/neutral/Billing/Schema.d.ts +0 -5
- package/dist/neutral/Billing/Schema.d.ts.map +0 -1
- package/dist/neutral/Billing/index.d.ts +0 -3
- package/dist/neutral/Billing/index.d.ts.map +0 -1
- package/dist/neutral/Currency.d.ts +0 -6
- package/dist/neutral/Currency.d.ts.map +0 -1
- package/dist/neutral/Discount/Config.d.ts +0 -23
- package/dist/neutral/Discount/Config.d.ts.map +0 -1
- package/dist/neutral/Discount/Params.d.ts +0 -9
- package/dist/neutral/Discount/Params.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Conditions/AppraisalAmountCondition.d.ts +0 -8
- package/dist/neutral/Discount/Payload/Coupon/Conditions/AppraisalAmountCondition.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Conditions/AssetQuantityCondition.d.ts +0 -8
- package/dist/neutral/Discount/Payload/Coupon/Conditions/AssetQuantityCondition.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Conditions/BuyerCondition.d.ts +0 -34
- package/dist/neutral/Discount/Payload/Coupon/Conditions/BuyerCondition.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Conditions/index.d.ts +0 -4
- package/dist/neutral/Discount/Payload/Coupon/Conditions/index.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +0 -92
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +0 -85
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +0 -92
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/index.d.ts +0 -4
- package/dist/neutral/Discount/Payload/Coupon/Coupons/index.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +0 -193
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/Schema.d.ts +0 -5
- package/dist/neutral/Discount/Payload/Coupon/Schema.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/index.d.ts +0 -6
- package/dist/neutral/Discount/Payload/Coupon/index.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts +0 -100
- package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts +0 -12
- package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/types/index.d.ts +0 -4
- package/dist/neutral/Discount/Payload/Coupon/types/index.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Coupon/types/isStackable.d.ts +0 -5
- package/dist/neutral/Discount/Payload/Coupon/types/isStackable.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/Discount.d.ts +0 -64
- package/dist/neutral/Discount/Payload/Discount.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/NoDiscount.d.ts +0 -3
- package/dist/neutral/Discount/Payload/NoDiscount.d.ts.map +0 -1
- package/dist/neutral/Discount/Payload/index.d.ts +0 -4
- package/dist/neutral/Discount/Payload/index.d.ts.map +0 -1
- package/dist/neutral/Discount/index.d.ts +0 -4
- package/dist/neutral/Discount/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/Outcome.d.ts +0 -78
- package/dist/neutral/Escrow/Outcome.d.ts.map +0 -1
- package/dist/neutral/Escrow/Schema.d.ts +0 -5
- package/dist/neutral/Escrow/Schema.d.ts.map +0 -1
- package/dist/neutral/Escrow/Terms/Party.d.ts +0 -6
- package/dist/neutral/Escrow/Terms/Party.d.ts.map +0 -1
- package/dist/neutral/Escrow/Terms/PartySecret.d.ts +0 -6
- package/dist/neutral/Escrow/Terms/PartySecret.d.ts.map +0 -1
- package/dist/neutral/Escrow/Terms/Terms.d.ts +0 -314
- package/dist/neutral/Escrow/Terms/Terms.d.ts.map +0 -1
- package/dist/neutral/Escrow/Terms/index.d.ts +0 -4
- package/dist/neutral/Escrow/Terms/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/index.d.ts +0 -6
- package/dist/neutral/Escrow/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts +0 -12
- package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts +0 -12
- package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/appraisal/index.d.ts +0 -3
- package/dist/neutral/Escrow/util/appraisal/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/index.d.ts +0 -3
- package/dist/neutral/Escrow/util/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts +0 -38
- package/dist/neutral/Escrow/util/secret/createEscrowIntent.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/secret/findEscrowPartySecretSignatures.d.ts +0 -12
- package/dist/neutral/Escrow/util/secret/findEscrowPartySecretSignatures.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/secret/getEscrowSecret.d.ts +0 -7
- package/dist/neutral/Escrow/util/secret/getEscrowSecret.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/secret/index.d.ts +0 -5
- package/dist/neutral/Escrow/util/secret/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts +0 -40
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/index.d.ts +0 -2
- package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.d.ts +0 -21
- package/dist/neutral/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts +0 -10
- package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/common/SecretValidators/index.d.ts +0 -2
- package/dist/neutral/Escrow/validators/common/SecretValidators/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/common/TemporalValidators/index.d.ts +0 -2
- package/dist/neutral/Escrow/validators/common/TemporalValidators/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/common/TemporalValidators/validateWithinWindow.d.ts +0 -6
- package/dist/neutral/Escrow/validators/common/TemporalValidators/validateWithinWindow.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/common/index.d.ts +0 -4
- package/dist/neutral/Escrow/validators/common/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/agent.d.ts +0 -4
- package/dist/neutral/Escrow/validators/escrow/agent.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts +0 -29
- package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/appraisalAuthorities.d.ts +0 -9
- package/dist/neutral/Escrow/validators/escrow/appraisalAuthorities.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/assets.d.ts +0 -8
- package/dist/neutral/Escrow/validators/escrow/assets.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/buyer.d.ts +0 -8
- package/dist/neutral/Escrow/validators/escrow/buyer.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/buyerSecret.d.ts +0 -21
- package/dist/neutral/Escrow/validators/escrow/buyerSecret.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/index.d.ts +0 -11
- package/dist/neutral/Escrow/validators/escrow/index.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/nbfExp.d.ts +0 -4
- package/dist/neutral/Escrow/validators/escrow/nbfExp.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/paymentAuthorities.d.ts +0 -4
- package/dist/neutral/Escrow/validators/escrow/paymentAuthorities.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/seller.d.ts +0 -8
- package/dist/neutral/Escrow/validators/escrow/seller.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/escrow/sellerSecret.d.ts +0 -21
- package/dist/neutral/Escrow/validators/escrow/sellerSecret.d.ts.map +0 -1
- package/dist/neutral/Escrow/validators/index.d.ts +0 -3
- package/dist/neutral/Escrow/validators/index.d.ts.map +0 -1
- package/dist/neutral/Invoice/Invoice.d.ts +0 -17
- package/dist/neutral/Invoice/Invoice.d.ts.map +0 -1
- package/dist/neutral/Invoice/index.d.ts +0 -2
- package/dist/neutral/Invoice/index.d.ts.map +0 -1
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +0 -84
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts.map +0 -1
- package/dist/neutral/Payment/Instrument/Card/Schema.d.ts +0 -5
- package/dist/neutral/Payment/Instrument/Card/Schema.d.ts.map +0 -1
- package/dist/neutral/Payment/Instrument/Card/index.d.ts +0 -3
- package/dist/neutral/Payment/Instrument/Card/index.d.ts.map +0 -1
- package/dist/neutral/Payment/Instrument/Schema.d.ts +0 -5
- package/dist/neutral/Payment/Instrument/Schema.d.ts.map +0 -1
- package/dist/neutral/Payment/Instrument/index.d.ts +0 -3
- package/dist/neutral/Payment/Instrument/index.d.ts.map +0 -1
- package/dist/neutral/Payment/Payload.d.ts +0 -64
- package/dist/neutral/Payment/Payload.d.ts.map +0 -1
- package/dist/neutral/Payment/Schema.d.ts +0 -5
- package/dist/neutral/Payment/Schema.d.ts.map +0 -1
- package/dist/neutral/Payment/Status/Payload.d.ts +0 -60
- package/dist/neutral/Payment/Status/Payload.d.ts.map +0 -1
- package/dist/neutral/Payment/Status/Schema.d.ts +0 -5
- package/dist/neutral/Payment/Status/Schema.d.ts.map +0 -1
- package/dist/neutral/Payment/Status/index.d.ts +0 -3
- package/dist/neutral/Payment/Status/index.d.ts.map +0 -1
- package/dist/neutral/Payment/index.d.ts +0 -5
- package/dist/neutral/Payment/index.d.ts.map +0 -1
- package/dist/neutral/Purchase/Payload.d.ts +0 -60
- package/dist/neutral/Purchase/Payload.d.ts.map +0 -1
- package/dist/neutral/Purchase/Schema.d.ts +0 -5
- package/dist/neutral/Purchase/Schema.d.ts.map +0 -1
- package/dist/neutral/Purchase/index.d.ts +0 -3
- package/dist/neutral/Purchase/index.d.ts.map +0 -1
- package/dist/neutral/Receipt/Payload.d.ts +0 -64
- package/dist/neutral/Receipt/Payload.d.ts.map +0 -1
- package/dist/neutral/Receipt/Schema.d.ts +0 -5
- package/dist/neutral/Receipt/Schema.d.ts.map +0 -1
- package/dist/neutral/Receipt/index.d.ts +0 -3
- package/dist/neutral/Receipt/index.d.ts.map +0 -1
- package/dist/neutral/Schema.d.ts +0 -5
- package/dist/neutral/Schema.d.ts.map +0 -1
- package/dist/neutral/Subtotal/Diviner/Config.d.ts +0 -10
- package/dist/neutral/Subtotal/Diviner/Config.d.ts.map +0 -1
- package/dist/neutral/Subtotal/Diviner/Params.d.ts +0 -4
- package/dist/neutral/Subtotal/Diviner/Params.d.ts.map +0 -1
- package/dist/neutral/Subtotal/Diviner/Payload.d.ts +0 -64
- package/dist/neutral/Subtotal/Diviner/Payload.d.ts.map +0 -1
- package/dist/neutral/Subtotal/Diviner/index.d.ts +0 -4
- package/dist/neutral/Subtotal/Diviner/index.d.ts.map +0 -1
- package/dist/neutral/Subtotal/index.d.ts +0 -2
- package/dist/neutral/Subtotal/index.d.ts.map +0 -1
- package/dist/neutral/Total/Diviner/Config.d.ts +0 -19
- package/dist/neutral/Total/Diviner/Config.d.ts.map +0 -1
- package/dist/neutral/Total/Diviner/Params.d.ts +0 -4
- package/dist/neutral/Total/Diviner/Params.d.ts.map +0 -1
- package/dist/neutral/Total/Diviner/Payload.d.ts +0 -64
- package/dist/neutral/Total/Diviner/Payload.d.ts.map +0 -1
- package/dist/neutral/Total/Diviner/index.d.ts +0 -4
- package/dist/neutral/Total/Diviner/index.d.ts.map +0 -1
- package/dist/neutral/Total/index.d.ts +0 -2
- package/dist/neutral/Total/index.d.ts.map +0 -1
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,1299 +1,3 @@
|
|
|
1
|
-
// src/
|
|
2
|
-
|
|
3
|
-
AED: 784,
|
|
4
|
-
AFN: 971,
|
|
5
|
-
ALL: 8,
|
|
6
|
-
AMD: 51,
|
|
7
|
-
ANG: 532,
|
|
8
|
-
AOA: 973,
|
|
9
|
-
ARS: 32,
|
|
10
|
-
AUD: 36,
|
|
11
|
-
AWG: 533,
|
|
12
|
-
AZN: 944,
|
|
13
|
-
BAM: 977,
|
|
14
|
-
BBD: 52,
|
|
15
|
-
BDT: 50,
|
|
16
|
-
BGN: 975,
|
|
17
|
-
BHD: 48,
|
|
18
|
-
BIF: 108,
|
|
19
|
-
BMD: 60,
|
|
20
|
-
BND: 96,
|
|
21
|
-
BOB: 68,
|
|
22
|
-
BOV: 984,
|
|
23
|
-
BRL: 986,
|
|
24
|
-
BSD: 44,
|
|
25
|
-
BTN: 64,
|
|
26
|
-
BWP: 72,
|
|
27
|
-
BYN: 933,
|
|
28
|
-
BZD: 84,
|
|
29
|
-
CAD: 124,
|
|
30
|
-
CDF: 976,
|
|
31
|
-
CHE: 947,
|
|
32
|
-
CHF: 756,
|
|
33
|
-
CHW: 948,
|
|
34
|
-
CLF: 990,
|
|
35
|
-
CLP: 152,
|
|
36
|
-
CNY: 156,
|
|
37
|
-
COP: 170,
|
|
38
|
-
COU: 970,
|
|
39
|
-
CRC: 188,
|
|
40
|
-
CUP: 192,
|
|
41
|
-
CVE: 132,
|
|
42
|
-
CZK: 203,
|
|
43
|
-
DJF: 262,
|
|
44
|
-
DKK: 208,
|
|
45
|
-
DOP: 214,
|
|
46
|
-
DZD: 12,
|
|
47
|
-
EGP: 818,
|
|
48
|
-
ERN: 232,
|
|
49
|
-
ETB: 230,
|
|
50
|
-
EUR: 978,
|
|
51
|
-
FJD: 242,
|
|
52
|
-
FKP: 238,
|
|
53
|
-
GBP: 826,
|
|
54
|
-
GEL: 981,
|
|
55
|
-
GHS: 936,
|
|
56
|
-
GIP: 292,
|
|
57
|
-
GMD: 270,
|
|
58
|
-
GNF: 324,
|
|
59
|
-
GTQ: 320,
|
|
60
|
-
GYD: 328,
|
|
61
|
-
HKD: 344,
|
|
62
|
-
HNL: 340,
|
|
63
|
-
HTG: 332,
|
|
64
|
-
HUF: 348,
|
|
65
|
-
IDR: 360,
|
|
66
|
-
ILS: 376,
|
|
67
|
-
INR: 356,
|
|
68
|
-
IQD: 368,
|
|
69
|
-
IRR: 364,
|
|
70
|
-
ISK: 352,
|
|
71
|
-
JMD: 388,
|
|
72
|
-
JOD: 400,
|
|
73
|
-
JPY: 392,
|
|
74
|
-
KES: 404,
|
|
75
|
-
KGS: 417,
|
|
76
|
-
KHR: 116,
|
|
77
|
-
KMF: 174,
|
|
78
|
-
KPW: 408,
|
|
79
|
-
KRW: 410,
|
|
80
|
-
KWD: 414,
|
|
81
|
-
KYD: 136,
|
|
82
|
-
KZT: 398,
|
|
83
|
-
LAK: 418,
|
|
84
|
-
LBP: 422,
|
|
85
|
-
LKR: 144,
|
|
86
|
-
LRD: 430,
|
|
87
|
-
LSL: 426,
|
|
88
|
-
LYD: 434,
|
|
89
|
-
MAD: 504,
|
|
90
|
-
MDL: 498,
|
|
91
|
-
MGA: 969,
|
|
92
|
-
MKD: 807,
|
|
93
|
-
MMK: 104,
|
|
94
|
-
MNT: 496,
|
|
95
|
-
MOP: 446,
|
|
96
|
-
MRU: 929,
|
|
97
|
-
MUR: 480,
|
|
98
|
-
MVR: 462,
|
|
99
|
-
MWK: 454,
|
|
100
|
-
MXN: 484,
|
|
101
|
-
MXV: 979,
|
|
102
|
-
MYR: 458,
|
|
103
|
-
MZN: 943,
|
|
104
|
-
NAD: 516,
|
|
105
|
-
NGN: 566,
|
|
106
|
-
NIO: 558,
|
|
107
|
-
NOK: 578,
|
|
108
|
-
NPR: 524,
|
|
109
|
-
NZD: 554,
|
|
110
|
-
OMR: 512,
|
|
111
|
-
PAB: 590,
|
|
112
|
-
PEN: 604,
|
|
113
|
-
PGK: 598,
|
|
114
|
-
PHP: 608,
|
|
115
|
-
PKR: 586,
|
|
116
|
-
PLN: 985,
|
|
117
|
-
PYG: 600,
|
|
118
|
-
QAR: 634,
|
|
119
|
-
RON: 946,
|
|
120
|
-
RSD: 941,
|
|
121
|
-
RUB: 643,
|
|
122
|
-
RWF: 646,
|
|
123
|
-
SAR: 682,
|
|
124
|
-
SBD: 90,
|
|
125
|
-
SCR: 690,
|
|
126
|
-
SDG: 938,
|
|
127
|
-
SEK: 752,
|
|
128
|
-
SGD: 702,
|
|
129
|
-
SHP: 654,
|
|
130
|
-
SLE: 925,
|
|
131
|
-
SOS: 706,
|
|
132
|
-
SRD: 968,
|
|
133
|
-
SSP: 728,
|
|
134
|
-
STN: 930,
|
|
135
|
-
SVC: 222,
|
|
136
|
-
SYP: 760,
|
|
137
|
-
SZL: 748,
|
|
138
|
-
THB: 764,
|
|
139
|
-
TJS: 972,
|
|
140
|
-
TMT: 934,
|
|
141
|
-
TND: 788,
|
|
142
|
-
TOP: 776,
|
|
143
|
-
TRY: 949,
|
|
144
|
-
TTD: 780,
|
|
145
|
-
TWD: 901,
|
|
146
|
-
TZS: 834,
|
|
147
|
-
UAH: 980,
|
|
148
|
-
UGX: 800,
|
|
149
|
-
USD: 840,
|
|
150
|
-
USN: 997,
|
|
151
|
-
UYI: 940,
|
|
152
|
-
UYU: 858,
|
|
153
|
-
UYW: 927,
|
|
154
|
-
UZS: 860,
|
|
155
|
-
VED: 926,
|
|
156
|
-
VES: 928,
|
|
157
|
-
VND: 704,
|
|
158
|
-
VUV: 548,
|
|
159
|
-
WST: 882,
|
|
160
|
-
XAF: 950,
|
|
161
|
-
XAG: 961,
|
|
162
|
-
XAU: 959,
|
|
163
|
-
XBA: 955,
|
|
164
|
-
XBB: 956,
|
|
165
|
-
XBC: 957,
|
|
166
|
-
XBD: 958,
|
|
167
|
-
XCD: 951,
|
|
168
|
-
XDR: 960,
|
|
169
|
-
XOF: 952,
|
|
170
|
-
XPD: 964,
|
|
171
|
-
XPF: 953,
|
|
172
|
-
XPT: 962,
|
|
173
|
-
XSU: 994,
|
|
174
|
-
XTS: 963,
|
|
175
|
-
XUA: 965,
|
|
176
|
-
XXX: 999,
|
|
177
|
-
YER: 886,
|
|
178
|
-
ZAR: 710,
|
|
179
|
-
ZMW: 967,
|
|
180
|
-
ZWG: 924,
|
|
181
|
-
ZWL: 932
|
|
182
|
-
};
|
|
183
|
-
var isIso4217CurrencyCode = (code) => Object.hasOwn(Iso4217CurrencyCodes, code);
|
|
184
|
-
|
|
185
|
-
// src/Amount/Payload.ts
|
|
186
|
-
import {
|
|
187
|
-
zodAsFactory,
|
|
188
|
-
zodIsFactory,
|
|
189
|
-
zodToFactory
|
|
190
|
-
} from "@ariestools/sdk";
|
|
191
|
-
import { asSchema, PayloadZodOfSchema } from "@xyo-network/sdk";
|
|
192
|
-
import * as z from "zod/mini";
|
|
193
|
-
var AmountSchema = asSchema("network.xyo.payments.amount", true);
|
|
194
|
-
var AmountFieldsZod = z.object({
|
|
195
|
-
amount: z.number(),
|
|
196
|
-
currency: z.custom()
|
|
197
|
-
});
|
|
198
|
-
var AmountZod = z.extend(PayloadZodOfSchema(AmountSchema), { ...AmountFieldsZod.shape });
|
|
199
|
-
var isAmount = zodIsFactory(AmountZod);
|
|
200
|
-
var asAmount = zodAsFactory(AmountZod, "asAmount");
|
|
201
|
-
var toAmount = zodToFactory(AmountZod, "toAmount");
|
|
202
|
-
|
|
203
|
-
// src/Billing/Address/Address.ts
|
|
204
|
-
import {
|
|
205
|
-
zodAsFactory as zodAsFactory2,
|
|
206
|
-
zodIsFactory as zodIsFactory2,
|
|
207
|
-
zodToFactory as zodToFactory2
|
|
208
|
-
} from "@ariestools/sdk";
|
|
209
|
-
import { PayloadZodOfSchema as PayloadZodOfSchema2 } from "@xyo-network/sdk";
|
|
210
|
-
import * as z2 from "zod/mini";
|
|
211
|
-
|
|
212
|
-
// src/Billing/Address/Schema.ts
|
|
213
|
-
import { asSchema as asSchema4 } from "@xyo-network/sdk";
|
|
214
|
-
|
|
215
|
-
// src/Billing/Schema.ts
|
|
216
|
-
import { asSchema as asSchema3 } from "@xyo-network/sdk";
|
|
217
|
-
|
|
218
|
-
// src/Schema.ts
|
|
219
|
-
import { asSchema as asSchema2 } from "@xyo-network/sdk";
|
|
220
|
-
var PaymentsSchema = asSchema2("network.xyo.payments", true);
|
|
221
|
-
|
|
222
|
-
// src/Billing/Schema.ts
|
|
223
|
-
var BillingSchema = asSchema3(`${PaymentsSchema}.billing`, true);
|
|
224
|
-
|
|
225
|
-
// src/Billing/Address/Schema.ts
|
|
226
|
-
var BillingAddressSchema = asSchema4(`${BillingSchema}.address`, true);
|
|
227
|
-
|
|
228
|
-
// src/Billing/Address/Address.ts
|
|
229
|
-
var BillingAddressFieldsZod = z2.object({
|
|
230
|
-
/** Street address line 1. */
|
|
231
|
-
address: z2.optional(z2.string()),
|
|
232
|
-
/** Street address line 2. */
|
|
233
|
-
address2: z2.optional(z2.nullable(z2.string())),
|
|
234
|
-
/** City of the billing address. */
|
|
235
|
-
city: z2.optional(z2.string()),
|
|
236
|
-
/** Country code of the billing address, ISO 3166-1 alpha-2 code. */
|
|
237
|
-
country: z2.optional(z2.string()),
|
|
238
|
-
/** First name */
|
|
239
|
-
firstName: z2.string(),
|
|
240
|
-
/** Last name */
|
|
241
|
-
lastName: z2.string(),
|
|
242
|
-
/** Organization or company name associated with the billing address. */
|
|
243
|
-
organization: z2.optional(z2.nullable(z2.string())),
|
|
244
|
-
/** Postal or ZIP code of the billing address. */
|
|
245
|
-
postalCode: z2.optional(z2.string()),
|
|
246
|
-
/** State or region of the billing address. */
|
|
247
|
-
region: z2.optional(z2.string())
|
|
248
|
-
});
|
|
249
|
-
var BillingAddressZod = z2.extend(PayloadZodOfSchema2(BillingAddressSchema), { ...BillingAddressFieldsZod.shape });
|
|
250
|
-
var isBillingAddress = zodIsFactory2(BillingAddressZod);
|
|
251
|
-
var asBillingAddress = zodAsFactory2(BillingAddressZod, "asBillingAddress");
|
|
252
|
-
var toBillingAddress = zodToFactory2(BillingAddressZod, "toBillingAddress");
|
|
253
|
-
|
|
254
|
-
// src/Currency.ts
|
|
255
|
-
import * as z3 from "zod/mini";
|
|
256
|
-
var SupportedCurrencyZod = z3.enum(["USD"]);
|
|
257
|
-
|
|
258
|
-
// src/Discount/Config.ts
|
|
259
|
-
import { asSchema as asSchema5 } from "@xyo-network/sdk";
|
|
260
|
-
var PaymentDiscountDivinerConfigSchema = asSchema5("network.xyo.diviner.payments.discount.config", true);
|
|
261
|
-
|
|
262
|
-
// src/Discount/Payload/Coupon/Conditions/AppraisalAmountCondition.ts
|
|
263
|
-
import { SchemaSchema } from "@xyo-network/sdk";
|
|
264
|
-
var createConditionForMaximumAppraisalAmount = (maximumAppraisalAmount) => {
|
|
265
|
-
return {
|
|
266
|
-
schema: SchemaSchema,
|
|
267
|
-
definition: {
|
|
268
|
-
allOf: [
|
|
269
|
-
{
|
|
270
|
-
type: "array",
|
|
271
|
-
contains: {
|
|
272
|
-
type: "object",
|
|
273
|
-
properties: {
|
|
274
|
-
schema: { type: "string", const: "network.xyo.escrow.terms" },
|
|
275
|
-
appraisals: { type: "array", minItems: 1 }
|
|
276
|
-
},
|
|
277
|
-
required: ["schema", "appraisals"]
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
type: "array",
|
|
282
|
-
contains: {
|
|
283
|
-
type: "object",
|
|
284
|
-
properties: { schema: { type: "string", const: "network.xyo.hash.lease.estimate" } },
|
|
285
|
-
required: ["schema"]
|
|
286
|
-
},
|
|
287
|
-
items: {
|
|
288
|
-
type: "object",
|
|
289
|
-
if: { properties: { schema: { type: "string", const: "network.xyo.hash.lease.estimate" } } },
|
|
290
|
-
then: { properties: { price: { type: "number", maximum: maximumAppraisalAmount } }, required: ["price"] }
|
|
291
|
-
}
|
|
292
|
-
}
|
|
293
|
-
]
|
|
294
|
-
}
|
|
295
|
-
};
|
|
296
|
-
};
|
|
297
|
-
|
|
298
|
-
// src/Discount/Payload/Coupon/Conditions/AssetQuantityCondition.ts
|
|
299
|
-
import { SchemaSchema as SchemaSchema2 } from "@xyo-network/sdk";
|
|
300
|
-
var createConditionForMinimumAssetQuantity = (minimumAssetQuantity) => {
|
|
301
|
-
return {
|
|
302
|
-
schema: SchemaSchema2,
|
|
303
|
-
definition: {
|
|
304
|
-
type: "array",
|
|
305
|
-
contains: {
|
|
306
|
-
type: "object",
|
|
307
|
-
properties: {
|
|
308
|
-
schema: { type: "string", const: "network.xyo.escrow.terms" },
|
|
309
|
-
assets: { type: "array", minItems: minimumAssetQuantity }
|
|
310
|
-
},
|
|
311
|
-
required: ["schema", "assets"]
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
};
|
|
315
|
-
};
|
|
316
|
-
|
|
317
|
-
// src/Discount/Payload/Coupon/Conditions/BuyerCondition.ts
|
|
318
|
-
import { SchemaSchema as SchemaSchema3 } from "@xyo-network/sdk";
|
|
319
|
-
var createConditionForRequiredBuyer = (buyer) => {
|
|
320
|
-
return {
|
|
321
|
-
schema: SchemaSchema3,
|
|
322
|
-
definition: {
|
|
323
|
-
type: "array",
|
|
324
|
-
contains: {
|
|
325
|
-
type: "object",
|
|
326
|
-
properties: {
|
|
327
|
-
schema: { type: "string", const: "network.xyo.escrow.terms" },
|
|
328
|
-
buyer: {
|
|
329
|
-
type: "array",
|
|
330
|
-
items: { type: "string", const: buyer },
|
|
331
|
-
minItems: 1
|
|
332
|
-
}
|
|
333
|
-
},
|
|
334
|
-
required: ["schema", "buyer"]
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
};
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
// src/Discount/Payload/Coupon/Coupons/FixedAmount.ts
|
|
341
|
-
import {
|
|
342
|
-
zodAsFactory as zodAsFactory4,
|
|
343
|
-
zodIsFactory as zodIsFactory4,
|
|
344
|
-
zodToFactory as zodToFactory4
|
|
345
|
-
} from "@ariestools/sdk";
|
|
346
|
-
import { asSchema as asSchema7, PayloadZodOfSchema as PayloadZodOfSchema3 } from "@xyo-network/sdk";
|
|
347
|
-
import * as z6 from "zod/mini";
|
|
348
|
-
|
|
349
|
-
// src/Discount/Payload/Coupon/Schema.ts
|
|
350
|
-
import { asSchema as asSchema6 } from "@xyo-network/sdk";
|
|
351
|
-
var CouponSchema = asSchema6("network.xyo.payments.coupon", true);
|
|
352
|
-
|
|
353
|
-
// src/Discount/Payload/Coupon/types/Condition.ts
|
|
354
|
-
import {
|
|
355
|
-
zodAsFactory as zodAsFactory3,
|
|
356
|
-
zodIsFactory as zodIsFactory3,
|
|
357
|
-
zodToFactory as zodToFactory3
|
|
358
|
-
} from "@ariestools/sdk";
|
|
359
|
-
import { SchemaSchema as SchemaSchema4 } from "@xyo-network/sdk";
|
|
360
|
-
import * as z4 from "zod/mini";
|
|
361
|
-
var ConditionZod = z4.custom().check(z4.refine((value) => typeof value === "object" && value !== null && value.schema === SchemaSchema4));
|
|
362
|
-
var isCondition = zodIsFactory3(ConditionZod);
|
|
363
|
-
var asCondition = zodAsFactory3(ConditionZod, "asCondition");
|
|
364
|
-
var toCondition = zodToFactory3(ConditionZod, "toCondition");
|
|
365
|
-
|
|
366
|
-
// src/Discount/Payload/Coupon/types/CouponFields.ts
|
|
367
|
-
import { HashZod } from "@ariestools/sdk";
|
|
368
|
-
import * as z5 from "zod/mini";
|
|
369
|
-
var CouponFieldsZod = z5.object({
|
|
370
|
-
/**
|
|
371
|
-
* The conditions that must be met in order for this coupon to be applied
|
|
372
|
-
*/
|
|
373
|
-
conditions: z5.optional(z5.array(HashZod)),
|
|
374
|
-
/**
|
|
375
|
-
* A timestamp that indicates the expiration time of the record
|
|
376
|
-
*/
|
|
377
|
-
exp: z5.number(),
|
|
378
|
-
/**
|
|
379
|
-
* A timestamp that indicates the time before which the record is not valid
|
|
380
|
-
*/
|
|
381
|
-
nbf: z5.number(),
|
|
382
|
-
/**
|
|
383
|
-
* Whether or not this discount can be stacked with other discounts
|
|
384
|
-
*/
|
|
385
|
-
stackable: z5.optional(z5.boolean())
|
|
386
|
-
});
|
|
387
|
-
|
|
388
|
-
// src/Discount/Payload/Coupon/types/isStackable.ts
|
|
389
|
-
var isStackable = (x) => (x ?? { stackable: false })?.stackable;
|
|
390
|
-
|
|
391
|
-
// src/Discount/Payload/Coupon/Coupons/FixedAmount.ts
|
|
392
|
-
var FixedAmountCouponSchema = asSchema7(`${CouponSchema}.fixed.amount`, true);
|
|
393
|
-
var FixedAmountCouponFieldsZod = z6.object({
|
|
394
|
-
...CouponFieldsZod.shape,
|
|
395
|
-
...AmountFieldsZod.shape
|
|
396
|
-
});
|
|
397
|
-
var FixedAmountCouponZod = z6.extend(PayloadZodOfSchema3(FixedAmountCouponSchema), { ...FixedAmountCouponFieldsZod.shape });
|
|
398
|
-
var isFixedAmountCoupon = zodIsFactory4(FixedAmountCouponZod);
|
|
399
|
-
var asFixedAmountCoupon = zodAsFactory4(FixedAmountCouponZod, "asFixedAmountCoupon");
|
|
400
|
-
var toFixedAmountCoupon = zodToFactory4(FixedAmountCouponZod, "toFixedAmountCoupon");
|
|
401
|
-
|
|
402
|
-
// src/Discount/Payload/Coupon/Coupons/FixedPercentage.ts
|
|
403
|
-
import {
|
|
404
|
-
zodAsFactory as zodAsFactory5,
|
|
405
|
-
zodIsFactory as zodIsFactory5,
|
|
406
|
-
zodToFactory as zodToFactory5
|
|
407
|
-
} from "@ariestools/sdk";
|
|
408
|
-
import { asSchema as asSchema8, PayloadZodOfSchema as PayloadZodOfSchema4 } from "@xyo-network/sdk";
|
|
409
|
-
import * as z7 from "zod/mini";
|
|
410
|
-
var FixedPercentageCouponSchema = asSchema8(`${CouponSchema}.fixed.percentage`, true);
|
|
411
|
-
var FixedPercentageCouponFieldsZod = z7.object({
|
|
412
|
-
...CouponFieldsZod.shape,
|
|
413
|
-
percentage: z7.number()
|
|
414
|
-
});
|
|
415
|
-
var FixedPercentageCouponZod = z7.extend(PayloadZodOfSchema4(FixedPercentageCouponSchema), { ...FixedPercentageCouponFieldsZod.shape });
|
|
416
|
-
var isFixedPercentageCoupon = zodIsFactory5(FixedPercentageCouponZod);
|
|
417
|
-
var asFixedPercentageCoupon = zodAsFactory5(FixedPercentageCouponZod, "asFixedPercentageCoupon");
|
|
418
|
-
var toFixedPercentageCoupon = zodToFactory5(FixedPercentageCouponZod, "toFixedPercentageCoupon");
|
|
419
|
-
|
|
420
|
-
// src/Discount/Payload/Coupon/Coupons/FixedPrice.ts
|
|
421
|
-
import {
|
|
422
|
-
zodAsFactory as zodAsFactory6,
|
|
423
|
-
zodIsFactory as zodIsFactory6,
|
|
424
|
-
zodToFactory as zodToFactory6
|
|
425
|
-
} from "@ariestools/sdk";
|
|
426
|
-
import { asSchema as asSchema9, PayloadZodOfSchema as PayloadZodOfSchema5 } from "@xyo-network/sdk";
|
|
427
|
-
import * as z8 from "zod/mini";
|
|
428
|
-
var FixedPriceCouponSchema = asSchema9(`${CouponSchema}.fixed.price`, true);
|
|
429
|
-
var FixedPriceCouponFieldsZod = z8.object({
|
|
430
|
-
...CouponFieldsZod.shape,
|
|
431
|
-
...AmountFieldsZod.shape
|
|
432
|
-
});
|
|
433
|
-
var FixedPriceCouponZod = z8.extend(PayloadZodOfSchema5(FixedPriceCouponSchema), { ...FixedPriceCouponFieldsZod.shape });
|
|
434
|
-
var isFixedPriceCoupon = zodIsFactory6(FixedPriceCouponZod);
|
|
435
|
-
var asFixedPriceCoupon = zodAsFactory6(FixedPriceCouponZod, "asFixedPriceCoupon");
|
|
436
|
-
var toFixedPriceCoupon = zodToFactory6(FixedPriceCouponZod, "toFixedPriceCoupon");
|
|
437
|
-
|
|
438
|
-
// src/Discount/Payload/Coupon/Payload.ts
|
|
439
|
-
import {
|
|
440
|
-
zodAsFactory as zodAsFactory7,
|
|
441
|
-
zodIsFactory as zodIsFactory7,
|
|
442
|
-
zodToFactory as zodToFactory7
|
|
443
|
-
} from "@ariestools/sdk";
|
|
444
|
-
import * as z9 from "zod/mini";
|
|
445
|
-
var CouponZod = z9.union([
|
|
446
|
-
FixedAmountCouponZod,
|
|
447
|
-
FixedPercentageCouponZod,
|
|
448
|
-
FixedPriceCouponZod
|
|
449
|
-
]);
|
|
450
|
-
var isCoupon = zodIsFactory7(CouponZod);
|
|
451
|
-
var asCoupon = zodAsFactory7(CouponZod, "asCoupon");
|
|
452
|
-
var toCoupon = zodToFactory7(CouponZod, "toCoupon");
|
|
453
|
-
|
|
454
|
-
// src/Discount/Payload/Discount.ts
|
|
455
|
-
import {
|
|
456
|
-
zodAsFactory as zodAsFactory8,
|
|
457
|
-
zodIsFactory as zodIsFactory8,
|
|
458
|
-
zodToFactory as zodToFactory8
|
|
459
|
-
} from "@ariestools/sdk";
|
|
460
|
-
import { asSchema as asSchema10, PayloadZodOfSchema as PayloadZodOfSchema6 } from "@xyo-network/sdk";
|
|
461
|
-
import * as z10 from "zod/mini";
|
|
462
|
-
var DiscountSchema = asSchema10("network.xyo.payments.discount", true);
|
|
463
|
-
var DiscountFieldsZod = z10.object({ ...AmountFieldsZod.shape });
|
|
464
|
-
var DiscountZod = z10.extend(PayloadZodOfSchema6(DiscountSchema), { ...DiscountFieldsZod.shape });
|
|
465
|
-
var isDiscount = zodIsFactory8(DiscountZod);
|
|
466
|
-
var asDiscount = zodAsFactory8(DiscountZod, "asDiscount");
|
|
467
|
-
var toDiscount = zodToFactory8(DiscountZod, "toDiscount");
|
|
468
|
-
|
|
469
|
-
// src/Discount/Payload/NoDiscount.ts
|
|
470
|
-
var NO_DISCOUNT = {
|
|
471
|
-
schema: DiscountSchema,
|
|
472
|
-
amount: 0,
|
|
473
|
-
currency: "USD"
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
// src/Escrow/Outcome.ts
|
|
477
|
-
import {
|
|
478
|
-
HashZod as HashZod2,
|
|
479
|
-
zodAsFactory as zodAsFactory9,
|
|
480
|
-
zodIsFactory as zodIsFactory9,
|
|
481
|
-
zodToFactory as zodToFactory9
|
|
482
|
-
} from "@ariestools/sdk";
|
|
483
|
-
import { asSchema as asSchema12, PayloadZodOfSchema as PayloadZodOfSchema7 } from "@xyo-network/sdk";
|
|
484
|
-
import * as z11 from "zod/mini";
|
|
485
|
-
|
|
486
|
-
// src/Escrow/Schema.ts
|
|
487
|
-
import { asSchema as asSchema11 } from "@xyo-network/sdk";
|
|
488
|
-
var EscrowSchema = asSchema11("network.xyo.escrow", true);
|
|
489
|
-
|
|
490
|
-
// src/Escrow/Outcome.ts
|
|
491
|
-
var EscrowOutcomeSchema = asSchema12(`${EscrowSchema}.outcome`, true);
|
|
492
|
-
var EscrowOutcomesZod = z11.enum(["fulfilled", "expired"]);
|
|
493
|
-
var EscrowOutcomeFieldsZod = z11.object({
|
|
494
|
-
outcome: EscrowOutcomesZod,
|
|
495
|
-
terms: HashZod2
|
|
496
|
-
});
|
|
497
|
-
var EscrowOutcomeZod = z11.extend(PayloadZodOfSchema7(EscrowOutcomeSchema), { ...EscrowOutcomeFieldsZod.shape });
|
|
498
|
-
var isEscrowOutcome = zodIsFactory9(EscrowOutcomeZod);
|
|
499
|
-
var asEscrowOutcome = zodAsFactory9(EscrowOutcomeZod, "asEscrowOutcome");
|
|
500
|
-
var toEscrowOutcome = zodToFactory9(EscrowOutcomeZod, "toEscrowOutcome");
|
|
501
|
-
|
|
502
|
-
// src/Escrow/Terms/Terms.ts
|
|
503
|
-
import {
|
|
504
|
-
HashZod as HashZod3,
|
|
505
|
-
zodAsFactory as zodAsFactory10,
|
|
506
|
-
zodIsFactory as zodIsFactory10,
|
|
507
|
-
zodToFactory as zodToFactory10
|
|
508
|
-
} from "@ariestools/sdk";
|
|
509
|
-
import { asSchema as asSchema13, PayloadZodOfSchema as PayloadZodOfSchema8 } from "@xyo-network/sdk";
|
|
510
|
-
import * as z12 from "zod/mini";
|
|
511
|
-
var EscrowTermsSchema = asSchema13(`${EscrowSchema}.terms`, true);
|
|
512
|
-
var EscrowTermsFieldsZod = z12.object({
|
|
513
|
-
/**
|
|
514
|
-
* The trusted estimators for the worth of the things being sold
|
|
515
|
-
*/
|
|
516
|
-
appraisalAuthorities: z12.array(z12.custom()),
|
|
517
|
-
/**
|
|
518
|
-
* The estimated worths of the things being sold
|
|
519
|
-
*/
|
|
520
|
-
appraisals: z12.array(HashZod3),
|
|
521
|
-
/**
|
|
522
|
-
* The things being sold
|
|
523
|
-
*/
|
|
524
|
-
assets: z12.array(HashZod3),
|
|
525
|
-
/**
|
|
526
|
-
* The buyer
|
|
527
|
-
*/
|
|
528
|
-
buyer: z12.array(z12.custom()),
|
|
529
|
-
/**
|
|
530
|
-
* The buyer
|
|
531
|
-
*/
|
|
532
|
-
buyerSecret: HashZod3,
|
|
533
|
-
/**
|
|
534
|
-
* Any discounts (coupons, vouchers, credits, etc.) to be applied to the escrow
|
|
535
|
-
*/
|
|
536
|
-
discounts: z12.array(HashZod3),
|
|
537
|
-
/**
|
|
538
|
-
* The escrow agent responsible for the escrow
|
|
539
|
-
*/
|
|
540
|
-
escrowAgent: z12.custom(),
|
|
541
|
-
/**
|
|
542
|
-
* The time the escrow expires
|
|
543
|
-
*/
|
|
544
|
-
exp: z12.number(),
|
|
545
|
-
/**
|
|
546
|
-
* The time the escrow starts
|
|
547
|
-
*/
|
|
548
|
-
nbf: z12.number(),
|
|
549
|
-
/**
|
|
550
|
-
* The trusted payment authorities
|
|
551
|
-
*/
|
|
552
|
-
paymentAuthorities: z12.array(z12.custom()),
|
|
553
|
-
/**
|
|
554
|
-
* The seller
|
|
555
|
-
*/
|
|
556
|
-
seller: z12.array(z12.custom()),
|
|
557
|
-
/**
|
|
558
|
-
* The seller
|
|
559
|
-
*/
|
|
560
|
-
sellerSecret: HashZod3
|
|
561
|
-
});
|
|
562
|
-
var EscrowTermsZod = z12.extend(PayloadZodOfSchema8(EscrowTermsSchema), {
|
|
563
|
-
appraisalAuthorities: z12.optional(z12.array(z12.custom())),
|
|
564
|
-
appraisals: z12.optional(z12.array(HashZod3)),
|
|
565
|
-
assets: z12.optional(z12.array(HashZod3)),
|
|
566
|
-
buyer: z12.optional(z12.array(z12.custom())),
|
|
567
|
-
buyerSecret: z12.optional(HashZod3),
|
|
568
|
-
discounts: z12.optional(z12.array(HashZod3)),
|
|
569
|
-
escrowAgent: z12.optional(z12.custom()),
|
|
570
|
-
exp: z12.optional(z12.number()),
|
|
571
|
-
nbf: z12.optional(z12.number()),
|
|
572
|
-
paymentAuthorities: z12.optional(z12.array(z12.custom())),
|
|
573
|
-
seller: z12.optional(z12.array(z12.custom())),
|
|
574
|
-
sellerSecret: z12.optional(HashZod3)
|
|
575
|
-
});
|
|
576
|
-
var isEscrowTerms = zodIsFactory10(EscrowTermsZod);
|
|
577
|
-
var asEscrowTerms = zodAsFactory10(EscrowTermsZod, "asEscrowTerms");
|
|
578
|
-
var toEscrowTerms = zodToFactory10(EscrowTermsZod, "toEscrowTerms");
|
|
579
|
-
|
|
580
|
-
// src/Escrow/util/appraisal/getAppraisalsByAsset.ts
|
|
581
|
-
import { isHashLeaseEstimateWithSources } from "@xyo-network/diviner-hash-lease";
|
|
582
|
-
var getAppraisalsByAsset = (terms, dictionary) => {
|
|
583
|
-
const assets = terms.assets;
|
|
584
|
-
if (!assets || assets.length === 0) return {};
|
|
585
|
-
const appraisals = Object.values(dictionary).filter(isHashLeaseEstimateWithSources);
|
|
586
|
-
const appraisalsByAsset = /* @__PURE__ */ new Map();
|
|
587
|
-
for (const estimate of appraisals) {
|
|
588
|
-
const { $sources } = estimate;
|
|
589
|
-
if ($sources === void 0 || $sources.length === 0) {
|
|
590
|
-
continue;
|
|
591
|
-
}
|
|
592
|
-
for (const asset of assets) {
|
|
593
|
-
if ($sources.includes(asset)) {
|
|
594
|
-
const existing = appraisalsByAsset.get(asset) ?? [];
|
|
595
|
-
existing.push(estimate);
|
|
596
|
-
appraisalsByAsset.set(asset, existing);
|
|
597
|
-
}
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
return Object.fromEntries(appraisalsByAsset);
|
|
601
|
-
};
|
|
602
|
-
|
|
603
|
-
// src/Escrow/util/appraisal/getSignaturesByAppraisal.ts
|
|
604
|
-
import { isBoundWitness } from "@xyo-network/sdk";
|
|
605
|
-
var getSignaturesByAppraisal = (terms, dictionary) => {
|
|
606
|
-
const appraisals = terms.appraisals;
|
|
607
|
-
if (!appraisals || appraisals.length === 0) return {};
|
|
608
|
-
const appraisalAuthorities = terms.appraisalAuthorities;
|
|
609
|
-
if (!appraisalAuthorities || appraisalAuthorities.length === 0) return {};
|
|
610
|
-
const appraisalBWsValid = new Map(
|
|
611
|
-
appraisals.map((hash) => [hash, []])
|
|
612
|
-
);
|
|
613
|
-
const boundWitnesses = Object.values(dictionary).filter(isBoundWitness);
|
|
614
|
-
for (const bw of boundWitnesses) {
|
|
615
|
-
for (const appraisal of appraisals) {
|
|
616
|
-
if (bw.payload_hashes.includes(appraisal) && bw.addresses.some((address) => appraisalAuthorities.includes(address))) {
|
|
617
|
-
appraisalBWsValid.get(appraisal)?.push(bw);
|
|
618
|
-
}
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
return Object.fromEntries(appraisalBWsValid);
|
|
622
|
-
};
|
|
623
|
-
|
|
624
|
-
// src/Escrow/util/secret/createEscrowIntent.ts
|
|
625
|
-
import { BoundWitnessBuilder } from "@xyo-network/sdk";
|
|
626
|
-
var createEscrowIntentWithSecret = async (terms, secret, account) => {
|
|
627
|
-
const builder = new BoundWitnessBuilder();
|
|
628
|
-
const result = await builder.signers([account]).payloads([terms, secret]).build();
|
|
629
|
-
return result;
|
|
630
|
-
};
|
|
631
|
-
|
|
632
|
-
// src/Escrow/util/secret/findEscrowPartySecretSignatures.ts
|
|
633
|
-
import { isBoundWitness as isBoundWitness2 } from "@xyo-network/sdk";
|
|
634
|
-
var getLogPrefix = (party) => {
|
|
635
|
-
const partySecret = party === "seller" ? "sellerSecret" : "buyerSecret";
|
|
636
|
-
return `EscrowTerms.${partySecret}`;
|
|
637
|
-
};
|
|
638
|
-
var findEscrowPartySecretSignatures = (terms, dictionary, party) => {
|
|
639
|
-
const partyAddresses = terms[party];
|
|
640
|
-
if (partyAddresses === void 0 || partyAddresses.length === 0) {
|
|
641
|
-
console.log(`${getLogPrefix(party)}: No ${party}: ${String(terms[party])}`);
|
|
642
|
-
return [];
|
|
643
|
-
}
|
|
644
|
-
const partySecret = party === "seller" ? "sellerSecret" : "buyerSecret";
|
|
645
|
-
const secretHash = terms[partySecret];
|
|
646
|
-
if (secretHash === void 0) {
|
|
647
|
-
console.log(`${getLogPrefix(party)}: No ${partySecret}: ${terms[partySecret]}`);
|
|
648
|
-
return [];
|
|
649
|
-
}
|
|
650
|
-
const partySignedBWs = Object.values(dictionary).filter(isBoundWitness2).filter((bw) => bw.payload_hashes.includes(secretHash)).filter((bw) => partyAddresses.every((address) => bw.addresses.includes(address)));
|
|
651
|
-
return partySignedBWs;
|
|
652
|
-
};
|
|
653
|
-
|
|
654
|
-
// src/Escrow/util/secret/getEscrowSecret.ts
|
|
655
|
-
import { Crypto } from "@ariestools/crypto";
|
|
656
|
-
import { IdSchema } from "@xyo-network/sdk";
|
|
657
|
-
var getEscrowSecret = () => {
|
|
658
|
-
return { salt: Crypto.randomUUID(), schema: IdSchema };
|
|
659
|
-
};
|
|
660
|
-
|
|
661
|
-
// src/Escrow/util/secret/updateEscrowTermsWithSecret.ts
|
|
662
|
-
import { BoundWitnessBuilder as BoundWitnessBuilder2, PayloadBuilder } from "@xyo-network/sdk";
|
|
663
|
-
var updateEscrowTermsWithSecret = async (terms, escrowParty, account, secret) => {
|
|
664
|
-
secret ??= getEscrowSecret();
|
|
665
|
-
const signers = Array.isArray(account) ? account : [account];
|
|
666
|
-
terms[escrowParty] = signers.map((signer) => signer.address);
|
|
667
|
-
const secretType = escrowParty === "buyer" ? "buyerSecret" : "sellerSecret";
|
|
668
|
-
const secretHash = await PayloadBuilder.dataHash(secret);
|
|
669
|
-
terms[secretType] = secretHash;
|
|
670
|
-
const builder = new BoundWitnessBuilder2();
|
|
671
|
-
const result = await builder.signers(signers).payloads([terms, secret]).build();
|
|
672
|
-
return result;
|
|
673
|
-
};
|
|
674
|
-
|
|
675
|
-
// src/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.ts
|
|
676
|
-
var moduleIdentifiersContainsOneOf = (escrowTerms, propertyExpression, moduleIdentifiers, required = true) => {
|
|
677
|
-
const termsValue = propertyExpression(escrowTerms);
|
|
678
|
-
if (termsValue === void 0) {
|
|
679
|
-
return required ? false : true;
|
|
680
|
-
}
|
|
681
|
-
return Array.isArray(termsValue) ? termsValue.some((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue);
|
|
682
|
-
};
|
|
683
|
-
var moduleIdentifiersContainsAllOf = (escrowTerms, selector, moduleIdentifiers, required = true) => {
|
|
684
|
-
const termsValue = selector(escrowTerms);
|
|
685
|
-
if (termsValue === void 0) {
|
|
686
|
-
return required ? false : true;
|
|
687
|
-
}
|
|
688
|
-
return Array.isArray(termsValue) ? termsValue.every((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue);
|
|
689
|
-
};
|
|
690
|
-
|
|
691
|
-
// src/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.ts
|
|
692
|
-
import { BoundWitnessValidator } from "@xyo-network/sdk";
|
|
693
|
-
var getLogPrefix2 = (party) => {
|
|
694
|
-
const partySecret = party === "seller" ? "sellerSecret" : "buyerSecret";
|
|
695
|
-
return `EscrowTerms.${partySecret}`;
|
|
696
|
-
};
|
|
697
|
-
var getPartySecretSignedValidator = (dictionary, party) => {
|
|
698
|
-
const partySecret = party === "seller" ? "sellerSecret" : "buyerSecret";
|
|
699
|
-
return async (terms) => {
|
|
700
|
-
const buyerSecretBWs = findEscrowPartySecretSignatures(terms, dictionary, party);
|
|
701
|
-
if (buyerSecretBWs.length === 0) {
|
|
702
|
-
console.log(`${getLogPrefix2(party)}: No BoundWitnesses supplied for ${partySecret}: ${terms[partySecret]}`);
|
|
703
|
-
return false;
|
|
704
|
-
}
|
|
705
|
-
const errors = await Promise.all(buyerSecretBWs.map((bw) => {
|
|
706
|
-
const validator = new BoundWitnessValidator(bw);
|
|
707
|
-
return validator.validate();
|
|
708
|
-
}));
|
|
709
|
-
const validBoundWitnesses = errors.every((errors2) => errors2.length === 0);
|
|
710
|
-
if (!validBoundWitnesses) {
|
|
711
|
-
console.log(`${getLogPrefix2(party)}: Invalid BoundWitnesses supplied for ${partySecret}: ${terms[partySecret]}`);
|
|
712
|
-
return false;
|
|
713
|
-
}
|
|
714
|
-
return true;
|
|
715
|
-
};
|
|
716
|
-
};
|
|
717
|
-
|
|
718
|
-
// src/Escrow/validators/common/TemporalValidators/validateWithinWindow.ts
|
|
719
|
-
var validateWithinWindow = (value, exp, nbf = Date.now()) => {
|
|
720
|
-
if (value.nbf === void 0 || value.nbf > nbf) return false;
|
|
721
|
-
return !(value.exp === void 0 || value.exp < exp);
|
|
722
|
-
};
|
|
723
|
-
|
|
724
|
-
// src/Escrow/validators/escrow/agent.ts
|
|
725
|
-
var name = "EscrowTerms.escrowAgent";
|
|
726
|
-
var getEscrowAgentAllowedValidator = (allowedEscrowAgent) => {
|
|
727
|
-
return (terms) => {
|
|
728
|
-
const result = moduleIdentifiersContainsOneOf(terms, (t) => t.escrowAgent, [allowedEscrowAgent], true);
|
|
729
|
-
if (!result) {
|
|
730
|
-
console.log(`${name}: Escrow agent not allowed: ${terms.escrowAgent}`);
|
|
731
|
-
}
|
|
732
|
-
return result;
|
|
733
|
-
};
|
|
734
|
-
};
|
|
735
|
-
|
|
736
|
-
// src/Escrow/validators/escrow/appraisal.ts
|
|
737
|
-
import { assertEx } from "@ariestools/sdk";
|
|
738
|
-
import { isBoundWitness as isBoundWitness3 } from "@xyo-network/sdk";
|
|
739
|
-
var name2 = "EscrowTerms.appraisal";
|
|
740
|
-
var appraisalsExistValidator = (terms) => {
|
|
741
|
-
const appraisals = terms.appraisals;
|
|
742
|
-
if (!appraisals || appraisals.length === 0) {
|
|
743
|
-
console.log(`${name2}: No appraisals: ${String(terms.appraisals)}`);
|
|
744
|
-
return false;
|
|
745
|
-
}
|
|
746
|
-
return true;
|
|
747
|
-
};
|
|
748
|
-
var getAppraisalsFromValidAuthoritiesValidator = (dictionary) => {
|
|
749
|
-
return (terms) => {
|
|
750
|
-
const appraisals = assertEx(terms.appraisals, () => `${name2}: No appraisals: ${String(terms.appraisals)}`);
|
|
751
|
-
const appraisalAuthorities = assertEx(terms.appraisalAuthorities, () => `${name2}: No appraisalAuthorities: ${String(terms.appraisalAuthorities)}`);
|
|
752
|
-
const appraisalBWsValid = new Map(
|
|
753
|
-
appraisals.map((hash) => [hash, []])
|
|
754
|
-
);
|
|
755
|
-
const boundWitnesses = Object.values(dictionary).filter(isBoundWitness3);
|
|
756
|
-
for (const bw of boundWitnesses) {
|
|
757
|
-
for (const appraisal of appraisals) {
|
|
758
|
-
if (bw.payload_hashes.includes(appraisal) && bw.addresses.some((address) => appraisalAuthorities.includes(address))) {
|
|
759
|
-
appraisalBWsValid.get(appraisal)?.push(bw);
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
for (const [appraisal, bws] of appraisalBWsValid) {
|
|
764
|
-
if (bws.length === 0) {
|
|
765
|
-
console.log(`${name2}: No valid appraisals for ${appraisal}`);
|
|
766
|
-
return false;
|
|
767
|
-
}
|
|
768
|
-
}
|
|
769
|
-
return true;
|
|
770
|
-
};
|
|
771
|
-
};
|
|
772
|
-
var getAppraisalsValidValidator = (dictionary, minimumExp) => {
|
|
773
|
-
return (terms) => {
|
|
774
|
-
const estimatesByAsset = getAppraisalsByAsset(terms, dictionary);
|
|
775
|
-
const now = Date.now();
|
|
776
|
-
const exp = now + minimumExp;
|
|
777
|
-
for (const [asset, estimates] of Object.entries(estimatesByAsset)) {
|
|
778
|
-
for (const estimate of estimates) {
|
|
779
|
-
if (!validateEstimate(estimate, exp)) {
|
|
780
|
-
console.log(`${name2}: Invalid estimate for asset ${asset}:`, estimate);
|
|
781
|
-
return false;
|
|
782
|
-
}
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
return true;
|
|
786
|
-
};
|
|
787
|
-
};
|
|
788
|
-
var getAppraisalsForAllAssetsValidator = (dictionary) => {
|
|
789
|
-
return (terms) => {
|
|
790
|
-
const assets = assertEx(terms.assets, () => `${name2}: No assets: ${String(terms.assets)}`);
|
|
791
|
-
const estimatesByAsset = getAppraisalsByAsset(terms, dictionary);
|
|
792
|
-
if (Object.keys(estimatesByAsset).length !== assets.length) {
|
|
793
|
-
console.log(`${name2}: Missing appraisals for all assets: ${String(assets)}`);
|
|
794
|
-
return false;
|
|
795
|
-
}
|
|
796
|
-
return true;
|
|
797
|
-
};
|
|
798
|
-
};
|
|
799
|
-
var validateEstimate = (estimate, exp) => {
|
|
800
|
-
if (!validateWithinWindow(estimate, exp)) return false;
|
|
801
|
-
if (estimate.currency !== "USD") return false;
|
|
802
|
-
return estimate.price >= 0;
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
// src/Escrow/validators/escrow/appraisalAuthorities.ts
|
|
806
|
-
import { asAddress } from "@ariestools/sdk";
|
|
807
|
-
var name3 = "EscrowTerms.appraisalAuthorities";
|
|
808
|
-
var appraisalAuthoritiesExistValidator = (terms) => {
|
|
809
|
-
const appraisalAuthorities = terms.appraisalAuthorities;
|
|
810
|
-
if (!appraisalAuthorities || appraisalAuthorities.length === 0) {
|
|
811
|
-
console.log(`${name3}: No appraisalAuthorities: ${String(terms.appraisalAuthorities)}`);
|
|
812
|
-
return false;
|
|
813
|
-
}
|
|
814
|
-
if (appraisalAuthorities.map((x) => asAddress(x)).length !== appraisalAuthorities.length) {
|
|
815
|
-
console.log(`${name3}: Invalid address: ${String(terms.appraisalAuthorities)}`);
|
|
816
|
-
return false;
|
|
817
|
-
}
|
|
818
|
-
return true;
|
|
819
|
-
};
|
|
820
|
-
var getAppraisalAuthoritiesAllowedValidator = (allowed) => {
|
|
821
|
-
return (terms) => {
|
|
822
|
-
const result = moduleIdentifiersContainsAllOf(terms, (t) => t.appraisalAuthorities, allowed, true);
|
|
823
|
-
if (!result) {
|
|
824
|
-
console.log(`${name3}: Appraisal authority not allowed: ${String(terms.appraisalAuthorities)}`);
|
|
825
|
-
}
|
|
826
|
-
return result;
|
|
827
|
-
};
|
|
828
|
-
};
|
|
829
|
-
|
|
830
|
-
// src/Escrow/validators/escrow/assets.ts
|
|
831
|
-
var name4 = "EscrowTerms.assets";
|
|
832
|
-
var assetsExistValidator = (terms) => {
|
|
833
|
-
const assets = terms.assets;
|
|
834
|
-
if (!assets || assets.length === 0) {
|
|
835
|
-
console.log(`${name4}: No assets: ${String(terms.assets)}`);
|
|
836
|
-
return false;
|
|
837
|
-
}
|
|
838
|
-
return true;
|
|
839
|
-
};
|
|
840
|
-
|
|
841
|
-
// src/Escrow/validators/escrow/buyer.ts
|
|
842
|
-
import { asAddress as asAddress2 } from "@ariestools/sdk";
|
|
843
|
-
var name5 = "EscrowTerms.buyer";
|
|
844
|
-
var buyerExistsValidator = (terms) => {
|
|
845
|
-
const buyer = terms.buyer;
|
|
846
|
-
if (!buyer || buyer.length === 0) {
|
|
847
|
-
console.log(`${name5}: No buyer: ${String(terms.buyer)}`);
|
|
848
|
-
return false;
|
|
849
|
-
}
|
|
850
|
-
if (buyer.map((x) => asAddress2(x)).length !== buyer.length) {
|
|
851
|
-
console.log(`${name5}: Invalid address: ${String(terms.buyer)}`);
|
|
852
|
-
return false;
|
|
853
|
-
}
|
|
854
|
-
return true;
|
|
855
|
-
};
|
|
856
|
-
|
|
857
|
-
// src/Escrow/validators/escrow/buyerSecret.ts
|
|
858
|
-
import { assertEx as assertEx2 } from "@ariestools/sdk";
|
|
859
|
-
var name6 = "EscrowTerms.buyerSecret";
|
|
860
|
-
var buyerSecretExistsValidator = (terms) => {
|
|
861
|
-
const buyerSecret = terms.buyerSecret;
|
|
862
|
-
if (!buyerSecret || buyerSecret.length === 0) {
|
|
863
|
-
console.log(`${name6}: No buyerSecret: ${terms.buyerSecret}`);
|
|
864
|
-
return false;
|
|
865
|
-
}
|
|
866
|
-
return true;
|
|
867
|
-
};
|
|
868
|
-
var getBuyerSecretSuppliedValidator = (dictionary) => {
|
|
869
|
-
return (terms) => {
|
|
870
|
-
const buyerSecret = assertEx2(terms.buyerSecret, () => `${name6}: No buyerSecret: ${terms.buyerSecret}`);
|
|
871
|
-
if (!Object.hasOwn(dictionary, buyerSecret)) {
|
|
872
|
-
console.log(`${name6}: Payload not supplied for buyerSecret: ${buyerSecret}`);
|
|
873
|
-
return false;
|
|
874
|
-
}
|
|
875
|
-
return true;
|
|
876
|
-
};
|
|
877
|
-
};
|
|
878
|
-
var getBuyerSecretSignedValidator = (dictionary) => {
|
|
879
|
-
return getPartySecretSignedValidator(dictionary, "buyer");
|
|
880
|
-
};
|
|
881
|
-
|
|
882
|
-
// src/Escrow/validators/escrow/nbfExp.ts
|
|
883
|
-
var getNbfExpValidator = (now, minRequiredDuration) => {
|
|
884
|
-
const minExp = now + minRequiredDuration;
|
|
885
|
-
return (terms) => {
|
|
886
|
-
const { exp, nbf } = terms;
|
|
887
|
-
if (nbf === void 0 || nbf < now) {
|
|
888
|
-
console.log(`EscrowTerms.nbf: invalid nbf ${terms.nbf}`);
|
|
889
|
-
return false;
|
|
890
|
-
}
|
|
891
|
-
if (exp === void 0 || exp < minExp || nbf > exp) {
|
|
892
|
-
console.log(`EscrowTerms.exp: invalid exp ${terms.exp}`);
|
|
893
|
-
return false;
|
|
894
|
-
}
|
|
895
|
-
return true;
|
|
896
|
-
};
|
|
897
|
-
};
|
|
898
|
-
|
|
899
|
-
// src/Escrow/validators/escrow/paymentAuthorities.ts
|
|
900
|
-
var name7 = "EscrowTerms.paymentAuthorities";
|
|
901
|
-
var getPaymentAuthoritiesAllowedValidator = (allowed) => {
|
|
902
|
-
return (terms) => {
|
|
903
|
-
const result = moduleIdentifiersContainsAllOf(terms, (t) => t.paymentAuthorities, allowed, true);
|
|
904
|
-
if (!result) {
|
|
905
|
-
console.log(`${name7}: Payment authority not allowed: ${String(terms.paymentAuthorities)}`);
|
|
906
|
-
}
|
|
907
|
-
return result;
|
|
908
|
-
};
|
|
909
|
-
};
|
|
910
|
-
|
|
911
|
-
// src/Escrow/validators/escrow/seller.ts
|
|
912
|
-
import { asAddress as asAddress3 } from "@ariestools/sdk";
|
|
913
|
-
var name8 = "EscrowTerms.seller";
|
|
914
|
-
var sellerExistsValidator = (terms) => {
|
|
915
|
-
const seller = terms.seller;
|
|
916
|
-
if (!seller || seller.length === 0) {
|
|
917
|
-
console.log(`${name8}: No seller: ${String(terms.seller)}`);
|
|
918
|
-
return false;
|
|
919
|
-
}
|
|
920
|
-
if (seller.map((x) => asAddress3(x)).length !== seller.length) {
|
|
921
|
-
console.log(`${name8}: Invalid address: ${String(terms.seller)}`);
|
|
922
|
-
return false;
|
|
923
|
-
}
|
|
924
|
-
return true;
|
|
925
|
-
};
|
|
926
|
-
|
|
927
|
-
// src/Escrow/validators/escrow/sellerSecret.ts
|
|
928
|
-
import { assertEx as assertEx3 } from "@ariestools/sdk";
|
|
929
|
-
var name9 = "EscrowTerms.sellerSecret";
|
|
930
|
-
var sellerSecretExistsValidator = (terms) => {
|
|
931
|
-
const sellerSecret = terms.sellerSecret;
|
|
932
|
-
if (!sellerSecret || sellerSecret.length === 0) {
|
|
933
|
-
console.log(`${name9}: No sellerSecret: ${terms.sellerSecret}`);
|
|
934
|
-
return false;
|
|
935
|
-
}
|
|
936
|
-
return true;
|
|
937
|
-
};
|
|
938
|
-
var getSellerSecretSuppliedValidator = (dictionary) => {
|
|
939
|
-
return (terms) => {
|
|
940
|
-
const sellerSecret = assertEx3(terms.sellerSecret, () => `${name9}: No sellerSecret: ${terms.sellerSecret}`);
|
|
941
|
-
if (!Object.hasOwn(dictionary, sellerSecret)) {
|
|
942
|
-
console.log(`${name9}: Payload not supplied for sellerSecret: ${sellerSecret}`);
|
|
943
|
-
return false;
|
|
944
|
-
}
|
|
945
|
-
return true;
|
|
946
|
-
};
|
|
947
|
-
};
|
|
948
|
-
var getSellerSecretSignedValidator = (dictionary) => {
|
|
949
|
-
return getPartySecretSignedValidator(dictionary, "seller");
|
|
950
|
-
};
|
|
951
|
-
|
|
952
|
-
// src/Payment/Instrument/Card/Payload.ts
|
|
953
|
-
import {
|
|
954
|
-
zodAsFactory as zodAsFactory11,
|
|
955
|
-
zodIsFactory as zodIsFactory11,
|
|
956
|
-
zodToFactory as zodToFactory11
|
|
957
|
-
} from "@ariestools/sdk";
|
|
958
|
-
import { PayloadZodOfSchema as PayloadZodOfSchema9 } from "@xyo-network/sdk";
|
|
959
|
-
import * as z13 from "zod/mini";
|
|
960
|
-
|
|
961
|
-
// src/Payment/Instrument/Card/Schema.ts
|
|
962
|
-
import { asSchema as asSchema16 } from "@xyo-network/sdk";
|
|
963
|
-
|
|
964
|
-
// src/Payment/Instrument/Schema.ts
|
|
965
|
-
import { asSchema as asSchema15 } from "@xyo-network/sdk";
|
|
966
|
-
|
|
967
|
-
// src/Payment/Schema.ts
|
|
968
|
-
import { asSchema as asSchema14 } from "@xyo-network/sdk";
|
|
969
|
-
var PaymentSchema = asSchema14(`${PaymentsSchema}.payment`, true);
|
|
970
|
-
|
|
971
|
-
// src/Payment/Instrument/Schema.ts
|
|
972
|
-
var PaymentInstrumentSchema = asSchema15(`${PaymentSchema}.instrument`, true);
|
|
973
|
-
|
|
974
|
-
// src/Payment/Instrument/Card/Schema.ts
|
|
975
|
-
var PaymentCardSchema = asSchema16(`${PaymentInstrumentSchema}.card`, true);
|
|
976
|
-
|
|
977
|
-
// src/Payment/Instrument/Card/Payload.ts
|
|
978
|
-
var PaymentCardFieldsZod = z13.object({
|
|
979
|
-
/**
|
|
980
|
-
* Card Number (PAN) of the payment card. This value is required to perform a payment.
|
|
981
|
-
*/
|
|
982
|
-
cardNumber: z13.string(),
|
|
983
|
-
/**
|
|
984
|
-
* The name as it appears on the payment card.
|
|
985
|
-
*/
|
|
986
|
-
cardholderName: z13.optional(z13.string()),
|
|
987
|
-
/**
|
|
988
|
-
* Card Verification Value (CVV/CVC) of the payment card.
|
|
989
|
-
*/
|
|
990
|
-
cvv: z13.string(),
|
|
991
|
-
/**
|
|
992
|
-
* Expiration month of the payment card.
|
|
993
|
-
*/
|
|
994
|
-
expMonth: z13.number(),
|
|
995
|
-
/**
|
|
996
|
-
* Expiration year of the payment card.
|
|
997
|
-
*/
|
|
998
|
-
expYear: z13.number()
|
|
999
|
-
});
|
|
1000
|
-
var PaymentCardZod = z13.extend(PayloadZodOfSchema9(PaymentCardSchema), { ...PaymentCardFieldsZod.shape });
|
|
1001
|
-
var isPaymentCard = zodIsFactory11(PaymentCardZod);
|
|
1002
|
-
var asPaymentCard = zodAsFactory11(PaymentCardZod, "asPaymentCard");
|
|
1003
|
-
var toPaymentCard = zodToFactory11(PaymentCardZod, "toPaymentCard");
|
|
1004
|
-
|
|
1005
|
-
// src/Payment/Payload.ts
|
|
1006
|
-
import {
|
|
1007
|
-
zodAsFactory as zodAsFactory12,
|
|
1008
|
-
zodIsFactory as zodIsFactory12,
|
|
1009
|
-
zodToFactory as zodToFactory12
|
|
1010
|
-
} from "@ariestools/sdk";
|
|
1011
|
-
import { PayloadZodOfSchema as PayloadZodOfSchema10 } from "@xyo-network/sdk";
|
|
1012
|
-
import * as z14 from "zod/mini";
|
|
1013
|
-
var PaymentFieldsZod = z14.object({
|
|
1014
|
-
/**
|
|
1015
|
-
* The amount paid
|
|
1016
|
-
*/
|
|
1017
|
-
amount: z14.number(),
|
|
1018
|
-
/**
|
|
1019
|
-
* The currency of the amount paid
|
|
1020
|
-
*/
|
|
1021
|
-
currency: SupportedCurrencyZod
|
|
1022
|
-
});
|
|
1023
|
-
var PaymentZod = z14.extend(PayloadZodOfSchema10(PaymentSchema), { ...PaymentFieldsZod.shape });
|
|
1024
|
-
var isPayment = zodIsFactory12(PaymentZod);
|
|
1025
|
-
var asPayment = zodAsFactory12(PaymentZod, "asPayment");
|
|
1026
|
-
var toPayment = zodToFactory12(PaymentZod, "toPayment");
|
|
1027
|
-
|
|
1028
|
-
// src/Payment/Status/Payload.ts
|
|
1029
|
-
import {
|
|
1030
|
-
zodAsFactory as zodAsFactory13,
|
|
1031
|
-
zodIsFactory as zodIsFactory13,
|
|
1032
|
-
zodToFactory as zodToFactory13
|
|
1033
|
-
} from "@ariestools/sdk";
|
|
1034
|
-
import { PayloadZodOfSchema as PayloadZodOfSchema11 } from "@xyo-network/sdk";
|
|
1035
|
-
import * as z15 from "zod/mini";
|
|
1036
|
-
|
|
1037
|
-
// src/Payment/Status/Schema.ts
|
|
1038
|
-
import { asSchema as asSchema17 } from "@xyo-network/sdk";
|
|
1039
|
-
var PaymentStatusSchema = asSchema17(`${PaymentSchema}.status`, true);
|
|
1040
|
-
|
|
1041
|
-
// src/Payment/Status/Payload.ts
|
|
1042
|
-
var PaymentStatusFieldsZod = z15.object({
|
|
1043
|
-
/**
|
|
1044
|
-
* The result of the payment (i.e. declined)
|
|
1045
|
-
*/
|
|
1046
|
-
result: z15.optional(z15.string()),
|
|
1047
|
-
/**
|
|
1048
|
-
* The status of the payment (i.e. completed)
|
|
1049
|
-
*/
|
|
1050
|
-
status: z15.string()
|
|
1051
|
-
});
|
|
1052
|
-
var PaymentStatusZod = z15.extend(PayloadZodOfSchema11(PaymentStatusSchema), { ...PaymentStatusFieldsZod.shape });
|
|
1053
|
-
var isPaymentStatus = zodIsFactory13(PaymentStatusZod);
|
|
1054
|
-
var asPaymentStatus = zodAsFactory13(PaymentStatusZod, "asPaymentStatus");
|
|
1055
|
-
var toPaymentStatus = zodToFactory13(PaymentStatusZod, "toPaymentStatus");
|
|
1056
|
-
|
|
1057
|
-
// src/Purchase/Payload.ts
|
|
1058
|
-
import {
|
|
1059
|
-
HashZod as HashZod4,
|
|
1060
|
-
zodAsFactory as zodAsFactory14,
|
|
1061
|
-
zodIsFactory as zodIsFactory14,
|
|
1062
|
-
zodToFactory as zodToFactory14
|
|
1063
|
-
} from "@ariestools/sdk";
|
|
1064
|
-
import { PayloadZodOfSchema as PayloadZodOfSchema12 } from "@xyo-network/sdk";
|
|
1065
|
-
import * as z16 from "zod/mini";
|
|
1066
|
-
|
|
1067
|
-
// src/Purchase/Schema.ts
|
|
1068
|
-
import { asSchema as asSchema18 } from "@xyo-network/sdk";
|
|
1069
|
-
var PurchaseSchema = asSchema18(`${PaymentsSchema}.purchase`, true);
|
|
1070
|
-
|
|
1071
|
-
// src/Purchase/Payload.ts
|
|
1072
|
-
var PurchaseFieldsZod = z16.object({
|
|
1073
|
-
/**
|
|
1074
|
-
* The things that were purchased
|
|
1075
|
-
*/
|
|
1076
|
-
assets: z16.array(HashZod4),
|
|
1077
|
-
/**
|
|
1078
|
-
* The receipts for payments for this purchase. Array to allow for multiple payments
|
|
1079
|
-
* for a single quote.
|
|
1080
|
-
*/
|
|
1081
|
-
receipts: z16.array(HashZod4)
|
|
1082
|
-
});
|
|
1083
|
-
var PurchaseZod = z16.extend(PayloadZodOfSchema12(PurchaseSchema), { ...PurchaseFieldsZod.shape });
|
|
1084
|
-
var isPurchase = zodIsFactory14(PurchaseZod);
|
|
1085
|
-
var asPurchase = zodAsFactory14(PurchaseZod, "asPurchase");
|
|
1086
|
-
var toPurchase = zodToFactory14(PurchaseZod, "toPurchase");
|
|
1087
|
-
|
|
1088
|
-
// src/Receipt/Payload.ts
|
|
1089
|
-
import {
|
|
1090
|
-
zodAsFactory as zodAsFactory15,
|
|
1091
|
-
zodIsFactory as zodIsFactory15,
|
|
1092
|
-
zodToFactory as zodToFactory15
|
|
1093
|
-
} from "@ariestools/sdk";
|
|
1094
|
-
import { PayloadZodOfSchema as PayloadZodOfSchema13 } from "@xyo-network/sdk";
|
|
1095
|
-
import * as z17 from "zod/mini";
|
|
1096
|
-
|
|
1097
|
-
// src/Receipt/Schema.ts
|
|
1098
|
-
import { asSchema as asSchema19 } from "@xyo-network/sdk";
|
|
1099
|
-
var ReceiptSchema = asSchema19(`${PaymentsSchema}.receipt`, true);
|
|
1100
|
-
|
|
1101
|
-
// src/Receipt/Payload.ts
|
|
1102
|
-
var ReceiptFieldsZod = z17.object({
|
|
1103
|
-
/**
|
|
1104
|
-
* The amount paid
|
|
1105
|
-
*/
|
|
1106
|
-
amount: z17.number(),
|
|
1107
|
-
/**
|
|
1108
|
-
* The currency of the amount paid
|
|
1109
|
-
*/
|
|
1110
|
-
currency: SupportedCurrencyZod
|
|
1111
|
-
});
|
|
1112
|
-
var ReceiptZod = z17.extend(PayloadZodOfSchema13(ReceiptSchema), { ...ReceiptFieldsZod.shape });
|
|
1113
|
-
var isReceipt = zodIsFactory15(ReceiptZod);
|
|
1114
|
-
var asReceipt = zodAsFactory15(ReceiptZod, "asReceipt");
|
|
1115
|
-
var toReceipt = zodToFactory15(ReceiptZod, "toReceipt");
|
|
1116
|
-
|
|
1117
|
-
// src/Subtotal/Diviner/Config.ts
|
|
1118
|
-
import { asSchema as asSchema20 } from "@xyo-network/sdk";
|
|
1119
|
-
var PaymentSubtotalDivinerConfigSchema = asSchema20("network.xyo.diviner.payments.subtotal.config", true);
|
|
1120
|
-
|
|
1121
|
-
// src/Subtotal/Diviner/Payload.ts
|
|
1122
|
-
import {
|
|
1123
|
-
zodAsFactory as zodAsFactory16,
|
|
1124
|
-
zodIsFactory as zodIsFactory16,
|
|
1125
|
-
zodToFactory as zodToFactory16
|
|
1126
|
-
} from "@ariestools/sdk";
|
|
1127
|
-
import { asSchema as asSchema21, PayloadZodOfSchema as PayloadZodOfSchema14 } from "@xyo-network/sdk";
|
|
1128
|
-
import * as z18 from "zod/mini";
|
|
1129
|
-
var SubtotalSchema = asSchema21("network.xyo.payments.subtotal", true);
|
|
1130
|
-
var SubtotalFieldsZod = z18.object({ ...AmountFieldsZod.shape });
|
|
1131
|
-
var SubtotalZod = z18.extend(PayloadZodOfSchema14(SubtotalSchema), { ...SubtotalFieldsZod.shape });
|
|
1132
|
-
var isSubtotal = zodIsFactory16(SubtotalZod);
|
|
1133
|
-
var asSubtotal = zodAsFactory16(SubtotalZod, "asSubtotal");
|
|
1134
|
-
var toSubtotal = zodToFactory16(SubtotalZod, "toSubtotal");
|
|
1135
|
-
|
|
1136
|
-
// src/Total/Diviner/Config.ts
|
|
1137
|
-
import { asSchema as asSchema22 } from "@xyo-network/sdk";
|
|
1138
|
-
var PaymentTotalDivinerConfigSchema = asSchema22("network.xyo.diviner.payments.total.config", true);
|
|
1139
|
-
|
|
1140
|
-
// src/Total/Diviner/Payload.ts
|
|
1141
|
-
import {
|
|
1142
|
-
zodAsFactory as zodAsFactory17,
|
|
1143
|
-
zodIsFactory as zodIsFactory17,
|
|
1144
|
-
zodToFactory as zodToFactory17
|
|
1145
|
-
} from "@ariestools/sdk";
|
|
1146
|
-
import { asSchema as asSchema23, PayloadZodOfSchema as PayloadZodOfSchema15 } from "@xyo-network/sdk";
|
|
1147
|
-
import * as z19 from "zod/mini";
|
|
1148
|
-
var TotalSchema = asSchema23("network.xyo.payments.total", true);
|
|
1149
|
-
var TotalFieldsZod = z19.object({ ...AmountFieldsZod.shape });
|
|
1150
|
-
var TotalZod = z19.extend(PayloadZodOfSchema15(TotalSchema), { ...TotalFieldsZod.shape });
|
|
1151
|
-
var isTotal = zodIsFactory17(TotalZod);
|
|
1152
|
-
var asTotal = zodAsFactory17(TotalZod, "asTotal");
|
|
1153
|
-
var toTotal = zodToFactory17(TotalZod, "toTotal");
|
|
1154
|
-
export {
|
|
1155
|
-
AmountFieldsZod,
|
|
1156
|
-
AmountSchema,
|
|
1157
|
-
AmountZod,
|
|
1158
|
-
BillingAddressFieldsZod,
|
|
1159
|
-
BillingAddressSchema,
|
|
1160
|
-
BillingAddressZod,
|
|
1161
|
-
BillingSchema,
|
|
1162
|
-
ConditionZod,
|
|
1163
|
-
CouponFieldsZod,
|
|
1164
|
-
CouponSchema,
|
|
1165
|
-
CouponZod,
|
|
1166
|
-
DiscountFieldsZod,
|
|
1167
|
-
DiscountSchema,
|
|
1168
|
-
DiscountZod,
|
|
1169
|
-
EscrowOutcomeFieldsZod,
|
|
1170
|
-
EscrowOutcomeSchema,
|
|
1171
|
-
EscrowOutcomeZod,
|
|
1172
|
-
EscrowOutcomesZod,
|
|
1173
|
-
EscrowSchema,
|
|
1174
|
-
EscrowTermsFieldsZod,
|
|
1175
|
-
EscrowTermsSchema,
|
|
1176
|
-
EscrowTermsZod,
|
|
1177
|
-
FixedAmountCouponFieldsZod,
|
|
1178
|
-
FixedAmountCouponSchema,
|
|
1179
|
-
FixedAmountCouponZod,
|
|
1180
|
-
FixedPercentageCouponFieldsZod,
|
|
1181
|
-
FixedPercentageCouponSchema,
|
|
1182
|
-
FixedPercentageCouponZod,
|
|
1183
|
-
FixedPriceCouponFieldsZod,
|
|
1184
|
-
FixedPriceCouponSchema,
|
|
1185
|
-
FixedPriceCouponZod,
|
|
1186
|
-
Iso4217CurrencyCodes,
|
|
1187
|
-
NO_DISCOUNT,
|
|
1188
|
-
PaymentCardFieldsZod,
|
|
1189
|
-
PaymentCardSchema,
|
|
1190
|
-
PaymentCardZod,
|
|
1191
|
-
PaymentDiscountDivinerConfigSchema,
|
|
1192
|
-
PaymentFieldsZod,
|
|
1193
|
-
PaymentInstrumentSchema,
|
|
1194
|
-
PaymentSchema,
|
|
1195
|
-
PaymentStatusFieldsZod,
|
|
1196
|
-
PaymentStatusSchema,
|
|
1197
|
-
PaymentStatusZod,
|
|
1198
|
-
PaymentSubtotalDivinerConfigSchema,
|
|
1199
|
-
PaymentTotalDivinerConfigSchema,
|
|
1200
|
-
PaymentZod,
|
|
1201
|
-
PurchaseFieldsZod,
|
|
1202
|
-
PurchaseSchema,
|
|
1203
|
-
PurchaseZod,
|
|
1204
|
-
ReceiptFieldsZod,
|
|
1205
|
-
ReceiptSchema,
|
|
1206
|
-
ReceiptZod,
|
|
1207
|
-
SubtotalFieldsZod,
|
|
1208
|
-
SubtotalSchema,
|
|
1209
|
-
SubtotalZod,
|
|
1210
|
-
SupportedCurrencyZod,
|
|
1211
|
-
TotalFieldsZod,
|
|
1212
|
-
TotalSchema,
|
|
1213
|
-
TotalZod,
|
|
1214
|
-
appraisalAuthoritiesExistValidator,
|
|
1215
|
-
appraisalsExistValidator,
|
|
1216
|
-
asAmount,
|
|
1217
|
-
asBillingAddress,
|
|
1218
|
-
asCondition,
|
|
1219
|
-
asCoupon,
|
|
1220
|
-
asDiscount,
|
|
1221
|
-
asEscrowOutcome,
|
|
1222
|
-
asEscrowTerms,
|
|
1223
|
-
asFixedAmountCoupon,
|
|
1224
|
-
asFixedPercentageCoupon,
|
|
1225
|
-
asFixedPriceCoupon,
|
|
1226
|
-
asPayment,
|
|
1227
|
-
asPaymentCard,
|
|
1228
|
-
asPaymentStatus,
|
|
1229
|
-
asPurchase,
|
|
1230
|
-
asReceipt,
|
|
1231
|
-
asSubtotal,
|
|
1232
|
-
asTotal,
|
|
1233
|
-
assetsExistValidator,
|
|
1234
|
-
buyerExistsValidator,
|
|
1235
|
-
buyerSecretExistsValidator,
|
|
1236
|
-
createConditionForMaximumAppraisalAmount,
|
|
1237
|
-
createConditionForMinimumAssetQuantity,
|
|
1238
|
-
createConditionForRequiredBuyer,
|
|
1239
|
-
createEscrowIntentWithSecret,
|
|
1240
|
-
findEscrowPartySecretSignatures,
|
|
1241
|
-
getAppraisalAuthoritiesAllowedValidator,
|
|
1242
|
-
getAppraisalsByAsset,
|
|
1243
|
-
getAppraisalsForAllAssetsValidator,
|
|
1244
|
-
getAppraisalsFromValidAuthoritiesValidator,
|
|
1245
|
-
getAppraisalsValidValidator,
|
|
1246
|
-
getBuyerSecretSignedValidator,
|
|
1247
|
-
getBuyerSecretSuppliedValidator,
|
|
1248
|
-
getEscrowAgentAllowedValidator,
|
|
1249
|
-
getEscrowSecret,
|
|
1250
|
-
getNbfExpValidator,
|
|
1251
|
-
getPartySecretSignedValidator,
|
|
1252
|
-
getPaymentAuthoritiesAllowedValidator,
|
|
1253
|
-
getSellerSecretSignedValidator,
|
|
1254
|
-
getSellerSecretSuppliedValidator,
|
|
1255
|
-
getSignaturesByAppraisal,
|
|
1256
|
-
isAmount,
|
|
1257
|
-
isBillingAddress,
|
|
1258
|
-
isCondition,
|
|
1259
|
-
isCoupon,
|
|
1260
|
-
isDiscount,
|
|
1261
|
-
isEscrowOutcome,
|
|
1262
|
-
isEscrowTerms,
|
|
1263
|
-
isFixedAmountCoupon,
|
|
1264
|
-
isFixedPercentageCoupon,
|
|
1265
|
-
isFixedPriceCoupon,
|
|
1266
|
-
isIso4217CurrencyCode,
|
|
1267
|
-
isPayment,
|
|
1268
|
-
isPaymentCard,
|
|
1269
|
-
isPaymentStatus,
|
|
1270
|
-
isPurchase,
|
|
1271
|
-
isReceipt,
|
|
1272
|
-
isStackable,
|
|
1273
|
-
isSubtotal,
|
|
1274
|
-
isTotal,
|
|
1275
|
-
moduleIdentifiersContainsAllOf,
|
|
1276
|
-
moduleIdentifiersContainsOneOf,
|
|
1277
|
-
sellerExistsValidator,
|
|
1278
|
-
sellerSecretExistsValidator,
|
|
1279
|
-
toAmount,
|
|
1280
|
-
toBillingAddress,
|
|
1281
|
-
toCondition,
|
|
1282
|
-
toCoupon,
|
|
1283
|
-
toDiscount,
|
|
1284
|
-
toEscrowOutcome,
|
|
1285
|
-
toEscrowTerms,
|
|
1286
|
-
toFixedAmountCoupon,
|
|
1287
|
-
toFixedPercentageCoupon,
|
|
1288
|
-
toFixedPriceCoupon,
|
|
1289
|
-
toPayment,
|
|
1290
|
-
toPaymentCard,
|
|
1291
|
-
toPaymentStatus,
|
|
1292
|
-
toPurchase,
|
|
1293
|
-
toReceipt,
|
|
1294
|
-
toSubtotal,
|
|
1295
|
-
toTotal,
|
|
1296
|
-
updateEscrowTermsWithSecret,
|
|
1297
|
-
validateWithinWindow
|
|
1298
|
-
};
|
|
1
|
+
// src/index.ts
|
|
2
|
+
export * from "@xyo-network/payload-plugins/payment";
|
|
1299
3
|
//# sourceMappingURL=index.mjs.map
|