@xyo-network/payment-payload-plugins 5.3.1 → 5.3.3
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/Amount/Payload.d.ts +2 -2
- package/dist/neutral/Billing/Address/Address.d.ts +2 -2
- package/dist/neutral/Discount/Config.d.ts +1 -1
- package/dist/neutral/Discount/Config.d.ts.map +1 -1
- package/dist/neutral/Discount/Params.d.ts +1 -1
- package/dist/neutral/Discount/Params.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Conditions/BuyerCondition.d.ts +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Conditions/BuyerCondition.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedAmount.d.ts +2 -2
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPercentage.d.ts +2 -2
- package/dist/neutral/Discount/Payload/Coupon/Coupons/FixedPrice.d.ts +2 -2
- package/dist/neutral/Discount/Payload/Coupon/Payload.d.ts +2 -2
- package/dist/neutral/Discount/Payload/Coupon/types/Condition.d.ts +2 -2
- package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts +1 -1
- package/dist/neutral/Discount/Payload/Coupon/types/CouponFields.d.ts.map +1 -1
- package/dist/neutral/Discount/Payload/Discount.d.ts +2 -2
- package/dist/neutral/Escrow/Outcome.d.ts +2 -2
- package/dist/neutral/Escrow/Outcome.d.ts.map +1 -1
- package/dist/neutral/Escrow/Terms/Terms.d.ts +3 -3
- package/dist/neutral/Escrow/Terms/Terms.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts +1 -1
- package/dist/neutral/Escrow/util/appraisal/getAppraisalsByAsset.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts +1 -1
- package/dist/neutral/Escrow/util/appraisal/getSignaturesByAppraisal.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/findEscrowPartySecretSignatures.d.ts +1 -1
- package/dist/neutral/Escrow/util/secret/findEscrowPartySecretSignatures.d.ts.map +1 -1
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts +3 -3
- package/dist/neutral/Escrow/util/secret/updateEscrowTermsWithSecret.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts +1 -1
- package/dist/neutral/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/appraisal.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/buyerSecret.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/buyerSecret.d.ts.map +1 -1
- package/dist/neutral/Escrow/validators/escrow/sellerSecret.d.ts +1 -1
- package/dist/neutral/Escrow/validators/escrow/sellerSecret.d.ts.map +1 -1
- package/dist/neutral/Payment/Instrument/Card/Payload.d.ts +2 -2
- package/dist/neutral/Payment/Payload.d.ts +2 -2
- package/dist/neutral/Payment/Status/Payload.d.ts +2 -2
- package/dist/neutral/Purchase/Payload.d.ts +3 -3
- package/dist/neutral/Purchase/Payload.d.ts.map +1 -1
- package/dist/neutral/Receipt/Payload.d.ts +2 -2
- package/dist/neutral/Subtotal/Diviner/Payload.d.ts +2 -2
- package/dist/neutral/Total/Diviner/Payload.d.ts +2 -2
- package/dist/neutral/index.mjs +24 -24
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +39 -27
- package/src/Amount/Iso4217Currency.ts +0 -557
- package/src/Amount/Payload.ts +0 -36
- package/src/Amount/index.ts +0 -2
- package/src/Billing/Address/Address.ts +0 -48
- package/src/Billing/Address/Schema.ts +0 -6
- package/src/Billing/Address/index.ts +0 -2
- package/src/Billing/Schema.ts +0 -6
- package/src/Billing/index.ts +0 -2
- package/src/Currency.ts +0 -3
- package/src/Discount/Config.ts +0 -35
- package/src/Discount/Params.ts +0 -14
- package/src/Discount/Payload/Coupon/Conditions/AppraisalAmountCondition.ts +0 -43
- package/src/Discount/Payload/Coupon/Conditions/AssetQuantityCondition.ts +0 -25
- package/src/Discount/Payload/Coupon/Conditions/BuyerCondition.ts +0 -50
- package/src/Discount/Payload/Coupon/Conditions/index.ts +0 -3
- package/src/Discount/Payload/Coupon/Coupons/FixedAmount.ts +0 -35
- package/src/Discount/Payload/Coupon/Coupons/FixedPercentage.ts +0 -36
- package/src/Discount/Payload/Coupon/Coupons/FixedPrice.ts +0 -35
- package/src/Discount/Payload/Coupon/Coupons/index.ts +0 -3
- package/src/Discount/Payload/Coupon/Payload.ts +0 -37
- package/src/Discount/Payload/Coupon/Schema.ts +0 -4
- package/src/Discount/Payload/Coupon/index.ts +0 -5
- package/src/Discount/Payload/Coupon/types/Condition.ts +0 -21
- package/src/Discount/Payload/Coupon/types/CouponFields.ts +0 -16
- package/src/Discount/Payload/Coupon/types/index.ts +0 -3
- package/src/Discount/Payload/Coupon/types/isStackable.ts +0 -6
- package/src/Discount/Payload/Discount.ts +0 -33
- package/src/Discount/Payload/NoDiscount.ts +0 -8
- package/src/Discount/Payload/index.ts +0 -3
- package/src/Discount/index.ts +0 -3
- package/src/Escrow/Outcome.ts +0 -42
- package/src/Escrow/Schema.ts +0 -4
- package/src/Escrow/Terms/Party.ts +0 -6
- package/src/Escrow/Terms/PartySecret.ts +0 -6
- package/src/Escrow/Terms/Terms.ts +0 -82
- package/src/Escrow/Terms/index.ts +0 -3
- package/src/Escrow/index.ts +0 -5
- package/src/Escrow/util/appraisal/getAppraisalsByAsset.ts +0 -32
- package/src/Escrow/util/appraisal/getSignaturesByAppraisal.ts +0 -40
- package/src/Escrow/util/appraisal/index.ts +0 -2
- package/src/Escrow/util/index.ts +0 -2
- package/src/Escrow/util/secret/createEscrowIntent.ts +0 -17
- package/src/Escrow/util/secret/findEscrowPartySecretSignatures.ts +0 -47
- package/src/Escrow/util/secret/getEscrowSecret.ts +0 -11
- package/src/Escrow/util/secret/index.ts +0 -4
- package/src/Escrow/util/secret/updateEscrowTermsWithSecret.ts +0 -37
- package/src/Escrow/validators/common/ModuleInstanceValidators/index.ts +0 -1
- package/src/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.ts +0 -48
- package/src/Escrow/validators/common/SecretValidators/getPartySecretSignedValidator.ts +0 -46
- package/src/Escrow/validators/common/SecretValidators/index.ts +0 -1
- package/src/Escrow/validators/common/TemporalValidators/index.ts +0 -1
- package/src/Escrow/validators/common/TemporalValidators/validateWithinWindow.ts +0 -6
- package/src/Escrow/validators/common/index.ts +0 -3
- package/src/Escrow/validators/escrow/agent.ts +0 -17
- package/src/Escrow/validators/escrow/appraisal.ts +0 -114
- package/src/Escrow/validators/escrow/appraisalAuthorities.ts +0 -37
- package/src/Escrow/validators/escrow/assets.ts +0 -19
- package/src/Escrow/validators/escrow/buyer.ts +0 -25
- package/src/Escrow/validators/escrow/buyerSecret.ts +0 -49
- package/src/Escrow/validators/escrow/index.ts +0 -10
- package/src/Escrow/validators/escrow/nbfExp.ts +0 -19
- package/src/Escrow/validators/escrow/paymentAuthorities.ts +0 -17
- package/src/Escrow/validators/escrow/seller.ts +0 -25
- package/src/Escrow/validators/escrow/sellerSecret.ts +0 -49
- package/src/Escrow/validators/index.ts +0 -2
- package/src/Invoice/Invoice.ts +0 -19
- package/src/Invoice/index.ts +0 -1
- package/src/Payment/Instrument/Card/Payload.ts +0 -50
- package/src/Payment/Instrument/Card/Schema.ts +0 -6
- package/src/Payment/Instrument/Card/index.ts +0 -2
- package/src/Payment/Instrument/Schema.ts +0 -6
- package/src/Payment/Instrument/index.ts +0 -2
- package/src/Payment/Payload.ts +0 -39
- package/src/Payment/Schema.ts +0 -6
- package/src/Payment/Status/Payload.ts +0 -39
- package/src/Payment/Status/Schema.ts +0 -6
- package/src/Payment/Status/index.ts +0 -2
- package/src/Payment/index.ts +0 -4
- package/src/Purchase/Payload.ts +0 -40
- package/src/Purchase/Schema.ts +0 -6
- package/src/Purchase/index.ts +0 -2
- package/src/Receipt/Payload.ts +0 -39
- package/src/Receipt/Schema.ts +0 -6
- package/src/Receipt/index.ts +0 -2
- package/src/Schema.ts +0 -4
- package/src/Subtotal/Diviner/Config.ts +0 -14
- package/src/Subtotal/Diviner/Params.ts +0 -8
- package/src/Subtotal/Diviner/Payload.ts +0 -33
- package/src/Subtotal/Diviner/index.ts +0 -3
- package/src/Subtotal/index.ts +0 -1
- package/src/Total/Diviner/Config.ts +0 -25
- package/src/Total/Diviner/Params.ts +0 -8
- package/src/Total/Diviner/Payload.ts +0 -33
- package/src/Total/Diviner/index.ts +0 -3
- package/src/Total/index.ts +0 -1
- package/src/index.ts +0 -11
|
@@ -1,557 +0,0 @@
|
|
|
1
|
-
/* eslint-disable max-lines */
|
|
2
|
-
/**
|
|
3
|
-
* ISO 4217 currency codes
|
|
4
|
-
*/
|
|
5
|
-
export type Iso4217AlphabeticalCode
|
|
6
|
-
= 'AED'
|
|
7
|
-
| 'AFN'
|
|
8
|
-
| 'ALL'
|
|
9
|
-
| 'AMD'
|
|
10
|
-
| 'ANG'
|
|
11
|
-
| 'AOA'
|
|
12
|
-
| 'ARS'
|
|
13
|
-
| 'AUD'
|
|
14
|
-
| 'AWG'
|
|
15
|
-
| 'AZN'
|
|
16
|
-
| 'BAM'
|
|
17
|
-
| 'BBD'
|
|
18
|
-
| 'BDT'
|
|
19
|
-
| 'BGN'
|
|
20
|
-
| 'BHD'
|
|
21
|
-
| 'BIF'
|
|
22
|
-
| 'BMD'
|
|
23
|
-
| 'BND'
|
|
24
|
-
| 'BOB'
|
|
25
|
-
| 'BOV'
|
|
26
|
-
| 'BRL'
|
|
27
|
-
| 'BSD'
|
|
28
|
-
| 'BTN'
|
|
29
|
-
| 'BWP'
|
|
30
|
-
| 'BYN'
|
|
31
|
-
| 'BZD'
|
|
32
|
-
| 'CAD'
|
|
33
|
-
| 'CDF'
|
|
34
|
-
| 'CHE'
|
|
35
|
-
| 'CHF'
|
|
36
|
-
| 'CHW'
|
|
37
|
-
| 'CLF'
|
|
38
|
-
| 'CLP'
|
|
39
|
-
| 'CNY'
|
|
40
|
-
| 'COP'
|
|
41
|
-
| 'COU'
|
|
42
|
-
| 'CRC'
|
|
43
|
-
| 'CUP'
|
|
44
|
-
| 'CVE'
|
|
45
|
-
| 'CZK'
|
|
46
|
-
| 'DJF'
|
|
47
|
-
| 'DKK'
|
|
48
|
-
| 'DOP'
|
|
49
|
-
| 'DZD'
|
|
50
|
-
| 'EGP'
|
|
51
|
-
| 'ERN'
|
|
52
|
-
| 'ETB'
|
|
53
|
-
| 'EUR'
|
|
54
|
-
| 'FJD'
|
|
55
|
-
| 'FKP'
|
|
56
|
-
| 'GBP'
|
|
57
|
-
| 'GEL'
|
|
58
|
-
| 'GHS'
|
|
59
|
-
| 'GIP'
|
|
60
|
-
| 'GMD'
|
|
61
|
-
| 'GNF'
|
|
62
|
-
| 'GTQ'
|
|
63
|
-
| 'GYD'
|
|
64
|
-
| 'HKD'
|
|
65
|
-
| 'HNL'
|
|
66
|
-
| 'HTG'
|
|
67
|
-
| 'HUF'
|
|
68
|
-
| 'IDR'
|
|
69
|
-
| 'ILS'
|
|
70
|
-
| 'INR'
|
|
71
|
-
| 'IQD'
|
|
72
|
-
| 'IRR'
|
|
73
|
-
| 'ISK'
|
|
74
|
-
| 'JMD'
|
|
75
|
-
| 'JOD'
|
|
76
|
-
| 'JPY'
|
|
77
|
-
| 'KES'
|
|
78
|
-
| 'KGS'
|
|
79
|
-
| 'KHR'
|
|
80
|
-
| 'KMF'
|
|
81
|
-
| 'KPW'
|
|
82
|
-
| 'KRW'
|
|
83
|
-
| 'KWD'
|
|
84
|
-
| 'KYD'
|
|
85
|
-
| 'KZT'
|
|
86
|
-
| 'LAK'
|
|
87
|
-
| 'LBP'
|
|
88
|
-
| 'LKR'
|
|
89
|
-
| 'LRD'
|
|
90
|
-
| 'LSL'
|
|
91
|
-
| 'LYD'
|
|
92
|
-
| 'MAD'
|
|
93
|
-
| 'MDL'
|
|
94
|
-
| 'MGA'
|
|
95
|
-
| 'MKD'
|
|
96
|
-
| 'MMK'
|
|
97
|
-
| 'MNT'
|
|
98
|
-
| 'MOP'
|
|
99
|
-
| 'MRU'
|
|
100
|
-
| 'MUR'
|
|
101
|
-
| 'MVR'
|
|
102
|
-
| 'MWK'
|
|
103
|
-
| 'MXN'
|
|
104
|
-
| 'MXV'
|
|
105
|
-
| 'MYR'
|
|
106
|
-
| 'MZN'
|
|
107
|
-
| 'NAD'
|
|
108
|
-
| 'NGN'
|
|
109
|
-
| 'NIO'
|
|
110
|
-
| 'NOK'
|
|
111
|
-
| 'NPR'
|
|
112
|
-
| 'NZD'
|
|
113
|
-
| 'OMR'
|
|
114
|
-
| 'PAB'
|
|
115
|
-
| 'PEN'
|
|
116
|
-
| 'PGK'
|
|
117
|
-
| 'PHP'
|
|
118
|
-
| 'PKR'
|
|
119
|
-
| 'PLN'
|
|
120
|
-
| 'PYG'
|
|
121
|
-
| 'QAR'
|
|
122
|
-
| 'RON'
|
|
123
|
-
| 'RSD'
|
|
124
|
-
| 'RUB'
|
|
125
|
-
| 'RWF'
|
|
126
|
-
| 'SAR'
|
|
127
|
-
| 'SBD'
|
|
128
|
-
| 'SCR'
|
|
129
|
-
| 'SDG'
|
|
130
|
-
| 'SEK'
|
|
131
|
-
| 'SGD'
|
|
132
|
-
| 'SHP'
|
|
133
|
-
| 'SLE'
|
|
134
|
-
| 'SOS'
|
|
135
|
-
| 'SRD'
|
|
136
|
-
| 'SSP'
|
|
137
|
-
| 'STN'
|
|
138
|
-
| 'SVC'
|
|
139
|
-
| 'SYP'
|
|
140
|
-
| 'SZL'
|
|
141
|
-
| 'THB'
|
|
142
|
-
| 'TJS'
|
|
143
|
-
| 'TMT'
|
|
144
|
-
| 'TND'
|
|
145
|
-
| 'TOP'
|
|
146
|
-
| 'TRY'
|
|
147
|
-
| 'TTD'
|
|
148
|
-
| 'TWD'
|
|
149
|
-
| 'TZS'
|
|
150
|
-
| 'UAH'
|
|
151
|
-
| 'UGX'
|
|
152
|
-
| 'USD'
|
|
153
|
-
| 'USN'
|
|
154
|
-
| 'UYI'
|
|
155
|
-
| 'UYU'
|
|
156
|
-
| 'UYW'
|
|
157
|
-
| 'UZS'
|
|
158
|
-
| 'VED'
|
|
159
|
-
| 'VES'
|
|
160
|
-
| 'VND'
|
|
161
|
-
| 'VUV'
|
|
162
|
-
| 'WST'
|
|
163
|
-
| 'XAF'
|
|
164
|
-
| 'XAG'
|
|
165
|
-
| 'XAU'
|
|
166
|
-
| 'XBA'
|
|
167
|
-
| 'XBB'
|
|
168
|
-
| 'XBC'
|
|
169
|
-
| 'XBD'
|
|
170
|
-
| 'XCD'
|
|
171
|
-
| 'XDR'
|
|
172
|
-
| 'XOF'
|
|
173
|
-
| 'XPD'
|
|
174
|
-
| 'XPF'
|
|
175
|
-
| 'XPT'
|
|
176
|
-
| 'XSU'
|
|
177
|
-
| 'XTS'
|
|
178
|
-
| 'XUA'
|
|
179
|
-
| 'XXX'
|
|
180
|
-
| 'YER'
|
|
181
|
-
| 'ZAR'
|
|
182
|
-
| 'ZMW'
|
|
183
|
-
| 'ZWG'
|
|
184
|
-
| 'ZWL'
|
|
185
|
-
|
|
186
|
-
// TODO: Technically, the values should be 3 digit numbers with leading
|
|
187
|
-
// zeros, so we can padStart if we need to be strict
|
|
188
|
-
/**
|
|
189
|
-
* ISO 4217 numeric currency number codes
|
|
190
|
-
*/
|
|
191
|
-
export type Iso4217NumericCode
|
|
192
|
-
= 784
|
|
193
|
-
| 971
|
|
194
|
-
| 8
|
|
195
|
-
| 51
|
|
196
|
-
| 532
|
|
197
|
-
| 973
|
|
198
|
-
| 32
|
|
199
|
-
| 36
|
|
200
|
-
| 533
|
|
201
|
-
| 944
|
|
202
|
-
| 977
|
|
203
|
-
| 52
|
|
204
|
-
| 50
|
|
205
|
-
| 975
|
|
206
|
-
| 48
|
|
207
|
-
| 108
|
|
208
|
-
| 60
|
|
209
|
-
| 96
|
|
210
|
-
| 68
|
|
211
|
-
| 984
|
|
212
|
-
| 986
|
|
213
|
-
| 44
|
|
214
|
-
| 64
|
|
215
|
-
| 72
|
|
216
|
-
| 933
|
|
217
|
-
| 84
|
|
218
|
-
| 124
|
|
219
|
-
| 976
|
|
220
|
-
| 947
|
|
221
|
-
| 756
|
|
222
|
-
| 948
|
|
223
|
-
| 990
|
|
224
|
-
| 152
|
|
225
|
-
| 156
|
|
226
|
-
| 170
|
|
227
|
-
| 970
|
|
228
|
-
| 188
|
|
229
|
-
| 192
|
|
230
|
-
| 132
|
|
231
|
-
| 203
|
|
232
|
-
| 262
|
|
233
|
-
| 208
|
|
234
|
-
| 214
|
|
235
|
-
| 12
|
|
236
|
-
| 818
|
|
237
|
-
| 232
|
|
238
|
-
| 230
|
|
239
|
-
| 978
|
|
240
|
-
| 242
|
|
241
|
-
| 238
|
|
242
|
-
| 826
|
|
243
|
-
| 981
|
|
244
|
-
| 936
|
|
245
|
-
| 292
|
|
246
|
-
| 270
|
|
247
|
-
| 324
|
|
248
|
-
| 320
|
|
249
|
-
| 328
|
|
250
|
-
| 344
|
|
251
|
-
| 340
|
|
252
|
-
| 332
|
|
253
|
-
| 348
|
|
254
|
-
| 360
|
|
255
|
-
| 376
|
|
256
|
-
| 356
|
|
257
|
-
| 368
|
|
258
|
-
| 364
|
|
259
|
-
| 352
|
|
260
|
-
| 388
|
|
261
|
-
| 400
|
|
262
|
-
| 392
|
|
263
|
-
| 404
|
|
264
|
-
| 417
|
|
265
|
-
| 116
|
|
266
|
-
| 174
|
|
267
|
-
| 408
|
|
268
|
-
| 410
|
|
269
|
-
| 414
|
|
270
|
-
| 136
|
|
271
|
-
| 398
|
|
272
|
-
| 418
|
|
273
|
-
| 422
|
|
274
|
-
| 144
|
|
275
|
-
| 430
|
|
276
|
-
| 426
|
|
277
|
-
| 434
|
|
278
|
-
| 504
|
|
279
|
-
| 498
|
|
280
|
-
| 969
|
|
281
|
-
| 807
|
|
282
|
-
| 104
|
|
283
|
-
| 496
|
|
284
|
-
| 446
|
|
285
|
-
| 929
|
|
286
|
-
| 480
|
|
287
|
-
| 462
|
|
288
|
-
| 454
|
|
289
|
-
| 484
|
|
290
|
-
| 979
|
|
291
|
-
| 458
|
|
292
|
-
| 943
|
|
293
|
-
| 516
|
|
294
|
-
| 566
|
|
295
|
-
| 558
|
|
296
|
-
| 578
|
|
297
|
-
| 524
|
|
298
|
-
| 554
|
|
299
|
-
| 512
|
|
300
|
-
| 590
|
|
301
|
-
| 604
|
|
302
|
-
| 598
|
|
303
|
-
| 608
|
|
304
|
-
| 586
|
|
305
|
-
| 985
|
|
306
|
-
| 600
|
|
307
|
-
| 634
|
|
308
|
-
| 946
|
|
309
|
-
| 941
|
|
310
|
-
| 643
|
|
311
|
-
| 646
|
|
312
|
-
| 682
|
|
313
|
-
| 90
|
|
314
|
-
| 690
|
|
315
|
-
| 938
|
|
316
|
-
| 752
|
|
317
|
-
| 702
|
|
318
|
-
| 654
|
|
319
|
-
| 925
|
|
320
|
-
| 706
|
|
321
|
-
| 968
|
|
322
|
-
| 728
|
|
323
|
-
| 930
|
|
324
|
-
| 222
|
|
325
|
-
| 760
|
|
326
|
-
| 748
|
|
327
|
-
| 764
|
|
328
|
-
| 972
|
|
329
|
-
| 934
|
|
330
|
-
| 788
|
|
331
|
-
| 776
|
|
332
|
-
| 949
|
|
333
|
-
| 780
|
|
334
|
-
| 901
|
|
335
|
-
| 834
|
|
336
|
-
| 980
|
|
337
|
-
| 800
|
|
338
|
-
| 840
|
|
339
|
-
| 997
|
|
340
|
-
| 940
|
|
341
|
-
| 858
|
|
342
|
-
| 927
|
|
343
|
-
| 860
|
|
344
|
-
| 926
|
|
345
|
-
| 928
|
|
346
|
-
| 704
|
|
347
|
-
| 548
|
|
348
|
-
| 882
|
|
349
|
-
| 950
|
|
350
|
-
| 961
|
|
351
|
-
| 959
|
|
352
|
-
| 955
|
|
353
|
-
| 956
|
|
354
|
-
| 957
|
|
355
|
-
| 958
|
|
356
|
-
| 951
|
|
357
|
-
| 960
|
|
358
|
-
| 952
|
|
359
|
-
| 964
|
|
360
|
-
| 953
|
|
361
|
-
| 962
|
|
362
|
-
| 994
|
|
363
|
-
| 963
|
|
364
|
-
| 965
|
|
365
|
-
| 999
|
|
366
|
-
| 886
|
|
367
|
-
| 710
|
|
368
|
-
| 967
|
|
369
|
-
| 924
|
|
370
|
-
| 932
|
|
371
|
-
|
|
372
|
-
/**
|
|
373
|
-
* Dictionary of ISO 4217 alphabetical currency codes to numeric currency number codes
|
|
374
|
-
*/
|
|
375
|
-
export const Iso4217CurrencyCodes: Record<Iso4217AlphabeticalCode, Iso4217NumericCode> = {
|
|
376
|
-
AED: 784,
|
|
377
|
-
AFN: 971,
|
|
378
|
-
ALL: 8,
|
|
379
|
-
AMD: 51,
|
|
380
|
-
ANG: 532,
|
|
381
|
-
AOA: 973,
|
|
382
|
-
ARS: 32,
|
|
383
|
-
AUD: 36,
|
|
384
|
-
AWG: 533,
|
|
385
|
-
AZN: 944,
|
|
386
|
-
BAM: 977,
|
|
387
|
-
BBD: 52,
|
|
388
|
-
BDT: 50,
|
|
389
|
-
BGN: 975,
|
|
390
|
-
BHD: 48,
|
|
391
|
-
BIF: 108,
|
|
392
|
-
BMD: 60,
|
|
393
|
-
BND: 96,
|
|
394
|
-
BOB: 68,
|
|
395
|
-
BOV: 984,
|
|
396
|
-
BRL: 986,
|
|
397
|
-
BSD: 44,
|
|
398
|
-
BTN: 64,
|
|
399
|
-
BWP: 72,
|
|
400
|
-
BYN: 933,
|
|
401
|
-
BZD: 84,
|
|
402
|
-
CAD: 124,
|
|
403
|
-
CDF: 976,
|
|
404
|
-
CHE: 947,
|
|
405
|
-
CHF: 756,
|
|
406
|
-
CHW: 948,
|
|
407
|
-
CLF: 990,
|
|
408
|
-
CLP: 152,
|
|
409
|
-
CNY: 156,
|
|
410
|
-
COP: 170,
|
|
411
|
-
COU: 970,
|
|
412
|
-
CRC: 188,
|
|
413
|
-
CUP: 192,
|
|
414
|
-
CVE: 132,
|
|
415
|
-
CZK: 203,
|
|
416
|
-
DJF: 262,
|
|
417
|
-
DKK: 208,
|
|
418
|
-
DOP: 214,
|
|
419
|
-
DZD: 12,
|
|
420
|
-
EGP: 818,
|
|
421
|
-
ERN: 232,
|
|
422
|
-
ETB: 230,
|
|
423
|
-
EUR: 978,
|
|
424
|
-
FJD: 242,
|
|
425
|
-
FKP: 238,
|
|
426
|
-
GBP: 826,
|
|
427
|
-
GEL: 981,
|
|
428
|
-
GHS: 936,
|
|
429
|
-
GIP: 292,
|
|
430
|
-
GMD: 270,
|
|
431
|
-
GNF: 324,
|
|
432
|
-
GTQ: 320,
|
|
433
|
-
GYD: 328,
|
|
434
|
-
HKD: 344,
|
|
435
|
-
HNL: 340,
|
|
436
|
-
HTG: 332,
|
|
437
|
-
HUF: 348,
|
|
438
|
-
IDR: 360,
|
|
439
|
-
ILS: 376,
|
|
440
|
-
INR: 356,
|
|
441
|
-
IQD: 368,
|
|
442
|
-
IRR: 364,
|
|
443
|
-
ISK: 352,
|
|
444
|
-
JMD: 388,
|
|
445
|
-
JOD: 400,
|
|
446
|
-
JPY: 392,
|
|
447
|
-
KES: 404,
|
|
448
|
-
KGS: 417,
|
|
449
|
-
KHR: 116,
|
|
450
|
-
KMF: 174,
|
|
451
|
-
KPW: 408,
|
|
452
|
-
KRW: 410,
|
|
453
|
-
KWD: 414,
|
|
454
|
-
KYD: 136,
|
|
455
|
-
KZT: 398,
|
|
456
|
-
LAK: 418,
|
|
457
|
-
LBP: 422,
|
|
458
|
-
LKR: 144,
|
|
459
|
-
LRD: 430,
|
|
460
|
-
LSL: 426,
|
|
461
|
-
LYD: 434,
|
|
462
|
-
MAD: 504,
|
|
463
|
-
MDL: 498,
|
|
464
|
-
MGA: 969,
|
|
465
|
-
MKD: 807,
|
|
466
|
-
MMK: 104,
|
|
467
|
-
MNT: 496,
|
|
468
|
-
MOP: 446,
|
|
469
|
-
MRU: 929,
|
|
470
|
-
MUR: 480,
|
|
471
|
-
MVR: 462,
|
|
472
|
-
MWK: 454,
|
|
473
|
-
MXN: 484,
|
|
474
|
-
MXV: 979,
|
|
475
|
-
MYR: 458,
|
|
476
|
-
MZN: 943,
|
|
477
|
-
NAD: 516,
|
|
478
|
-
NGN: 566,
|
|
479
|
-
NIO: 558,
|
|
480
|
-
NOK: 578,
|
|
481
|
-
NPR: 524,
|
|
482
|
-
NZD: 554,
|
|
483
|
-
OMR: 512,
|
|
484
|
-
PAB: 590,
|
|
485
|
-
PEN: 604,
|
|
486
|
-
PGK: 598,
|
|
487
|
-
PHP: 608,
|
|
488
|
-
PKR: 586,
|
|
489
|
-
PLN: 985,
|
|
490
|
-
PYG: 600,
|
|
491
|
-
QAR: 634,
|
|
492
|
-
RON: 946,
|
|
493
|
-
RSD: 941,
|
|
494
|
-
RUB: 643,
|
|
495
|
-
RWF: 646,
|
|
496
|
-
SAR: 682,
|
|
497
|
-
SBD: 90,
|
|
498
|
-
SCR: 690,
|
|
499
|
-
SDG: 938,
|
|
500
|
-
SEK: 752,
|
|
501
|
-
SGD: 702,
|
|
502
|
-
SHP: 654,
|
|
503
|
-
SLE: 925,
|
|
504
|
-
SOS: 706,
|
|
505
|
-
SRD: 968,
|
|
506
|
-
SSP: 728,
|
|
507
|
-
STN: 930,
|
|
508
|
-
SVC: 222,
|
|
509
|
-
SYP: 760,
|
|
510
|
-
SZL: 748,
|
|
511
|
-
THB: 764,
|
|
512
|
-
TJS: 972,
|
|
513
|
-
TMT: 934,
|
|
514
|
-
TND: 788,
|
|
515
|
-
TOP: 776,
|
|
516
|
-
TRY: 949,
|
|
517
|
-
TTD: 780,
|
|
518
|
-
TWD: 901,
|
|
519
|
-
TZS: 834,
|
|
520
|
-
UAH: 980,
|
|
521
|
-
UGX: 800,
|
|
522
|
-
USD: 840,
|
|
523
|
-
USN: 997,
|
|
524
|
-
UYI: 940,
|
|
525
|
-
UYU: 858,
|
|
526
|
-
UYW: 927,
|
|
527
|
-
UZS: 860,
|
|
528
|
-
VED: 926,
|
|
529
|
-
VES: 928,
|
|
530
|
-
VND: 704,
|
|
531
|
-
VUV: 548,
|
|
532
|
-
WST: 882,
|
|
533
|
-
XAF: 950,
|
|
534
|
-
XAG: 961,
|
|
535
|
-
XAU: 959,
|
|
536
|
-
XBA: 955,
|
|
537
|
-
XBB: 956,
|
|
538
|
-
XBC: 957,
|
|
539
|
-
XBD: 958,
|
|
540
|
-
XCD: 951,
|
|
541
|
-
XDR: 960,
|
|
542
|
-
XOF: 952,
|
|
543
|
-
XPD: 964,
|
|
544
|
-
XPF: 953,
|
|
545
|
-
XPT: 962,
|
|
546
|
-
XSU: 994,
|
|
547
|
-
XTS: 963,
|
|
548
|
-
XUA: 965,
|
|
549
|
-
XXX: 999,
|
|
550
|
-
YER: 886,
|
|
551
|
-
ZAR: 710,
|
|
552
|
-
ZMW: 967,
|
|
553
|
-
ZWG: 924,
|
|
554
|
-
ZWL: 932,
|
|
555
|
-
}
|
|
556
|
-
|
|
557
|
-
export const isIso4217CurrencyCode = (code: string): code is Iso4217AlphabeticalCode => Iso4217CurrencyCodes[code as Iso4217AlphabeticalCode] ? true : false
|
package/src/Amount/Payload.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
-
import type { PayloadWithSources, WithSources } from '@xyo-network/payload-model'
|
|
3
|
-
import {
|
|
4
|
-
asSchema,
|
|
5
|
-
isPayloadOfSchemaType,
|
|
6
|
-
isPayloadOfSchemaTypeWithSources,
|
|
7
|
-
} from '@xyo-network/payload-model'
|
|
8
|
-
|
|
9
|
-
import type { Iso4217AlphabeticalCode } from './Iso4217Currency.ts'
|
|
10
|
-
|
|
11
|
-
export const AmountSchema = asSchema('network.xyo.payments.amount', true)
|
|
12
|
-
export type AmountSchema = typeof AmountSchema
|
|
13
|
-
|
|
14
|
-
export interface AmountFields {
|
|
15
|
-
amount: number
|
|
16
|
-
currency: Iso4217AlphabeticalCode
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* The result of a amount
|
|
21
|
-
*/
|
|
22
|
-
export type Amount = PayloadWithSources<AmountFields, AmountSchema>
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Identity function for determining if an object is an Amount
|
|
26
|
-
*/
|
|
27
|
-
export const isAmount = isPayloadOfSchemaType<Amount>(AmountSchema)
|
|
28
|
-
export const asAmount = AsObjectFactory.create<Amount>(isAmount)
|
|
29
|
-
export const asOptionalAmount = AsObjectFactory.createOptional<Amount>(isAmount)
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* Identity function for determining if an object is an Amount with sources
|
|
33
|
-
*/
|
|
34
|
-
export const isAmountWithSources = isPayloadOfSchemaTypeWithSources<Amount>(AmountSchema)
|
|
35
|
-
export const asAmountWithSources = AsObjectFactory.create<WithSources<Amount>>(isAmountWithSources)
|
|
36
|
-
export const asOptionalAmountWithSources = AsObjectFactory.createOptional<WithSources<Amount>>(isAmountWithSources)
|
package/src/Amount/index.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { AsObjectFactory } from '@xylabs/object'
|
|
2
|
-
import type { Payload, WithSources } from '@xyo-network/payload-model'
|
|
3
|
-
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithSources } from '@xyo-network/payload-model'
|
|
4
|
-
|
|
5
|
-
import { BillingAddressSchema } from './Schema.ts'
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The fields describing a billing address.
|
|
9
|
-
*/
|
|
10
|
-
export interface BillingAddressFields {
|
|
11
|
-
/** Street address line 1. */
|
|
12
|
-
address?: string
|
|
13
|
-
/** Street address line 2. */
|
|
14
|
-
address2?: string | null
|
|
15
|
-
/** City of the billing address. */
|
|
16
|
-
city?: string
|
|
17
|
-
/** Country code of the billing address, ISO 3166-1 alpha-2 code. */
|
|
18
|
-
country?: string
|
|
19
|
-
/** First name */
|
|
20
|
-
firstName: string
|
|
21
|
-
/** Last name */
|
|
22
|
-
lastName: string
|
|
23
|
-
/** Organization or company name associated with the billing address. */
|
|
24
|
-
organization?: string | null
|
|
25
|
-
/** Postal or ZIP code of the billing address. */
|
|
26
|
-
postalCode?: string
|
|
27
|
-
/** State or region of the billing address. */
|
|
28
|
-
region?: string
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
/**
|
|
32
|
-
* A BillingAddress Payload
|
|
33
|
-
*/
|
|
34
|
-
export type BillingAddress = Payload<BillingAddressFields, BillingAddressSchema>
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* Identity function for determine if an object is a BillingAddress
|
|
38
|
-
*/
|
|
39
|
-
export const isBillingAddress = isPayloadOfSchemaType<BillingAddress>(BillingAddressSchema)
|
|
40
|
-
export const asBillingAddress = AsObjectFactory.create<BillingAddress>(isBillingAddress)
|
|
41
|
-
export const asOptionalBillingAddress = AsObjectFactory.createOptional<BillingAddress>(isBillingAddress)
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Identity function for determine if an object is a BillingAddress with sources
|
|
45
|
-
*/
|
|
46
|
-
export const isBillingAddressWithSources = isPayloadOfSchemaTypeWithSources<BillingAddress>(BillingAddressSchema)
|
|
47
|
-
export const asBillingAddressWithSources = AsObjectFactory.create<WithSources<BillingAddress>>(isBillingAddressWithSources)
|
|
48
|
-
export const asOptionalBillingAddressWithSources = AsObjectFactory.createOptional<WithSources<BillingAddress>>(isBillingAddressWithSources)
|
package/src/Billing/Schema.ts
DELETED
package/src/Billing/index.ts
DELETED
package/src/Currency.ts
DELETED
package/src/Discount/Config.ts
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
// import type { Hash } from '@xylabs/hex'
|
|
2
|
-
import type { Address } from '@xylabs/hex'
|
|
3
|
-
import type { DivinerConfig } from '@xyo-network/diviner-model'
|
|
4
|
-
import type { ModuleIdentifier } from '@xyo-network/module-model'
|
|
5
|
-
import { asSchema } from '@xyo-network/payload-model'
|
|
6
|
-
|
|
7
|
-
export const PaymentDiscountDivinerConfigSchema = asSchema('network.xyo.diviner.payments.discount.config', true)
|
|
8
|
-
export type PaymentDiscountDivinerConfigSchema = typeof PaymentDiscountDivinerConfigSchema
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* The configuration for the Payment Discount Diviner
|
|
12
|
-
*/
|
|
13
|
-
export type PaymentDiscountDivinerConfig = DivinerConfig<
|
|
14
|
-
{
|
|
15
|
-
/**
|
|
16
|
-
* The boundwitness diviner used to query for payloads
|
|
17
|
-
*/
|
|
18
|
-
boundWitnessDiviner?: ModuleIdentifier
|
|
19
|
-
/**
|
|
20
|
-
* The list of coupon authorities that can be used to get a discount
|
|
21
|
-
*/
|
|
22
|
-
couponAuthorities?: Address[]
|
|
23
|
-
|
|
24
|
-
// /**
|
|
25
|
-
// * The list of coupons that are supported by this diviner
|
|
26
|
-
// */
|
|
27
|
-
// supportedCoupons?: Hash[]
|
|
28
|
-
|
|
29
|
-
/**
|
|
30
|
-
* The Diviner that can be used to determine the subtotal to apply discounts to
|
|
31
|
-
*/
|
|
32
|
-
paymentSubtotalDiviner?: ModuleIdentifier
|
|
33
|
-
},
|
|
34
|
-
PaymentDiscountDivinerConfigSchema
|
|
35
|
-
>
|
package/src/Discount/Params.ts
DELETED
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Address } from '@xylabs/hex'
|
|
2
|
-
import type { DivinerParams } from '@xyo-network/diviner-model'
|
|
3
|
-
import type { AnyConfigSchema } from '@xyo-network/module-model'
|
|
4
|
-
|
|
5
|
-
import type { PaymentDiscountDivinerConfig } from './Config.ts'
|
|
6
|
-
|
|
7
|
-
export interface PaymentDiscountDivinerParams<
|
|
8
|
-
TConfig extends AnyConfigSchema<PaymentDiscountDivinerConfig> = AnyConfigSchema<PaymentDiscountDivinerConfig>,
|
|
9
|
-
> extends DivinerParams<TConfig> {
|
|
10
|
-
/**
|
|
11
|
-
* The list of coupon authorities that can be used to get a discount
|
|
12
|
-
*/
|
|
13
|
-
couponAuthorities?: Address[]
|
|
14
|
-
}
|