@xyo-network/payment-payload-plugins 2.97.0 → 2.97.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.cjs +487 -1
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.js +480 -1
- package/dist/browser/index.js.map +1 -1
- package/dist/neutral/index.cjs +487 -1
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.js +480 -1
- package/dist/neutral/index.js.map +1 -1
- package/dist/node/index.cjs +545 -1
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.js +480 -1
- package/dist/node/index.js.map +1 -1
- package/package.json +11 -11
package/dist/neutral/index.js
CHANGED
|
@@ -1,2 +1,481 @@
|
|
|
1
|
-
|
|
1
|
+
// src/Billing/Address/Address.ts
|
|
2
|
+
import { isPayloadOfSchemaType, isPayloadOfSchemaTypeWithMeta, isPayloadOfSchemaTypeWithSources } from "@xyo-network/payload-model";
|
|
3
|
+
|
|
4
|
+
// src/Schema.ts
|
|
5
|
+
var PaymentsSchema = "network.xyo.payments";
|
|
6
|
+
|
|
7
|
+
// src/Billing/Schema.ts
|
|
8
|
+
var BillingSchema = `${PaymentsSchema}.billing`;
|
|
9
|
+
|
|
10
|
+
// src/Billing/Address/Schema.ts
|
|
11
|
+
var BillingAddressSchema = `${BillingSchema}.address`;
|
|
12
|
+
|
|
13
|
+
// src/Billing/Address/Address.ts
|
|
14
|
+
var isBillingAddress = isPayloadOfSchemaType(BillingAddressSchema);
|
|
15
|
+
var isBillingAddressWithSources = isPayloadOfSchemaTypeWithSources(BillingAddressSchema);
|
|
16
|
+
var isBillingAddressWithMeta = isPayloadOfSchemaTypeWithMeta(BillingAddressSchema);
|
|
17
|
+
|
|
18
|
+
// src/Escrow/createEscrowIntent.ts
|
|
19
|
+
import { BoundWitnessBuilder } from "@xyo-network/boundwitness-builder";
|
|
20
|
+
var createEscrowIntent = async (terms, account) => {
|
|
21
|
+
const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([...terms]).build();
|
|
22
|
+
return result;
|
|
23
|
+
};
|
|
24
|
+
var createEscrowIntentWithSecret = async (terms, secret, account) => {
|
|
25
|
+
const result = await new BoundWitnessBuilder({ accounts: [account] }).payloads([terms, secret]).build();
|
|
26
|
+
return result;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
// src/Escrow/getEscrowSecret.ts
|
|
30
|
+
import { Crypto } from "@xylabs/crypto";
|
|
31
|
+
import { IdSchema } from "@xyo-network/id-payload-plugin";
|
|
32
|
+
var getEscrowSecret = () => {
|
|
33
|
+
return { salt: Crypto.randomUUID(), schema: IdSchema };
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// src/Escrow/Schema.ts
|
|
37
|
+
var EscrowSchema = "network.xyo.escrow";
|
|
38
|
+
|
|
39
|
+
// src/Escrow/Terms.ts
|
|
40
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType2, isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta2, isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources2 } from "@xyo-network/payload-model";
|
|
41
|
+
var EscrowTermsSchema = `${EscrowSchema}.terms`;
|
|
42
|
+
var isEscrowTerms = isPayloadOfSchemaType2(EscrowTermsSchema);
|
|
43
|
+
var isEscrowTermsWithSources = isPayloadOfSchemaTypeWithSources2(EscrowTermsSchema);
|
|
44
|
+
var isEscrowTermsWithMeta = isPayloadOfSchemaTypeWithMeta2(EscrowTermsSchema);
|
|
45
|
+
|
|
46
|
+
// src/Escrow/validators/common/ModuleInstanceValidators/moduleInstanceValidators.ts
|
|
47
|
+
var moduleIdentifiersContainsOneOf = (escrowTerms, propertyExpression, moduleIdentifiers, required = true) => {
|
|
48
|
+
const termsValue = propertyExpression(escrowTerms);
|
|
49
|
+
if (termsValue === void 0) {
|
|
50
|
+
return required ? false : true;
|
|
51
|
+
} else {
|
|
52
|
+
return Array.isArray(termsValue) ? termsValue.some((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue);
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
var moduleIdentifiersContainsAllOf = (escrowTerms, selector, moduleIdentifiers, required = true) => {
|
|
56
|
+
const termsValue = selector(escrowTerms);
|
|
57
|
+
if (termsValue === void 0) {
|
|
58
|
+
return required ? false : true;
|
|
59
|
+
} else {
|
|
60
|
+
return Array.isArray(termsValue) ? termsValue.every((address) => moduleIdentifiers.includes(address)) : moduleIdentifiers.includes(termsValue);
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
// src/Escrow/validators/common/TemporalValidators/validateWithinWindow.ts
|
|
65
|
+
var validateWithinWindow = (value, exp, nbf = Date.now()) => {
|
|
66
|
+
if (value.nbf === void 0 || value.nbf > nbf) return false;
|
|
67
|
+
if (value.exp === void 0 || value.exp < exp) return false;
|
|
68
|
+
return true;
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/Escrow/validators/escrow/agent.ts
|
|
72
|
+
var name = "EscrowTerms.escrowAgent";
|
|
73
|
+
var getEscrowAgentAllowedValidator = (allowedEscrowAgent) => {
|
|
74
|
+
return (terms) => {
|
|
75
|
+
const result = moduleIdentifiersContainsOneOf(terms, (t) => t.escrowAgent, [allowedEscrowAgent], true);
|
|
76
|
+
if (!result) {
|
|
77
|
+
console.log(`${name}: Escrow agent not allowed: ${terms.escrowAgent}`);
|
|
78
|
+
}
|
|
79
|
+
return result;
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
// src/Escrow/validators/escrow/appraisal.ts
|
|
84
|
+
import { assertEx } from "@xylabs/assert";
|
|
85
|
+
import { isBoundWitnessWithMeta } from "@xyo-network/boundwitness-model";
|
|
86
|
+
import { isHashLeaseEstimateWithSources } from "@xyo-network/diviner-hash-lease";
|
|
87
|
+
var name2 = "EscrowTerms.appraisal";
|
|
88
|
+
var appraisalsExistValidator = (terms) => {
|
|
89
|
+
const appraisals = terms.appraisals;
|
|
90
|
+
if (!appraisals || appraisals.length === 0) {
|
|
91
|
+
console.log(`${name2}: No appraisals: ${terms.appraisals}`);
|
|
92
|
+
return false;
|
|
93
|
+
}
|
|
94
|
+
return true;
|
|
95
|
+
};
|
|
96
|
+
var getAppraisalsFromValidAuthoritiesValidator = (dictionary) => {
|
|
97
|
+
return (terms) => {
|
|
98
|
+
const appraisals = assertEx(terms.appraisals, () => `${name2}: No appraisals: ${terms.appraisals}`);
|
|
99
|
+
const appraisalAuthorities = assertEx(terms.appraisalAuthorities, () => `${name2}: No appraisalAuthorities: ${terms.appraisalAuthorities}`);
|
|
100
|
+
const appraisalBWsValid = Object.fromEntries(
|
|
101
|
+
appraisals.map((hash) => [hash, []])
|
|
102
|
+
);
|
|
103
|
+
for (const bw of Object.values(dictionary).filter(isBoundWitnessWithMeta)) {
|
|
104
|
+
for (const appraisal of appraisals) {
|
|
105
|
+
if (bw.payload_hashes.includes(appraisal) && bw.addresses.some((address) => appraisalAuthorities.includes(address))) {
|
|
106
|
+
appraisalBWsValid[appraisal].push(bw);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
for (const [appraisal, bws] of Object.entries(appraisalBWsValid)) {
|
|
111
|
+
if (bws.length === 0) {
|
|
112
|
+
console.log(`${name2}: No valid appraisals for ${appraisal}`);
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
return true;
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
var getAppraisalsValidValidator = (dictionary, minimumExp) => {
|
|
120
|
+
return (terms) => {
|
|
121
|
+
const estimatesByAsset = getEstimatesByAsset(terms, dictionary);
|
|
122
|
+
const now = Date.now();
|
|
123
|
+
const exp = now + minimumExp;
|
|
124
|
+
for (const [asset, estimates] of Object.entries(estimatesByAsset)) {
|
|
125
|
+
for (const estimate of estimates) {
|
|
126
|
+
if (!validateEstimate(estimate, exp)) {
|
|
127
|
+
console.log(`${name2}: Invalid estimate for asset ${asset}: ${estimate}`);
|
|
128
|
+
return false;
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
return true;
|
|
133
|
+
};
|
|
134
|
+
};
|
|
135
|
+
var getAppraisalsForAllAssetsValidator = (dictionary) => {
|
|
136
|
+
return (terms) => {
|
|
137
|
+
const estimatesByAsset = getEstimatesByAsset(terms, dictionary);
|
|
138
|
+
const assets = assertEx(terms.assets, () => `${name2}: No assets: ${terms.assets}`);
|
|
139
|
+
if (Object.keys(estimatesByAsset).length !== assets.length) {
|
|
140
|
+
console.log(`${name2}: Missing appraisals for all assets: ${assets}`);
|
|
141
|
+
return false;
|
|
142
|
+
}
|
|
143
|
+
return true;
|
|
144
|
+
};
|
|
145
|
+
};
|
|
146
|
+
var validateEstimate = (estimate, exp) => {
|
|
147
|
+
if (!validateWithinWindow(estimate, exp)) return false;
|
|
148
|
+
if (estimate.currency !== "USD") return false;
|
|
149
|
+
if (estimate.price <= 0) return false;
|
|
150
|
+
return true;
|
|
151
|
+
};
|
|
152
|
+
var getEstimatesByAsset = (terms, dictionary) => {
|
|
153
|
+
const assets = assertEx(terms.assets, () => `${name2}: No assets: ${terms.assets}`);
|
|
154
|
+
const estimates = Object.values(dictionary).filter(isHashLeaseEstimateWithSources);
|
|
155
|
+
const estimatesByAsset = {};
|
|
156
|
+
for (const estimate of estimates) {
|
|
157
|
+
const { sources } = estimate;
|
|
158
|
+
if (sources === void 0 || sources.length === 0) {
|
|
159
|
+
console.log(`${name2}: No sources: ${estimate}`);
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
for (const asset of assets) {
|
|
163
|
+
if (sources.includes(asset)) {
|
|
164
|
+
if (!estimatesByAsset[asset]) estimatesByAsset[asset] = [];
|
|
165
|
+
estimatesByAsset[asset].push(estimate);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return estimatesByAsset;
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
// src/Escrow/validators/escrow/appraisalAuthorities.ts
|
|
173
|
+
import { asAddress } from "@xylabs/hex";
|
|
174
|
+
var name3 = "EscrowTerms.appraisalAuthorities";
|
|
175
|
+
var appraisalAuthoritiesExistValidator = (terms) => {
|
|
176
|
+
const appraisalAuthorities = terms.appraisalAuthorities;
|
|
177
|
+
if (!appraisalAuthorities || appraisalAuthorities.length === 0) {
|
|
178
|
+
console.log(`${name3}: No appraisalAuthorities: ${terms.appraisalAuthorities}`);
|
|
179
|
+
return false;
|
|
180
|
+
}
|
|
181
|
+
if (appraisalAuthorities.map((x) => asAddress(x)).length !== appraisalAuthorities.length) {
|
|
182
|
+
console.log(`${name3}: Invalid address: ${terms.appraisalAuthorities}`);
|
|
183
|
+
return false;
|
|
184
|
+
}
|
|
185
|
+
return true;
|
|
186
|
+
};
|
|
187
|
+
var getAppraisalAuthoritiesAllowedValidator = (allowed) => {
|
|
188
|
+
return (terms) => {
|
|
189
|
+
const result = moduleIdentifiersContainsAllOf(terms, (t) => t.appraisalAuthorities, allowed, true);
|
|
190
|
+
if (!result) {
|
|
191
|
+
console.log(`${name3}: Appraisal authority not allowed: ${terms.appraisalAuthorities}`);
|
|
192
|
+
}
|
|
193
|
+
return result;
|
|
194
|
+
};
|
|
195
|
+
};
|
|
196
|
+
|
|
197
|
+
// src/Escrow/validators/escrow/assets.ts
|
|
198
|
+
var name4 = "EscrowTerms.assets";
|
|
199
|
+
var assetsExistValidator = (terms) => {
|
|
200
|
+
const assets = terms.assets;
|
|
201
|
+
if (!assets || assets.length === 0) {
|
|
202
|
+
console.log(`${name4}: No assets: ${terms.assets}`);
|
|
203
|
+
return false;
|
|
204
|
+
}
|
|
205
|
+
return true;
|
|
206
|
+
};
|
|
207
|
+
|
|
208
|
+
// src/Escrow/validators/escrow/buyer.ts
|
|
209
|
+
import { asAddress as asAddress2 } from "@xylabs/hex";
|
|
210
|
+
var name5 = "EscrowTerms.buyer";
|
|
211
|
+
var buyerExistsValidator = (terms) => {
|
|
212
|
+
const buyer = terms.buyer;
|
|
213
|
+
if (!buyer || buyer.length === 0) {
|
|
214
|
+
console.log(`${name5}: No buyer: ${terms.buyer}`);
|
|
215
|
+
return false;
|
|
216
|
+
}
|
|
217
|
+
if (buyer.map((x) => asAddress2(x)).length !== buyer.length) {
|
|
218
|
+
console.log(`${name5}: Invalid address: ${terms.buyer}`);
|
|
219
|
+
return false;
|
|
220
|
+
}
|
|
221
|
+
return true;
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
// src/Escrow/validators/escrow/buyerSecret.ts
|
|
225
|
+
import { assertEx as assertEx2 } from "@xylabs/assert";
|
|
226
|
+
import { isBoundWitnessWithMeta as isBoundWitnessWithMeta2 } from "@xyo-network/boundwitness-model";
|
|
227
|
+
import { BoundWitnessValidator } from "@xyo-network/boundwitness-validator";
|
|
228
|
+
var name6 = "EscrowTerms.buyerSecret";
|
|
229
|
+
var buyerSecretExistsValidator = (terms) => {
|
|
230
|
+
const buyerSecret = terms.buyerSecret;
|
|
231
|
+
if (!buyerSecret || buyerSecret.length === 0) {
|
|
232
|
+
console.log(`${name6}: No buyerSecret: ${terms.buyerSecret}`);
|
|
233
|
+
return false;
|
|
234
|
+
}
|
|
235
|
+
return true;
|
|
236
|
+
};
|
|
237
|
+
var getBuyerSecretSuppliedValidator = (dictionary) => {
|
|
238
|
+
return (terms) => {
|
|
239
|
+
const buyerSecret = assertEx2(terms.buyerSecret, () => `${name6}: No buyerSecret: ${terms.buyerSecret}`);
|
|
240
|
+
if (!dictionary[buyerSecret]) {
|
|
241
|
+
console.log(`${name6}: Payload not supplied for buyerSecret: ${buyerSecret}`);
|
|
242
|
+
return false;
|
|
243
|
+
}
|
|
244
|
+
return true;
|
|
245
|
+
};
|
|
246
|
+
};
|
|
247
|
+
var getBuyerSecretSignedValidator = (dictionary) => {
|
|
248
|
+
return async (terms) => {
|
|
249
|
+
const buyer = assertEx2(terms.buyer, () => `${name6}: No buyer: ${terms.buyer}`);
|
|
250
|
+
const buyerSecret = assertEx2(terms.buyerSecret, () => `${name6}: No buyerSecret: ${terms.buyerSecret}`);
|
|
251
|
+
const buyerSecretBWs = Object.values(dictionary).filter(isBoundWitnessWithMeta2).filter((bw) => bw.payload_hashes.includes(buyerSecret)).filter((bw) => buyer.every((buyerAddress) => bw.addresses.includes(buyerAddress)));
|
|
252
|
+
if (buyerSecretBWs.length === 0) {
|
|
253
|
+
console.log(`${name6}: No BoundWitnesses supplied for buyerSecret: ${buyerSecret}`);
|
|
254
|
+
return false;
|
|
255
|
+
}
|
|
256
|
+
const errors = await Promise.all(buyerSecretBWs.map((bw) => new BoundWitnessValidator(bw).validate()));
|
|
257
|
+
const validBoundWitnesses = errors.every((errors2) => errors2.length === 0);
|
|
258
|
+
if (!validBoundWitnesses) {
|
|
259
|
+
console.log(`${name6}: Invalid BoundWitnesses supplied for buyerSecret: ${buyerSecret}`);
|
|
260
|
+
return false;
|
|
261
|
+
}
|
|
262
|
+
return true;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
|
|
266
|
+
// src/Escrow/validators/escrow/nbfExp.ts
|
|
267
|
+
var getNbfExpValidator = (now, minRequiredDuration) => {
|
|
268
|
+
const minExp = now + minRequiredDuration;
|
|
269
|
+
return (terms) => {
|
|
270
|
+
const { exp, nbf } = terms;
|
|
271
|
+
if (nbf === void 0 || nbf < now) {
|
|
272
|
+
console.log(`EscrowTerms.nbf: invalid nbf ${terms.nbf}`);
|
|
273
|
+
return false;
|
|
274
|
+
}
|
|
275
|
+
if (exp === void 0 || exp < minExp || nbf > exp) {
|
|
276
|
+
console.log(`EscrowTerms.exp: invalid exp ${terms.exp}`);
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
return true;
|
|
280
|
+
};
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
// src/Escrow/validators/escrow/paymentAuthorities.ts
|
|
284
|
+
var name7 = "EscrowTerms.paymentAuthorities";
|
|
285
|
+
var getPaymentAuthoritiesAllowedValidator = (allowed) => {
|
|
286
|
+
return (terms) => {
|
|
287
|
+
const result = moduleIdentifiersContainsAllOf(terms, (t) => t.paymentAuthorities, allowed, true);
|
|
288
|
+
if (!result) {
|
|
289
|
+
console.log(`${name7}: Payment authority not allowed: ${terms.paymentAuthorities}`);
|
|
290
|
+
}
|
|
291
|
+
return result;
|
|
292
|
+
};
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// src/Escrow/validators/escrow/seller.ts
|
|
296
|
+
import { asAddress as asAddress3 } from "@xylabs/hex";
|
|
297
|
+
var name8 = "EscrowTerms.seller";
|
|
298
|
+
var sellerExistsValidator = (terms) => {
|
|
299
|
+
const seller = terms.seller;
|
|
300
|
+
if (!seller || seller.length === 0) {
|
|
301
|
+
console.log(`${name8}: No seller: ${terms.seller}`);
|
|
302
|
+
return false;
|
|
303
|
+
}
|
|
304
|
+
if (seller.map((x) => asAddress3(x)).length !== seller.length) {
|
|
305
|
+
console.log(`${name8}: Invalid address: ${terms.seller}`);
|
|
306
|
+
return false;
|
|
307
|
+
}
|
|
308
|
+
return true;
|
|
309
|
+
};
|
|
310
|
+
|
|
311
|
+
// src/Escrow/validators/escrow/sellerSecret.ts
|
|
312
|
+
import { assertEx as assertEx3 } from "@xylabs/assert";
|
|
313
|
+
import { isBoundWitnessWithMeta as isBoundWitnessWithMeta3 } from "@xyo-network/boundwitness-model";
|
|
314
|
+
import { BoundWitnessValidator as BoundWitnessValidator2 } from "@xyo-network/boundwitness-validator";
|
|
315
|
+
var name9 = "EscrowTerms.sellerSecret";
|
|
316
|
+
var sellerSecretExistsValidator = (terms) => {
|
|
317
|
+
const sellerSecret = terms.sellerSecret;
|
|
318
|
+
if (!sellerSecret || sellerSecret.length === 0) {
|
|
319
|
+
console.log(`${name9}: No sellerSecret: ${terms.sellerSecret}`);
|
|
320
|
+
return false;
|
|
321
|
+
}
|
|
322
|
+
return true;
|
|
323
|
+
};
|
|
324
|
+
var getSellerSecretSuppliedValidator = (dictionary) => {
|
|
325
|
+
return (terms) => {
|
|
326
|
+
const sellerSecret = assertEx3(terms.sellerSecret, () => `${name9}: No sellerSecret: ${terms.sellerSecret}`);
|
|
327
|
+
if (!dictionary[sellerSecret]) {
|
|
328
|
+
console.log(`${name9}: Payload not supplied for sellerSecret: ${sellerSecret}`);
|
|
329
|
+
return false;
|
|
330
|
+
}
|
|
331
|
+
return true;
|
|
332
|
+
};
|
|
333
|
+
};
|
|
334
|
+
var getSellerSecretSignedValidator = (dictionary) => {
|
|
335
|
+
return async (terms) => {
|
|
336
|
+
const seller = assertEx3(terms.seller, () => `${name9}: No seller: ${terms.seller}`);
|
|
337
|
+
const sellerSecret = assertEx3(terms.sellerSecret, () => `${name9}: No sellerSecret: ${terms.sellerSecret}`);
|
|
338
|
+
const sellerSecretBWs = Object.values(dictionary).filter(isBoundWitnessWithMeta3).filter((bw) => bw.payload_hashes.includes(sellerSecret)).filter((bw) => seller.every((sellerAddress) => bw.addresses.includes(sellerAddress)));
|
|
339
|
+
if (sellerSecretBWs.length === 0) {
|
|
340
|
+
console.log(`${name9}: No BoundWitnesses supplied for sellerSecret: ${sellerSecret}`);
|
|
341
|
+
return false;
|
|
342
|
+
}
|
|
343
|
+
const errors = await Promise.all(sellerSecretBWs.map((bw) => new BoundWitnessValidator2(bw).validate()));
|
|
344
|
+
const validBoundWitnesses = errors.every((errors2) => errors2.length === 0);
|
|
345
|
+
if (!validBoundWitnesses) {
|
|
346
|
+
console.log(`${name9}: Invalid BoundWitnesses supplied for sellerSecret: ${sellerSecret}`);
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
349
|
+
return true;
|
|
350
|
+
};
|
|
351
|
+
};
|
|
352
|
+
|
|
353
|
+
// src/Payment/Instrument/Card/Payload.ts
|
|
354
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType3, isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta3, isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources3 } from "@xyo-network/payload-model";
|
|
355
|
+
|
|
356
|
+
// src/Payment/Schema.ts
|
|
357
|
+
var PaymentSchema = `${PaymentsSchema}.payment`;
|
|
358
|
+
|
|
359
|
+
// src/Payment/Instrument/Schema.ts
|
|
360
|
+
var PaymentInstrumentSchema = `${PaymentSchema}.instrument`;
|
|
361
|
+
|
|
362
|
+
// src/Payment/Instrument/Card/Schema.ts
|
|
363
|
+
var PaymentCardSchema = `${PaymentInstrumentSchema}.card`;
|
|
364
|
+
|
|
365
|
+
// src/Payment/Instrument/Card/Payload.ts
|
|
366
|
+
var isPaymentCard = isPayloadOfSchemaType3(PaymentCardSchema);
|
|
367
|
+
var isPaymentCardWithSources = isPayloadOfSchemaTypeWithSources3(PaymentCardSchema);
|
|
368
|
+
var isPaymentCardWithMeta = isPayloadOfSchemaTypeWithMeta3(PaymentCardSchema);
|
|
369
|
+
|
|
370
|
+
// src/Payment/Payload.ts
|
|
371
|
+
import {
|
|
372
|
+
isPayloadOfSchemaType as isPayloadOfSchemaType4,
|
|
373
|
+
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta4,
|
|
374
|
+
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources4
|
|
375
|
+
} from "@xyo-network/payload-model";
|
|
376
|
+
var isPayment = isPayloadOfSchemaType4(PaymentSchema);
|
|
377
|
+
var isPaymentWithSources = isPayloadOfSchemaTypeWithSources4(PaymentSchema);
|
|
378
|
+
var isPaymentWithMeta = isPayloadOfSchemaTypeWithMeta4(PaymentSchema);
|
|
379
|
+
|
|
380
|
+
// src/Payment/Status/Payload.ts
|
|
381
|
+
import {
|
|
382
|
+
isPayloadOfSchemaType as isPayloadOfSchemaType5,
|
|
383
|
+
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta5,
|
|
384
|
+
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources5
|
|
385
|
+
} from "@xyo-network/payload-model";
|
|
386
|
+
|
|
387
|
+
// src/Payment/Status/Schema.ts
|
|
388
|
+
var PaymentStatusSchema = `${PaymentSchema}.status`;
|
|
389
|
+
|
|
390
|
+
// src/Payment/Status/Payload.ts
|
|
391
|
+
var isPaymentStatus = isPayloadOfSchemaType5(PaymentStatusSchema);
|
|
392
|
+
var isPaymentStatusWithSources = isPayloadOfSchemaTypeWithSources5(PaymentStatusSchema);
|
|
393
|
+
var isPaymentStatusWithMeta = isPayloadOfSchemaTypeWithMeta5(PaymentStatusSchema);
|
|
394
|
+
|
|
395
|
+
// src/Purchase/Payload.ts
|
|
396
|
+
import {
|
|
397
|
+
isPayloadOfSchemaType as isPayloadOfSchemaType6,
|
|
398
|
+
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta6,
|
|
399
|
+
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources6
|
|
400
|
+
} from "@xyo-network/payload-model";
|
|
401
|
+
|
|
402
|
+
// src/Purchase/Schema.ts
|
|
403
|
+
var PurchaseSchema = `${PaymentsSchema}.purchase`;
|
|
404
|
+
|
|
405
|
+
// src/Purchase/Payload.ts
|
|
406
|
+
var isPurchase = isPayloadOfSchemaType6(PurchaseSchema);
|
|
407
|
+
var isPurchaseWithSources = isPayloadOfSchemaTypeWithSources6(PurchaseSchema);
|
|
408
|
+
var isPurchaseWithMeta = isPayloadOfSchemaTypeWithMeta6(PurchaseSchema);
|
|
409
|
+
|
|
410
|
+
// src/Receipt/Payload.ts
|
|
411
|
+
import {
|
|
412
|
+
isPayloadOfSchemaType as isPayloadOfSchemaType7,
|
|
413
|
+
isPayloadOfSchemaTypeWithMeta as isPayloadOfSchemaTypeWithMeta7,
|
|
414
|
+
isPayloadOfSchemaTypeWithSources as isPayloadOfSchemaTypeWithSources7
|
|
415
|
+
} from "@xyo-network/payload-model";
|
|
416
|
+
|
|
417
|
+
// src/Receipt/Schema.ts
|
|
418
|
+
var ReceiptSchema = `${PaymentsSchema}.receipt`;
|
|
419
|
+
|
|
420
|
+
// src/Receipt/Payload.ts
|
|
421
|
+
var isReceipt = isPayloadOfSchemaType7(ReceiptSchema);
|
|
422
|
+
var isReceiptWithSources = isPayloadOfSchemaTypeWithSources7(ReceiptSchema);
|
|
423
|
+
var isReceiptWithMeta = isPayloadOfSchemaTypeWithMeta7(ReceiptSchema);
|
|
424
|
+
export {
|
|
425
|
+
BillingAddressSchema,
|
|
426
|
+
BillingSchema,
|
|
427
|
+
EscrowSchema,
|
|
428
|
+
EscrowTermsSchema,
|
|
429
|
+
PaymentCardSchema,
|
|
430
|
+
PaymentInstrumentSchema,
|
|
431
|
+
PaymentSchema,
|
|
432
|
+
PaymentStatusSchema,
|
|
433
|
+
PurchaseSchema,
|
|
434
|
+
ReceiptSchema,
|
|
435
|
+
appraisalAuthoritiesExistValidator,
|
|
436
|
+
appraisalsExistValidator,
|
|
437
|
+
assetsExistValidator,
|
|
438
|
+
buyerExistsValidator,
|
|
439
|
+
buyerSecretExistsValidator,
|
|
440
|
+
createEscrowIntent,
|
|
441
|
+
createEscrowIntentWithSecret,
|
|
442
|
+
getAppraisalAuthoritiesAllowedValidator,
|
|
443
|
+
getAppraisalsForAllAssetsValidator,
|
|
444
|
+
getAppraisalsFromValidAuthoritiesValidator,
|
|
445
|
+
getAppraisalsValidValidator,
|
|
446
|
+
getBuyerSecretSignedValidator,
|
|
447
|
+
getBuyerSecretSuppliedValidator,
|
|
448
|
+
getEscrowAgentAllowedValidator,
|
|
449
|
+
getEscrowSecret,
|
|
450
|
+
getNbfExpValidator,
|
|
451
|
+
getPaymentAuthoritiesAllowedValidator,
|
|
452
|
+
getSellerSecretSignedValidator,
|
|
453
|
+
getSellerSecretSuppliedValidator,
|
|
454
|
+
isBillingAddress,
|
|
455
|
+
isBillingAddressWithMeta,
|
|
456
|
+
isBillingAddressWithSources,
|
|
457
|
+
isEscrowTerms,
|
|
458
|
+
isEscrowTermsWithMeta,
|
|
459
|
+
isEscrowTermsWithSources,
|
|
460
|
+
isPayment,
|
|
461
|
+
isPaymentCard,
|
|
462
|
+
isPaymentCardWithMeta,
|
|
463
|
+
isPaymentCardWithSources,
|
|
464
|
+
isPaymentStatus,
|
|
465
|
+
isPaymentStatusWithMeta,
|
|
466
|
+
isPaymentStatusWithSources,
|
|
467
|
+
isPaymentWithMeta,
|
|
468
|
+
isPaymentWithSources,
|
|
469
|
+
isPurchase,
|
|
470
|
+
isPurchaseWithMeta,
|
|
471
|
+
isPurchaseWithSources,
|
|
472
|
+
isReceipt,
|
|
473
|
+
isReceiptWithMeta,
|
|
474
|
+
isReceiptWithSources,
|
|
475
|
+
moduleIdentifiersContainsAllOf,
|
|
476
|
+
moduleIdentifiersContainsOneOf,
|
|
477
|
+
sellerExistsValidator,
|
|
478
|
+
sellerSecretExistsValidator,
|
|
479
|
+
validateWithinWindow
|
|
480
|
+
};
|
|
2
481
|
//# sourceMappingURL=index.js.map
|