@xyo-network/boundwitness-model 5.3.30 → 5.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +0 -889
- package/dist/browser/QueryBoundWitness.d.ts +2 -2
- package/dist/browser/QueryBoundWitness.d.ts.map +1 -1
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/QueryBoundWitness.d.ts +2 -2
- package/dist/neutral/QueryBoundWitness.d.ts.map +1 -1
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/QueryBoundWitness.d.ts +2 -2
- package/dist/node/QueryBoundWitness.d.ts.map +1 -1
- package/dist/node/index.mjs.map +1 -1
- package/package.json +11 -15
package/README.md
CHANGED
|
@@ -38,895 +38,6 @@ bun add {{name}}
|
|
|
38
38
|
|
|
39
39
|
See the [LICENSE](LICENSE) file for license rights and limitations (LGPL-3.0-only).
|
|
40
40
|
|
|
41
|
-
## Reference
|
|
42
|
-
|
|
43
|
-
### packages
|
|
44
|
-
|
|
45
|
-
### protocol
|
|
46
|
-
|
|
47
|
-
### packages
|
|
48
|
-
|
|
49
|
-
### boundwitness
|
|
50
|
-
|
|
51
|
-
### packages
|
|
52
|
-
|
|
53
|
-
### model
|
|
54
|
-
|
|
55
|
-
### .temp-typedoc
|
|
56
|
-
|
|
57
|
-
### functions
|
|
58
|
-
|
|
59
|
-
### <a id="BoundWitnessJsonSchema"></a>BoundWitnessJsonSchema
|
|
60
|
-
|
|
61
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
62
|
-
|
|
63
|
-
***
|
|
64
|
-
|
|
65
|
-
```ts
|
|
66
|
-
function BoundWitnessJsonSchema(): object;
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## Returns
|
|
70
|
-
|
|
71
|
-
`object`
|
|
72
|
-
|
|
73
|
-
### $id
|
|
74
|
-
|
|
75
|
-
```ts
|
|
76
|
-
$id: string = 'https://schemas.xyo.network/2.0/boundwitness';
|
|
77
|
-
```
|
|
78
|
-
|
|
79
|
-
### additionalProperties
|
|
80
|
-
|
|
81
|
-
```ts
|
|
82
|
-
additionalProperties: boolean = false;
|
|
83
|
-
```
|
|
84
|
-
|
|
85
|
-
### properties
|
|
86
|
-
|
|
87
|
-
```ts
|
|
88
|
-
properties: object;
|
|
89
|
-
```
|
|
90
|
-
|
|
91
|
-
### properties.addresses
|
|
92
|
-
|
|
93
|
-
```ts
|
|
94
|
-
addresses: object;
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
### properties.addresses.items
|
|
98
|
-
|
|
99
|
-
```ts
|
|
100
|
-
items: object;
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
### properties.addresses.items.type
|
|
104
|
-
|
|
105
|
-
```ts
|
|
106
|
-
type: string = 'string';
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
### properties.addresses.type
|
|
110
|
-
|
|
111
|
-
```ts
|
|
112
|
-
type: string = 'array';
|
|
113
|
-
```
|
|
114
|
-
|
|
115
|
-
### properties.payload\_hashes
|
|
116
|
-
|
|
117
|
-
```ts
|
|
118
|
-
payload_hashes: object;
|
|
119
|
-
```
|
|
120
|
-
|
|
121
|
-
### properties.payload\_hashes.items
|
|
122
|
-
|
|
123
|
-
```ts
|
|
124
|
-
items: object;
|
|
125
|
-
```
|
|
126
|
-
|
|
127
|
-
### properties.payload\_hashes.items.type
|
|
128
|
-
|
|
129
|
-
```ts
|
|
130
|
-
type: string = 'string';
|
|
131
|
-
```
|
|
132
|
-
|
|
133
|
-
### properties.payload\_hashes.type
|
|
134
|
-
|
|
135
|
-
```ts
|
|
136
|
-
type: string = 'array';
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
### properties.payload\_schemas
|
|
140
|
-
|
|
141
|
-
```ts
|
|
142
|
-
payload_schemas: object;
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
### properties.payload\_schemas.items
|
|
146
|
-
|
|
147
|
-
```ts
|
|
148
|
-
items: object;
|
|
149
|
-
```
|
|
150
|
-
|
|
151
|
-
### properties.payload\_schemas.items.type
|
|
152
|
-
|
|
153
|
-
```ts
|
|
154
|
-
type: string = 'string';
|
|
155
|
-
```
|
|
156
|
-
|
|
157
|
-
### properties.payload\_schemas.type
|
|
158
|
-
|
|
159
|
-
```ts
|
|
160
|
-
type: string = 'array';
|
|
161
|
-
```
|
|
162
|
-
|
|
163
|
-
### properties.previous\_hashes
|
|
164
|
-
|
|
165
|
-
```ts
|
|
166
|
-
previous_hashes: object;
|
|
167
|
-
```
|
|
168
|
-
|
|
169
|
-
### properties.previous\_hashes.items
|
|
170
|
-
|
|
171
|
-
```ts
|
|
172
|
-
items: object;
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### properties.previous\_hashes.items.nullable
|
|
176
|
-
|
|
177
|
-
```ts
|
|
178
|
-
nullable: boolean = true;
|
|
179
|
-
```
|
|
180
|
-
|
|
181
|
-
### properties.previous\_hashes.items.type
|
|
182
|
-
|
|
183
|
-
```ts
|
|
184
|
-
type: string = 'string';
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
### properties.previous\_hashes.type
|
|
188
|
-
|
|
189
|
-
```ts
|
|
190
|
-
type: string = 'array';
|
|
191
|
-
```
|
|
192
|
-
|
|
193
|
-
### properties.schema
|
|
194
|
-
|
|
195
|
-
```ts
|
|
196
|
-
schema: object;
|
|
197
|
-
```
|
|
198
|
-
|
|
199
|
-
### properties.schema.type
|
|
200
|
-
|
|
201
|
-
```ts
|
|
202
|
-
type: string = 'string';
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
### required
|
|
206
|
-
|
|
207
|
-
```ts
|
|
208
|
-
required: string[];
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### type
|
|
212
|
-
|
|
213
|
-
```ts
|
|
214
|
-
type: string = 'object';
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### <a id="HydratedBoundWitnessZodBuilder"></a>HydratedBoundWitnessZodBuilder
|
|
218
|
-
|
|
219
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
220
|
-
|
|
221
|
-
***
|
|
222
|
-
|
|
223
|
-
```ts
|
|
224
|
-
function HydratedBoundWitnessZodBuilder<T>(bwZod): ZodTuple<[T, ZodArray<ZodObject<{
|
|
225
|
-
schema: ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>;
|
|
226
|
-
}, $loose>>], null>;
|
|
227
|
-
```
|
|
228
|
-
|
|
229
|
-
## Type Parameters
|
|
230
|
-
|
|
231
|
-
### T
|
|
232
|
-
|
|
233
|
-
`T` *extends* `ZodType`\<\{
|
|
234
|
-
`addresses`: `BrandedAddress`[];
|
|
235
|
-
`payload_hashes`: `BrandedHash`[];
|
|
236
|
-
`payload_schemas`: `BrandedSchema`\<`string`\>[];
|
|
237
|
-
`previous_hashes`: (`BrandedHash` \| `null`)[];
|
|
238
|
-
`$destination?`: `BrandedAddress`;
|
|
239
|
-
`$sourceQuery?`: `BrandedHash`;
|
|
240
|
-
`schema`: `"network.xyo.boundwitness"` & `object`;
|
|
241
|
-
`$signatures`: (`BrandedHex` \| `null`)[];
|
|
242
|
-
\}, `unknown`, `$ZodTypeInternals`\<\{
|
|
243
|
-
`addresses`: `BrandedAddress`[];
|
|
244
|
-
`payload_hashes`: `BrandedHash`[];
|
|
245
|
-
`payload_schemas`: `BrandedSchema`\<`string`\>[];
|
|
246
|
-
`previous_hashes`: (`BrandedHash` \| `null`)[];
|
|
247
|
-
`$destination?`: `BrandedAddress`;
|
|
248
|
-
`$sourceQuery?`: `BrandedHash`;
|
|
249
|
-
`schema`: `"network.xyo.boundwitness"` & `object`;
|
|
250
|
-
`$signatures`: (`BrandedHex` \| `null`)[];
|
|
251
|
-
\}, `unknown`\>\>
|
|
252
|
-
|
|
253
|
-
## Parameters
|
|
254
|
-
|
|
255
|
-
### bwZod
|
|
256
|
-
|
|
257
|
-
`T`
|
|
258
|
-
|
|
259
|
-
## Returns
|
|
260
|
-
|
|
261
|
-
`ZodTuple`\<\[`T`, `ZodArray`\<`ZodObject`\<\{
|
|
262
|
-
`schema`: `ZodPipe`\<`ZodString`, `ZodTransform`\<`BrandedSchema`\<`string`\>, `string`\>\>;
|
|
263
|
-
\}, `$loose`\>\>\], `null`\>
|
|
264
|
-
|
|
265
|
-
### <a id="isQueryBoundWitness"></a>isQueryBoundWitness
|
|
266
|
-
|
|
267
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
268
|
-
|
|
269
|
-
***
|
|
270
|
-
|
|
271
|
-
```ts
|
|
272
|
-
function isQueryBoundWitness(x?): x is UnsignedQueryBoundWitness;
|
|
273
|
-
```
|
|
274
|
-
|
|
275
|
-
## Parameters
|
|
276
|
-
|
|
277
|
-
### x?
|
|
278
|
-
|
|
279
|
-
`unknown`
|
|
280
|
-
|
|
281
|
-
## Returns
|
|
282
|
-
|
|
283
|
-
`x is UnsignedQueryBoundWitness`
|
|
284
|
-
|
|
285
|
-
### <a id="isQueryBoundWitnessWithStorageMeta"></a>isQueryBoundWitnessWithStorageMeta
|
|
286
|
-
|
|
287
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
288
|
-
|
|
289
|
-
***
|
|
290
|
-
|
|
291
|
-
```ts
|
|
292
|
-
function isQueryBoundWitnessWithStorageMeta(x?): x is WithStorageMeta<UnsignedQueryBoundWitness>;
|
|
293
|
-
```
|
|
294
|
-
|
|
295
|
-
## Parameters
|
|
296
|
-
|
|
297
|
-
### x?
|
|
298
|
-
|
|
299
|
-
`unknown`
|
|
300
|
-
|
|
301
|
-
## Returns
|
|
302
|
-
|
|
303
|
-
`x is WithStorageMeta<UnsignedQueryBoundWitness>`
|
|
304
|
-
|
|
305
|
-
### type-aliases
|
|
306
|
-
|
|
307
|
-
### <a id="AnyBoundWitness"></a>AnyBoundWitness
|
|
308
|
-
|
|
309
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
310
|
-
|
|
311
|
-
***
|
|
312
|
-
|
|
313
|
-
```ts
|
|
314
|
-
type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>;
|
|
315
|
-
```
|
|
316
|
-
|
|
317
|
-
### <a id="AnySignedBoundWitness"></a>AnySignedBoundWitness
|
|
318
|
-
|
|
319
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
320
|
-
|
|
321
|
-
***
|
|
322
|
-
|
|
323
|
-
```ts
|
|
324
|
-
type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>;
|
|
325
|
-
```
|
|
326
|
-
|
|
327
|
-
### <a id="AnyUnsignedBoundWitness"></a>AnyUnsignedBoundWitness
|
|
328
|
-
|
|
329
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
330
|
-
|
|
331
|
-
***
|
|
332
|
-
|
|
333
|
-
```ts
|
|
334
|
-
type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>;
|
|
335
|
-
```
|
|
336
|
-
|
|
337
|
-
### <a id="BoundWitness"></a>BoundWitness
|
|
338
|
-
|
|
339
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
340
|
-
|
|
341
|
-
***
|
|
342
|
-
|
|
343
|
-
```ts
|
|
344
|
-
type BoundWitness = z.infer<typeof BoundWitnessZod>;
|
|
345
|
-
```
|
|
346
|
-
|
|
347
|
-
### <a id="BoundWitnessMeta"></a>BoundWitnessMeta
|
|
348
|
-
|
|
349
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
350
|
-
|
|
351
|
-
***
|
|
352
|
-
|
|
353
|
-
```ts
|
|
354
|
-
type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>;
|
|
355
|
-
```
|
|
356
|
-
|
|
357
|
-
### <a id="BoundWitnessRequiredFields"></a>BoundWitnessRequiredFields
|
|
358
|
-
|
|
359
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
360
|
-
|
|
361
|
-
***
|
|
362
|
-
|
|
363
|
-
```ts
|
|
364
|
-
type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>;
|
|
365
|
-
```
|
|
366
|
-
|
|
367
|
-
### <a id="BoundWitnessSchema"></a>BoundWitnessSchema
|
|
368
|
-
|
|
369
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
370
|
-
|
|
371
|
-
***
|
|
372
|
-
|
|
373
|
-
```ts
|
|
374
|
-
type BoundWitnessSchema = typeof BoundWitnessSchema;
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
### <a id="PossiblySigned"></a>PossiblySigned
|
|
378
|
-
|
|
379
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
380
|
-
|
|
381
|
-
***
|
|
382
|
-
|
|
383
|
-
```ts
|
|
384
|
-
type PossiblySigned<T> = Unsigned<T> | Signed<T>;
|
|
385
|
-
```
|
|
386
|
-
|
|
387
|
-
## Type Parameters
|
|
388
|
-
|
|
389
|
-
### T
|
|
390
|
-
|
|
391
|
-
`T` *extends* [`BoundWitness`](#BoundWitness)
|
|
392
|
-
|
|
393
|
-
### <a id="QueryBoundWitness"></a>QueryBoundWitness
|
|
394
|
-
|
|
395
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
396
|
-
|
|
397
|
-
***
|
|
398
|
-
|
|
399
|
-
```ts
|
|
400
|
-
type QueryBoundWitness = UnsignedQueryBoundWitness;
|
|
401
|
-
```
|
|
402
|
-
|
|
403
|
-
### <a id="QueryBoundWitnessFields"></a>QueryBoundWitnessFields
|
|
404
|
-
|
|
405
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
406
|
-
|
|
407
|
-
***
|
|
408
|
-
|
|
409
|
-
```ts
|
|
410
|
-
type QueryBoundWitnessFields = object;
|
|
411
|
-
```
|
|
412
|
-
|
|
413
|
-
## Properties
|
|
414
|
-
|
|
415
|
-
### error\_hashes?
|
|
416
|
-
|
|
417
|
-
```ts
|
|
418
|
-
optional error_hashes?: Hash[];
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
***
|
|
422
|
-
|
|
423
|
-
### query
|
|
424
|
-
|
|
425
|
-
```ts
|
|
426
|
-
query: Hash;
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
### <a id="SignaturesMeta"></a>SignaturesMeta
|
|
430
|
-
|
|
431
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
432
|
-
|
|
433
|
-
***
|
|
434
|
-
|
|
435
|
-
```ts
|
|
436
|
-
type SignaturesMeta = z.infer<typeof SignaturesMetaZod>;
|
|
437
|
-
```
|
|
438
|
-
|
|
439
|
-
### <a id="Signed"></a>Signed
|
|
440
|
-
|
|
441
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
442
|
-
|
|
443
|
-
***
|
|
444
|
-
|
|
445
|
-
```ts
|
|
446
|
-
type Signed<T> = Omit<T, "$signatures"> & SignedSignaturesMeta;
|
|
447
|
-
```
|
|
448
|
-
|
|
449
|
-
## Type Parameters
|
|
450
|
-
|
|
451
|
-
### T
|
|
452
|
-
|
|
453
|
-
`T` *extends* [`BoundWitness`](#BoundWitness)
|
|
454
|
-
|
|
455
|
-
### <a id="SignedBoundWitness"></a>SignedBoundWitness
|
|
456
|
-
|
|
457
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
458
|
-
|
|
459
|
-
***
|
|
460
|
-
|
|
461
|
-
```ts
|
|
462
|
-
type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>;
|
|
463
|
-
```
|
|
464
|
-
|
|
465
|
-
### <a id="SignedSignaturesMeta"></a>SignedSignaturesMeta
|
|
466
|
-
|
|
467
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
468
|
-
|
|
469
|
-
***
|
|
470
|
-
|
|
471
|
-
```ts
|
|
472
|
-
type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>;
|
|
473
|
-
```
|
|
474
|
-
|
|
475
|
-
### <a id="Unsigned"></a>Unsigned
|
|
476
|
-
|
|
477
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
478
|
-
|
|
479
|
-
***
|
|
480
|
-
|
|
481
|
-
```ts
|
|
482
|
-
type Unsigned<T> = Omit<T, "$signatures"> & UnsignedSignaturesMeta;
|
|
483
|
-
```
|
|
484
|
-
|
|
485
|
-
## Type Parameters
|
|
486
|
-
|
|
487
|
-
### T
|
|
488
|
-
|
|
489
|
-
`T` *extends* [`BoundWitness`](#BoundWitness)
|
|
490
|
-
|
|
491
|
-
### <a id="UnsignedBoundWitness"></a>UnsignedBoundWitness
|
|
492
|
-
|
|
493
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
494
|
-
|
|
495
|
-
***
|
|
496
|
-
|
|
497
|
-
```ts
|
|
498
|
-
type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>;
|
|
499
|
-
```
|
|
500
|
-
|
|
501
|
-
### <a id="UnsignedQueryBoundWitness"></a>UnsignedQueryBoundWitness
|
|
502
|
-
|
|
503
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
504
|
-
|
|
505
|
-
***
|
|
506
|
-
|
|
507
|
-
```ts
|
|
508
|
-
type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields;
|
|
509
|
-
```
|
|
510
|
-
|
|
511
|
-
### <a id="UnsignedSignaturesMeta"></a>UnsignedSignaturesMeta
|
|
512
|
-
|
|
513
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
514
|
-
|
|
515
|
-
***
|
|
516
|
-
|
|
517
|
-
```ts
|
|
518
|
-
type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>;
|
|
519
|
-
```
|
|
520
|
-
|
|
521
|
-
### variables
|
|
522
|
-
|
|
523
|
-
### <a id="AnyBoundWitnessZod"></a>AnyBoundWitnessZod
|
|
524
|
-
|
|
525
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
526
|
-
|
|
527
|
-
***
|
|
528
|
-
|
|
529
|
-
```ts
|
|
530
|
-
const AnyBoundWitnessZod: ZodObject<{
|
|
531
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
532
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
533
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
534
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
535
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
536
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
537
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
538
|
-
$signatures: ZodArray<ZodUnion<readonly [ZodPipe<ZodString, ZodTransform<BrandedHex, string>>, ZodNull]>>;
|
|
539
|
-
}, $loose>;
|
|
540
|
-
```
|
|
541
|
-
|
|
542
|
-
### <a id="AnySignedBoundWitnessZod"></a>AnySignedBoundWitnessZod
|
|
543
|
-
|
|
544
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
545
|
-
|
|
546
|
-
***
|
|
547
|
-
|
|
548
|
-
```ts
|
|
549
|
-
const AnySignedBoundWitnessZod: ZodObject<{
|
|
550
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
551
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
552
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
553
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
554
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
555
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
556
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
557
|
-
$signatures: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHex, string>>>;
|
|
558
|
-
}, $loose>;
|
|
559
|
-
```
|
|
560
|
-
|
|
561
|
-
### <a id="AnyUnsignedBoundWitnessZod"></a>AnyUnsignedBoundWitnessZod
|
|
562
|
-
|
|
563
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
564
|
-
|
|
565
|
-
***
|
|
566
|
-
|
|
567
|
-
```ts
|
|
568
|
-
const AnyUnsignedBoundWitnessZod: ZodObject<{
|
|
569
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
570
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
571
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
572
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
573
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
574
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
575
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
576
|
-
$signatures: ZodArray<ZodNull>;
|
|
577
|
-
}, $loose>;
|
|
578
|
-
```
|
|
579
|
-
|
|
580
|
-
### <a id="BoundWitnessMetaZod"></a>BoundWitnessMetaZod
|
|
581
|
-
|
|
582
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
583
|
-
|
|
584
|
-
***
|
|
585
|
-
|
|
586
|
-
```ts
|
|
587
|
-
const BoundWitnessMetaZod: ZodObject<{
|
|
588
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
589
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
590
|
-
$signatures: ZodArray<ZodUnion<readonly [ZodPipe<ZodString, ZodTransform<BrandedHex, string>>, ZodNull]>>;
|
|
591
|
-
}, $strip>;
|
|
592
|
-
```
|
|
593
|
-
|
|
594
|
-
### <a id="BoundWitnessRequiredFieldsZod"></a>BoundWitnessRequiredFieldsZod
|
|
595
|
-
|
|
596
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
597
|
-
|
|
598
|
-
***
|
|
599
|
-
|
|
600
|
-
```ts
|
|
601
|
-
const BoundWitnessRequiredFieldsZod: ZodObject<{
|
|
602
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
603
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
604
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
605
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
606
|
-
}, $strip>;
|
|
607
|
-
```
|
|
608
|
-
|
|
609
|
-
### <a id="BoundWitnessSchema"></a>BoundWitnessSchema
|
|
610
|
-
|
|
611
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
612
|
-
|
|
613
|
-
***
|
|
614
|
-
|
|
615
|
-
```ts
|
|
616
|
-
const BoundWitnessSchema: "network.xyo.boundwitness" & object;
|
|
617
|
-
```
|
|
618
|
-
|
|
619
|
-
## Type Declaration
|
|
620
|
-
|
|
621
|
-
### \_\_schema
|
|
622
|
-
|
|
623
|
-
```ts
|
|
624
|
-
readonly __schema: true;
|
|
625
|
-
```
|
|
626
|
-
|
|
627
|
-
### <a id="BoundWitnessZod"></a>BoundWitnessZod
|
|
628
|
-
|
|
629
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
630
|
-
|
|
631
|
-
***
|
|
632
|
-
|
|
633
|
-
```ts
|
|
634
|
-
const BoundWitnessZod: ZodObject<{
|
|
635
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
636
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
637
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
638
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
639
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
640
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
641
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
642
|
-
$signatures: ZodArray<ZodUnion<readonly [ZodPipe<ZodString, ZodTransform<BrandedHex, string>>, ZodNull]>>;
|
|
643
|
-
}, $strip>;
|
|
644
|
-
```
|
|
645
|
-
|
|
646
|
-
### <a id="HydratedBoundWitnessZod"></a>HydratedBoundWitnessZod
|
|
647
|
-
|
|
648
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
649
|
-
|
|
650
|
-
***
|
|
651
|
-
|
|
652
|
-
```ts
|
|
653
|
-
const HydratedBoundWitnessZod: ZodTuple<[ZodObject<{
|
|
654
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
655
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
656
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
657
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
658
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
659
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
660
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
661
|
-
$signatures: ZodArray<ZodUnion<readonly [ZodPipe<ZodString, ZodTransform<BrandedHex, string>>, ZodNull]>>;
|
|
662
|
-
}, $strip>, ZodArray<ZodObject<{
|
|
663
|
-
schema: ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>;
|
|
664
|
-
}, $loose>>], null>;
|
|
665
|
-
```
|
|
666
|
-
|
|
667
|
-
### <a id="SignaturesMetaZod"></a>SignaturesMetaZod
|
|
668
|
-
|
|
669
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
670
|
-
|
|
671
|
-
***
|
|
672
|
-
|
|
673
|
-
```ts
|
|
674
|
-
const SignaturesMetaZod: ZodObject<{
|
|
675
|
-
$signatures: ZodArray<ZodUnion<readonly [ZodPipe<ZodString, ZodTransform<BrandedHex, string>>, ZodNull]>>;
|
|
676
|
-
}, $strip>;
|
|
677
|
-
```
|
|
678
|
-
|
|
679
|
-
### <a id="SignedBoundWitnessZod"></a>SignedBoundWitnessZod
|
|
680
|
-
|
|
681
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
682
|
-
|
|
683
|
-
***
|
|
684
|
-
|
|
685
|
-
```ts
|
|
686
|
-
const SignedBoundWitnessZod: ZodObject<{
|
|
687
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
688
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
689
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
690
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
691
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
692
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
693
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
694
|
-
$signatures: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHex, string>>>;
|
|
695
|
-
}, $strip>;
|
|
696
|
-
```
|
|
697
|
-
|
|
698
|
-
### <a id="SignedHydratedBoundWitnessZod"></a>SignedHydratedBoundWitnessZod
|
|
699
|
-
|
|
700
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
701
|
-
|
|
702
|
-
***
|
|
703
|
-
|
|
704
|
-
```ts
|
|
705
|
-
const SignedHydratedBoundWitnessZod: ZodTuple<[ZodObject<{
|
|
706
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
707
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
708
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
709
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
710
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
711
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
712
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
713
|
-
$signatures: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHex, string>>>;
|
|
714
|
-
}, $strip>, ZodArray<ZodObject<{
|
|
715
|
-
schema: ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>;
|
|
716
|
-
}, $loose>>], null>;
|
|
717
|
-
```
|
|
718
|
-
|
|
719
|
-
### <a id="SignedSignaturesMetaZod"></a>SignedSignaturesMetaZod
|
|
720
|
-
|
|
721
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
722
|
-
|
|
723
|
-
***
|
|
724
|
-
|
|
725
|
-
```ts
|
|
726
|
-
const SignedSignaturesMetaZod: ZodObject<{
|
|
727
|
-
$signatures: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHex, string>>>;
|
|
728
|
-
}, $strip>;
|
|
729
|
-
```
|
|
730
|
-
|
|
731
|
-
### <a id="UnsignedBoundWitnessZod"></a>UnsignedBoundWitnessZod
|
|
732
|
-
|
|
733
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
734
|
-
|
|
735
|
-
***
|
|
736
|
-
|
|
737
|
-
```ts
|
|
738
|
-
const UnsignedBoundWitnessZod: ZodObject<{
|
|
739
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
740
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
741
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
742
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
743
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
744
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
745
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
746
|
-
$signatures: ZodArray<ZodNull>;
|
|
747
|
-
}, $strip>;
|
|
748
|
-
```
|
|
749
|
-
|
|
750
|
-
### <a id="UnsignedHydratedBoundWitnessZod"></a>UnsignedHydratedBoundWitnessZod
|
|
751
|
-
|
|
752
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
753
|
-
|
|
754
|
-
***
|
|
755
|
-
|
|
756
|
-
```ts
|
|
757
|
-
const UnsignedHydratedBoundWitnessZod: ZodTuple<[ZodObject<{
|
|
758
|
-
addresses: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
759
|
-
payload_hashes: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
760
|
-
payload_schemas: ZodArray<ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>>;
|
|
761
|
-
previous_hashes: ZodArray<ZodNullable<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>>;
|
|
762
|
-
$destination: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedAddress, string>>>;
|
|
763
|
-
$sourceQuery: ZodOptional<ZodPipe<ZodString, ZodTransform<BrandedHash, string>>>;
|
|
764
|
-
schema: ZodLiteral<"network.xyo.boundwitness" & object>;
|
|
765
|
-
$signatures: ZodArray<ZodNull>;
|
|
766
|
-
}, $strip>, ZodArray<ZodObject<{
|
|
767
|
-
schema: ZodPipe<ZodString, ZodTransform<BrandedSchema<string>, string>>;
|
|
768
|
-
}, $loose>>], null>;
|
|
769
|
-
```
|
|
770
|
-
|
|
771
|
-
### <a id="UnsignedSignaturesMetaZod"></a>UnsignedSignaturesMetaZod
|
|
772
|
-
|
|
773
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
774
|
-
|
|
775
|
-
***
|
|
776
|
-
|
|
777
|
-
```ts
|
|
778
|
-
const UnsignedSignaturesMetaZod: ZodObject<{
|
|
779
|
-
$signatures: ZodArray<ZodNull>;
|
|
780
|
-
}, $strip>;
|
|
781
|
-
```
|
|
782
|
-
|
|
783
|
-
### <a id="asBoundWitness"></a>asBoundWitness
|
|
784
|
-
|
|
785
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
786
|
-
|
|
787
|
-
***
|
|
788
|
-
|
|
789
|
-
```ts
|
|
790
|
-
const asBoundWitness: {
|
|
791
|
-
<T> (value): T & object | undefined;
|
|
792
|
-
<T> (value, assert): T & object;
|
|
793
|
-
};
|
|
794
|
-
```
|
|
795
|
-
|
|
796
|
-
## Call Signature
|
|
797
|
-
|
|
798
|
-
```ts
|
|
799
|
-
<T>(value): T & object | undefined;
|
|
800
|
-
```
|
|
801
|
-
|
|
802
|
-
### Type Parameters
|
|
803
|
-
|
|
804
|
-
### T
|
|
805
|
-
|
|
806
|
-
`T`
|
|
807
|
-
|
|
808
|
-
### Parameters
|
|
809
|
-
|
|
810
|
-
### value
|
|
811
|
-
|
|
812
|
-
`T`
|
|
813
|
-
|
|
814
|
-
### Returns
|
|
815
|
-
|
|
816
|
-
`T` & `object` \| `undefined`
|
|
817
|
-
|
|
818
|
-
## Call Signature
|
|
819
|
-
|
|
820
|
-
```ts
|
|
821
|
-
<T>(value, assert): T & object;
|
|
822
|
-
```
|
|
823
|
-
|
|
824
|
-
### Type Parameters
|
|
825
|
-
|
|
826
|
-
### T
|
|
827
|
-
|
|
828
|
-
`T`
|
|
829
|
-
|
|
830
|
-
### Parameters
|
|
831
|
-
|
|
832
|
-
### value
|
|
833
|
-
|
|
834
|
-
`T`
|
|
835
|
-
|
|
836
|
-
### assert
|
|
837
|
-
|
|
838
|
-
`ZodFactoryConfig`
|
|
839
|
-
|
|
840
|
-
### Returns
|
|
841
|
-
|
|
842
|
-
`T` & `object`
|
|
843
|
-
|
|
844
|
-
### <a id="isBoundWitness"></a>isBoundWitness
|
|
845
|
-
|
|
846
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
847
|
-
|
|
848
|
-
***
|
|
849
|
-
|
|
850
|
-
```ts
|
|
851
|
-
const isBoundWitness: <T>(value) => value is T & { addresses: BrandedAddress[]; payload_hashes: BrandedHash[]; payload_schemas: BrandedSchema<string>[]; previous_hashes: (BrandedHash | null)[]; $destination?: BrandedAddress; $sourceQuery?: BrandedHash; schema: "network.xyo.boundwitness" & { __schema: true }; $signatures: (BrandedHex | null)[] };
|
|
852
|
-
```
|
|
853
|
-
|
|
854
|
-
## Type Parameters
|
|
855
|
-
|
|
856
|
-
### T
|
|
857
|
-
|
|
858
|
-
`T`
|
|
859
|
-
|
|
860
|
-
## Parameters
|
|
861
|
-
|
|
862
|
-
### value
|
|
863
|
-
|
|
864
|
-
`T`
|
|
865
|
-
|
|
866
|
-
## Returns
|
|
867
|
-
|
|
868
|
-
value is T & \{ addresses: BrandedAddress\[\]; payload\_hashes: BrandedHash\[\]; payload\_schemas: BrandedSchema\<string\>\[\]; previous\_hashes: (BrandedHash \| null)\[\]; $destination?: BrandedAddress; $sourceQuery?: BrandedHash; schema: "network.xyo.boundwitness" & \{ \_\_schema: true \}; $signatures: (BrandedHex \| null)\[\] \}
|
|
869
|
-
|
|
870
|
-
### <a id="toBoundWitness"></a>toBoundWitness
|
|
871
|
-
|
|
872
|
-
[**@xyo-network/boundwitness-model**](#../README)
|
|
873
|
-
|
|
874
|
-
***
|
|
875
|
-
|
|
876
|
-
```ts
|
|
877
|
-
const toBoundWitness: {
|
|
878
|
-
<T> (value): T & object | undefined;
|
|
879
|
-
<T> (value, assert): T & object;
|
|
880
|
-
};
|
|
881
|
-
```
|
|
882
|
-
|
|
883
|
-
## Call Signature
|
|
884
|
-
|
|
885
|
-
```ts
|
|
886
|
-
<T>(value): T & object | undefined;
|
|
887
|
-
```
|
|
888
|
-
|
|
889
|
-
### Type Parameters
|
|
890
|
-
|
|
891
|
-
### T
|
|
892
|
-
|
|
893
|
-
`T`
|
|
894
|
-
|
|
895
|
-
### Parameters
|
|
896
|
-
|
|
897
|
-
### value
|
|
898
|
-
|
|
899
|
-
`T`
|
|
900
|
-
|
|
901
|
-
### Returns
|
|
902
|
-
|
|
903
|
-
`T` & `object` \| `undefined`
|
|
904
|
-
|
|
905
|
-
## Call Signature
|
|
906
|
-
|
|
907
|
-
```ts
|
|
908
|
-
<T>(value, assert): T & object;
|
|
909
|
-
```
|
|
910
|
-
|
|
911
|
-
### Type Parameters
|
|
912
|
-
|
|
913
|
-
### T
|
|
914
|
-
|
|
915
|
-
`T`
|
|
916
|
-
|
|
917
|
-
### Parameters
|
|
918
|
-
|
|
919
|
-
### value
|
|
920
|
-
|
|
921
|
-
`T`
|
|
922
|
-
|
|
923
|
-
### assert
|
|
924
|
-
|
|
925
|
-
`ZodFactoryConfig`
|
|
926
|
-
|
|
927
|
-
### Returns
|
|
928
|
-
|
|
929
|
-
`T` & `object`
|
|
930
41
|
|
|
931
42
|
|
|
932
43
|
[logo]: https://cdn.xy.company/img/brand/XYO_full_colored.png
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
2
|
import type { WithStorageMeta } from '@xyo-network/payload-model';
|
|
3
3
|
import { type BoundWitness } from './BoundWitness/index.ts';
|
|
4
|
-
export
|
|
4
|
+
export interface QueryBoundWitnessFields {
|
|
5
5
|
error_hashes?: Hash[];
|
|
6
6
|
query: Hash;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
export type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields;
|
|
9
9
|
export type QueryBoundWitness = UnsignedQueryBoundWitness;
|
|
10
10
|
export declare const isQueryBoundWitness: (x?: unknown) => x is QueryBoundWitness;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBoundWitness.d.ts","sourceRoot":"","sources":["../../src/QueryBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,yBAAyB,CAAA;AAE3E,MAAM,
|
|
1
|
+
{"version":3,"file":"QueryBoundWitness.d.ts","sourceRoot":"","sources":["../../src/QueryBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,yBAAyB,CAAA;AAE3E,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,KAAK,EAAE,IAAI,CAAA;CACZ;AAED,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,uBAAuB,CAAA;AAE9E,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,GAAI,IAAI,OAAO,KAAG,CAAC,IAAI,iBAAuF,CAAA;AAC9I,eAAO,MAAM,kCAAkC,GAAI,IAAI,OAAO,KAAG,CAAC,IAAI,eAAe,CAAC,iBAAiB,CAA+C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/HydratedBoundWitness.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import {\n AddressZod, HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport type { SignedSignaturesMeta, UnsignedSignaturesMeta } from './Signatures.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n\nexport type Unsigned<T extends BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\n\nexport type Signed<T extends BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\n\nexport type PossiblySigned<T extends BoundWitness> = Unsigned<T> | Signed<T>\n","import { asSchema } from '@xyo-network/payload-model'\n\nexport const BoundWitnessSchema = asSchema('network.xyo.boundwitness', true)\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import { PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { type BoundWitness, BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedBoundWitnessZod } from './SignedBoundWitness.ts'\nimport { UnsignedBoundWitnessZod } from './UnsignedBoundWitness.ts'\n\nexport function HydratedBoundWitnessZodBuilder<T extends z.ZodType<BoundWitness>>(bwZod: T) {\n return z.tuple([bwZod, z.array(PayloadZod.loose())])\n}\n\nexport const HydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(BoundWitnessZod)\n// export type HydratedBoundWitness = z.infer<typeof HydratedBoundWitnessZod>\n\nexport const SignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(SignedBoundWitnessZod)\n// export type SignedHydratedBoundWitness = z.infer<typeof SignedHydratedBoundWitnessZod>\n\nexport const UnsignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(UnsignedBoundWitnessZod)\n// export type UnsignedHydratedBoundWitness = z.infer<typeof UnsignedHydratedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/HydratedBoundWitness.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import {\n AddressZod, HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport type { SignedSignaturesMeta, UnsignedSignaturesMeta } from './Signatures.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n\nexport type Unsigned<T extends BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\n\nexport type Signed<T extends BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\n\nexport type PossiblySigned<T extends BoundWitness> = Unsigned<T> | Signed<T>\n","import { asSchema } from '@xyo-network/payload-model'\n\nexport const BoundWitnessSchema = asSchema('network.xyo.boundwitness', true)\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import { PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { type BoundWitness, BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedBoundWitnessZod } from './SignedBoundWitness.ts'\nimport { UnsignedBoundWitnessZod } from './UnsignedBoundWitness.ts'\n\nexport function HydratedBoundWitnessZodBuilder<T extends z.ZodType<BoundWitness>>(bwZod: T) {\n return z.tuple([bwZod, z.array(PayloadZod.loose())])\n}\n\nexport const HydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(BoundWitnessZod)\n// export type HydratedBoundWitness = z.infer<typeof HydratedBoundWitnessZod>\n\nexport const SignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(SignedBoundWitnessZod)\n// export type SignedHydratedBoundWitness = z.infer<typeof SignedHydratedBoundWitnessZod>\n\nexport const UnsignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(UnsignedBoundWitnessZod)\n// export type UnsignedHydratedBoundWitness = z.infer<typeof UnsignedHydratedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport interface QueryBoundWitnessFields {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAAY;AAAA,EACZ;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLd,SAAS,gBAAgB;AAElB,IAAM,qBAAqB,SAAS,4BAA4B,IAAI;;;ACF3E,SAAS,cAAc;AACvB,OAAO,OAAO;AAEP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;;;AFMhF,IAAM,gCAAgCC,GAAE,OAAO;AAAA,EACpD,WAAWA,GAAE,MAAM,UAAU;AAAA,EAC7B,gBAAgBA,GAAE,MAAM,OAAO;AAAA,EAC/B,iBAAiBA,GAAE,MAAM,SAAS;AAAA,EAClC,iBAAiBA,GAAE,MAAM,QAAQ,SAAS,CAAC;AAC7C,CAAC;AAIM,IAAM,sBAAsBA,GAAE,OAAO;AAAA,EAC1C,cAAc,WAAW,SAAS;AAAA,EAClC,cAAc,QAAQ,SAAS;AACjC,CAAC,EAAE,OAAO,kBAAkB,KAAK;AAI1B,IAAM,kBAAkB,WAC5B,WAAW,EAAE,QAAQA,GAAE,QAAQ,kBAAkB,EAAE,CAAC,EACpD,WAAW,8BAA8B,KAAK,EAC9C,WAAW,oBAAoB,KAAK;AAKhC,IAAM,iBAAiB,aAAa,eAAe;AACnD,IAAM,iBAAiB,aAAa,iBAAiB,gBAAgB;AACrE,IAAM,iBAAiB,aAAa,iBAAiB,gBAAgB;AAErE,IAAM,qBAAqB,gBAAgB,MAAM;;;AGpCjD,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;ACjBA,SAAS,cAAAC,mBAAkB;AAC3B,OAAOC,QAAO;;;ACIP,IAAM,wBAAwB,gBAAgB,OAAO,wBAAwB,KAAK;AAGlF,IAAM,2BAA2B,sBAAsB,MAAM;;;ACH7D,IAAM,0BAA0B,gBAAgB,OAAO,0BAA0B,KAAK;AAGtF,IAAM,6BAA6B,wBAAwB,MAAM;;;AFDjE,SAAS,+BAAkE,OAAU;AAC1F,SAAOC,GAAE,MAAM,CAAC,OAAOA,GAAE,MAAMC,YAAW,MAAM,CAAC,CAAC,CAAC;AACrD;AAEO,IAAM,0BAA0B,+BAA+B,eAAe;AAG9E,IAAM,gCAAgC,+BAA+B,qBAAqB;AAG1F,IAAM,kCAAkC,+BAA+B,uBAAuB;;;AGfrG,SAAS,qBAAqB;AAavB,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,qCAAqC,CAAC,MAAyD,oBAAoB,CAAC,KAAK,cAAc,CAAC;","names":["z","z","PayloadZod","z","z","PayloadZod"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
2
|
import type { WithStorageMeta } from '@xyo-network/payload-model';
|
|
3
3
|
import { type BoundWitness } from './BoundWitness/index.ts';
|
|
4
|
-
export
|
|
4
|
+
export interface QueryBoundWitnessFields {
|
|
5
5
|
error_hashes?: Hash[];
|
|
6
6
|
query: Hash;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
export type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields;
|
|
9
9
|
export type QueryBoundWitness = UnsignedQueryBoundWitness;
|
|
10
10
|
export declare const isQueryBoundWitness: (x?: unknown) => x is QueryBoundWitness;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBoundWitness.d.ts","sourceRoot":"","sources":["../../src/QueryBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,yBAAyB,CAAA;AAE3E,MAAM,
|
|
1
|
+
{"version":3,"file":"QueryBoundWitness.d.ts","sourceRoot":"","sources":["../../src/QueryBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,yBAAyB,CAAA;AAE3E,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,KAAK,EAAE,IAAI,CAAA;CACZ;AAED,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,uBAAuB,CAAA;AAE9E,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,GAAI,IAAI,OAAO,KAAG,CAAC,IAAI,iBAAuF,CAAA;AAC9I,eAAO,MAAM,kCAAkC,GAAI,IAAI,OAAO,KAAG,CAAC,IAAI,eAAe,CAAC,iBAAiB,CAA+C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/HydratedBoundWitness.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import {\n AddressZod, HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport type { SignedSignaturesMeta, UnsignedSignaturesMeta } from './Signatures.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n\nexport type Unsigned<T extends BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\n\nexport type Signed<T extends BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\n\nexport type PossiblySigned<T extends BoundWitness> = Unsigned<T> | Signed<T>\n","import { asSchema } from '@xyo-network/payload-model'\n\nexport const BoundWitnessSchema = asSchema('network.xyo.boundwitness', true)\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import { PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { type BoundWitness, BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedBoundWitnessZod } from './SignedBoundWitness.ts'\nimport { UnsignedBoundWitnessZod } from './UnsignedBoundWitness.ts'\n\nexport function HydratedBoundWitnessZodBuilder<T extends z.ZodType<BoundWitness>>(bwZod: T) {\n return z.tuple([bwZod, z.array(PayloadZod.loose())])\n}\n\nexport const HydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(BoundWitnessZod)\n// export type HydratedBoundWitness = z.infer<typeof HydratedBoundWitnessZod>\n\nexport const SignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(SignedBoundWitnessZod)\n// export type SignedHydratedBoundWitness = z.infer<typeof SignedHydratedBoundWitnessZod>\n\nexport const UnsignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(UnsignedBoundWitnessZod)\n// export type UnsignedHydratedBoundWitness = z.infer<typeof UnsignedHydratedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/HydratedBoundWitness.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import {\n AddressZod, HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport type { SignedSignaturesMeta, UnsignedSignaturesMeta } from './Signatures.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n\nexport type Unsigned<T extends BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\n\nexport type Signed<T extends BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\n\nexport type PossiblySigned<T extends BoundWitness> = Unsigned<T> | Signed<T>\n","import { asSchema } from '@xyo-network/payload-model'\n\nexport const BoundWitnessSchema = asSchema('network.xyo.boundwitness', true)\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import { PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { type BoundWitness, BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedBoundWitnessZod } from './SignedBoundWitness.ts'\nimport { UnsignedBoundWitnessZod } from './UnsignedBoundWitness.ts'\n\nexport function HydratedBoundWitnessZodBuilder<T extends z.ZodType<BoundWitness>>(bwZod: T) {\n return z.tuple([bwZod, z.array(PayloadZod.loose())])\n}\n\nexport const HydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(BoundWitnessZod)\n// export type HydratedBoundWitness = z.infer<typeof HydratedBoundWitnessZod>\n\nexport const SignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(SignedBoundWitnessZod)\n// export type SignedHydratedBoundWitness = z.infer<typeof SignedHydratedBoundWitnessZod>\n\nexport const UnsignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(UnsignedBoundWitnessZod)\n// export type UnsignedHydratedBoundWitness = z.infer<typeof UnsignedHydratedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport interface QueryBoundWitnessFields {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAAY;AAAA,EACZ;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLd,SAAS,gBAAgB;AAElB,IAAM,qBAAqB,SAAS,4BAA4B,IAAI;;;ACF3E,SAAS,cAAc;AACvB,OAAO,OAAO;AAEP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;;;AFMhF,IAAM,gCAAgCC,GAAE,OAAO;AAAA,EACpD,WAAWA,GAAE,MAAM,UAAU;AAAA,EAC7B,gBAAgBA,GAAE,MAAM,OAAO;AAAA,EAC/B,iBAAiBA,GAAE,MAAM,SAAS;AAAA,EAClC,iBAAiBA,GAAE,MAAM,QAAQ,SAAS,CAAC;AAC7C,CAAC;AAIM,IAAM,sBAAsBA,GAAE,OAAO;AAAA,EAC1C,cAAc,WAAW,SAAS;AAAA,EAClC,cAAc,QAAQ,SAAS;AACjC,CAAC,EAAE,OAAO,kBAAkB,KAAK;AAI1B,IAAM,kBAAkB,WAC5B,WAAW,EAAE,QAAQA,GAAE,QAAQ,kBAAkB,EAAE,CAAC,EACpD,WAAW,8BAA8B,KAAK,EAC9C,WAAW,oBAAoB,KAAK;AAKhC,IAAM,iBAAiB,aAAa,eAAe;AACnD,IAAM,iBAAiB,aAAa,iBAAiB,gBAAgB;AACrE,IAAM,iBAAiB,aAAa,iBAAiB,gBAAgB;AAErE,IAAM,qBAAqB,gBAAgB,MAAM;;;AGpCjD,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;ACjBA,SAAS,cAAAC,mBAAkB;AAC3B,OAAOC,QAAO;;;ACIP,IAAM,wBAAwB,gBAAgB,OAAO,wBAAwB,KAAK;AAGlF,IAAM,2BAA2B,sBAAsB,MAAM;;;ACH7D,IAAM,0BAA0B,gBAAgB,OAAO,0BAA0B,KAAK;AAGtF,IAAM,6BAA6B,wBAAwB,MAAM;;;AFDjE,SAAS,+BAAkE,OAAU;AAC1F,SAAOC,GAAE,MAAM,CAAC,OAAOA,GAAE,MAAMC,YAAW,MAAM,CAAC,CAAC,CAAC;AACrD;AAEO,IAAM,0BAA0B,+BAA+B,eAAe;AAG9E,IAAM,gCAAgC,+BAA+B,qBAAqB;AAG1F,IAAM,kCAAkC,+BAA+B,uBAAuB;;;AGfrG,SAAS,qBAAqB;AAavB,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,qCAAqC,CAAC,MAAyD,oBAAoB,CAAC,KAAK,cAAc,CAAC;","names":["z","z","PayloadZod","z","z","PayloadZod"]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { Hash } from '@xylabs/sdk-js';
|
|
2
2
|
import type { WithStorageMeta } from '@xyo-network/payload-model';
|
|
3
3
|
import { type BoundWitness } from './BoundWitness/index.ts';
|
|
4
|
-
export
|
|
4
|
+
export interface QueryBoundWitnessFields {
|
|
5
5
|
error_hashes?: Hash[];
|
|
6
6
|
query: Hash;
|
|
7
|
-
}
|
|
7
|
+
}
|
|
8
8
|
export type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields;
|
|
9
9
|
export type QueryBoundWitness = UnsignedQueryBoundWitness;
|
|
10
10
|
export declare const isQueryBoundWitness: (x?: unknown) => x is QueryBoundWitness;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueryBoundWitness.d.ts","sourceRoot":"","sources":["../../src/QueryBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,yBAAyB,CAAA;AAE3E,MAAM,
|
|
1
|
+
{"version":3,"file":"QueryBoundWitness.d.ts","sourceRoot":"","sources":["../../src/QueryBoundWitness.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,gBAAgB,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,EAAE,KAAK,YAAY,EAAkB,MAAM,yBAAyB,CAAA;AAE3E,MAAM,WAAW,uBAAuB;IACtC,YAAY,CAAC,EAAE,IAAI,EAAE,CAAA;IACrB,KAAK,EAAE,IAAI,CAAA;CACZ;AAED,MAAM,MAAM,yBAAyB,GAAG,YAAY,GAAG,uBAAuB,CAAA;AAE9E,MAAM,MAAM,iBAAiB,GAAG,yBAAyB,CAAA;AAEzD,eAAO,MAAM,mBAAmB,GAAI,IAAI,OAAO,KAAG,CAAC,IAAI,iBAAuF,CAAA;AAC9I,eAAO,MAAM,kCAAkC,GAAI,IAAI,OAAO,KAAG,CAAC,IAAI,eAAe,CAAC,iBAAiB,CAA+C,CAAA"}
|
package/dist/node/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/HydratedBoundWitness.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import {\n AddressZod, HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport type { SignedSignaturesMeta, UnsignedSignaturesMeta } from './Signatures.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n\nexport type Unsigned<T extends BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\n\nexport type Signed<T extends BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\n\nexport type PossiblySigned<T extends BoundWitness> = Unsigned<T> | Signed<T>\n","import { asSchema } from '@xyo-network/payload-model'\n\nexport const BoundWitnessSchema = asSchema('network.xyo.boundwitness', true)\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import { PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { type BoundWitness, BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedBoundWitnessZod } from './SignedBoundWitness.ts'\nimport { UnsignedBoundWitnessZod } from './UnsignedBoundWitness.ts'\n\nexport function HydratedBoundWitnessZodBuilder<T extends z.ZodType<BoundWitness>>(bwZod: T) {\n return z.tuple([bwZod, z.array(PayloadZod.loose())])\n}\n\nexport const HydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(BoundWitnessZod)\n// export type HydratedBoundWitness = z.infer<typeof HydratedBoundWitnessZod>\n\nexport const SignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(SignedBoundWitnessZod)\n// export type SignedHydratedBoundWitness = z.infer<typeof SignedHydratedBoundWitnessZod>\n\nexport const UnsignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(UnsignedBoundWitnessZod)\n// export type UnsignedHydratedBoundWitness = z.infer<typeof UnsignedHydratedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport
|
|
1
|
+
{"version":3,"sources":["../../src/BoundWitness/BoundWitness.ts","../../src/BoundWitness/BoundWitnessSchema.ts","../../src/BoundWitness/Signatures.ts","../../src/BoundWitness/BoundWitnessJsonSchema.ts","../../src/BoundWitness/HydratedBoundWitness.ts","../../src/BoundWitness/SignedBoundWitness.ts","../../src/BoundWitness/UnsignedBoundWitness.ts","../../src/QueryBoundWitness.ts"],"sourcesContent":["import {\n AddressZod, HashZod,\n zodAsFactory, zodIsFactory, zodToFactory,\n} from '@xylabs/sdk-js'\nimport { PayloadZod, SchemaZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { BoundWitnessSchema } from './BoundWitnessSchema.ts'\nimport type { SignedSignaturesMeta, UnsignedSignaturesMeta } from './Signatures.ts'\nimport { SignaturesMetaZod } from './Signatures.ts'\n\nexport const BoundWitnessRequiredFieldsZod = z.object({\n addresses: z.array(AddressZod),\n payload_hashes: z.array(HashZod),\n payload_schemas: z.array(SchemaZod),\n previous_hashes: z.array(HashZod.nullable()),\n})\n\nexport type BoundWitnessRequiredFields = z.infer<typeof BoundWitnessRequiredFieldsZod>\n\nexport const BoundWitnessMetaZod = z.object({\n $destination: AddressZod.optional(),\n $sourceQuery: HashZod.optional(),\n}).extend(SignaturesMetaZod.shape)\n\nexport type BoundWitnessMeta = z.infer<typeof BoundWitnessMetaZod>\n\nexport const BoundWitnessZod = PayloadZod\n .safeExtend({ schema: z.literal(BoundWitnessSchema) })\n .safeExtend(BoundWitnessRequiredFieldsZod.shape)\n .safeExtend(BoundWitnessMetaZod.shape)\n // .refine(data => data.$signatures.length === data.addresses.length, { message: '$signatures length must equal addresses length' })\n\nexport type BoundWitness = z.infer<typeof BoundWitnessZod>\n\nexport const isBoundWitness = zodIsFactory(BoundWitnessZod)\nexport const asBoundWitness = zodAsFactory(BoundWitnessZod, 'asBoundWitness')\nexport const toBoundWitness = zodToFactory(BoundWitnessZod, 'toBoundWitness')\n\nexport const AnyBoundWitnessZod = BoundWitnessZod.loose()\nexport type AnyBoundWitness = z.infer<typeof AnyBoundWitnessZod>\n\nexport type Unsigned<T extends BoundWitness> = Omit<T, '$signatures'> & UnsignedSignaturesMeta\n\nexport type Signed<T extends BoundWitness> = Omit<T, '$signatures'> & SignedSignaturesMeta\n\nexport type PossiblySigned<T extends BoundWitness> = Unsigned<T> | Signed<T>\n","import { asSchema } from '@xyo-network/payload-model'\n\nexport const BoundWitnessSchema = asSchema('network.xyo.boundwitness', true)\nexport type BoundWitnessSchema = typeof BoundWitnessSchema\n","import { HexZod } from '@xylabs/sdk-js'\nimport z from 'zod'\n\nexport const SignaturesMetaZod = z.object({ $signatures: z.array(z.union([HexZod, z.null()])) })\nexport const UnsignedSignaturesMetaZod = z.object({ $signatures: z.array(z.null()) })\nexport const SignedSignaturesMetaZod = z.object({ $signatures: z.array(HexZod).min(1) })\n\nexport type SignaturesMeta = z.infer<typeof SignaturesMetaZod>\nexport type UnsignedSignaturesMeta = z.infer<typeof UnsignedSignaturesMetaZod>\nexport type SignedSignaturesMeta = z.infer<typeof SignedSignaturesMetaZod>\n","// Should type as JSONSchemaType<BoundWitness> once ajv/eslint issue is fixed\n// https://github.com/microsoft/TypeScript/issues/44851\n\nexport const BoundWitnessJsonSchema = () => {\n return {\n $id: 'https://schemas.xyo.network/2.0/boundwitness',\n additionalProperties: false,\n properties: {\n addresses: { items: { type: 'string' }, type: 'array' },\n payload_hashes: { items: { type: 'string' }, type: 'array' },\n payload_schemas: { items: { type: 'string' }, type: 'array' },\n previous_hashes: { items: { nullable: true, type: 'string' }, type: 'array' },\n schema: { type: 'string' },\n },\n required: ['addresses', 'payload_hashes', 'payload_schemas', 'previous_hashes', 'schema'],\n type: 'object',\n }\n}\n","import { PayloadZod } from '@xyo-network/payload-model'\nimport z from 'zod'\n\nimport { type BoundWitness, BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedBoundWitnessZod } from './SignedBoundWitness.ts'\nimport { UnsignedBoundWitnessZod } from './UnsignedBoundWitness.ts'\n\nexport function HydratedBoundWitnessZodBuilder<T extends z.ZodType<BoundWitness>>(bwZod: T) {\n return z.tuple([bwZod, z.array(PayloadZod.loose())])\n}\n\nexport const HydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(BoundWitnessZod)\n// export type HydratedBoundWitness = z.infer<typeof HydratedBoundWitnessZod>\n\nexport const SignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(SignedBoundWitnessZod)\n// export type SignedHydratedBoundWitness = z.infer<typeof SignedHydratedBoundWitnessZod>\n\nexport const UnsignedHydratedBoundWitnessZod = HydratedBoundWitnessZodBuilder(UnsignedBoundWitnessZod)\n// export type UnsignedHydratedBoundWitness = z.infer<typeof UnsignedHydratedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { SignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const SignedBoundWitnessZod = BoundWitnessZod.extend(SignedSignaturesMetaZod.shape)\nexport type SignedBoundWitness = z.infer<typeof SignedBoundWitnessZod>\n\nexport const AnySignedBoundWitnessZod = SignedBoundWitnessZod.loose()\nexport type AnySignedBoundWitness = z.infer<typeof AnySignedBoundWitnessZod>\n","import type z from 'zod'\n\nimport { BoundWitnessZod } from './BoundWitness.ts'\nimport { UnsignedSignaturesMetaZod } from './Signatures.ts'\n\nexport const UnsignedBoundWitnessZod = BoundWitnessZod.extend(UnsignedSignaturesMetaZod.shape)\nexport type UnsignedBoundWitness = z.infer<typeof UnsignedBoundWitnessZod>\n\nexport const AnyUnsignedBoundWitnessZod = UnsignedBoundWitnessZod.loose()\nexport type AnyUnsignedBoundWitness = z.infer<typeof AnyUnsignedBoundWitnessZod>\n","import type { Hash } from '@xylabs/sdk-js'\nimport type { WithStorageMeta } from '@xyo-network/payload-model'\nimport { isStorageMeta } from '@xyo-network/payload-model'\n\nimport { type BoundWitness, isBoundWitness } from './BoundWitness/index.ts'\n\nexport interface QueryBoundWitnessFields {\n error_hashes?: Hash[]\n query: Hash\n}\n\nexport type UnsignedQueryBoundWitness = BoundWitness & QueryBoundWitnessFields\n\nexport type QueryBoundWitness = UnsignedQueryBoundWitness\n\nexport const isQueryBoundWitness = (x?: unknown): x is QueryBoundWitness => isBoundWitness(x) && (x as QueryBoundWitness)?.query !== undefined\nexport const isQueryBoundWitnessWithStorageMeta = (x?: unknown): x is WithStorageMeta<QueryBoundWitness> => isQueryBoundWitness(x) && isStorageMeta(x)\n"],"mappings":";AAAA;AAAA,EACE;AAAA,EAAY;AAAA,EACZ;AAAA,EAAc;AAAA,EAAc;AAAA,OACvB;AACP,SAAS,YAAY,iBAAiB;AACtC,OAAOA,QAAO;;;ACLd,SAAS,gBAAgB;AAElB,IAAM,qBAAqB,SAAS,4BAA4B,IAAI;;;ACF3E,SAAS,cAAc;AACvB,OAAO,OAAO;AAEP,IAAM,oBAAoB,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AACxF,IAAM,4BAA4B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,CAAC;AAC7E,IAAM,0BAA0B,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,MAAM,EAAE,IAAI,CAAC,EAAE,CAAC;;;AFMhF,IAAM,gCAAgCC,GAAE,OAAO;AAAA,EACpD,WAAWA,GAAE,MAAM,UAAU;AAAA,EAC7B,gBAAgBA,GAAE,MAAM,OAAO;AAAA,EAC/B,iBAAiBA,GAAE,MAAM,SAAS;AAAA,EAClC,iBAAiBA,GAAE,MAAM,QAAQ,SAAS,CAAC;AAC7C,CAAC;AAIM,IAAM,sBAAsBA,GAAE,OAAO;AAAA,EAC1C,cAAc,WAAW,SAAS;AAAA,EAClC,cAAc,QAAQ,SAAS;AACjC,CAAC,EAAE,OAAO,kBAAkB,KAAK;AAI1B,IAAM,kBAAkB,WAC5B,WAAW,EAAE,QAAQA,GAAE,QAAQ,kBAAkB,EAAE,CAAC,EACpD,WAAW,8BAA8B,KAAK,EAC9C,WAAW,oBAAoB,KAAK;AAKhC,IAAM,iBAAiB,aAAa,eAAe;AACnD,IAAM,iBAAiB,aAAa,iBAAiB,gBAAgB;AACrE,IAAM,iBAAiB,aAAa,iBAAiB,gBAAgB;AAErE,IAAM,qBAAqB,gBAAgB,MAAM;;;AGpCjD,IAAM,yBAAyB,MAAM;AAC1C,SAAO;AAAA,IACL,KAAK;AAAA,IACL,sBAAsB;AAAA,IACtB,YAAY;AAAA,MACV,WAAW,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MACtD,gBAAgB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC3D,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5D,iBAAiB,EAAE,OAAO,EAAE,UAAU,MAAM,MAAM,SAAS,GAAG,MAAM,QAAQ;AAAA,MAC5E,QAAQ,EAAE,MAAM,SAAS;AAAA,IAC3B;AAAA,IACA,UAAU,CAAC,aAAa,kBAAkB,mBAAmB,mBAAmB,QAAQ;AAAA,IACxF,MAAM;AAAA,EACR;AACF;;;ACjBA,SAAS,cAAAC,mBAAkB;AAC3B,OAAOC,QAAO;;;ACIP,IAAM,wBAAwB,gBAAgB,OAAO,wBAAwB,KAAK;AAGlF,IAAM,2BAA2B,sBAAsB,MAAM;;;ACH7D,IAAM,0BAA0B,gBAAgB,OAAO,0BAA0B,KAAK;AAGtF,IAAM,6BAA6B,wBAAwB,MAAM;;;AFDjE,SAAS,+BAAkE,OAAU;AAC1F,SAAOC,GAAE,MAAM,CAAC,OAAOA,GAAE,MAAMC,YAAW,MAAM,CAAC,CAAC,CAAC;AACrD;AAEO,IAAM,0BAA0B,+BAA+B,eAAe;AAG9E,IAAM,gCAAgC,+BAA+B,qBAAqB;AAG1F,IAAM,kCAAkC,+BAA+B,uBAAuB;;;AGfrG,SAAS,qBAAqB;AAavB,IAAM,sBAAsB,CAAC,MAAwC,eAAe,CAAC,KAAM,GAAyB,UAAU;AAC9H,IAAM,qCAAqC,CAAC,MAAyD,oBAAoB,CAAC,KAAK,cAAc,CAAC;","names":["z","z","PayloadZod","z","z","PayloadZod"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/boundwitness-model",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.4.0",
|
|
4
4
|
"description": "Primary SDK for using XYO Protocol 2.0",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -22,12 +22,10 @@
|
|
|
22
22
|
"exports": {
|
|
23
23
|
".": {
|
|
24
24
|
"types": "./dist/neutral/index.d.ts",
|
|
25
|
-
"import": "./dist/neutral/index.mjs",
|
|
26
25
|
"default": "./dist/neutral/index.mjs"
|
|
27
26
|
},
|
|
28
27
|
"./package.json": "./package.json"
|
|
29
28
|
},
|
|
30
|
-
"types": "dist/neutral/index.d.ts",
|
|
31
29
|
"files": [
|
|
32
30
|
"dist",
|
|
33
31
|
"!**/*.bench.*",
|
|
@@ -37,24 +35,22 @@
|
|
|
37
35
|
],
|
|
38
36
|
"devDependencies": {
|
|
39
37
|
"@opentelemetry/api": "^1.9.1",
|
|
40
|
-
"@types/node": "^25.
|
|
41
|
-
"@xylabs/sdk-js": "^5.0.
|
|
42
|
-
"@xylabs/
|
|
43
|
-
"@xylabs/
|
|
44
|
-
"@xylabs/tsconfig": "~7.8.7",
|
|
45
|
-
"axios": "^1.14.0",
|
|
38
|
+
"@types/node": "^25.6.0",
|
|
39
|
+
"@xylabs/sdk-js": "^5.0.97",
|
|
40
|
+
"@xylabs/toolchain": "~7.10.8",
|
|
41
|
+
"@xylabs/tsconfig": "~7.10.8",
|
|
46
42
|
"esbuild": "^0.28.0",
|
|
47
43
|
"pako": "~2.1.0",
|
|
48
44
|
"typescript": "~5.9.3",
|
|
49
|
-
"vite": "^8.0.
|
|
50
|
-
"vitest": "~4.1.
|
|
45
|
+
"vite": "^8.0.8",
|
|
46
|
+
"vitest": "~4.1.4",
|
|
51
47
|
"zod": "~4.3.6",
|
|
52
|
-
"@xyo-network/payload-model": "~5.
|
|
48
|
+
"@xyo-network/payload-model": "~5.4.0"
|
|
53
49
|
},
|
|
54
50
|
"peerDependencies": {
|
|
55
|
-
"@xylabs/sdk-js": "^5",
|
|
56
|
-
"
|
|
57
|
-
"
|
|
51
|
+
"@xylabs/sdk-js": "^5.0.97",
|
|
52
|
+
"@xyo-network/payload-model": "~5.4",
|
|
53
|
+
"zod": "^4"
|
|
58
54
|
},
|
|
59
55
|
"publishConfig": {
|
|
60
56
|
"access": "public"
|