@spacesprotocol/libveritas 0.0.0-dev.20260331155020 → 0.0.0-dev.20260401231450
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/libveritas.d.ts +74 -22
- package/libveritas.js +197 -67
- package/libveritas_bg.wasm +0 -0
- package/package.json +1 -1
package/libveritas.d.ts
CHANGED
|
@@ -40,18 +40,19 @@ export class Message {
|
|
|
40
40
|
free(): void;
|
|
41
41
|
[Symbol.dispose](): void;
|
|
42
42
|
/**
|
|
43
|
-
* Decode a message from
|
|
43
|
+
* Decode a message from bytes.
|
|
44
44
|
*/
|
|
45
45
|
constructor(bytes: Uint8Array);
|
|
46
46
|
/**
|
|
47
|
-
* Set
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
* Set delegate records on the message for a canonical name.
|
|
48
|
+
*/
|
|
49
|
+
setDelegateRecords(canonical: string, records_bytes: Uint8Array): void;
|
|
50
|
+
/**
|
|
51
|
+
* Set records on the message for a canonical name.
|
|
51
52
|
*/
|
|
52
|
-
|
|
53
|
+
setRecords(canonical: string, records_bytes: Uint8Array): void;
|
|
53
54
|
/**
|
|
54
|
-
* Serialize the message to
|
|
55
|
+
* Serialize the message to bytes.
|
|
55
56
|
*/
|
|
56
57
|
toBytes(): Uint8Array;
|
|
57
58
|
/**
|
|
@@ -87,23 +88,20 @@ export class MessageBuilder {
|
|
|
87
88
|
/**
|
|
88
89
|
* Add a .spacecert chain with records (sip7 wire bytes).
|
|
89
90
|
*/
|
|
90
|
-
addHandle(chain_bytes: Uint8Array, records_bytes: Uint8Array
|
|
91
|
+
addHandle(chain_bytes: Uint8Array, records_bytes: Uint8Array): void;
|
|
91
92
|
/**
|
|
92
93
|
* Add records for a handle (sip7 wire bytes).
|
|
93
94
|
*/
|
|
94
|
-
addRecords(handle: string, records_bytes: Uint8Array
|
|
95
|
+
addRecords(handle: string, records_bytes: Uint8Array): void;
|
|
95
96
|
/**
|
|
96
97
|
* Add a full data update (records + optional delegate records).
|
|
97
98
|
*/
|
|
98
99
|
addUpdate(entry: any): void;
|
|
99
100
|
/**
|
|
100
|
-
* Build the message from a
|
|
101
|
+
* Build the message from a ChainProof.
|
|
101
102
|
*
|
|
102
103
|
* Consumes the builder — cannot be called twice.
|
|
103
|
-
*
|
|
104
|
-
* Returns `{ message, unsigned }` where `unsigned` is an array of
|
|
105
|
-
* `{ handle, signer, signingId }` for each record set that needs signing.
|
|
106
|
-
* After signing, call `message.setSignature(signer, sig)` for each.
|
|
104
|
+
* Returns `{ message, unsigned }` with unsigned record sets that need signing.
|
|
107
105
|
*/
|
|
108
106
|
build(chain_proof: Uint8Array): any;
|
|
109
107
|
/**
|
|
@@ -157,7 +155,7 @@ export class Record {
|
|
|
157
155
|
static addr(key: string, value: any): any;
|
|
158
156
|
static blob(key: string, value: Uint8Array): any;
|
|
159
157
|
static seq(version: bigint): any;
|
|
160
|
-
static sig(
|
|
158
|
+
static sig(canonical: string, handle: string, flags: number, sig: Uint8Array): any;
|
|
161
159
|
static txt(key: string, value: any): any;
|
|
162
160
|
static unknown(rtype: number, rdata: Uint8Array): any;
|
|
163
161
|
}
|
|
@@ -201,6 +199,49 @@ export class RecordSet {
|
|
|
201
199
|
unpack(): any;
|
|
202
200
|
}
|
|
203
201
|
|
|
202
|
+
export function SIG_PRIMARY_ZONE(): number;
|
|
203
|
+
|
|
204
|
+
/**
|
|
205
|
+
* An unsigned record set pending signature.
|
|
206
|
+
*/
|
|
207
|
+
export class UnsignedRecordSet {
|
|
208
|
+
private constructor();
|
|
209
|
+
free(): void;
|
|
210
|
+
[Symbol.dispose](): void;
|
|
211
|
+
/**
|
|
212
|
+
* The canonical/flattened name.
|
|
213
|
+
*/
|
|
214
|
+
canonical(): string;
|
|
215
|
+
/**
|
|
216
|
+
* Current sig flags.
|
|
217
|
+
*/
|
|
218
|
+
flags(): number;
|
|
219
|
+
/**
|
|
220
|
+
* The original handle name (before flattening).
|
|
221
|
+
*/
|
|
222
|
+
handle(): string;
|
|
223
|
+
/**
|
|
224
|
+
* Whether these are delegate records.
|
|
225
|
+
*/
|
|
226
|
+
isDelegate(): boolean;
|
|
227
|
+
/**
|
|
228
|
+
* Pack the Sig record with the given signature. Returns signed RecordSet wire bytes.
|
|
229
|
+
*/
|
|
230
|
+
packSig(signature: Uint8Array): Uint8Array;
|
|
231
|
+
/**
|
|
232
|
+
* Set sig flags (e.g. `SIG_PRIMARY_ZONE`).
|
|
233
|
+
*/
|
|
234
|
+
setFlags(flags: number): void;
|
|
235
|
+
/**
|
|
236
|
+
* The raw signable bytes (before hashing). Use when the signer doesn't take a digest.
|
|
237
|
+
*/
|
|
238
|
+
signableBytes(): Uint8Array;
|
|
239
|
+
/**
|
|
240
|
+
* The 32-byte signing hash (Spaces signed-message prefix + SHA256).
|
|
241
|
+
*/
|
|
242
|
+
signingId(): Uint8Array;
|
|
243
|
+
}
|
|
244
|
+
|
|
204
245
|
export function VERIFY_DEFAULT(): number;
|
|
205
246
|
|
|
206
247
|
export function VERIFY_DEV_MODE(): number;
|
|
@@ -223,7 +264,7 @@ export class VerifiedMessage {
|
|
|
223
264
|
*/
|
|
224
265
|
message(): Message;
|
|
225
266
|
/**
|
|
226
|
-
* Get the verified message as
|
|
267
|
+
* Get the verified message as bytes.
|
|
227
268
|
*/
|
|
228
269
|
messageBytes(): Uint8Array;
|
|
229
270
|
/**
|
|
@@ -294,7 +335,7 @@ export function verifySpacesMessage(msg: Uint8Array, signature: Uint8Array, pubk
|
|
|
294
335
|
export function zoneIsBetterThan(a: any, b: any): boolean;
|
|
295
336
|
|
|
296
337
|
/**
|
|
297
|
-
* Serialize a zone JS object to
|
|
338
|
+
* Serialize a zone JS object to bytes for storage.
|
|
298
339
|
*/
|
|
299
340
|
export function zoneToBytes(zone: any): Uint8Array;
|
|
300
341
|
|
|
@@ -302,8 +343,8 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
302
343
|
|
|
303
344
|
export interface InitOutput {
|
|
304
345
|
readonly memory: WebAssembly.Memory;
|
|
346
|
+
readonly SIG_PRIMARY_ZONE: () => number;
|
|
305
347
|
readonly VERIFY_DEFAULT: () => number;
|
|
306
|
-
readonly VERIFY_DEV_MODE: () => number;
|
|
307
348
|
readonly VERIFY_ENABLE_SNARK: () => number;
|
|
308
349
|
readonly __wbg_anchors_free: (a: number, b: number) => void;
|
|
309
350
|
readonly __wbg_lookup_free: (a: number, b: number) => void;
|
|
@@ -312,6 +353,7 @@ export interface InitOutput {
|
|
|
312
353
|
readonly __wbg_querycontext_free: (a: number, b: number) => void;
|
|
313
354
|
readonly __wbg_record_free: (a: number, b: number) => void;
|
|
314
355
|
readonly __wbg_recordset_free: (a: number, b: number) => void;
|
|
356
|
+
readonly __wbg_unsignedrecordset_free: (a: number, b: number) => void;
|
|
315
357
|
readonly __wbg_verifiedmessage_free: (a: number, b: number) => void;
|
|
316
358
|
readonly __wbg_veritas_free: (a: number, b: number) => void;
|
|
317
359
|
readonly anchors_computeTrustSet: (a: number) => [number, number, number];
|
|
@@ -325,13 +367,14 @@ export interface InitOutput {
|
|
|
325
367
|
readonly lookup_new: (a: number, b: number) => [number, number, number];
|
|
326
368
|
readonly lookup_start: (a: number) => [number, number];
|
|
327
369
|
readonly message_from_bytes: (a: number, b: number) => [number, number, number];
|
|
328
|
-
readonly
|
|
370
|
+
readonly message_setDelegateRecords: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
371
|
+
readonly message_setRecords: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
329
372
|
readonly message_toBytes: (a: number) => [number, number];
|
|
330
373
|
readonly message_update: (a: number, b: any) => [number, number];
|
|
331
374
|
readonly messagebuilder_addCert: (a: number, b: number, c: number) => [number, number];
|
|
332
375
|
readonly messagebuilder_addChain: (a: number, b: number, c: number) => [number, number];
|
|
333
|
-
readonly messagebuilder_addHandle: (a: number, b: number, c: number, d: number, e: number
|
|
334
|
-
readonly messagebuilder_addRecords: (a: number, b: number, c: number, d: number, e: number
|
|
376
|
+
readonly messagebuilder_addHandle: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
377
|
+
readonly messagebuilder_addRecords: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
335
378
|
readonly messagebuilder_addUpdate: (a: number, b: any) => [number, number];
|
|
336
379
|
readonly messagebuilder_build: (a: number, b: number, c: number) => [number, number, number];
|
|
337
380
|
readonly messagebuilder_chainProofRequest: (a: number) => [number, number, number];
|
|
@@ -342,7 +385,7 @@ export interface InitOutput {
|
|
|
342
385
|
readonly record_addr: (a: number, b: number, c: any) => any;
|
|
343
386
|
readonly record_blob: (a: number, b: number, c: number, d: number) => any;
|
|
344
387
|
readonly record_seq: (a: bigint) => any;
|
|
345
|
-
readonly record_sig: (a: number, b: number, c: number, d: number, e: number, f: number) => any;
|
|
388
|
+
readonly record_sig: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => any;
|
|
346
389
|
readonly record_txt: (a: number, b: number, c: any) => any;
|
|
347
390
|
readonly record_unknown: (a: number, b: number, c: number) => any;
|
|
348
391
|
readonly recordset_isEmpty: (a: number) => number;
|
|
@@ -351,6 +394,14 @@ export interface InitOutput {
|
|
|
351
394
|
readonly recordset_signingId: (a: number) => [number, number];
|
|
352
395
|
readonly recordset_toBytes: (a: number) => [number, number];
|
|
353
396
|
readonly recordset_unpack: (a: number) => [number, number, number];
|
|
397
|
+
readonly unsignedrecordset_canonical: (a: number) => [number, number];
|
|
398
|
+
readonly unsignedrecordset_flags: (a: number) => number;
|
|
399
|
+
readonly unsignedrecordset_handle: (a: number) => [number, number];
|
|
400
|
+
readonly unsignedrecordset_isDelegate: (a: number) => number;
|
|
401
|
+
readonly unsignedrecordset_packSig: (a: number, b: number, c: number) => [number, number];
|
|
402
|
+
readonly unsignedrecordset_setFlags: (a: number, b: number) => void;
|
|
403
|
+
readonly unsignedrecordset_signableBytes: (a: number) => [number, number];
|
|
404
|
+
readonly unsignedrecordset_signingId: (a: number) => [number, number];
|
|
354
405
|
readonly verifiedmessage_certificates: (a: number) => [number, number];
|
|
355
406
|
readonly verifiedmessage_message: (a: number) => number;
|
|
356
407
|
readonly verifiedmessage_messageBytes: (a: number) => [number, number];
|
|
@@ -413,6 +464,7 @@ export interface InitOutput {
|
|
|
413
464
|
readonly rustsecp256k1_v0_10_0_context_destroy: (a: number) => void;
|
|
414
465
|
readonly rustsecp256k1_v0_10_0_default_error_callback_fn: (a: number, b: number) => void;
|
|
415
466
|
readonly rustsecp256k1_v0_10_0_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
467
|
+
readonly VERIFY_DEV_MODE: () => number;
|
|
416
468
|
readonly sys_panic: (a: number, b: number) => void;
|
|
417
469
|
readonly sys_verify_integrity2: (a: number, b: number) => void;
|
|
418
470
|
readonly sys_read_words: (a: number, b: number, c: number) => number;
|
package/libveritas.js
CHANGED
|
@@ -129,7 +129,7 @@ export class Message {
|
|
|
129
129
|
wasm.__wbg_message_free(ptr, 0);
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
|
-
* Decode a message from
|
|
132
|
+
* Decode a message from bytes.
|
|
133
133
|
* @param {Uint8Array} bytes
|
|
134
134
|
*/
|
|
135
135
|
constructor(bytes) {
|
|
@@ -144,25 +144,37 @@ export class Message {
|
|
|
144
144
|
return this;
|
|
145
145
|
}
|
|
146
146
|
/**
|
|
147
|
-
* Set
|
|
148
|
-
*
|
|
149
|
-
*
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
147
|
+
* Set delegate records on the message for a canonical name.
|
|
148
|
+
* @param {string} canonical
|
|
149
|
+
* @param {Uint8Array} records_bytes
|
|
150
|
+
*/
|
|
151
|
+
setDelegateRecords(canonical, records_bytes) {
|
|
152
|
+
const ptr0 = passStringToWasm0(canonical, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
153
|
+
const len0 = WASM_VECTOR_LEN;
|
|
154
|
+
const ptr1 = passArray8ToWasm0(records_bytes, wasm.__wbindgen_malloc);
|
|
155
|
+
const len1 = WASM_VECTOR_LEN;
|
|
156
|
+
const ret = wasm.message_setDelegateRecords(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
157
|
+
if (ret[1]) {
|
|
158
|
+
throw takeFromExternrefTable0(ret[0]);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Set records on the message for a canonical name.
|
|
163
|
+
* @param {string} canonical
|
|
164
|
+
* @param {Uint8Array} records_bytes
|
|
153
165
|
*/
|
|
154
|
-
|
|
155
|
-
const ptr0 = passStringToWasm0(
|
|
166
|
+
setRecords(canonical, records_bytes) {
|
|
167
|
+
const ptr0 = passStringToWasm0(canonical, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
156
168
|
const len0 = WASM_VECTOR_LEN;
|
|
157
|
-
const ptr1 = passArray8ToWasm0(
|
|
169
|
+
const ptr1 = passArray8ToWasm0(records_bytes, wasm.__wbindgen_malloc);
|
|
158
170
|
const len1 = WASM_VECTOR_LEN;
|
|
159
|
-
const ret = wasm.
|
|
171
|
+
const ret = wasm.message_setRecords(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
160
172
|
if (ret[1]) {
|
|
161
173
|
throw takeFromExternrefTable0(ret[0]);
|
|
162
174
|
}
|
|
163
175
|
}
|
|
164
176
|
/**
|
|
165
|
-
* Serialize the message to
|
|
177
|
+
* Serialize the message to bytes.
|
|
166
178
|
* @returns {Uint8Array}
|
|
167
179
|
*/
|
|
168
180
|
toBytes() {
|
|
@@ -236,14 +248,13 @@ export class MessageBuilder {
|
|
|
236
248
|
* Add a .spacecert chain with records (sip7 wire bytes).
|
|
237
249
|
* @param {Uint8Array} chain_bytes
|
|
238
250
|
* @param {Uint8Array} records_bytes
|
|
239
|
-
* @param {boolean} rev
|
|
240
251
|
*/
|
|
241
|
-
addHandle(chain_bytes, records_bytes
|
|
252
|
+
addHandle(chain_bytes, records_bytes) {
|
|
242
253
|
const ptr0 = passArray8ToWasm0(chain_bytes, wasm.__wbindgen_malloc);
|
|
243
254
|
const len0 = WASM_VECTOR_LEN;
|
|
244
255
|
const ptr1 = passArray8ToWasm0(records_bytes, wasm.__wbindgen_malloc);
|
|
245
256
|
const len1 = WASM_VECTOR_LEN;
|
|
246
|
-
const ret = wasm.messagebuilder_addHandle(this.__wbg_ptr, ptr0, len0, ptr1, len1
|
|
257
|
+
const ret = wasm.messagebuilder_addHandle(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
247
258
|
if (ret[1]) {
|
|
248
259
|
throw takeFromExternrefTable0(ret[0]);
|
|
249
260
|
}
|
|
@@ -252,14 +263,13 @@ export class MessageBuilder {
|
|
|
252
263
|
* Add records for a handle (sip7 wire bytes).
|
|
253
264
|
* @param {string} handle
|
|
254
265
|
* @param {Uint8Array} records_bytes
|
|
255
|
-
* @param {boolean} rev
|
|
256
266
|
*/
|
|
257
|
-
addRecords(handle, records_bytes
|
|
267
|
+
addRecords(handle, records_bytes) {
|
|
258
268
|
const ptr0 = passStringToWasm0(handle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
259
269
|
const len0 = WASM_VECTOR_LEN;
|
|
260
270
|
const ptr1 = passArray8ToWasm0(records_bytes, wasm.__wbindgen_malloc);
|
|
261
271
|
const len1 = WASM_VECTOR_LEN;
|
|
262
|
-
const ret = wasm.messagebuilder_addRecords(this.__wbg_ptr, ptr0, len0, ptr1, len1
|
|
272
|
+
const ret = wasm.messagebuilder_addRecords(this.__wbg_ptr, ptr0, len0, ptr1, len1);
|
|
263
273
|
if (ret[1]) {
|
|
264
274
|
throw takeFromExternrefTable0(ret[0]);
|
|
265
275
|
}
|
|
@@ -275,13 +285,10 @@ export class MessageBuilder {
|
|
|
275
285
|
}
|
|
276
286
|
}
|
|
277
287
|
/**
|
|
278
|
-
* Build the message from a
|
|
288
|
+
* Build the message from a ChainProof.
|
|
279
289
|
*
|
|
280
290
|
* Consumes the builder — cannot be called twice.
|
|
281
|
-
*
|
|
282
|
-
* Returns `{ message, unsigned }` where `unsigned` is an array of
|
|
283
|
-
* `{ handle, signer, signingId }` for each record set that needs signing.
|
|
284
|
-
* After signing, call `message.setSignature(signer, sig)` for each.
|
|
291
|
+
* Returns `{ message, unsigned }` with unsigned record sets that need signing.
|
|
285
292
|
* @param {Uint8Array} chain_proof
|
|
286
293
|
* @returns {any}
|
|
287
294
|
*/
|
|
@@ -425,19 +432,20 @@ export class Record {
|
|
|
425
432
|
return ret;
|
|
426
433
|
}
|
|
427
434
|
/**
|
|
428
|
-
* @param {string}
|
|
429
|
-
* @param {string}
|
|
435
|
+
* @param {string} canonical
|
|
436
|
+
* @param {string} handle
|
|
437
|
+
* @param {number} flags
|
|
430
438
|
* @param {Uint8Array} sig
|
|
431
439
|
* @returns {any}
|
|
432
440
|
*/
|
|
433
|
-
static sig(
|
|
434
|
-
const ptr0 = passStringToWasm0(
|
|
441
|
+
static sig(canonical, handle, flags, sig) {
|
|
442
|
+
const ptr0 = passStringToWasm0(canonical, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
435
443
|
const len0 = WASM_VECTOR_LEN;
|
|
436
|
-
const ptr1 = passStringToWasm0(
|
|
444
|
+
const ptr1 = passStringToWasm0(handle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
437
445
|
const len1 = WASM_VECTOR_LEN;
|
|
438
446
|
const ptr2 = passArray8ToWasm0(sig, wasm.__wbindgen_malloc);
|
|
439
447
|
const len2 = WASM_VECTOR_LEN;
|
|
440
|
-
const ret = wasm.record_sig(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
448
|
+
const ret = wasm.record_sig(ptr0, len0, ptr1, len1, flags, ptr2, len2);
|
|
441
449
|
return ret;
|
|
442
450
|
}
|
|
443
451
|
/**
|
|
@@ -561,6 +569,126 @@ export class RecordSet {
|
|
|
561
569
|
}
|
|
562
570
|
if (Symbol.dispose) RecordSet.prototype[Symbol.dispose] = RecordSet.prototype.free;
|
|
563
571
|
|
|
572
|
+
/**
|
|
573
|
+
* @returns {number}
|
|
574
|
+
*/
|
|
575
|
+
export function SIG_PRIMARY_ZONE() {
|
|
576
|
+
const ret = wasm.SIG_PRIMARY_ZONE();
|
|
577
|
+
return ret;
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
/**
|
|
581
|
+
* An unsigned record set pending signature.
|
|
582
|
+
*/
|
|
583
|
+
export class UnsignedRecordSet {
|
|
584
|
+
static __wrap(ptr) {
|
|
585
|
+
ptr = ptr >>> 0;
|
|
586
|
+
const obj = Object.create(UnsignedRecordSet.prototype);
|
|
587
|
+
obj.__wbg_ptr = ptr;
|
|
588
|
+
UnsignedRecordSetFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
589
|
+
return obj;
|
|
590
|
+
}
|
|
591
|
+
__destroy_into_raw() {
|
|
592
|
+
const ptr = this.__wbg_ptr;
|
|
593
|
+
this.__wbg_ptr = 0;
|
|
594
|
+
UnsignedRecordSetFinalization.unregister(this);
|
|
595
|
+
return ptr;
|
|
596
|
+
}
|
|
597
|
+
free() {
|
|
598
|
+
const ptr = this.__destroy_into_raw();
|
|
599
|
+
wasm.__wbg_unsignedrecordset_free(ptr, 0);
|
|
600
|
+
}
|
|
601
|
+
/**
|
|
602
|
+
* The canonical/flattened name.
|
|
603
|
+
* @returns {string}
|
|
604
|
+
*/
|
|
605
|
+
canonical() {
|
|
606
|
+
let deferred1_0;
|
|
607
|
+
let deferred1_1;
|
|
608
|
+
try {
|
|
609
|
+
const ret = wasm.unsignedrecordset_canonical(this.__wbg_ptr);
|
|
610
|
+
deferred1_0 = ret[0];
|
|
611
|
+
deferred1_1 = ret[1];
|
|
612
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
613
|
+
} finally {
|
|
614
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
/**
|
|
618
|
+
* Current sig flags.
|
|
619
|
+
* @returns {number}
|
|
620
|
+
*/
|
|
621
|
+
flags() {
|
|
622
|
+
const ret = wasm.unsignedrecordset_flags(this.__wbg_ptr);
|
|
623
|
+
return ret;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* The original handle name (before flattening).
|
|
627
|
+
* @returns {string}
|
|
628
|
+
*/
|
|
629
|
+
handle() {
|
|
630
|
+
let deferred1_0;
|
|
631
|
+
let deferred1_1;
|
|
632
|
+
try {
|
|
633
|
+
const ret = wasm.unsignedrecordset_handle(this.__wbg_ptr);
|
|
634
|
+
deferred1_0 = ret[0];
|
|
635
|
+
deferred1_1 = ret[1];
|
|
636
|
+
return getStringFromWasm0(ret[0], ret[1]);
|
|
637
|
+
} finally {
|
|
638
|
+
wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
/**
|
|
642
|
+
* Whether these are delegate records.
|
|
643
|
+
* @returns {boolean}
|
|
644
|
+
*/
|
|
645
|
+
isDelegate() {
|
|
646
|
+
const ret = wasm.unsignedrecordset_isDelegate(this.__wbg_ptr);
|
|
647
|
+
return ret !== 0;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Pack the Sig record with the given signature. Returns signed RecordSet wire bytes.
|
|
651
|
+
* @param {Uint8Array} signature
|
|
652
|
+
* @returns {Uint8Array}
|
|
653
|
+
*/
|
|
654
|
+
packSig(signature) {
|
|
655
|
+
const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
656
|
+
const len0 = WASM_VECTOR_LEN;
|
|
657
|
+
const ret = wasm.unsignedrecordset_packSig(this.__wbg_ptr, ptr0, len0);
|
|
658
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
659
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
660
|
+
return v2;
|
|
661
|
+
}
|
|
662
|
+
/**
|
|
663
|
+
* Set sig flags (e.g. `SIG_PRIMARY_ZONE`).
|
|
664
|
+
* @param {number} flags
|
|
665
|
+
*/
|
|
666
|
+
setFlags(flags) {
|
|
667
|
+
wasm.unsignedrecordset_setFlags(this.__wbg_ptr, flags);
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* The raw signable bytes (before hashing). Use when the signer doesn't take a digest.
|
|
671
|
+
* @returns {Uint8Array}
|
|
672
|
+
*/
|
|
673
|
+
signableBytes() {
|
|
674
|
+
const ret = wasm.unsignedrecordset_signableBytes(this.__wbg_ptr);
|
|
675
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
676
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
677
|
+
return v1;
|
|
678
|
+
}
|
|
679
|
+
/**
|
|
680
|
+
* The 32-byte signing hash (Spaces signed-message prefix + SHA256).
|
|
681
|
+
* @returns {Uint8Array}
|
|
682
|
+
*/
|
|
683
|
+
signingId() {
|
|
684
|
+
const ret = wasm.unsignedrecordset_signingId(this.__wbg_ptr);
|
|
685
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
686
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
687
|
+
return v1;
|
|
688
|
+
}
|
|
689
|
+
}
|
|
690
|
+
if (Symbol.dispose) UnsignedRecordSet.prototype[Symbol.dispose] = UnsignedRecordSet.prototype.free;
|
|
691
|
+
|
|
564
692
|
/**
|
|
565
693
|
* @returns {number}
|
|
566
694
|
*/
|
|
@@ -625,7 +753,7 @@ export class VerifiedMessage {
|
|
|
625
753
|
return Message.__wrap(ret);
|
|
626
754
|
}
|
|
627
755
|
/**
|
|
628
|
-
* Get the verified message as
|
|
756
|
+
* Get the verified message as bytes.
|
|
629
757
|
* @returns {Uint8Array}
|
|
630
758
|
*/
|
|
631
759
|
messageBytes() {
|
|
@@ -884,7 +1012,7 @@ export function zoneIsBetterThan(a, b) {
|
|
|
884
1012
|
}
|
|
885
1013
|
|
|
886
1014
|
/**
|
|
887
|
-
* Serialize a zone JS object to
|
|
1015
|
+
* Serialize a zone JS object to bytes for storage.
|
|
888
1016
|
* @param {any} zone
|
|
889
1017
|
* @returns {Uint8Array}
|
|
890
1018
|
*/
|
|
@@ -901,55 +1029,50 @@ export function zoneToBytes(zone) {
|
|
|
901
1029
|
function __wbg_get_imports() {
|
|
902
1030
|
const import0 = {
|
|
903
1031
|
__proto__: null,
|
|
904
|
-
|
|
1032
|
+
__wbg_Error_2e59b1b37a9a34c3: function(arg0, arg1) {
|
|
905
1033
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
906
1034
|
return ret;
|
|
907
1035
|
},
|
|
908
|
-
|
|
1036
|
+
__wbg___wbindgen_bigint_get_as_i64_2c5082002e4826e2: function(arg0, arg1) {
|
|
909
1037
|
const v = arg1;
|
|
910
1038
|
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
911
1039
|
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
912
1040
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
913
1041
|
},
|
|
914
|
-
|
|
915
|
-
const v = arg0;
|
|
916
|
-
const ret = typeof(v) === 'boolean' ? v : undefined;
|
|
917
|
-
return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
|
|
918
|
-
},
|
|
919
|
-
__wbg___wbindgen_debug_string_8baecc377ad92880: function(arg0, arg1) {
|
|
1042
|
+
__wbg___wbindgen_debug_string_dd5d2d07ce9e6c57: function(arg0, arg1) {
|
|
920
1043
|
const ret = debugString(arg1);
|
|
921
1044
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
922
1045
|
const len1 = WASM_VECTOR_LEN;
|
|
923
1046
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
924
1047
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
925
1048
|
},
|
|
926
|
-
|
|
1049
|
+
__wbg___wbindgen_is_bigint_6c98f7e945dacdde: function(arg0) {
|
|
927
1050
|
const ret = typeof(arg0) === 'bigint';
|
|
928
1051
|
return ret;
|
|
929
1052
|
},
|
|
930
|
-
|
|
1053
|
+
__wbg___wbindgen_is_null_344c8750a8525473: function(arg0) {
|
|
931
1054
|
const ret = arg0 === null;
|
|
932
1055
|
return ret;
|
|
933
1056
|
},
|
|
934
|
-
|
|
1057
|
+
__wbg___wbindgen_is_string_b29b5c5a8065ba1a: function(arg0) {
|
|
935
1058
|
const ret = typeof(arg0) === 'string';
|
|
936
1059
|
return ret;
|
|
937
1060
|
},
|
|
938
|
-
|
|
1061
|
+
__wbg___wbindgen_is_undefined_c0cca72b82b86f4d: function(arg0) {
|
|
939
1062
|
const ret = arg0 === undefined;
|
|
940
1063
|
return ret;
|
|
941
1064
|
},
|
|
942
|
-
|
|
1065
|
+
__wbg___wbindgen_jsval_eq_7d430e744a913d26: function(arg0, arg1) {
|
|
943
1066
|
const ret = arg0 === arg1;
|
|
944
1067
|
return ret;
|
|
945
1068
|
},
|
|
946
|
-
|
|
1069
|
+
__wbg___wbindgen_number_get_7579aab02a8a620c: function(arg0, arg1) {
|
|
947
1070
|
const obj = arg1;
|
|
948
1071
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
949
1072
|
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
950
1073
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
951
1074
|
},
|
|
952
|
-
|
|
1075
|
+
__wbg___wbindgen_string_get_914df97fcfa788f2: function(arg0, arg1) {
|
|
953
1076
|
const obj = arg1;
|
|
954
1077
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
955
1078
|
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
@@ -957,30 +1080,30 @@ function __wbg_get_imports() {
|
|
|
957
1080
|
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
958
1081
|
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
959
1082
|
},
|
|
960
|
-
|
|
1083
|
+
__wbg___wbindgen_throw_81fc77679af83bc6: function(arg0, arg1) {
|
|
961
1084
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
962
1085
|
},
|
|
963
|
-
|
|
1086
|
+
__wbg_from_741da0f916ab74aa: function(arg0) {
|
|
964
1087
|
const ret = Array.from(arg0);
|
|
965
1088
|
return ret;
|
|
966
1089
|
},
|
|
967
|
-
|
|
1090
|
+
__wbg_get_4848e350b40afc16: function(arg0, arg1) {
|
|
968
1091
|
const ret = arg0[arg1 >>> 0];
|
|
969
1092
|
return ret;
|
|
970
1093
|
},
|
|
971
|
-
|
|
1094
|
+
__wbg_get_f96702c6245e4ef9: function() { return handleError(function (arg0, arg1) {
|
|
972
1095
|
const ret = Reflect.get(arg0, arg1);
|
|
973
1096
|
return ret;
|
|
974
1097
|
}, arguments); },
|
|
975
|
-
|
|
1098
|
+
__wbg_isArray_db61795ad004c139: function(arg0) {
|
|
976
1099
|
const ret = Array.isArray(arg0);
|
|
977
1100
|
return ret;
|
|
978
1101
|
},
|
|
979
|
-
|
|
1102
|
+
__wbg_length_0c32cb8543c8e4c8: function(arg0) {
|
|
980
1103
|
const ret = arg0.length;
|
|
981
1104
|
return ret;
|
|
982
1105
|
},
|
|
983
|
-
|
|
1106
|
+
__wbg_length_6e821edde497a532: function(arg0) {
|
|
984
1107
|
const ret = arg0.length;
|
|
985
1108
|
return ret;
|
|
986
1109
|
},
|
|
@@ -988,44 +1111,48 @@ function __wbg_get_imports() {
|
|
|
988
1111
|
const ret = Message.__wrap(arg0);
|
|
989
1112
|
return ret;
|
|
990
1113
|
},
|
|
991
|
-
|
|
992
|
-
const ret = new
|
|
1114
|
+
__wbg_new_4f9fafbb3909af72: function() {
|
|
1115
|
+
const ret = new Object();
|
|
993
1116
|
return ret;
|
|
994
1117
|
},
|
|
995
|
-
|
|
996
|
-
const ret = new
|
|
1118
|
+
__wbg_new_f3c9df4f38f3f798: function() {
|
|
1119
|
+
const ret = new Array();
|
|
997
1120
|
return ret;
|
|
998
1121
|
},
|
|
999
|
-
|
|
1122
|
+
__wbg_new_from_slice_2580ff33d0d10520: function(arg0, arg1) {
|
|
1000
1123
|
const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1));
|
|
1001
1124
|
return ret;
|
|
1002
1125
|
},
|
|
1003
|
-
|
|
1126
|
+
__wbg_new_with_length_9cedd08484b73942: function(arg0) {
|
|
1004
1127
|
const ret = new Uint8Array(arg0 >>> 0);
|
|
1005
1128
|
return ret;
|
|
1006
1129
|
},
|
|
1007
|
-
|
|
1130
|
+
__wbg_parse_545d11396395fbbd: function() { return handleError(function (arg0, arg1) {
|
|
1008
1131
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
1009
1132
|
return ret;
|
|
1010
1133
|
}, arguments); },
|
|
1011
|
-
|
|
1134
|
+
__wbg_prototypesetcall_3e05eb9545565046: function(arg0, arg1, arg2) {
|
|
1012
1135
|
Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
|
|
1013
1136
|
},
|
|
1014
|
-
|
|
1137
|
+
__wbg_push_6bdbc990be5ac37b: function(arg0, arg1) {
|
|
1015
1138
|
const ret = arg0.push(arg1);
|
|
1016
1139
|
return ret;
|
|
1017
1140
|
},
|
|
1018
|
-
|
|
1141
|
+
__wbg_set_16a9c1a07b3d38ec: function(arg0, arg1, arg2) {
|
|
1142
|
+
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
1143
|
+
},
|
|
1144
|
+
__wbg_set_8ee2d34facb8466e: function() { return handleError(function (arg0, arg1, arg2) {
|
|
1019
1145
|
const ret = Reflect.set(arg0, arg1, arg2);
|
|
1020
1146
|
return ret;
|
|
1021
1147
|
}, arguments); },
|
|
1022
|
-
|
|
1023
|
-
arg0.set(getArrayU8FromWasm0(arg1, arg2));
|
|
1024
|
-
},
|
|
1025
|
-
__wbg_stringify_c3d7897996042de9: function() { return handleError(function (arg0) {
|
|
1148
|
+
__wbg_stringify_a2c39d991e1bf91d: function() { return handleError(function (arg0) {
|
|
1026
1149
|
const ret = JSON.stringify(arg0);
|
|
1027
1150
|
return ret;
|
|
1028
1151
|
}, arguments); },
|
|
1152
|
+
__wbg_unsignedrecordset_new: function(arg0) {
|
|
1153
|
+
const ret = UnsignedRecordSet.__wrap(arg0);
|
|
1154
|
+
return ret;
|
|
1155
|
+
},
|
|
1029
1156
|
__wbindgen_cast_0000000000000001: function(arg0) {
|
|
1030
1157
|
// Cast intrinsic for `F64 -> Externref`.
|
|
1031
1158
|
const ret = arg0;
|
|
@@ -1078,6 +1205,9 @@ const RecordFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1078
1205
|
const RecordSetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1079
1206
|
? { register: () => {}, unregister: () => {} }
|
|
1080
1207
|
: new FinalizationRegistry(ptr => wasm.__wbg_recordset_free(ptr >>> 0, 1));
|
|
1208
|
+
const UnsignedRecordSetFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1209
|
+
? { register: () => {}, unregister: () => {} }
|
|
1210
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_unsignedrecordset_free(ptr >>> 0, 1));
|
|
1081
1211
|
const VerifiedMessageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1082
1212
|
? { register: () => {}, unregister: () => {} }
|
|
1083
1213
|
: new FinalizationRegistry(ptr => wasm.__wbg_verifiedmessage_free(ptr >>> 0, 1));
|
package/libveritas_bg.wasm
CHANGED
|
Binary file
|