@haneullabs/walrus-wasm 0.1.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/CHANGELOG.md +55 -0
- package/Cargo.lock +2010 -0
- package/Cargo.toml +39 -0
- package/README.md +1 -0
- package/index.js +7 -0
- package/index.mjs +5 -0
- package/nodejs/walrus_wasm.d.ts +48 -0
- package/nodejs/walrus_wasm.js +560 -0
- package/nodejs/walrus_wasm_bg.wasm +0 -0
- package/nodejs/walrus_wasm_bg.wasm.d.ts +23 -0
- package/package.json +38 -0
- package/rust-toolchain.toml +3 -0
- package/src/bls12381.rs +47 -0
- package/src/encoder.rs +178 -0
- package/src/lib.rs +9 -0
- package/test/encoder.test.ts +260 -0
- package/vitest.config.mts +17 -0
- package/web/walrus_wasm.d.ts +95 -0
- package/web/walrus_wasm.js +626 -0
- package/web/walrus_wasm_bg.js +590 -0
- package/web/walrus_wasm_bg.wasm +0 -0
- package/web/walrus_wasm_bg.wasm.d.ts +23 -0
|
@@ -0,0 +1,590 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
export function __wbg_set_wasm(val) {
|
|
3
|
+
wasm = val;
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
let WASM_VECTOR_LEN = 0;
|
|
8
|
+
|
|
9
|
+
let cachedUint8ArrayMemory0 = null;
|
|
10
|
+
|
|
11
|
+
function getUint8ArrayMemory0() {
|
|
12
|
+
if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
|
|
13
|
+
cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
|
|
14
|
+
}
|
|
15
|
+
return cachedUint8ArrayMemory0;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
|
|
19
|
+
|
|
20
|
+
let cachedTextEncoder = new lTextEncoder('utf-8');
|
|
21
|
+
|
|
22
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
23
|
+
? function (arg, view) {
|
|
24
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
25
|
+
}
|
|
26
|
+
: function (arg, view) {
|
|
27
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
28
|
+
view.set(buf);
|
|
29
|
+
return {
|
|
30
|
+
read: arg.length,
|
|
31
|
+
written: buf.length
|
|
32
|
+
};
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
36
|
+
|
|
37
|
+
if (realloc === undefined) {
|
|
38
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
39
|
+
const ptr = malloc(buf.length, 1) >>> 0;
|
|
40
|
+
getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
41
|
+
WASM_VECTOR_LEN = buf.length;
|
|
42
|
+
return ptr;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let len = arg.length;
|
|
46
|
+
let ptr = malloc(len, 1) >>> 0;
|
|
47
|
+
|
|
48
|
+
const mem = getUint8ArrayMemory0();
|
|
49
|
+
|
|
50
|
+
let offset = 0;
|
|
51
|
+
|
|
52
|
+
for (; offset < len; offset++) {
|
|
53
|
+
const code = arg.charCodeAt(offset);
|
|
54
|
+
if (code > 0x7F) break;
|
|
55
|
+
mem[ptr + offset] = code;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
if (offset !== len) {
|
|
59
|
+
if (offset !== 0) {
|
|
60
|
+
arg = arg.slice(offset);
|
|
61
|
+
}
|
|
62
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
|
|
63
|
+
const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
|
|
64
|
+
const ret = encodeString(arg, view);
|
|
65
|
+
|
|
66
|
+
offset += ret.written;
|
|
67
|
+
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
WASM_VECTOR_LEN = offset;
|
|
71
|
+
return ptr;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
let cachedDataViewMemory0 = null;
|
|
75
|
+
|
|
76
|
+
function getDataViewMemory0() {
|
|
77
|
+
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
78
|
+
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
79
|
+
}
|
|
80
|
+
return cachedDataViewMemory0;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function addToExternrefTable0(obj) {
|
|
84
|
+
const idx = wasm.__externref_table_alloc();
|
|
85
|
+
wasm.__wbindgen_export_4.set(idx, obj);
|
|
86
|
+
return idx;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function handleError(f, args) {
|
|
90
|
+
try {
|
|
91
|
+
return f.apply(this, args);
|
|
92
|
+
} catch (e) {
|
|
93
|
+
const idx = addToExternrefTable0(e);
|
|
94
|
+
wasm.__wbindgen_exn_store(idx);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
function isLikeNone(x) {
|
|
99
|
+
return x === undefined || x === null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
function debugString(val) {
|
|
103
|
+
// primitive types
|
|
104
|
+
const type = typeof val;
|
|
105
|
+
if (type == 'number' || type == 'boolean' || val == null) {
|
|
106
|
+
return `${val}`;
|
|
107
|
+
}
|
|
108
|
+
if (type == 'string') {
|
|
109
|
+
return `"${val}"`;
|
|
110
|
+
}
|
|
111
|
+
if (type == 'symbol') {
|
|
112
|
+
const description = val.description;
|
|
113
|
+
if (description == null) {
|
|
114
|
+
return 'Symbol';
|
|
115
|
+
} else {
|
|
116
|
+
return `Symbol(${description})`;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
if (type == 'function') {
|
|
120
|
+
const name = val.name;
|
|
121
|
+
if (typeof name == 'string' && name.length > 0) {
|
|
122
|
+
return `Function(${name})`;
|
|
123
|
+
} else {
|
|
124
|
+
return 'Function';
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
// objects
|
|
128
|
+
if (Array.isArray(val)) {
|
|
129
|
+
const length = val.length;
|
|
130
|
+
let debug = '[';
|
|
131
|
+
if (length > 0) {
|
|
132
|
+
debug += debugString(val[0]);
|
|
133
|
+
}
|
|
134
|
+
for(let i = 1; i < length; i++) {
|
|
135
|
+
debug += ', ' + debugString(val[i]);
|
|
136
|
+
}
|
|
137
|
+
debug += ']';
|
|
138
|
+
return debug;
|
|
139
|
+
}
|
|
140
|
+
// Test for built-in
|
|
141
|
+
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
142
|
+
let className;
|
|
143
|
+
if (builtInMatches && builtInMatches.length > 1) {
|
|
144
|
+
className = builtInMatches[1];
|
|
145
|
+
} else {
|
|
146
|
+
// Failed to match the standard '[object ClassName]'
|
|
147
|
+
return toString.call(val);
|
|
148
|
+
}
|
|
149
|
+
if (className == 'Object') {
|
|
150
|
+
// we're a user defined class or Object
|
|
151
|
+
// JSON.stringify avoids problems with cycles, and is generally much
|
|
152
|
+
// easier than looping through ownProperties of `val`.
|
|
153
|
+
try {
|
|
154
|
+
return 'Object(' + JSON.stringify(val) + ')';
|
|
155
|
+
} catch (_) {
|
|
156
|
+
return 'Object';
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
// errors
|
|
160
|
+
if (val instanceof Error) {
|
|
161
|
+
return `${val.name}: ${val.message}\n${val.stack}`;
|
|
162
|
+
}
|
|
163
|
+
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
164
|
+
return className;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
|
|
168
|
+
|
|
169
|
+
let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
170
|
+
|
|
171
|
+
cachedTextDecoder.decode();
|
|
172
|
+
|
|
173
|
+
function getStringFromWasm0(ptr, len) {
|
|
174
|
+
ptr = ptr >>> 0;
|
|
175
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
function takeFromExternrefTable0(idx) {
|
|
179
|
+
const value = wasm.__wbindgen_export_4.get(idx);
|
|
180
|
+
wasm.__externref_table_dealloc(idx);
|
|
181
|
+
return value;
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
function passArray8ToWasm0(arg, malloc) {
|
|
185
|
+
const ptr = malloc(arg.length * 1, 1) >>> 0;
|
|
186
|
+
getUint8ArrayMemory0().set(arg, ptr / 1);
|
|
187
|
+
WASM_VECTOR_LEN = arg.length;
|
|
188
|
+
return ptr;
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* @param {Uint8Array} signature
|
|
192
|
+
* @param {Uint8Array} public_key
|
|
193
|
+
* @param {Uint8Array} msg
|
|
194
|
+
* @returns {boolean}
|
|
195
|
+
*/
|
|
196
|
+
export function bls12381_min_pk_verify(signature, public_key, msg) {
|
|
197
|
+
const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
198
|
+
const len0 = WASM_VECTOR_LEN;
|
|
199
|
+
const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
|
|
200
|
+
const len1 = WASM_VECTOR_LEN;
|
|
201
|
+
const ptr2 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
202
|
+
const len2 = WASM_VECTOR_LEN;
|
|
203
|
+
const ret = wasm.bls12381_min_pk_verify(ptr0, len0, ptr1, len1, ptr2, len2);
|
|
204
|
+
if (ret[2]) {
|
|
205
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
206
|
+
}
|
|
207
|
+
return ret[0] !== 0;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
211
|
+
ptr = ptr >>> 0;
|
|
212
|
+
return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Aggregate a list of signatures.
|
|
216
|
+
* The signatures must be of the type Vec<Vec<u8>> with each signature being a 96 bytes long serialized signature.
|
|
217
|
+
* @param {any} signatures
|
|
218
|
+
* @returns {Uint8Array}
|
|
219
|
+
*/
|
|
220
|
+
export function bls12381_min_pk_aggregate(signatures) {
|
|
221
|
+
const ret = wasm.bls12381_min_pk_aggregate(signatures);
|
|
222
|
+
if (ret[3]) {
|
|
223
|
+
throw takeFromExternrefTable0(ret[2]);
|
|
224
|
+
}
|
|
225
|
+
var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
|
|
226
|
+
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
227
|
+
return v1;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* Verify an aggregate signature.
|
|
232
|
+
* @param {any} public_keys
|
|
233
|
+
* @param {Uint8Array} msg
|
|
234
|
+
* @param {Uint8Array} signature
|
|
235
|
+
* @returns {boolean}
|
|
236
|
+
*/
|
|
237
|
+
export function bls12381_min_pk_verify_aggregate(public_keys, msg, signature) {
|
|
238
|
+
const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
|
|
239
|
+
const len0 = WASM_VECTOR_LEN;
|
|
240
|
+
const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
|
|
241
|
+
const len1 = WASM_VECTOR_LEN;
|
|
242
|
+
const ret = wasm.bls12381_min_pk_verify_aggregate(public_keys, ptr0, len0, ptr1, len1);
|
|
243
|
+
if (ret[2]) {
|
|
244
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
245
|
+
}
|
|
246
|
+
return ret[0] !== 0;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
/**
|
|
250
|
+
* @param {any} msg
|
|
251
|
+
* @returns {any}
|
|
252
|
+
*/
|
|
253
|
+
export function rs_encode(msg) {
|
|
254
|
+
const ret = wasm.rs_encode(msg);
|
|
255
|
+
if (ret[2]) {
|
|
256
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
257
|
+
}
|
|
258
|
+
return takeFromExternrefTable0(ret[0]);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
/**
|
|
262
|
+
* @param {any} original
|
|
263
|
+
* @param {any} recovery
|
|
264
|
+
* @returns {any}
|
|
265
|
+
*/
|
|
266
|
+
export function rs_decode(original, recovery) {
|
|
267
|
+
const ret = wasm.rs_decode(original, recovery);
|
|
268
|
+
if (ret[2]) {
|
|
269
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
270
|
+
}
|
|
271
|
+
return takeFromExternrefTable0(ret[0]);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
const BlobEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
275
|
+
? { register: () => {}, unregister: () => {} }
|
|
276
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_blobencoder_free(ptr >>> 0, 1));
|
|
277
|
+
|
|
278
|
+
export class BlobEncoder {
|
|
279
|
+
|
|
280
|
+
__destroy_into_raw() {
|
|
281
|
+
const ptr = this.__wbg_ptr;
|
|
282
|
+
this.__wbg_ptr = 0;
|
|
283
|
+
BlobEncoderFinalization.unregister(this);
|
|
284
|
+
return ptr;
|
|
285
|
+
}
|
|
286
|
+
|
|
287
|
+
free() {
|
|
288
|
+
const ptr = this.__destroy_into_raw();
|
|
289
|
+
wasm.__wbg_blobencoder_free(ptr, 0);
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* @param {number} n_shards
|
|
293
|
+
*/
|
|
294
|
+
constructor(n_shards) {
|
|
295
|
+
const ret = wasm.blobencoder_new(n_shards);
|
|
296
|
+
if (ret[2]) {
|
|
297
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
298
|
+
}
|
|
299
|
+
this.__wbg_ptr = ret[0] >>> 0;
|
|
300
|
+
BlobEncoderFinalization.register(this, this.__wbg_ptr, this);
|
|
301
|
+
return this;
|
|
302
|
+
}
|
|
303
|
+
/**
|
|
304
|
+
* WASM wrapper for [walrus_core::encoding::blob_encoding::BlobEncoder::encode_with_metadata].
|
|
305
|
+
* Returns a tuple with a vector of [walrus_core::encoding::slivers::SliverPair]´s and a [walrus_core::metadata::VerifiedBlobMetadataWithId]`.
|
|
306
|
+
* @param {Uint8Array} data
|
|
307
|
+
* @returns {any}
|
|
308
|
+
*/
|
|
309
|
+
encode_with_metadata(data) {
|
|
310
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
311
|
+
const len0 = WASM_VECTOR_LEN;
|
|
312
|
+
const ret = wasm.blobencoder_encode_with_metadata(this.__wbg_ptr, ptr0, len0);
|
|
313
|
+
if (ret[2]) {
|
|
314
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
315
|
+
}
|
|
316
|
+
return takeFromExternrefTable0(ret[0]);
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* WASM wrapper for [walrus_core::encoding::blob_encoding::BlobEncoder::compute_metadata].
|
|
320
|
+
* Returns [walrus_core::metadata::VerifiedBlobMetadataWithId].
|
|
321
|
+
* @param {Uint8Array} data
|
|
322
|
+
* @returns {any}
|
|
323
|
+
*/
|
|
324
|
+
compute_metadata(data) {
|
|
325
|
+
const ptr0 = passArray8ToWasm0(data, wasm.__wbindgen_malloc);
|
|
326
|
+
const len0 = WASM_VECTOR_LEN;
|
|
327
|
+
const ret = wasm.blobencoder_compute_metadata(this.__wbg_ptr, ptr0, len0);
|
|
328
|
+
if (ret[2]) {
|
|
329
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
330
|
+
}
|
|
331
|
+
return takeFromExternrefTable0(ret[0]);
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* WASM wrapper for [walrus_core::encoding::blob_encoding::BlobEncoder::decode].
|
|
335
|
+
* The input `slivers` is expected to be a `Vec<SliverData<Primary>>`.
|
|
336
|
+
* Returns `Vec<u8>`.
|
|
337
|
+
* @param {any} blob_id
|
|
338
|
+
* @param {bigint} blob_size
|
|
339
|
+
* @param {any} slivers
|
|
340
|
+
* @returns {any}
|
|
341
|
+
*/
|
|
342
|
+
decode(blob_id, blob_size, slivers) {
|
|
343
|
+
const ret = wasm.blobencoder_decode(this.__wbg_ptr, blob_id, blob_size, slivers);
|
|
344
|
+
if (ret[2]) {
|
|
345
|
+
throw takeFromExternrefTable0(ret[1]);
|
|
346
|
+
}
|
|
347
|
+
return takeFromExternrefTable0(ret[0]);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
|
|
351
|
+
export function __wbg_String_fed4d24b68977888(arg0, arg1) {
|
|
352
|
+
const ret = String(arg1);
|
|
353
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
354
|
+
const len1 = WASM_VECTOR_LEN;
|
|
355
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
356
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
357
|
+
};
|
|
358
|
+
|
|
359
|
+
export function __wbg_buffer_609cc3eee51ed158(arg0) {
|
|
360
|
+
const ret = arg0.buffer;
|
|
361
|
+
return ret;
|
|
362
|
+
};
|
|
363
|
+
|
|
364
|
+
export function __wbg_call_672a4d21634d4a24() { return handleError(function (arg0, arg1) {
|
|
365
|
+
const ret = arg0.call(arg1);
|
|
366
|
+
return ret;
|
|
367
|
+
}, arguments) };
|
|
368
|
+
|
|
369
|
+
export function __wbg_done_769e5ede4b31c67b(arg0) {
|
|
370
|
+
const ret = arg0.done;
|
|
371
|
+
return ret;
|
|
372
|
+
};
|
|
373
|
+
|
|
374
|
+
export function __wbg_get_67b2ba62fc30de12() { return handleError(function (arg0, arg1) {
|
|
375
|
+
const ret = Reflect.get(arg0, arg1);
|
|
376
|
+
return ret;
|
|
377
|
+
}, arguments) };
|
|
378
|
+
|
|
379
|
+
export function __wbg_get_b9b93047fe3cf45b(arg0, arg1) {
|
|
380
|
+
const ret = arg0[arg1 >>> 0];
|
|
381
|
+
return ret;
|
|
382
|
+
};
|
|
383
|
+
|
|
384
|
+
export function __wbg_getwithrefkey_bb8f74a92cb2e784(arg0, arg1) {
|
|
385
|
+
const ret = arg0[arg1];
|
|
386
|
+
return ret;
|
|
387
|
+
};
|
|
388
|
+
|
|
389
|
+
export function __wbg_instanceof_ArrayBuffer_e14585432e3737fc(arg0) {
|
|
390
|
+
let result;
|
|
391
|
+
try {
|
|
392
|
+
result = arg0 instanceof ArrayBuffer;
|
|
393
|
+
} catch (_) {
|
|
394
|
+
result = false;
|
|
395
|
+
}
|
|
396
|
+
const ret = result;
|
|
397
|
+
return ret;
|
|
398
|
+
};
|
|
399
|
+
|
|
400
|
+
export function __wbg_instanceof_Uint8Array_17156bcf118086a9(arg0) {
|
|
401
|
+
let result;
|
|
402
|
+
try {
|
|
403
|
+
result = arg0 instanceof Uint8Array;
|
|
404
|
+
} catch (_) {
|
|
405
|
+
result = false;
|
|
406
|
+
}
|
|
407
|
+
const ret = result;
|
|
408
|
+
return ret;
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
export function __wbg_isArray_a1eab7e0d067391b(arg0) {
|
|
412
|
+
const ret = Array.isArray(arg0);
|
|
413
|
+
return ret;
|
|
414
|
+
};
|
|
415
|
+
|
|
416
|
+
export function __wbg_isSafeInteger_343e2beeeece1bb0(arg0) {
|
|
417
|
+
const ret = Number.isSafeInteger(arg0);
|
|
418
|
+
return ret;
|
|
419
|
+
};
|
|
420
|
+
|
|
421
|
+
export function __wbg_iterator_9a24c88df860dc65() {
|
|
422
|
+
const ret = Symbol.iterator;
|
|
423
|
+
return ret;
|
|
424
|
+
};
|
|
425
|
+
|
|
426
|
+
export function __wbg_length_a446193dc22c12f8(arg0) {
|
|
427
|
+
const ret = arg0.length;
|
|
428
|
+
return ret;
|
|
429
|
+
};
|
|
430
|
+
|
|
431
|
+
export function __wbg_length_e2d2a49132c1b256(arg0) {
|
|
432
|
+
const ret = arg0.length;
|
|
433
|
+
return ret;
|
|
434
|
+
};
|
|
435
|
+
|
|
436
|
+
export function __wbg_new_405e22f390576ce2() {
|
|
437
|
+
const ret = new Object();
|
|
438
|
+
return ret;
|
|
439
|
+
};
|
|
440
|
+
|
|
441
|
+
export function __wbg_new_78feb108b6472713() {
|
|
442
|
+
const ret = new Array();
|
|
443
|
+
return ret;
|
|
444
|
+
};
|
|
445
|
+
|
|
446
|
+
export function __wbg_new_a12002a7f91c75be(arg0) {
|
|
447
|
+
const ret = new Uint8Array(arg0);
|
|
448
|
+
return ret;
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
export function __wbg_next_25feadfc0913fea9(arg0) {
|
|
452
|
+
const ret = arg0.next;
|
|
453
|
+
return ret;
|
|
454
|
+
};
|
|
455
|
+
|
|
456
|
+
export function __wbg_next_6574e1a8a62d1055() { return handleError(function (arg0) {
|
|
457
|
+
const ret = arg0.next();
|
|
458
|
+
return ret;
|
|
459
|
+
}, arguments) };
|
|
460
|
+
|
|
461
|
+
export function __wbg_set_37837023f3d740e8(arg0, arg1, arg2) {
|
|
462
|
+
arg0[arg1 >>> 0] = arg2;
|
|
463
|
+
};
|
|
464
|
+
|
|
465
|
+
export function __wbg_set_3fda3bac07393de4(arg0, arg1, arg2) {
|
|
466
|
+
arg0[arg1] = arg2;
|
|
467
|
+
};
|
|
468
|
+
|
|
469
|
+
export function __wbg_set_65595bdd868b3009(arg0, arg1, arg2) {
|
|
470
|
+
arg0.set(arg1, arg2 >>> 0);
|
|
471
|
+
};
|
|
472
|
+
|
|
473
|
+
export function __wbg_value_cd1ffa7b1ab794f1(arg0) {
|
|
474
|
+
const ret = arg0.value;
|
|
475
|
+
return ret;
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
export function __wbindgen_bigint_from_u64(arg0) {
|
|
479
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
480
|
+
return ret;
|
|
481
|
+
};
|
|
482
|
+
|
|
483
|
+
export function __wbindgen_bigint_get_as_i64(arg0, arg1) {
|
|
484
|
+
const v = arg1;
|
|
485
|
+
const ret = typeof(v) === 'bigint' ? v : undefined;
|
|
486
|
+
getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
|
|
487
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
488
|
+
};
|
|
489
|
+
|
|
490
|
+
export function __wbindgen_boolean_get(arg0) {
|
|
491
|
+
const v = arg0;
|
|
492
|
+
const ret = typeof(v) === 'boolean' ? (v ? 1 : 0) : 2;
|
|
493
|
+
return ret;
|
|
494
|
+
};
|
|
495
|
+
|
|
496
|
+
export function __wbindgen_debug_string(arg0, arg1) {
|
|
497
|
+
const ret = debugString(arg1);
|
|
498
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
499
|
+
const len1 = WASM_VECTOR_LEN;
|
|
500
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
501
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
export function __wbindgen_error_new(arg0, arg1) {
|
|
505
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
506
|
+
return ret;
|
|
507
|
+
};
|
|
508
|
+
|
|
509
|
+
export function __wbindgen_in(arg0, arg1) {
|
|
510
|
+
const ret = arg0 in arg1;
|
|
511
|
+
return ret;
|
|
512
|
+
};
|
|
513
|
+
|
|
514
|
+
export function __wbindgen_init_externref_table() {
|
|
515
|
+
const table = wasm.__wbindgen_export_4;
|
|
516
|
+
const offset = table.grow(4);
|
|
517
|
+
table.set(0, undefined);
|
|
518
|
+
table.set(offset + 0, undefined);
|
|
519
|
+
table.set(offset + 1, null);
|
|
520
|
+
table.set(offset + 2, true);
|
|
521
|
+
table.set(offset + 3, false);
|
|
522
|
+
;
|
|
523
|
+
};
|
|
524
|
+
|
|
525
|
+
export function __wbindgen_is_bigint(arg0) {
|
|
526
|
+
const ret = typeof(arg0) === 'bigint';
|
|
527
|
+
return ret;
|
|
528
|
+
};
|
|
529
|
+
|
|
530
|
+
export function __wbindgen_is_function(arg0) {
|
|
531
|
+
const ret = typeof(arg0) === 'function';
|
|
532
|
+
return ret;
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
export function __wbindgen_is_object(arg0) {
|
|
536
|
+
const val = arg0;
|
|
537
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
538
|
+
return ret;
|
|
539
|
+
};
|
|
540
|
+
|
|
541
|
+
export function __wbindgen_is_undefined(arg0) {
|
|
542
|
+
const ret = arg0 === undefined;
|
|
543
|
+
return ret;
|
|
544
|
+
};
|
|
545
|
+
|
|
546
|
+
export function __wbindgen_jsval_eq(arg0, arg1) {
|
|
547
|
+
const ret = arg0 === arg1;
|
|
548
|
+
return ret;
|
|
549
|
+
};
|
|
550
|
+
|
|
551
|
+
export function __wbindgen_jsval_loose_eq(arg0, arg1) {
|
|
552
|
+
const ret = arg0 == arg1;
|
|
553
|
+
return ret;
|
|
554
|
+
};
|
|
555
|
+
|
|
556
|
+
export function __wbindgen_memory() {
|
|
557
|
+
const ret = wasm.memory;
|
|
558
|
+
return ret;
|
|
559
|
+
};
|
|
560
|
+
|
|
561
|
+
export function __wbindgen_number_get(arg0, arg1) {
|
|
562
|
+
const obj = arg1;
|
|
563
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
564
|
+
getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
|
|
565
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
|
|
566
|
+
};
|
|
567
|
+
|
|
568
|
+
export function __wbindgen_number_new(arg0) {
|
|
569
|
+
const ret = arg0;
|
|
570
|
+
return ret;
|
|
571
|
+
};
|
|
572
|
+
|
|
573
|
+
export function __wbindgen_string_get(arg0, arg1) {
|
|
574
|
+
const obj = arg1;
|
|
575
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
576
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
577
|
+
var len1 = WASM_VECTOR_LEN;
|
|
578
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
579
|
+
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
580
|
+
};
|
|
581
|
+
|
|
582
|
+
export function __wbindgen_string_new(arg0, arg1) {
|
|
583
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
584
|
+
return ret;
|
|
585
|
+
};
|
|
586
|
+
|
|
587
|
+
export function __wbindgen_throw(arg0, arg1) {
|
|
588
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
589
|
+
};
|
|
590
|
+
|
|
Binary file
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export const __wbg_blobencoder_free: (a: number, b: number) => void;
|
|
5
|
+
export const blobencoder_compute_metadata: (a: number, b: any) => [number, number, number];
|
|
6
|
+
export const blobencoder_decode: (a: number, b: any, c: bigint, d: number, e: number, f: any) => [number, number];
|
|
7
|
+
export const blobencoder_encode: (a: number, b: any, c: any, d: any) => [number, number, number];
|
|
8
|
+
export const blobencoder_new: (a: number) => [number, number, number];
|
|
9
|
+
export const bls12381_min_pk_aggregate: (a: any) => [number, number, number, number];
|
|
10
|
+
export const bls12381_min_pk_verify: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number];
|
|
11
|
+
export const bls12381_min_pk_verify_aggregate: (a: any, b: number, c: number, d: number, e: number) => [number, number, number];
|
|
12
|
+
export const rustsecp256k1_v0_8_1_context_create: (a: number) => number;
|
|
13
|
+
export const rustsecp256k1_v0_8_1_context_destroy: (a: number) => void;
|
|
14
|
+
export const rustsecp256k1_v0_8_1_default_error_callback_fn: (a: number, b: number) => void;
|
|
15
|
+
export const rustsecp256k1_v0_8_1_default_illegal_callback_fn: (a: number, b: number) => void;
|
|
16
|
+
export const __wbindgen_malloc: (a: number, b: number) => number;
|
|
17
|
+
export const __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
|
18
|
+
export const __wbindgen_exn_store: (a: number) => void;
|
|
19
|
+
export const __externref_table_alloc: () => number;
|
|
20
|
+
export const __wbindgen_externrefs: WebAssembly.Table;
|
|
21
|
+
export const __externref_table_dealloc: (a: number) => void;
|
|
22
|
+
export const __wbindgen_free: (a: number, b: number, c: number) => void;
|
|
23
|
+
export const __wbindgen_start: () => void;
|