@xyo-network/boundwitness-validator 5.3.24 → 5.3.26
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/README.md +902 -10
- package/package.json +22 -22
package/README.md
CHANGED
|
@@ -1,23 +1,915 @@
|
|
|
1
|
+
[![logo][]](https://xyo.network)
|
|
2
|
+
|
|
1
3
|
# @xyo-network/boundwitness-validator
|
|
2
4
|
|
|
3
|
-
[![
|
|
5
|
+
[![npm][npm-badge]][npm-link]
|
|
6
|
+
[![license][license-badge]][license-link]
|
|
7
|
+
|
|
8
|
+
> Primary SDK for using XYO Protocol 2.0
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
Using npm:
|
|
13
|
+
|
|
14
|
+
```sh
|
|
15
|
+
npm install {{name}}
|
|
16
|
+
```
|
|
4
17
|
|
|
5
|
-
|
|
18
|
+
Using yarn:
|
|
6
19
|
|
|
7
|
-
|
|
20
|
+
```sh
|
|
21
|
+
yarn add {{name}}
|
|
22
|
+
```
|
|
8
23
|
|
|
9
|
-
|
|
24
|
+
Using pnpm:
|
|
10
25
|
|
|
11
|
-
|
|
26
|
+
```sh
|
|
27
|
+
pnpm add {{name}}
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Using bun:
|
|
31
|
+
|
|
32
|
+
```sh
|
|
33
|
+
bun add {{name}}
|
|
34
|
+
```
|
|
12
35
|
|
|
13
|
-
Part of [sdk-xyo-client-js](https://www.npmjs.com/package/@xyo-network/sdk-xyo-client-js)
|
|
14
36
|
|
|
15
37
|
## License
|
|
16
38
|
|
|
17
|
-
|
|
39
|
+
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
40
|
+
|
|
41
|
+
## Reference
|
|
42
|
+
|
|
43
|
+
### packages
|
|
44
|
+
|
|
45
|
+
### protocol
|
|
46
|
+
|
|
47
|
+
### packages
|
|
48
|
+
|
|
49
|
+
### boundwitness
|
|
50
|
+
|
|
51
|
+
### packages
|
|
52
|
+
|
|
53
|
+
### validator
|
|
54
|
+
|
|
55
|
+
### .temp-typedoc
|
|
56
|
+
|
|
57
|
+
### classes
|
|
58
|
+
|
|
59
|
+
### <a id="BoundWitnessValidator"></a>BoundWitnessValidator
|
|
60
|
+
|
|
61
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
62
|
+
|
|
63
|
+
***
|
|
64
|
+
|
|
65
|
+
## Extends
|
|
66
|
+
|
|
67
|
+
- `PayloadValidator`\<`T`\>
|
|
68
|
+
|
|
69
|
+
## Type Parameters
|
|
70
|
+
|
|
71
|
+
### T
|
|
72
|
+
|
|
73
|
+
`T` *extends* `BoundWitness` = `BoundWitness`
|
|
74
|
+
|
|
75
|
+
## Constructors
|
|
76
|
+
|
|
77
|
+
### Constructor
|
|
78
|
+
|
|
79
|
+
```ts
|
|
80
|
+
new BoundWitnessValidator<T>(payload): BoundWitnessValidator<T>;
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
### Parameters
|
|
84
|
+
|
|
85
|
+
#### payload
|
|
86
|
+
|
|
87
|
+
`T`
|
|
88
|
+
|
|
89
|
+
### Returns
|
|
90
|
+
|
|
91
|
+
`BoundWitnessValidator`\<`T`\>
|
|
92
|
+
|
|
93
|
+
### Inherited from
|
|
94
|
+
|
|
95
|
+
```ts
|
|
96
|
+
PayloadValidator<T>.constructor
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Properties
|
|
100
|
+
|
|
101
|
+
### schemaNameValidatorFactory
|
|
102
|
+
|
|
103
|
+
```ts
|
|
104
|
+
protected static schemaNameValidatorFactory: AllValidatorFactory;
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
### Inherited from
|
|
108
|
+
|
|
109
|
+
```ts
|
|
110
|
+
PayloadValidator.schemaNameValidatorFactory
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
***
|
|
114
|
+
|
|
115
|
+
### payload
|
|
116
|
+
|
|
117
|
+
```ts
|
|
118
|
+
protected payload: Payload;
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### Inherited from
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
PayloadValidator.payload
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
## Accessors
|
|
128
|
+
|
|
129
|
+
### expectedSchema
|
|
130
|
+
|
|
131
|
+
### Get Signature
|
|
132
|
+
|
|
133
|
+
```ts
|
|
134
|
+
get protected expectedSchema(): string;
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
#### Returns
|
|
138
|
+
|
|
139
|
+
`string`
|
|
140
|
+
|
|
141
|
+
***
|
|
142
|
+
|
|
143
|
+
### schemaValidator
|
|
144
|
+
|
|
145
|
+
### Get Signature
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
get schemaValidator(): AllValidator;
|
|
149
|
+
```
|
|
150
|
+
|
|
151
|
+
#### Returns
|
|
152
|
+
|
|
153
|
+
`AllValidator`
|
|
154
|
+
|
|
155
|
+
### Inherited from
|
|
156
|
+
|
|
157
|
+
```ts
|
|
158
|
+
PayloadValidator.schemaValidator
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## Methods
|
|
162
|
+
|
|
163
|
+
### validateSignature()
|
|
164
|
+
|
|
165
|
+
```ts
|
|
166
|
+
static validateSignature(
|
|
167
|
+
hash,
|
|
168
|
+
address,
|
|
169
|
+
signature?): Promise<Error[]>;
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
### Parameters
|
|
173
|
+
|
|
174
|
+
#### hash
|
|
175
|
+
|
|
176
|
+
`ArrayBufferLike`
|
|
177
|
+
|
|
178
|
+
#### address
|
|
179
|
+
|
|
180
|
+
`ArrayBufferLike`
|
|
181
|
+
|
|
182
|
+
#### signature?
|
|
183
|
+
|
|
184
|
+
`ArrayBufferLike`
|
|
185
|
+
|
|
186
|
+
### Returns
|
|
187
|
+
|
|
188
|
+
`Promise`\<`Error`[]\>
|
|
189
|
+
|
|
190
|
+
***
|
|
191
|
+
|
|
192
|
+
### addresses()
|
|
193
|
+
|
|
194
|
+
```ts
|
|
195
|
+
addresses(): Error[];
|
|
196
|
+
```
|
|
197
|
+
|
|
198
|
+
### Returns
|
|
199
|
+
|
|
200
|
+
`Error`[]
|
|
201
|
+
|
|
202
|
+
***
|
|
203
|
+
|
|
204
|
+
### addressesUniqueness()
|
|
205
|
+
|
|
206
|
+
```ts
|
|
207
|
+
addressesUniqueness(): Error[];
|
|
208
|
+
```
|
|
209
|
+
|
|
210
|
+
### Returns
|
|
211
|
+
|
|
212
|
+
`Error`[]
|
|
213
|
+
|
|
214
|
+
***
|
|
215
|
+
|
|
216
|
+
### previousHashes()
|
|
217
|
+
|
|
218
|
+
```ts
|
|
219
|
+
previousHashes(): Error[];
|
|
220
|
+
```
|
|
221
|
+
|
|
222
|
+
### Returns
|
|
223
|
+
|
|
224
|
+
`Error`[]
|
|
225
|
+
|
|
226
|
+
***
|
|
227
|
+
|
|
228
|
+
### schema()
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
schema(): Error[];
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
### Returns
|
|
235
|
+
|
|
236
|
+
`Error`[]
|
|
237
|
+
|
|
238
|
+
***
|
|
239
|
+
|
|
240
|
+
### schemas()
|
|
241
|
+
|
|
242
|
+
```ts
|
|
243
|
+
schemas(): Error[];
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
### Returns
|
|
247
|
+
|
|
248
|
+
`Error`[]
|
|
249
|
+
|
|
250
|
+
***
|
|
251
|
+
|
|
252
|
+
### signatures()
|
|
253
|
+
|
|
254
|
+
```ts
|
|
255
|
+
signatures(): Promise<Error[]>;
|
|
256
|
+
```
|
|
257
|
+
|
|
258
|
+
### Returns
|
|
259
|
+
|
|
260
|
+
`Promise`\<`Error`[]\>
|
|
261
|
+
|
|
262
|
+
***
|
|
263
|
+
|
|
264
|
+
### validate()
|
|
265
|
+
|
|
266
|
+
```ts
|
|
267
|
+
validate(): Promise<Error[]>;
|
|
268
|
+
```
|
|
269
|
+
|
|
270
|
+
### Returns
|
|
271
|
+
|
|
272
|
+
`Promise`\<`Error`[]\>
|
|
273
|
+
|
|
274
|
+
### Overrides
|
|
275
|
+
|
|
276
|
+
```ts
|
|
277
|
+
PayloadValidator.validate
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
***
|
|
281
|
+
|
|
282
|
+
### validateArrayLengths()
|
|
283
|
+
|
|
284
|
+
```ts
|
|
285
|
+
validateArrayLengths(): Error[];
|
|
286
|
+
```
|
|
287
|
+
|
|
288
|
+
### Returns
|
|
289
|
+
|
|
290
|
+
`Error`[]
|
|
291
|
+
|
|
292
|
+
***
|
|
293
|
+
|
|
294
|
+
### validatePayloadHashesLength()
|
|
295
|
+
|
|
296
|
+
```ts
|
|
297
|
+
validatePayloadHashesLength(): Error[];
|
|
298
|
+
```
|
|
299
|
+
|
|
300
|
+
### Returns
|
|
301
|
+
|
|
302
|
+
`Error`[]
|
|
303
|
+
|
|
304
|
+
***
|
|
305
|
+
|
|
306
|
+
### setSchemaNameValidatorFactory()
|
|
307
|
+
|
|
308
|
+
```ts
|
|
309
|
+
static setSchemaNameValidatorFactory(factory): void;
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
### Parameters
|
|
313
|
+
|
|
314
|
+
#### factory
|
|
315
|
+
|
|
316
|
+
`AllValidatorFactory`
|
|
317
|
+
|
|
318
|
+
### Returns
|
|
319
|
+
|
|
320
|
+
`void`
|
|
321
|
+
|
|
322
|
+
### Inherited from
|
|
323
|
+
|
|
324
|
+
```ts
|
|
325
|
+
PayloadValidator.setSchemaNameValidatorFactory
|
|
326
|
+
```
|
|
327
|
+
|
|
328
|
+
***
|
|
329
|
+
|
|
330
|
+
### schemaName()
|
|
331
|
+
|
|
332
|
+
```ts
|
|
333
|
+
schemaName(): Error[];
|
|
334
|
+
```
|
|
335
|
+
|
|
336
|
+
### Returns
|
|
337
|
+
|
|
338
|
+
`Error`[]
|
|
339
|
+
|
|
340
|
+
### Inherited from
|
|
341
|
+
|
|
342
|
+
```ts
|
|
343
|
+
PayloadValidator.schemaName
|
|
344
|
+
```
|
|
345
|
+
|
|
346
|
+
### functions
|
|
347
|
+
|
|
348
|
+
### <a id="addressesContains"></a>addressesContains
|
|
349
|
+
|
|
350
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
351
|
+
|
|
352
|
+
***
|
|
353
|
+
|
|
354
|
+
```ts
|
|
355
|
+
function addressesContains(bw, address): boolean;
|
|
356
|
+
```
|
|
357
|
+
|
|
358
|
+
Checks if the boundwitness contains the addresses
|
|
359
|
+
|
|
360
|
+
## Parameters
|
|
361
|
+
|
|
362
|
+
### bw
|
|
363
|
+
|
|
364
|
+
The boundwitness to check
|
|
365
|
+
|
|
366
|
+
### schema
|
|
367
|
+
|
|
368
|
+
`"network.xyo.boundwitness"` & `object`
|
|
369
|
+
|
|
370
|
+
### addresses
|
|
371
|
+
|
|
372
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
373
|
+
|
|
374
|
+
### payload_hashes
|
|
375
|
+
|
|
376
|
+
`BrandedHash`[]
|
|
377
|
+
|
|
378
|
+
### payload_schemas
|
|
379
|
+
|
|
380
|
+
`BrandedSchema`\<`string`\>[]
|
|
381
|
+
|
|
382
|
+
### previous_hashes
|
|
383
|
+
|
|
384
|
+
(`BrandedHash` \| `null`)[]
|
|
385
|
+
|
|
386
|
+
### $destination?
|
|
387
|
+
|
|
388
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
389
|
+
|
|
390
|
+
### $sourceQuery?
|
|
391
|
+
|
|
392
|
+
`BrandedHash`
|
|
393
|
+
|
|
394
|
+
### $signatures
|
|
395
|
+
|
|
396
|
+
(`BrandedHex` \| `null`)[]
|
|
397
|
+
|
|
398
|
+
### address
|
|
399
|
+
|
|
400
|
+
`BrandedAddress`
|
|
401
|
+
|
|
402
|
+
## Returns
|
|
403
|
+
|
|
404
|
+
`boolean`
|
|
405
|
+
|
|
406
|
+
True if the boundwitness contains the addresses
|
|
407
|
+
|
|
408
|
+
### <a id="addressesContainsAll"></a>addressesContainsAll
|
|
409
|
+
|
|
410
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
411
|
+
|
|
412
|
+
***
|
|
413
|
+
|
|
414
|
+
```ts
|
|
415
|
+
function addressesContainsAll(bw, addresses): boolean;
|
|
416
|
+
```
|
|
417
|
+
|
|
418
|
+
Checks if the boundwitness contains all of the addresses
|
|
419
|
+
|
|
420
|
+
## Parameters
|
|
421
|
+
|
|
422
|
+
### bw
|
|
423
|
+
|
|
424
|
+
The boundwitness to check
|
|
425
|
+
|
|
426
|
+
### schema
|
|
427
|
+
|
|
428
|
+
`"network.xyo.boundwitness"` & `object`
|
|
429
|
+
|
|
430
|
+
### addresses
|
|
431
|
+
|
|
432
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
433
|
+
|
|
434
|
+
### payload_hashes
|
|
435
|
+
|
|
436
|
+
`BrandedHash`[]
|
|
437
|
+
|
|
438
|
+
### payload_schemas
|
|
439
|
+
|
|
440
|
+
`BrandedSchema`\<`string`\>[]
|
|
441
|
+
|
|
442
|
+
### previous_hashes
|
|
443
|
+
|
|
444
|
+
(`BrandedHash` \| `null`)[]
|
|
445
|
+
|
|
446
|
+
### $destination?
|
|
447
|
+
|
|
448
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
449
|
+
|
|
450
|
+
### $sourceQuery?
|
|
451
|
+
|
|
452
|
+
`BrandedHash`
|
|
453
|
+
|
|
454
|
+
### $signatures
|
|
455
|
+
|
|
456
|
+
(`BrandedHex` \| `null`)[]
|
|
457
|
+
|
|
458
|
+
### addresses
|
|
459
|
+
|
|
460
|
+
`BrandedAddress`[]
|
|
461
|
+
|
|
462
|
+
The addresses to check for
|
|
463
|
+
|
|
464
|
+
## Returns
|
|
465
|
+
|
|
466
|
+
`boolean`
|
|
467
|
+
|
|
468
|
+
True if the boundwitness contains all of the addresses
|
|
469
|
+
|
|
470
|
+
### <a id="addressesContainsAny"></a>addressesContainsAny
|
|
471
|
+
|
|
472
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
473
|
+
|
|
474
|
+
***
|
|
475
|
+
|
|
476
|
+
```ts
|
|
477
|
+
function addressesContainsAny(bw, addresses): boolean;
|
|
478
|
+
```
|
|
479
|
+
|
|
480
|
+
Checks if the boundwitness contains any of the addresses. If the addresses array
|
|
481
|
+
is empty, it will return true. This is to match the behavior or addressesContainsAll
|
|
482
|
+
which will return true if the addresses array is empty.
|
|
483
|
+
|
|
484
|
+
## Parameters
|
|
485
|
+
|
|
486
|
+
### bw
|
|
487
|
+
|
|
488
|
+
The boundwitness to check
|
|
489
|
+
|
|
490
|
+
### schema
|
|
491
|
+
|
|
492
|
+
`"network.xyo.boundwitness"` & `object`
|
|
493
|
+
|
|
494
|
+
### addresses
|
|
495
|
+
|
|
496
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
497
|
+
|
|
498
|
+
### payload_hashes
|
|
499
|
+
|
|
500
|
+
`BrandedHash`[]
|
|
501
|
+
|
|
502
|
+
### payload_schemas
|
|
503
|
+
|
|
504
|
+
`BrandedSchema`\<`string`\>[]
|
|
505
|
+
|
|
506
|
+
### previous_hashes
|
|
507
|
+
|
|
508
|
+
(`BrandedHash` \| `null`)[]
|
|
509
|
+
|
|
510
|
+
### $destination?
|
|
511
|
+
|
|
512
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
513
|
+
|
|
514
|
+
### $sourceQuery?
|
|
515
|
+
|
|
516
|
+
`BrandedHash`
|
|
517
|
+
|
|
518
|
+
### $signatures
|
|
519
|
+
|
|
520
|
+
(`BrandedHex` \| `null`)[]
|
|
521
|
+
|
|
522
|
+
### addresses
|
|
523
|
+
|
|
524
|
+
`BrandedAddress`[]
|
|
525
|
+
|
|
526
|
+
The addresses to check for
|
|
527
|
+
|
|
528
|
+
## Returns
|
|
529
|
+
|
|
530
|
+
`boolean`
|
|
531
|
+
|
|
532
|
+
True if the boundwitness contains any of the addresses
|
|
533
|
+
|
|
534
|
+
### <a id="payloadHashesContains"></a>payloadHashesContains
|
|
535
|
+
|
|
536
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
537
|
+
|
|
538
|
+
***
|
|
539
|
+
|
|
540
|
+
```ts
|
|
541
|
+
function payloadHashesContains(bw, payloadHash): boolean;
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
Checks if the boundwitness contains the payload hash
|
|
545
|
+
|
|
546
|
+
## Parameters
|
|
547
|
+
|
|
548
|
+
### bw
|
|
549
|
+
|
|
550
|
+
The boundwitness to check
|
|
551
|
+
|
|
552
|
+
### schema
|
|
553
|
+
|
|
554
|
+
`"network.xyo.boundwitness"` & `object`
|
|
555
|
+
|
|
556
|
+
### addresses
|
|
557
|
+
|
|
558
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
559
|
+
|
|
560
|
+
### payload_hashes
|
|
561
|
+
|
|
562
|
+
`BrandedHash`[]
|
|
563
|
+
|
|
564
|
+
### payload_schemas
|
|
565
|
+
|
|
566
|
+
`BrandedSchema`\<`string`\>[]
|
|
567
|
+
|
|
568
|
+
### previous_hashes
|
|
569
|
+
|
|
570
|
+
(`BrandedHash` \| `null`)[]
|
|
571
|
+
|
|
572
|
+
### $destination?
|
|
573
|
+
|
|
574
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
575
|
+
|
|
576
|
+
### $sourceQuery?
|
|
577
|
+
|
|
578
|
+
`BrandedHash`
|
|
579
|
+
|
|
580
|
+
### $signatures
|
|
581
|
+
|
|
582
|
+
(`BrandedHex` \| `null`)[]
|
|
583
|
+
|
|
584
|
+
### payloadHash
|
|
585
|
+
|
|
586
|
+
`BrandedHash`
|
|
587
|
+
|
|
588
|
+
The payload hash to check for
|
|
589
|
+
|
|
590
|
+
## Returns
|
|
591
|
+
|
|
592
|
+
`boolean`
|
|
593
|
+
|
|
594
|
+
True if the boundwitness contains the payload hash
|
|
595
|
+
|
|
596
|
+
### <a id="payloadHashesContainsAll"></a>payloadHashesContainsAll
|
|
597
|
+
|
|
598
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
599
|
+
|
|
600
|
+
***
|
|
601
|
+
|
|
602
|
+
```ts
|
|
603
|
+
function payloadHashesContainsAll(bw, payloadHashes): boolean;
|
|
604
|
+
```
|
|
605
|
+
|
|
606
|
+
Checks if the boundwitness contains all of the payload hashes
|
|
607
|
+
|
|
608
|
+
## Parameters
|
|
609
|
+
|
|
610
|
+
### bw
|
|
611
|
+
|
|
612
|
+
The boundwitness to check
|
|
613
|
+
|
|
614
|
+
### schema
|
|
615
|
+
|
|
616
|
+
`"network.xyo.boundwitness"` & `object`
|
|
617
|
+
|
|
618
|
+
### addresses
|
|
619
|
+
|
|
620
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
621
|
+
|
|
622
|
+
### payload_hashes
|
|
623
|
+
|
|
624
|
+
`BrandedHash`[]
|
|
625
|
+
|
|
626
|
+
### payload_schemas
|
|
627
|
+
|
|
628
|
+
`BrandedSchema`\<`string`\>[]
|
|
629
|
+
|
|
630
|
+
### previous_hashes
|
|
631
|
+
|
|
632
|
+
(`BrandedHash` \| `null`)[]
|
|
633
|
+
|
|
634
|
+
### $destination?
|
|
635
|
+
|
|
636
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
637
|
+
|
|
638
|
+
### $sourceQuery?
|
|
639
|
+
|
|
640
|
+
`BrandedHash`
|
|
641
|
+
|
|
642
|
+
### $signatures
|
|
643
|
+
|
|
644
|
+
(`BrandedHex` \| `null`)[]
|
|
645
|
+
|
|
646
|
+
### payloadHashes
|
|
647
|
+
|
|
648
|
+
`BrandedHash`[]
|
|
649
|
+
|
|
650
|
+
The payload hashes to check for
|
|
651
|
+
|
|
652
|
+
## Returns
|
|
653
|
+
|
|
654
|
+
`boolean`
|
|
655
|
+
|
|
656
|
+
True if the boundwitness contains all of the payload hashes
|
|
657
|
+
|
|
658
|
+
### <a id="payloadHashesContainsAny"></a>payloadHashesContainsAny
|
|
659
|
+
|
|
660
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
661
|
+
|
|
662
|
+
***
|
|
663
|
+
|
|
664
|
+
```ts
|
|
665
|
+
function payloadHashesContainsAny(bw, payloadHashes): boolean;
|
|
666
|
+
```
|
|
667
|
+
|
|
668
|
+
Checks if the boundwitness contains any of the payload hashes. If the payload hashes array
|
|
669
|
+
is empty, it will return true. This is to match the behavior or payload hashesContainsAll
|
|
670
|
+
which will return true if the payload hashes array is empty.
|
|
671
|
+
|
|
672
|
+
## Parameters
|
|
673
|
+
|
|
674
|
+
### bw
|
|
675
|
+
|
|
676
|
+
The boundwitness to check
|
|
677
|
+
|
|
678
|
+
### schema
|
|
679
|
+
|
|
680
|
+
`"network.xyo.boundwitness"` & `object`
|
|
681
|
+
|
|
682
|
+
### addresses
|
|
683
|
+
|
|
684
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
685
|
+
|
|
686
|
+
### payload_hashes
|
|
687
|
+
|
|
688
|
+
`BrandedHash`[]
|
|
689
|
+
|
|
690
|
+
### payload_schemas
|
|
691
|
+
|
|
692
|
+
`BrandedSchema`\<`string`\>[]
|
|
693
|
+
|
|
694
|
+
### previous_hashes
|
|
695
|
+
|
|
696
|
+
(`BrandedHash` \| `null`)[]
|
|
697
|
+
|
|
698
|
+
### $destination?
|
|
699
|
+
|
|
700
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
701
|
+
|
|
702
|
+
### $sourceQuery?
|
|
703
|
+
|
|
704
|
+
`BrandedHash`
|
|
705
|
+
|
|
706
|
+
### $signatures
|
|
707
|
+
|
|
708
|
+
(`BrandedHex` \| `null`)[]
|
|
709
|
+
|
|
710
|
+
### payloadHashes
|
|
711
|
+
|
|
712
|
+
`BrandedHash`[]
|
|
713
|
+
|
|
714
|
+
The payload hashes to check for
|
|
715
|
+
|
|
716
|
+
## Returns
|
|
717
|
+
|
|
718
|
+
`boolean`
|
|
719
|
+
|
|
720
|
+
True if the boundwitness contains any of the payload hashes
|
|
721
|
+
|
|
722
|
+
### <a id="payloadSchemasContains"></a>payloadSchemasContains
|
|
723
|
+
|
|
724
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
725
|
+
|
|
726
|
+
***
|
|
727
|
+
|
|
728
|
+
```ts
|
|
729
|
+
function payloadSchemasContains(bw, schema): boolean;
|
|
730
|
+
```
|
|
731
|
+
|
|
732
|
+
Checks if the boundwitness contains the payload schema
|
|
733
|
+
|
|
734
|
+
## Parameters
|
|
735
|
+
|
|
736
|
+
### bw
|
|
737
|
+
|
|
738
|
+
The boundwitness to check
|
|
739
|
+
|
|
740
|
+
### schema
|
|
741
|
+
|
|
742
|
+
`"network.xyo.boundwitness"` & `object`
|
|
743
|
+
|
|
744
|
+
### addresses
|
|
745
|
+
|
|
746
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
747
|
+
|
|
748
|
+
### payload_hashes
|
|
749
|
+
|
|
750
|
+
`BrandedHash`[]
|
|
751
|
+
|
|
752
|
+
### payload_schemas
|
|
753
|
+
|
|
754
|
+
`BrandedSchema`\<`string`\>[]
|
|
755
|
+
|
|
756
|
+
### previous_hashes
|
|
757
|
+
|
|
758
|
+
(`BrandedHash` \| `null`)[]
|
|
759
|
+
|
|
760
|
+
### $destination?
|
|
761
|
+
|
|
762
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
763
|
+
|
|
764
|
+
### $sourceQuery?
|
|
765
|
+
|
|
766
|
+
`BrandedHash`
|
|
767
|
+
|
|
768
|
+
### $signatures
|
|
769
|
+
|
|
770
|
+
(`BrandedHex` \| `null`)[]
|
|
771
|
+
|
|
772
|
+
### schema
|
|
773
|
+
|
|
774
|
+
`Schema`
|
|
775
|
+
|
|
776
|
+
The payload schema to check for
|
|
777
|
+
|
|
778
|
+
## Returns
|
|
779
|
+
|
|
780
|
+
`boolean`
|
|
781
|
+
|
|
782
|
+
True if the boundwitness contains the payload schema
|
|
783
|
+
|
|
784
|
+
### <a id="payloadSchemasContainsAll"></a>payloadSchemasContainsAll
|
|
785
|
+
|
|
786
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
787
|
+
|
|
788
|
+
***
|
|
789
|
+
|
|
790
|
+
```ts
|
|
791
|
+
function payloadSchemasContainsAll(bw, payloadSchemas): boolean;
|
|
792
|
+
```
|
|
793
|
+
|
|
794
|
+
Checks if the boundwitness contains all of the payload schemas
|
|
795
|
+
|
|
796
|
+
## Parameters
|
|
797
|
+
|
|
798
|
+
### bw
|
|
799
|
+
|
|
800
|
+
The boundwitness to check
|
|
801
|
+
|
|
802
|
+
### schema
|
|
803
|
+
|
|
804
|
+
`"network.xyo.boundwitness"` & `object`
|
|
805
|
+
|
|
806
|
+
### addresses
|
|
807
|
+
|
|
808
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
809
|
+
|
|
810
|
+
### payload_hashes
|
|
811
|
+
|
|
812
|
+
`BrandedHash`[]
|
|
813
|
+
|
|
814
|
+
### payload_schemas
|
|
815
|
+
|
|
816
|
+
`BrandedSchema`\<`string`\>[]
|
|
817
|
+
|
|
818
|
+
### previous_hashes
|
|
819
|
+
|
|
820
|
+
(`BrandedHash` \| `null`)[]
|
|
821
|
+
|
|
822
|
+
### $destination?
|
|
823
|
+
|
|
824
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
825
|
+
|
|
826
|
+
### $sourceQuery?
|
|
827
|
+
|
|
828
|
+
`BrandedHash`
|
|
829
|
+
|
|
830
|
+
### $signatures
|
|
831
|
+
|
|
832
|
+
(`BrandedHex` \| `null`)[]
|
|
833
|
+
|
|
834
|
+
### payloadSchemas
|
|
835
|
+
|
|
836
|
+
`Schema`[]
|
|
837
|
+
|
|
838
|
+
The payload schemas to check for
|
|
839
|
+
|
|
840
|
+
## Returns
|
|
841
|
+
|
|
842
|
+
`boolean`
|
|
843
|
+
|
|
844
|
+
True if the boundwitness contains all of the payload schemas
|
|
845
|
+
|
|
846
|
+
### <a id="payloadSchemasContainsAny"></a>payloadSchemasContainsAny
|
|
847
|
+
|
|
848
|
+
[**@xyo-network/boundwitness-validator**](#../README)
|
|
849
|
+
|
|
850
|
+
***
|
|
851
|
+
|
|
852
|
+
```ts
|
|
853
|
+
function payloadSchemasContainsAny(bw, payloadSchemas): boolean;
|
|
854
|
+
```
|
|
855
|
+
|
|
856
|
+
Checks if the boundwitness contains any of the payload schemas. If the payload schemas array
|
|
857
|
+
is empty, it will return true. This is to match the behavior or payload schemasContainsAll
|
|
858
|
+
which will return true if the payload schemas array is empty.
|
|
859
|
+
|
|
860
|
+
## Parameters
|
|
861
|
+
|
|
862
|
+
### bw
|
|
863
|
+
|
|
864
|
+
The boundwitness to check
|
|
865
|
+
|
|
866
|
+
### schema
|
|
867
|
+
|
|
868
|
+
`"network.xyo.boundwitness"` & `object`
|
|
869
|
+
|
|
870
|
+
### addresses
|
|
871
|
+
|
|
872
|
+
`Lowercase`\<`string`\> & `object` & `object`[]
|
|
873
|
+
|
|
874
|
+
### payload_hashes
|
|
875
|
+
|
|
876
|
+
`BrandedHash`[]
|
|
877
|
+
|
|
878
|
+
### payload_schemas
|
|
879
|
+
|
|
880
|
+
`BrandedSchema`\<`string`\>[]
|
|
881
|
+
|
|
882
|
+
### previous_hashes
|
|
883
|
+
|
|
884
|
+
(`BrandedHash` \| `null`)[]
|
|
885
|
+
|
|
886
|
+
### $destination?
|
|
887
|
+
|
|
888
|
+
`Lowercase`\<`string`\> & `object` & `object`
|
|
889
|
+
|
|
890
|
+
### $sourceQuery?
|
|
891
|
+
|
|
892
|
+
`BrandedHash`
|
|
893
|
+
|
|
894
|
+
### $signatures
|
|
895
|
+
|
|
896
|
+
(`BrandedHex` \| `null`)[]
|
|
897
|
+
|
|
898
|
+
### payloadSchemas
|
|
899
|
+
|
|
900
|
+
`Schema`[]
|
|
901
|
+
|
|
902
|
+
The payload schemas to check for
|
|
903
|
+
|
|
904
|
+
## Returns
|
|
905
|
+
|
|
906
|
+
`boolean`
|
|
18
907
|
|
|
19
|
-
|
|
908
|
+
True if the boundwitness contains any of the payload schemas
|
|
20
909
|
|
|
21
|
-
[Made with 🔥 and ❄️ by XYO](https://xyo.network)
|
|
22
910
|
|
|
23
|
-
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
911
|
+
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
912
|
+
[npm-badge]: https://img.shields.io/npm/v/@xyo-network/boundwitness-validator.svg
|
|
913
|
+
[npm-link]: https://www.npmjs.com/package/@xyo-network/boundwitness-validator
|
|
914
|
+
[license-badge]: https://img.shields.io/npm/l/@xyo-network/boundwitness-validator.svg
|
|
915
|
+
[license-link]: https://github.com/xylabs/sdk-js/blob/main/LICENSE
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/boundwitness-validator",
|
|
3
|
-
"version": "5.3.
|
|
3
|
+
"version": "5.3.26",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -22,11 +22,11 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./dist/neutral/index.d.ts",
|
|
25
|
+
"import": "./dist/neutral/index.mjs",
|
|
25
26
|
"default": "./dist/neutral/index.mjs"
|
|
26
27
|
},
|
|
27
28
|
"./package.json": "./package.json"
|
|
28
29
|
},
|
|
29
|
-
"module": "dist/neutral/index.mjs",
|
|
30
30
|
"types": "dist/neutral/index.d.ts",
|
|
31
31
|
"files": [
|
|
32
32
|
"dist",
|
|
@@ -36,20 +36,20 @@
|
|
|
36
36
|
"README.md"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xyo-network/boundwitness-model": "~5.3.
|
|
40
|
-
"@xyo-network/payload": "~5.3.
|
|
41
|
-
"@xyo-network/payload-
|
|
42
|
-
"@xyo-network/elliptic": "~5.3.
|
|
43
|
-
"@xyo-network/payload-
|
|
39
|
+
"@xyo-network/boundwitness-model": "~5.3.26",
|
|
40
|
+
"@xyo-network/payload": "~5.3.26",
|
|
41
|
+
"@xyo-network/payload-model": "~5.3.26",
|
|
42
|
+
"@xyo-network/elliptic": "~5.3.26",
|
|
43
|
+
"@xyo-network/payload-validator": "~5.3.26"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"@opentelemetry/api": "^1.9.1",
|
|
47
|
-
"@types/node": "^25.5.
|
|
48
|
-
"@xylabs/sdk-js": "^5.0.
|
|
49
|
-
"@xylabs/ts-scripts-common": "~7.
|
|
50
|
-
"@xylabs/ts-scripts-pnpm": "~7.
|
|
51
|
-
"@xylabs/tsconfig": "~7.
|
|
52
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
47
|
+
"@types/node": "^25.5.2",
|
|
48
|
+
"@xylabs/sdk-js": "^5.0.94",
|
|
49
|
+
"@xylabs/ts-scripts-common": "~7.7.5",
|
|
50
|
+
"@xylabs/ts-scripts-pnpm": "~7.7.5",
|
|
51
|
+
"@xylabs/tsconfig": "~7.7.5",
|
|
52
|
+
"@xylabs/vitest-extended": "~5.0.94",
|
|
53
53
|
"acorn": "^8.16.0",
|
|
54
54
|
"axios": "^1.14.0",
|
|
55
55
|
"esbuild": "^0.28.0",
|
|
@@ -59,15 +59,15 @@
|
|
|
59
59
|
"vite": "^8.0.3",
|
|
60
60
|
"vitest": "~4.1.2",
|
|
61
61
|
"zod": "^4.3.6",
|
|
62
|
-
"@xyo-network/boundwitness-model": "~5.3.
|
|
63
|
-
"@xyo-network/elliptic": "~5.3.
|
|
64
|
-
"@xyo-network/
|
|
65
|
-
"@xyo-network/
|
|
66
|
-
"@xyo-network/payload-
|
|
67
|
-
"@xyo-network/payload
|
|
68
|
-
"@xyo-network/
|
|
69
|
-
"@xyo-network/wallet
|
|
70
|
-
"@xyo-network/
|
|
62
|
+
"@xyo-network/boundwitness-model": "~5.3.26",
|
|
63
|
+
"@xyo-network/elliptic": "~5.3.26",
|
|
64
|
+
"@xyo-network/boundwitness-builder": "~5.3.26",
|
|
65
|
+
"@xyo-network/payload-model": "~5.3.26",
|
|
66
|
+
"@xyo-network/payload-validator": "~5.3.26",
|
|
67
|
+
"@xyo-network/payload": "~5.3.26",
|
|
68
|
+
"@xyo-network/schema-name-validator": "~5.3.26",
|
|
69
|
+
"@xyo-network/wallet": "~5.3.26",
|
|
70
|
+
"@xyo-network/wallet-model": "~5.3.26"
|
|
71
71
|
},
|
|
72
72
|
"peerDependencies": {
|
|
73
73
|
"@xylabs/sdk-js": "^5",
|