@spacesprotocol/libveritas 0.0.0-dev.20260328160045 → 0.0.0-dev.20260328161923
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 +41 -50
- package/libveritas.js +55 -74
- package/libveritas_bg.wasm +0 -0
- package/package.json +1 -1
package/libveritas.d.ts
CHANGED
|
@@ -46,7 +46,7 @@ export class Message {
|
|
|
46
46
|
/**
|
|
47
47
|
* Serialize the message to borsh bytes.
|
|
48
48
|
*/
|
|
49
|
-
|
|
49
|
+
toBytes(): Uint8Array;
|
|
50
50
|
/**
|
|
51
51
|
* Update records on this message.
|
|
52
52
|
*
|
|
@@ -100,7 +100,7 @@ export class MessageBuilder {
|
|
|
100
100
|
*
|
|
101
101
|
* Send this to the provider/fabric to get the chain proofs needed for `build()`.
|
|
102
102
|
*/
|
|
103
|
-
|
|
103
|
+
chainProofRequest(): any;
|
|
104
104
|
/**
|
|
105
105
|
* Create an empty builder.
|
|
106
106
|
*
|
|
@@ -113,25 +113,6 @@ export class MessageBuilder {
|
|
|
113
113
|
constructor();
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
/**
|
|
117
|
-
* Helpers for constructing OffchainRecords (signed record sets).
|
|
118
|
-
*
|
|
119
|
-
* ```js
|
|
120
|
-
* const rs = RecordSet.pack([Record.seq(0), Record.txt("btc", "bc1qtest")]);
|
|
121
|
-
* const sig = await wallet.signSchnorr(rs.signingId());
|
|
122
|
-
* const bytes = OffchainRecords.from(rs, sig);
|
|
123
|
-
* ```
|
|
124
|
-
*/
|
|
125
|
-
export class OffchainRecords {
|
|
126
|
-
private constructor();
|
|
127
|
-
free(): void;
|
|
128
|
-
[Symbol.dispose](): void;
|
|
129
|
-
/**
|
|
130
|
-
* Create borsh-encoded OffchainRecords from a RecordSet and 64-byte signature.
|
|
131
|
-
*/
|
|
132
|
-
static from(record_set: RecordSet, signature: Uint8Array): Uint8Array;
|
|
133
|
-
}
|
|
134
|
-
|
|
135
116
|
export class QueryContext {
|
|
136
117
|
free(): void;
|
|
137
118
|
[Symbol.dispose](): void;
|
|
@@ -139,11 +120,11 @@ export class QueryContext {
|
|
|
139
120
|
* Add a handle to verify (e.g. "alice@bitcoin").
|
|
140
121
|
* If no requests are added, all handles in the message are verified.
|
|
141
122
|
*/
|
|
142
|
-
|
|
123
|
+
addRequest(handle: string): void;
|
|
143
124
|
/**
|
|
144
125
|
* Add a known zone from stored bytes (from a previous verification).
|
|
145
126
|
*/
|
|
146
|
-
|
|
127
|
+
addZone(zone_bytes: Uint8Array): void;
|
|
147
128
|
constructor();
|
|
148
129
|
}
|
|
149
130
|
|
|
@@ -232,7 +213,7 @@ export class VerifiedMessage {
|
|
|
232
213
|
/**
|
|
233
214
|
* Get the verified message as borsh bytes.
|
|
234
215
|
*/
|
|
235
|
-
|
|
216
|
+
messageBytes(): Uint8Array;
|
|
236
217
|
/**
|
|
237
218
|
* The root id this message was verified against.
|
|
238
219
|
*/
|
|
@@ -247,11 +228,11 @@ export class Veritas {
|
|
|
247
228
|
free(): void;
|
|
248
229
|
[Symbol.dispose](): void;
|
|
249
230
|
computeTrustSet(): any;
|
|
250
|
-
|
|
231
|
+
isFinalized(commitment_height: number): boolean;
|
|
251
232
|
constructor(anchors: Anchors);
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
233
|
+
newestAnchor(): number;
|
|
234
|
+
oldestAnchor(): number;
|
|
235
|
+
sovereigntyFor(commitment_height: number): string;
|
|
255
236
|
/**
|
|
256
237
|
* Verify a message with default options.
|
|
257
238
|
*/
|
|
@@ -270,30 +251,41 @@ export class Veritas {
|
|
|
270
251
|
export function createCertificateChain(subject: string, cert_bytes_list: Uint8Array[]): Uint8Array;
|
|
271
252
|
|
|
272
253
|
/**
|
|
273
|
-
*
|
|
254
|
+
* Create borsh-encoded OffchainRecords from a RecordSet and 64-byte Schnorr signature.
|
|
255
|
+
*
|
|
256
|
+
* ```js
|
|
257
|
+
* const rs = RecordSet.pack([Record.seq(0), Record.txt("btc", "bc1qtest")]);
|
|
258
|
+
* const sig = await wallet.signSchnorr(rs.signingId());
|
|
259
|
+
* const bytes = createOffchainRecords(rs, sig);
|
|
260
|
+
* ```
|
|
274
261
|
*/
|
|
275
|
-
export function
|
|
262
|
+
export function createOffchainRecords(record_set: RecordSet, signature: Uint8Array): Uint8Array;
|
|
276
263
|
|
|
277
264
|
/**
|
|
278
265
|
* Decode stored certificate bytes to a JS object.
|
|
279
266
|
*/
|
|
280
|
-
export function
|
|
267
|
+
export function decodeCertificate(bytes: Uint8Array): any;
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* Decode stored zone bytes to a plain JS object.
|
|
271
|
+
*/
|
|
272
|
+
export function decodeZone(bytes: Uint8Array): any;
|
|
281
273
|
|
|
282
274
|
/**
|
|
283
275
|
* Hash a message with the Spaces signed-message prefix (SHA256).
|
|
284
276
|
* Returns the 32-byte digest suitable for Schnorr signing/verification.
|
|
285
277
|
*/
|
|
286
|
-
export function
|
|
278
|
+
export function hashSignableMessage(msg: Uint8Array): Uint8Array;
|
|
287
279
|
|
|
288
280
|
/**
|
|
289
281
|
* Verify a raw Schnorr signature (no prefix, caller provides the 32-byte message hash).
|
|
290
282
|
*/
|
|
291
|
-
export function
|
|
283
|
+
export function verifySchnorr(msg_hash: Uint8Array, signature: Uint8Array, pubkey: Uint8Array): void;
|
|
292
284
|
|
|
293
285
|
/**
|
|
294
286
|
* Verify a Schnorr signature over a message using the Spaces signed-message prefix.
|
|
295
287
|
*/
|
|
296
|
-
export function
|
|
288
|
+
export function verifySpacesMessage(msg: Uint8Array, signature: Uint8Array, pubkey: Uint8Array): void;
|
|
297
289
|
|
|
298
290
|
/**
|
|
299
291
|
* Compare two zones — returns true if `a` is fresher/better than `b`.
|
|
@@ -316,23 +308,24 @@ export interface InitOutput {
|
|
|
316
308
|
readonly __wbg_lookup_free: (a: number, b: number) => void;
|
|
317
309
|
readonly __wbg_message_free: (a: number, b: number) => void;
|
|
318
310
|
readonly __wbg_messagebuilder_free: (a: number, b: number) => void;
|
|
319
|
-
readonly __wbg_offchainrecords_free: (a: number, b: number) => void;
|
|
320
311
|
readonly __wbg_querycontext_free: (a: number, b: number) => void;
|
|
312
|
+
readonly __wbg_record_free: (a: number, b: number) => void;
|
|
321
313
|
readonly __wbg_recordset_free: (a: number, b: number) => void;
|
|
322
314
|
readonly __wbg_verifiedmessage_free: (a: number, b: number) => void;
|
|
323
315
|
readonly __wbg_veritas_free: (a: number, b: number) => void;
|
|
324
316
|
readonly anchors_computeTrustSet: (a: number) => [number, number, number];
|
|
325
317
|
readonly anchors_from_json: (a: number, b: number) => [number, number, number];
|
|
326
318
|
readonly createCertificateChain: (a: number, b: number, c: number, d: number) => [number, number, number, number];
|
|
319
|
+
readonly createOffchainRecords: (a: number, b: number, c: number) => [number, number, number, number];
|
|
320
|
+
readonly decodeCertificate: (a: number, b: number) => [number, number, number];
|
|
327
321
|
readonly decodeZone: (a: number, b: number) => [number, number, number];
|
|
328
|
-
readonly
|
|
329
|
-
readonly hash_signable_message: (a: number, b: number) => [number, number];
|
|
322
|
+
readonly hashSignableMessage: (a: number, b: number) => [number, number];
|
|
330
323
|
readonly lookup_advance: (a: number, b: any) => [number, number, number, number];
|
|
331
324
|
readonly lookup_expandZones: (a: number, b: any) => [number, number, number];
|
|
332
325
|
readonly lookup_new: (a: number, b: number) => [number, number, number];
|
|
333
326
|
readonly lookup_start: (a: number) => [number, number];
|
|
334
327
|
readonly message_from_bytes: (a: number, b: number) => [number, number, number];
|
|
335
|
-
readonly
|
|
328
|
+
readonly message_toBytes: (a: number) => [number, number];
|
|
336
329
|
readonly message_update: (a: number, b: any) => [number, number];
|
|
337
330
|
readonly messagebuilder_addCert: (a: number, b: number, c: number) => [number, number];
|
|
338
331
|
readonly messagebuilder_addChain: (a: number, b: number, c: number) => [number, number];
|
|
@@ -340,11 +333,10 @@ export interface InitOutput {
|
|
|
340
333
|
readonly messagebuilder_addRecords: (a: number, b: number, c: number, d: number, e: number) => [number, number];
|
|
341
334
|
readonly messagebuilder_addUpdate: (a: number, b: any) => [number, number];
|
|
342
335
|
readonly messagebuilder_build: (a: number, b: number, c: number) => [number, number, number];
|
|
343
|
-
readonly
|
|
336
|
+
readonly messagebuilder_chainProofRequest: (a: number) => [number, number, number];
|
|
344
337
|
readonly messagebuilder_new: () => number;
|
|
345
|
-
readonly
|
|
346
|
-
readonly
|
|
347
|
-
readonly querycontext_add_zone: (a: number, b: number, c: number) => [number, number];
|
|
338
|
+
readonly querycontext_addRequest: (a: number, b: number, c: number) => [number, number];
|
|
339
|
+
readonly querycontext_addZone: (a: number, b: number, c: number) => [number, number];
|
|
348
340
|
readonly querycontext_new: () => number;
|
|
349
341
|
readonly record_blob: (a: number, b: number, c: number, d: number) => any;
|
|
350
342
|
readonly record_seq: (a: bigint) => any;
|
|
@@ -359,17 +351,17 @@ export interface InitOutput {
|
|
|
359
351
|
readonly recordset_unpack: (a: number) => [number, number, number];
|
|
360
352
|
readonly verifiedmessage_certificates: (a: number) => [number, number];
|
|
361
353
|
readonly verifiedmessage_message: (a: number) => number;
|
|
362
|
-
readonly
|
|
354
|
+
readonly verifiedmessage_messageBytes: (a: number) => [number, number];
|
|
363
355
|
readonly verifiedmessage_rootId: (a: number) => [number, number];
|
|
364
356
|
readonly verifiedmessage_zones: (a: number) => [number, number, number];
|
|
365
|
-
readonly
|
|
366
|
-
readonly
|
|
357
|
+
readonly verifySchnorr: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
358
|
+
readonly verifySpacesMessage: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number];
|
|
367
359
|
readonly veritas_computeTrustSet: (a: number) => [number, number, number];
|
|
368
|
-
readonly
|
|
360
|
+
readonly veritas_isFinalized: (a: number, b: number) => number;
|
|
369
361
|
readonly veritas_new: (a: number) => [number, number, number];
|
|
370
|
-
readonly
|
|
371
|
-
readonly
|
|
372
|
-
readonly
|
|
362
|
+
readonly veritas_newestAnchor: (a: number) => number;
|
|
363
|
+
readonly veritas_oldestAnchor: (a: number) => number;
|
|
364
|
+
readonly veritas_sovereigntyFor: (a: number, b: number) => [number, number];
|
|
373
365
|
readonly veritas_verify: (a: number, b: number, c: number) => [number, number, number];
|
|
374
366
|
readonly veritas_verifyWithOptions: (a: number, b: number, c: number, d: number) => [number, number, number];
|
|
375
367
|
readonly zoneIsBetterThan: (a: any, b: any) => [number, number, number];
|
|
@@ -422,7 +414,6 @@ export interface InitOutput {
|
|
|
422
414
|
readonly sys_panic: (a: number, b: number) => void;
|
|
423
415
|
readonly sys_verify_integrity2: (a: number, b: number) => void;
|
|
424
416
|
readonly sys_read_words: (a: number, b: number, c: number) => number;
|
|
425
|
-
readonly __wbg_record_free: (a: number, b: number) => void;
|
|
426
417
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
427
418
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
428
419
|
readonly __wbindgen_exn_store: (a: number) => void;
|
package/libveritas.js
CHANGED
|
@@ -147,8 +147,8 @@ export class Message {
|
|
|
147
147
|
* Serialize the message to borsh bytes.
|
|
148
148
|
* @returns {Uint8Array}
|
|
149
149
|
*/
|
|
150
|
-
|
|
151
|
-
const ret = wasm.
|
|
150
|
+
toBytes() {
|
|
151
|
+
const ret = wasm.message_toBytes(this.__wbg_ptr);
|
|
152
152
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
153
153
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
154
154
|
return v1;
|
|
@@ -276,8 +276,8 @@ export class MessageBuilder {
|
|
|
276
276
|
* Send this to the provider/fabric to get the chain proofs needed for `build()`.
|
|
277
277
|
* @returns {any}
|
|
278
278
|
*/
|
|
279
|
-
|
|
280
|
-
const ret = wasm.
|
|
279
|
+
chainProofRequest() {
|
|
280
|
+
const ret = wasm.messagebuilder_chainProofRequest(this.__wbg_ptr);
|
|
281
281
|
if (ret[2]) {
|
|
282
282
|
throw takeFromExternrefTable0(ret[1]);
|
|
283
283
|
}
|
|
@@ -301,47 +301,6 @@ export class MessageBuilder {
|
|
|
301
301
|
}
|
|
302
302
|
if (Symbol.dispose) MessageBuilder.prototype[Symbol.dispose] = MessageBuilder.prototype.free;
|
|
303
303
|
|
|
304
|
-
/**
|
|
305
|
-
* Helpers for constructing OffchainRecords (signed record sets).
|
|
306
|
-
*
|
|
307
|
-
* ```js
|
|
308
|
-
* const rs = RecordSet.pack([Record.seq(0), Record.txt("btc", "bc1qtest")]);
|
|
309
|
-
* const sig = await wallet.signSchnorr(rs.signingId());
|
|
310
|
-
* const bytes = OffchainRecords.from(rs, sig);
|
|
311
|
-
* ```
|
|
312
|
-
*/
|
|
313
|
-
export class OffchainRecords {
|
|
314
|
-
__destroy_into_raw() {
|
|
315
|
-
const ptr = this.__wbg_ptr;
|
|
316
|
-
this.__wbg_ptr = 0;
|
|
317
|
-
OffchainRecordsFinalization.unregister(this);
|
|
318
|
-
return ptr;
|
|
319
|
-
}
|
|
320
|
-
free() {
|
|
321
|
-
const ptr = this.__destroy_into_raw();
|
|
322
|
-
wasm.__wbg_offchainrecords_free(ptr, 0);
|
|
323
|
-
}
|
|
324
|
-
/**
|
|
325
|
-
* Create borsh-encoded OffchainRecords from a RecordSet and 64-byte signature.
|
|
326
|
-
* @param {RecordSet} record_set
|
|
327
|
-
* @param {Uint8Array} signature
|
|
328
|
-
* @returns {Uint8Array}
|
|
329
|
-
*/
|
|
330
|
-
static from(record_set, signature) {
|
|
331
|
-
_assertClass(record_set, RecordSet);
|
|
332
|
-
const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
333
|
-
const len0 = WASM_VECTOR_LEN;
|
|
334
|
-
const ret = wasm.offchainrecords_from(record_set.__wbg_ptr, ptr0, len0);
|
|
335
|
-
if (ret[3]) {
|
|
336
|
-
throw takeFromExternrefTable0(ret[2]);
|
|
337
|
-
}
|
|
338
|
-
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
339
|
-
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
340
|
-
return v2;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
if (Symbol.dispose) OffchainRecords.prototype[Symbol.dispose] = OffchainRecords.prototype.free;
|
|
344
|
-
|
|
345
304
|
export class QueryContext {
|
|
346
305
|
__destroy_into_raw() {
|
|
347
306
|
const ptr = this.__wbg_ptr;
|
|
@@ -358,10 +317,10 @@ export class QueryContext {
|
|
|
358
317
|
* If no requests are added, all handles in the message are verified.
|
|
359
318
|
* @param {string} handle
|
|
360
319
|
*/
|
|
361
|
-
|
|
320
|
+
addRequest(handle) {
|
|
362
321
|
const ptr0 = passStringToWasm0(handle, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
363
322
|
const len0 = WASM_VECTOR_LEN;
|
|
364
|
-
const ret = wasm.
|
|
323
|
+
const ret = wasm.querycontext_addRequest(this.__wbg_ptr, ptr0, len0);
|
|
365
324
|
if (ret[1]) {
|
|
366
325
|
throw takeFromExternrefTable0(ret[0]);
|
|
367
326
|
}
|
|
@@ -370,10 +329,10 @@ export class QueryContext {
|
|
|
370
329
|
* Add a known zone from stored bytes (from a previous verification).
|
|
371
330
|
* @param {Uint8Array} zone_bytes
|
|
372
331
|
*/
|
|
373
|
-
|
|
332
|
+
addZone(zone_bytes) {
|
|
374
333
|
const ptr0 = passArray8ToWasm0(zone_bytes, wasm.__wbindgen_malloc);
|
|
375
334
|
const len0 = WASM_VECTOR_LEN;
|
|
376
|
-
const ret = wasm.
|
|
335
|
+
const ret = wasm.querycontext_addZone(this.__wbg_ptr, ptr0, len0);
|
|
377
336
|
if (ret[1]) {
|
|
378
337
|
throw takeFromExternrefTable0(ret[0]);
|
|
379
338
|
}
|
|
@@ -631,8 +590,8 @@ export class VerifiedMessage {
|
|
|
631
590
|
* Get the verified message as borsh bytes.
|
|
632
591
|
* @returns {Uint8Array}
|
|
633
592
|
*/
|
|
634
|
-
|
|
635
|
-
const ret = wasm.
|
|
593
|
+
messageBytes() {
|
|
594
|
+
const ret = wasm.verifiedmessage_messageBytes(this.__wbg_ptr);
|
|
636
595
|
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
637
596
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
638
597
|
return v1;
|
|
@@ -686,8 +645,8 @@ export class Veritas {
|
|
|
686
645
|
* @param {number} commitment_height
|
|
687
646
|
* @returns {boolean}
|
|
688
647
|
*/
|
|
689
|
-
|
|
690
|
-
const ret = wasm.
|
|
648
|
+
isFinalized(commitment_height) {
|
|
649
|
+
const ret = wasm.veritas_isFinalized(this.__wbg_ptr, commitment_height);
|
|
691
650
|
return ret !== 0;
|
|
692
651
|
}
|
|
693
652
|
/**
|
|
@@ -706,26 +665,26 @@ export class Veritas {
|
|
|
706
665
|
/**
|
|
707
666
|
* @returns {number}
|
|
708
667
|
*/
|
|
709
|
-
|
|
710
|
-
const ret = wasm.
|
|
668
|
+
newestAnchor() {
|
|
669
|
+
const ret = wasm.veritas_newestAnchor(this.__wbg_ptr);
|
|
711
670
|
return ret >>> 0;
|
|
712
671
|
}
|
|
713
672
|
/**
|
|
714
673
|
* @returns {number}
|
|
715
674
|
*/
|
|
716
|
-
|
|
717
|
-
const ret = wasm.
|
|
675
|
+
oldestAnchor() {
|
|
676
|
+
const ret = wasm.veritas_oldestAnchor(this.__wbg_ptr);
|
|
718
677
|
return ret >>> 0;
|
|
719
678
|
}
|
|
720
679
|
/**
|
|
721
680
|
* @param {number} commitment_height
|
|
722
681
|
* @returns {string}
|
|
723
682
|
*/
|
|
724
|
-
|
|
683
|
+
sovereigntyFor(commitment_height) {
|
|
725
684
|
let deferred1_0;
|
|
726
685
|
let deferred1_1;
|
|
727
686
|
try {
|
|
728
|
-
const ret = wasm.
|
|
687
|
+
const ret = wasm.veritas_sovereigntyFor(this.__wbg_ptr, commitment_height);
|
|
729
688
|
deferred1_0 = ret[0];
|
|
730
689
|
deferred1_1 = ret[1];
|
|
731
690
|
return getStringFromWasm0(ret[0], ret[1]);
|
|
@@ -790,14 +749,39 @@ export function createCertificateChain(subject, cert_bytes_list) {
|
|
|
790
749
|
}
|
|
791
750
|
|
|
792
751
|
/**
|
|
793
|
-
*
|
|
752
|
+
* Create borsh-encoded OffchainRecords from a RecordSet and 64-byte Schnorr signature.
|
|
753
|
+
*
|
|
754
|
+
* ```js
|
|
755
|
+
* const rs = RecordSet.pack([Record.seq(0), Record.txt("btc", "bc1qtest")]);
|
|
756
|
+
* const sig = await wallet.signSchnorr(rs.signingId());
|
|
757
|
+
* const bytes = createOffchainRecords(rs, sig);
|
|
758
|
+
* ```
|
|
759
|
+
* @param {RecordSet} record_set
|
|
760
|
+
* @param {Uint8Array} signature
|
|
761
|
+
* @returns {Uint8Array}
|
|
762
|
+
*/
|
|
763
|
+
export function createOffchainRecords(record_set, signature) {
|
|
764
|
+
_assertClass(record_set, RecordSet);
|
|
765
|
+
const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
766
|
+
const len0 = WASM_VECTOR_LEN;
|
|
767
|
+
const ret = wasm.createOffchainRecords(record_set.__wbg_ptr, ptr0, len0);
|
|
768
|
+
if (ret[3]) {
|
|
769
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
770
|
+
}
|
|
771
|
+
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
772
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
773
|
+
return v2;
|
|
774
|
+
}
|
|
775
|
+
|
|
776
|
+
/**
|
|
777
|
+
* Decode stored certificate bytes to a JS object.
|
|
794
778
|
* @param {Uint8Array} bytes
|
|
795
779
|
* @returns {any}
|
|
796
780
|
*/
|
|
797
|
-
export function
|
|
781
|
+
export function decodeCertificate(bytes) {
|
|
798
782
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
799
783
|
const len0 = WASM_VECTOR_LEN;
|
|
800
|
-
const ret = wasm.
|
|
784
|
+
const ret = wasm.decodeCertificate(ptr0, len0);
|
|
801
785
|
if (ret[2]) {
|
|
802
786
|
throw takeFromExternrefTable0(ret[1]);
|
|
803
787
|
}
|
|
@@ -805,14 +789,14 @@ export function decodeZone(bytes) {
|
|
|
805
789
|
}
|
|
806
790
|
|
|
807
791
|
/**
|
|
808
|
-
* Decode stored
|
|
792
|
+
* Decode stored zone bytes to a plain JS object.
|
|
809
793
|
* @param {Uint8Array} bytes
|
|
810
794
|
* @returns {any}
|
|
811
795
|
*/
|
|
812
|
-
export function
|
|
796
|
+
export function decodeZone(bytes) {
|
|
813
797
|
const ptr0 = passArray8ToWasm0(bytes, wasm.__wbindgen_malloc);
|
|
814
798
|
const len0 = WASM_VECTOR_LEN;
|
|
815
|
-
const ret = wasm.
|
|
799
|
+
const ret = wasm.decodeZone(ptr0, len0);
|
|
816
800
|
if (ret[2]) {
|
|
817
801
|
throw takeFromExternrefTable0(ret[1]);
|
|
818
802
|
}
|
|
@@ -825,10 +809,10 @@ export function decode_certificate(bytes) {
|
|
|
825
809
|
* @param {Uint8Array} msg
|
|
826
810
|
* @returns {Uint8Array}
|
|
827
811
|
*/
|
|
828
|
-
export function
|
|
812
|
+
export function hashSignableMessage(msg) {
|
|
829
813
|
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
830
814
|
const len0 = WASM_VECTOR_LEN;
|
|
831
|
-
const ret = wasm.
|
|
815
|
+
const ret = wasm.hashSignableMessage(ptr0, len0);
|
|
832
816
|
var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
833
817
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
834
818
|
return v2;
|
|
@@ -840,14 +824,14 @@ export function hash_signable_message(msg) {
|
|
|
840
824
|
* @param {Uint8Array} signature
|
|
841
825
|
* @param {Uint8Array} pubkey
|
|
842
826
|
*/
|
|
843
|
-
export function
|
|
827
|
+
export function verifySchnorr(msg_hash, signature, pubkey) {
|
|
844
828
|
const ptr0 = passArray8ToWasm0(msg_hash, wasm.__wbindgen_malloc);
|
|
845
829
|
const len0 = WASM_VECTOR_LEN;
|
|
846
830
|
const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
847
831
|
const len1 = WASM_VECTOR_LEN;
|
|
848
832
|
const ptr2 = passArray8ToWasm0(pubkey, wasm.__wbindgen_malloc);
|
|
849
833
|
const len2 = WASM_VECTOR_LEN;
|
|
850
|
-
const ret = wasm.
|
|
834
|
+
const ret = wasm.verifySchnorr(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
851
835
|
if (ret[1]) {
|
|
852
836
|
throw takeFromExternrefTable0(ret[0]);
|
|
853
837
|
}
|
|
@@ -859,14 +843,14 @@ export function verify_schnorr(msg_hash, signature, pubkey) {
|
|
|
859
843
|
* @param {Uint8Array} signature
|
|
860
844
|
* @param {Uint8Array} pubkey
|
|
861
845
|
*/
|
|
862
|
-
export function
|
|
846
|
+
export function verifySpacesMessage(msg, signature, pubkey) {
|
|
863
847
|
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
864
848
|
const len0 = WASM_VECTOR_LEN;
|
|
865
849
|
const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
866
850
|
const len1 = WASM_VECTOR_LEN;
|
|
867
851
|
const ptr2 = passArray8ToWasm0(pubkey, wasm.__wbindgen_malloc);
|
|
868
852
|
const len2 = WASM_VECTOR_LEN;
|
|
869
|
-
const ret = wasm.
|
|
853
|
+
const ret = wasm.verifySpacesMessage(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
870
854
|
if (ret[1]) {
|
|
871
855
|
throw takeFromExternrefTable0(ret[0]);
|
|
872
856
|
}
|
|
@@ -1067,9 +1051,6 @@ const MessageFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
|
1067
1051
|
const MessageBuilderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1068
1052
|
? { register: () => {}, unregister: () => {} }
|
|
1069
1053
|
: new FinalizationRegistry(ptr => wasm.__wbg_messagebuilder_free(ptr >>> 0, 1));
|
|
1070
|
-
const OffchainRecordsFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1071
|
-
? { register: () => {}, unregister: () => {} }
|
|
1072
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_offchainrecords_free(ptr >>> 0, 1));
|
|
1073
1054
|
const QueryContextFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1074
1055
|
? { register: () => {}, unregister: () => {} }
|
|
1075
1056
|
: new FinalizationRegistry(ptr => wasm.__wbg_querycontext_free(ptr >>> 0, 1));
|
package/libveritas_bg.wasm
CHANGED
|
Binary file
|