@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/Cargo.toml ADDED
@@ -0,0 +1,39 @@
1
+ [package]
2
+ name = "walrus-wasm"
3
+ version = "0.1.0"
4
+ authors = ["jonaslindstrom"]
5
+ edition = "2024"
6
+
7
+ [lib]
8
+ crate-type = ["cdylib", "rlib"]
9
+
10
+ [features]
11
+ default = ["console_error_panic_hook"]
12
+
13
+ [dependencies]
14
+ bcs = "0.1"
15
+ wasm-bindgen = "0.2.84"
16
+ js-sys = "0.3"
17
+ fastcrypto = { git = "https://github.com/haneullabs/fastcrypto.git", rev = "f519333aefa238384f813af74bbb58c68cc38ee7", features = ["wasm"]}
18
+ walrus-core = { git = "ssh://git@github.com/haneullabs/walrus.git", branch = "main", package = "walrus-core" }
19
+ serde-wasm-bindgen = "0.4"
20
+ reed-solomon-simd = "3.0.1"
21
+
22
+ # The `console_error_panic_hook` crate provides better debugging of panics by
23
+ # logging them with `console.error`. This is great for development, but requires
24
+ # all the `std::fmt` and `std::panicking` infrastructure, so isn't great for
25
+ # code size when deploying.
26
+ console_error_panic_hook = { version = "0.1.7", optional = true }
27
+
28
+ [dev-dependencies]
29
+ wasm-bindgen-test = "0.3.34"
30
+
31
+ [profile.release]
32
+ # Tell `rustc` to optimize for small code size.
33
+ opt-level = "s"
34
+
35
+ [dependencies.web-sys]
36
+ version = "0.3"
37
+ features = [
38
+ "console",
39
+ ]
package/README.md ADDED
@@ -0,0 +1 @@
1
+ # Walrus WASM bindings
package/index.js ADDED
@@ -0,0 +1,7 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ const wasm = require('./nodejs/walrus_wasm.js');
5
+ function init() {}
6
+ module.exports = init;
7
+ Object.assign(module.exports, wasm, { default: init });
package/index.mjs ADDED
@@ -0,0 +1,5 @@
1
+ // Copyright (c) Mysten Labs, Inc.
2
+ // SPDX-License-Identifier: Apache-2.0
3
+
4
+ export * from './nodejs/walrus_wasm.js';
5
+ export default function init() {}
@@ -0,0 +1,48 @@
1
+ /* tslint:disable */
2
+ /* eslint-disable */
3
+ /**
4
+ * Aggregate a list of signatures.
5
+ * The signatures must be of the type Vec<Vec<u8>> with each signature being a 96 bytes long serialized signature.
6
+ */
7
+ export function bls12381_min_pk_aggregate(signatures: any): Uint8Array;
8
+ /**
9
+ * Verify an aggregate signature.
10
+ */
11
+ export function bls12381_min_pk_verify_aggregate(public_keys: any, msg: Uint8Array, signature: Uint8Array): boolean;
12
+ export function bls12381_min_pk_verify(signature: Uint8Array, public_key: Uint8Array, msg: Uint8Array): boolean;
13
+ export class BlobEncoder {
14
+ free(): void;
15
+ [Symbol.dispose](): void;
16
+ /**
17
+ * Compute metadata for data without encoding it.
18
+ * Returns only the essential fields needed for blob registration:
19
+ * (blob_id, root_hash, unencoded_length, encoding_type)
20
+ *
21
+ * This avoids serializing all 2k sliver hashes across the JS/WASM boundary.
22
+ */
23
+ compute_metadata(data: Uint8Array): any;
24
+ constructor(n_shards: number);
25
+ /**
26
+ * Decode blob from BCS-encoded SliverData buffers.
27
+ *
28
+ * Arguments:
29
+ * - blob_id: The blob identifier
30
+ * - blob_size: The original unencoded blob size in bytes
31
+ * - bcs_buffers: Vec<Uint8Array>, each containing BCS-encoded SliverData<Primary>
32
+ * - output_buffer: Uint8Array to write decoded data into (must be exactly blob_size bytes)
33
+ */
34
+ decode(blob_id: any, blob_size: bigint, bcs_buffers: Uint8Array[], output_buffer: Uint8Array): void;
35
+ /**
36
+ * Encode data and write BCS-encoded SliverData directly into pre-allocated buffers.
37
+ *
38
+ * Arguments:
39
+ * - data: Input data to encode
40
+ * - primary_buffers: Array of Uint8Array buffers (one per shard) for primary slivers
41
+ * - secondary_buffers: Array of Uint8Array buffers (one per shard) for secondary slivers
42
+ *
43
+ * Each buffer will be written with BCS-encoded SliverData.
44
+ *
45
+ * Returns: JsValue with (metadata, root_hash)
46
+ */
47
+ encode(data: Uint8Array, primary_buffers: Array<any>, secondary_buffers: Array<any>): any;
48
+ }
@@ -0,0 +1,560 @@
1
+
2
+ let imports = {};
3
+ imports['__wbindgen_placeholder__'] = module.exports;
4
+
5
+ let cachedUint8ArrayMemory0 = null;
6
+
7
+ function getUint8ArrayMemory0() {
8
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) {
9
+ cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
10
+ }
11
+ return cachedUint8ArrayMemory0;
12
+ }
13
+
14
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
15
+
16
+ cachedTextDecoder.decode();
17
+
18
+ function decodeText(ptr, len) {
19
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
20
+ }
21
+
22
+ function getStringFromWasm0(ptr, len) {
23
+ ptr = ptr >>> 0;
24
+ return decodeText(ptr, len);
25
+ }
26
+
27
+ let WASM_VECTOR_LEN = 0;
28
+
29
+ const cachedTextEncoder = new TextEncoder();
30
+
31
+ if (!('encodeInto' in cachedTextEncoder)) {
32
+ cachedTextEncoder.encodeInto = function (arg, view) {
33
+ const buf = cachedTextEncoder.encode(arg);
34
+ view.set(buf);
35
+ return {
36
+ read: arg.length,
37
+ written: buf.length
38
+ };
39
+ }
40
+ }
41
+
42
+ function passStringToWasm0(arg, malloc, realloc) {
43
+
44
+ if (realloc === undefined) {
45
+ const buf = cachedTextEncoder.encode(arg);
46
+ const ptr = malloc(buf.length, 1) >>> 0;
47
+ getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
48
+ WASM_VECTOR_LEN = buf.length;
49
+ return ptr;
50
+ }
51
+
52
+ let len = arg.length;
53
+ let ptr = malloc(len, 1) >>> 0;
54
+
55
+ const mem = getUint8ArrayMemory0();
56
+
57
+ let offset = 0;
58
+
59
+ for (; offset < len; offset++) {
60
+ const code = arg.charCodeAt(offset);
61
+ if (code > 0x7F) break;
62
+ mem[ptr + offset] = code;
63
+ }
64
+
65
+ if (offset !== len) {
66
+ if (offset !== 0) {
67
+ arg = arg.slice(offset);
68
+ }
69
+ ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
70
+ const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
71
+ const ret = cachedTextEncoder.encodeInto(arg, view);
72
+
73
+ offset += ret.written;
74
+ ptr = realloc(ptr, len, offset, 1) >>> 0;
75
+ }
76
+
77
+ WASM_VECTOR_LEN = offset;
78
+ return ptr;
79
+ }
80
+
81
+ let cachedDataViewMemory0 = null;
82
+
83
+ function getDataViewMemory0() {
84
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
85
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
86
+ }
87
+ return cachedDataViewMemory0;
88
+ }
89
+
90
+ function isLikeNone(x) {
91
+ return x === undefined || x === null;
92
+ }
93
+
94
+ function debugString(val) {
95
+ // primitive types
96
+ const type = typeof val;
97
+ if (type == 'number' || type == 'boolean' || val == null) {
98
+ return `${val}`;
99
+ }
100
+ if (type == 'string') {
101
+ return `"${val}"`;
102
+ }
103
+ if (type == 'symbol') {
104
+ const description = val.description;
105
+ if (description == null) {
106
+ return 'Symbol';
107
+ } else {
108
+ return `Symbol(${description})`;
109
+ }
110
+ }
111
+ if (type == 'function') {
112
+ const name = val.name;
113
+ if (typeof name == 'string' && name.length > 0) {
114
+ return `Function(${name})`;
115
+ } else {
116
+ return 'Function';
117
+ }
118
+ }
119
+ // objects
120
+ if (Array.isArray(val)) {
121
+ const length = val.length;
122
+ let debug = '[';
123
+ if (length > 0) {
124
+ debug += debugString(val[0]);
125
+ }
126
+ for(let i = 1; i < length; i++) {
127
+ debug += ', ' + debugString(val[i]);
128
+ }
129
+ debug += ']';
130
+ return debug;
131
+ }
132
+ // Test for built-in
133
+ const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
134
+ let className;
135
+ if (builtInMatches && builtInMatches.length > 1) {
136
+ className = builtInMatches[1];
137
+ } else {
138
+ // Failed to match the standard '[object ClassName]'
139
+ return toString.call(val);
140
+ }
141
+ if (className == 'Object') {
142
+ // we're a user defined class or Object
143
+ // JSON.stringify avoids problems with cycles, and is generally much
144
+ // easier than looping through ownProperties of `val`.
145
+ try {
146
+ return 'Object(' + JSON.stringify(val) + ')';
147
+ } catch (_) {
148
+ return 'Object';
149
+ }
150
+ }
151
+ // errors
152
+ if (val instanceof Error) {
153
+ return `${val.name}: ${val.message}\n${val.stack}`;
154
+ }
155
+ // TODO we could test for more things here, like `Set`s and `Map`s.
156
+ return className;
157
+ }
158
+
159
+ function addToExternrefTable0(obj) {
160
+ const idx = wasm.__externref_table_alloc();
161
+ wasm.__wbindgen_externrefs.set(idx, obj);
162
+ return idx;
163
+ }
164
+
165
+ function handleError(f, args) {
166
+ try {
167
+ return f.apply(this, args);
168
+ } catch (e) {
169
+ const idx = addToExternrefTable0(e);
170
+ wasm.__wbindgen_exn_store(idx);
171
+ }
172
+ }
173
+
174
+ function getArrayU8FromWasm0(ptr, len) {
175
+ ptr = ptr >>> 0;
176
+ return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
177
+ }
178
+
179
+ function takeFromExternrefTable0(idx) {
180
+ const value = wasm.__wbindgen_externrefs.get(idx);
181
+ wasm.__externref_table_dealloc(idx);
182
+ return value;
183
+ }
184
+
185
+ function passArrayJsValueToWasm0(array, malloc) {
186
+ const ptr = malloc(array.length * 4, 4) >>> 0;
187
+ for (let i = 0; i < array.length; i++) {
188
+ const add = addToExternrefTable0(array[i]);
189
+ getDataViewMemory0().setUint32(ptr + 4 * i, add, true);
190
+ }
191
+ WASM_VECTOR_LEN = array.length;
192
+ return ptr;
193
+ }
194
+ /**
195
+ * Aggregate a list of signatures.
196
+ * The signatures must be of the type Vec<Vec<u8>> with each signature being a 96 bytes long serialized signature.
197
+ * @param {any} signatures
198
+ * @returns {Uint8Array}
199
+ */
200
+ exports.bls12381_min_pk_aggregate = function(signatures) {
201
+ const ret = wasm.bls12381_min_pk_aggregate(signatures);
202
+ if (ret[3]) {
203
+ throw takeFromExternrefTable0(ret[2]);
204
+ }
205
+ var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
206
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
207
+ return v1;
208
+ };
209
+
210
+ function passArray8ToWasm0(arg, malloc) {
211
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
212
+ getUint8ArrayMemory0().set(arg, ptr / 1);
213
+ WASM_VECTOR_LEN = arg.length;
214
+ return ptr;
215
+ }
216
+ /**
217
+ * Verify an aggregate signature.
218
+ * @param {any} public_keys
219
+ * @param {Uint8Array} msg
220
+ * @param {Uint8Array} signature
221
+ * @returns {boolean}
222
+ */
223
+ exports.bls12381_min_pk_verify_aggregate = function(public_keys, msg, signature) {
224
+ const ptr0 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
225
+ const len0 = WASM_VECTOR_LEN;
226
+ const ptr1 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
227
+ const len1 = WASM_VECTOR_LEN;
228
+ const ret = wasm.bls12381_min_pk_verify_aggregate(public_keys, ptr0, len0, ptr1, len1);
229
+ if (ret[2]) {
230
+ throw takeFromExternrefTable0(ret[1]);
231
+ }
232
+ return ret[0] !== 0;
233
+ };
234
+
235
+ /**
236
+ * @param {Uint8Array} signature
237
+ * @param {Uint8Array} public_key
238
+ * @param {Uint8Array} msg
239
+ * @returns {boolean}
240
+ */
241
+ exports.bls12381_min_pk_verify = function(signature, public_key, msg) {
242
+ const ptr0 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
243
+ const len0 = WASM_VECTOR_LEN;
244
+ const ptr1 = passArray8ToWasm0(public_key, wasm.__wbindgen_malloc);
245
+ const len1 = WASM_VECTOR_LEN;
246
+ const ptr2 = passArray8ToWasm0(msg, wasm.__wbindgen_malloc);
247
+ const len2 = WASM_VECTOR_LEN;
248
+ const ret = wasm.bls12381_min_pk_verify(ptr0, len0, ptr1, len1, ptr2, len2);
249
+ if (ret[2]) {
250
+ throw takeFromExternrefTable0(ret[1]);
251
+ }
252
+ return ret[0] !== 0;
253
+ };
254
+
255
+ const BlobEncoderFinalization = (typeof FinalizationRegistry === 'undefined')
256
+ ? { register: () => {}, unregister: () => {} }
257
+ : new FinalizationRegistry(ptr => wasm.__wbg_blobencoder_free(ptr >>> 0, 1));
258
+
259
+ class BlobEncoder {
260
+
261
+ __destroy_into_raw() {
262
+ const ptr = this.__wbg_ptr;
263
+ this.__wbg_ptr = 0;
264
+ BlobEncoderFinalization.unregister(this);
265
+ return ptr;
266
+ }
267
+
268
+ free() {
269
+ const ptr = this.__destroy_into_raw();
270
+ wasm.__wbg_blobencoder_free(ptr, 0);
271
+ }
272
+ /**
273
+ * Compute metadata for data without encoding it.
274
+ * Returns only the essential fields needed for blob registration:
275
+ * (blob_id, root_hash, unencoded_length, encoding_type)
276
+ *
277
+ * This avoids serializing all 2k sliver hashes across the JS/WASM boundary.
278
+ * @param {Uint8Array} data
279
+ * @returns {any}
280
+ */
281
+ compute_metadata(data) {
282
+ const ret = wasm.blobencoder_compute_metadata(this.__wbg_ptr, data);
283
+ if (ret[2]) {
284
+ throw takeFromExternrefTable0(ret[1]);
285
+ }
286
+ return takeFromExternrefTable0(ret[0]);
287
+ }
288
+ /**
289
+ * @param {number} n_shards
290
+ */
291
+ constructor(n_shards) {
292
+ const ret = wasm.blobencoder_new(n_shards);
293
+ if (ret[2]) {
294
+ throw takeFromExternrefTable0(ret[1]);
295
+ }
296
+ this.__wbg_ptr = ret[0] >>> 0;
297
+ BlobEncoderFinalization.register(this, this.__wbg_ptr, this);
298
+ return this;
299
+ }
300
+ /**
301
+ * Decode blob from BCS-encoded SliverData buffers.
302
+ *
303
+ * Arguments:
304
+ * - blob_id: The blob identifier
305
+ * - blob_size: The original unencoded blob size in bytes
306
+ * - bcs_buffers: Vec<Uint8Array>, each containing BCS-encoded SliverData<Primary>
307
+ * - output_buffer: Uint8Array to write decoded data into (must be exactly blob_size bytes)
308
+ * @param {any} blob_id
309
+ * @param {bigint} blob_size
310
+ * @param {Uint8Array[]} bcs_buffers
311
+ * @param {Uint8Array} output_buffer
312
+ */
313
+ decode(blob_id, blob_size, bcs_buffers, output_buffer) {
314
+ const ptr0 = passArrayJsValueToWasm0(bcs_buffers, wasm.__wbindgen_malloc);
315
+ const len0 = WASM_VECTOR_LEN;
316
+ const ret = wasm.blobencoder_decode(this.__wbg_ptr, blob_id, blob_size, ptr0, len0, output_buffer);
317
+ if (ret[1]) {
318
+ throw takeFromExternrefTable0(ret[0]);
319
+ }
320
+ }
321
+ /**
322
+ * Encode data and write BCS-encoded SliverData directly into pre-allocated buffers.
323
+ *
324
+ * Arguments:
325
+ * - data: Input data to encode
326
+ * - primary_buffers: Array of Uint8Array buffers (one per shard) for primary slivers
327
+ * - secondary_buffers: Array of Uint8Array buffers (one per shard) for secondary slivers
328
+ *
329
+ * Each buffer will be written with BCS-encoded SliverData.
330
+ *
331
+ * Returns: JsValue with (metadata, root_hash)
332
+ * @param {Uint8Array} data
333
+ * @param {Array<any>} primary_buffers
334
+ * @param {Array<any>} secondary_buffers
335
+ * @returns {any}
336
+ */
337
+ encode(data, primary_buffers, secondary_buffers) {
338
+ const ret = wasm.blobencoder_encode(this.__wbg_ptr, data, primary_buffers, secondary_buffers);
339
+ if (ret[2]) {
340
+ throw takeFromExternrefTable0(ret[1]);
341
+ }
342
+ return takeFromExternrefTable0(ret[0]);
343
+ }
344
+ }
345
+ if (Symbol.dispose) BlobEncoder.prototype[Symbol.dispose] = BlobEncoder.prototype.free;
346
+
347
+ exports.BlobEncoder = BlobEncoder;
348
+
349
+ exports.__wbg_Error_e83987f665cf5504 = function(arg0, arg1) {
350
+ const ret = Error(getStringFromWasm0(arg0, arg1));
351
+ return ret;
352
+ };
353
+
354
+ exports.__wbg_String_fed4d24b68977888 = function(arg0, arg1) {
355
+ const ret = String(arg1);
356
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
357
+ const len1 = WASM_VECTOR_LEN;
358
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
359
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
360
+ };
361
+
362
+ exports.__wbg___wbindgen_boolean_get_6d5a1ee65bab5f68 = function(arg0) {
363
+ const v = arg0;
364
+ const ret = typeof(v) === 'boolean' ? v : undefined;
365
+ return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0;
366
+ };
367
+
368
+ exports.__wbg___wbindgen_debug_string_df47ffb5e35e6763 = function(arg0, arg1) {
369
+ const ret = debugString(arg1);
370
+ const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
371
+ const len1 = WASM_VECTOR_LEN;
372
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
373
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
374
+ };
375
+
376
+ exports.__wbg___wbindgen_is_function_ee8a6c5833c90377 = function(arg0) {
377
+ const ret = typeof(arg0) === 'function';
378
+ return ret;
379
+ };
380
+
381
+ exports.__wbg___wbindgen_is_object_c818261d21f283a4 = function(arg0) {
382
+ const val = arg0;
383
+ const ret = typeof(val) === 'object' && val !== null;
384
+ return ret;
385
+ };
386
+
387
+ exports.__wbg___wbindgen_jsval_loose_eq_b664b38a2f582147 = function(arg0, arg1) {
388
+ const ret = arg0 == arg1;
389
+ return ret;
390
+ };
391
+
392
+ exports.__wbg___wbindgen_number_get_a20bf9b85341449d = function(arg0, arg1) {
393
+ const obj = arg1;
394
+ const ret = typeof(obj) === 'number' ? obj : undefined;
395
+ getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true);
396
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
397
+ };
398
+
399
+ exports.__wbg___wbindgen_string_get_e4f06c90489ad01b = function(arg0, arg1) {
400
+ const obj = arg1;
401
+ const ret = typeof(obj) === 'string' ? obj : undefined;
402
+ var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
403
+ var len1 = WASM_VECTOR_LEN;
404
+ getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
405
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
406
+ };
407
+
408
+ exports.__wbg___wbindgen_throw_b855445ff6a94295 = function(arg0, arg1) {
409
+ throw new Error(getStringFromWasm0(arg0, arg1));
410
+ };
411
+
412
+ exports.__wbg_call_e762c39fa8ea36bf = function() { return handleError(function (arg0, arg1) {
413
+ const ret = arg0.call(arg1);
414
+ return ret;
415
+ }, arguments) };
416
+
417
+ exports.__wbg_done_2042aa2670fb1db1 = function(arg0) {
418
+ const ret = arg0.done;
419
+ return ret;
420
+ };
421
+
422
+ exports.__wbg_get_7bed016f185add81 = function(arg0, arg1) {
423
+ const ret = arg0[arg1 >>> 0];
424
+ return ret;
425
+ };
426
+
427
+ exports.__wbg_get_efcb449f58ec27c2 = function() { return handleError(function (arg0, arg1) {
428
+ const ret = Reflect.get(arg0, arg1);
429
+ return ret;
430
+ }, arguments) };
431
+
432
+ exports.__wbg_instanceof_ArrayBuffer_70beb1189ca63b38 = function(arg0) {
433
+ let result;
434
+ try {
435
+ result = arg0 instanceof ArrayBuffer;
436
+ } catch (_) {
437
+ result = false;
438
+ }
439
+ const ret = result;
440
+ return ret;
441
+ };
442
+
443
+ exports.__wbg_instanceof_Uint8Array_20c8e73002f7af98 = function(arg0) {
444
+ let result;
445
+ try {
446
+ result = arg0 instanceof Uint8Array;
447
+ } catch (_) {
448
+ result = false;
449
+ }
450
+ const ret = result;
451
+ return ret;
452
+ };
453
+
454
+ exports.__wbg_isArray_96e0af9891d0945d = function(arg0) {
455
+ const ret = Array.isArray(arg0);
456
+ return ret;
457
+ };
458
+
459
+ exports.__wbg_isSafeInteger_d216eda7911dde36 = function(arg0) {
460
+ const ret = Number.isSafeInteger(arg0);
461
+ return ret;
462
+ };
463
+
464
+ exports.__wbg_iterator_e5822695327a3c39 = function() {
465
+ const ret = Symbol.iterator;
466
+ return ret;
467
+ };
468
+
469
+ exports.__wbg_length_69bca3cb64fc8748 = function(arg0) {
470
+ const ret = arg0.length;
471
+ return ret;
472
+ };
473
+
474
+ exports.__wbg_length_cdd215e10d9dd507 = function(arg0) {
475
+ const ret = arg0.length;
476
+ return ret;
477
+ };
478
+
479
+ exports.__wbg_new_1acc0b6eea89d040 = function() {
480
+ const ret = new Object();
481
+ return ret;
482
+ };
483
+
484
+ exports.__wbg_new_5a79be3ab53b8aa5 = function(arg0) {
485
+ const ret = new Uint8Array(arg0);
486
+ return ret;
487
+ };
488
+
489
+ exports.__wbg_new_e17d9f43105b08be = function() {
490
+ const ret = new Array();
491
+ return ret;
492
+ };
493
+
494
+ exports.__wbg_next_020810e0ae8ebcb0 = function() { return handleError(function (arg0) {
495
+ const ret = arg0.next();
496
+ return ret;
497
+ }, arguments) };
498
+
499
+ exports.__wbg_next_2c826fe5dfec6b6a = function(arg0) {
500
+ const ret = arg0.next;
501
+ return ret;
502
+ };
503
+
504
+ exports.__wbg_prototypesetcall_2a6620b6922694b2 = function(arg0, arg1, arg2) {
505
+ Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2);
506
+ };
507
+
508
+ exports.__wbg_set_3fda3bac07393de4 = function(arg0, arg1, arg2) {
509
+ arg0[arg1] = arg2;
510
+ };
511
+
512
+ exports.__wbg_set_9e6516df7b7d0f19 = function(arg0, arg1, arg2) {
513
+ arg0.set(getArrayU8FromWasm0(arg1, arg2));
514
+ };
515
+
516
+ exports.__wbg_set_c213c871859d6500 = function(arg0, arg1, arg2) {
517
+ arg0[arg1 >>> 0] = arg2;
518
+ };
519
+
520
+ exports.__wbg_value_692627309814bb8c = function(arg0) {
521
+ const ret = arg0.value;
522
+ return ret;
523
+ };
524
+
525
+ exports.__wbindgen_cast_2241b6af4c4b2941 = function(arg0, arg1) {
526
+ // Cast intrinsic for `Ref(String) -> Externref`.
527
+ const ret = getStringFromWasm0(arg0, arg1);
528
+ return ret;
529
+ };
530
+
531
+ exports.__wbindgen_cast_4625c577ab2ec9ee = function(arg0) {
532
+ // Cast intrinsic for `U64 -> Externref`.
533
+ const ret = BigInt.asUintN(64, arg0);
534
+ return ret;
535
+ };
536
+
537
+ exports.__wbindgen_cast_d6cd19b81560fd6e = function(arg0) {
538
+ // Cast intrinsic for `F64 -> Externref`.
539
+ const ret = arg0;
540
+ return ret;
541
+ };
542
+
543
+ exports.__wbindgen_init_externref_table = function() {
544
+ const table = wasm.__wbindgen_externrefs;
545
+ const offset = table.grow(4);
546
+ table.set(0, undefined);
547
+ table.set(offset + 0, undefined);
548
+ table.set(offset + 1, null);
549
+ table.set(offset + 2, true);
550
+ table.set(offset + 3, false);
551
+ ;
552
+ };
553
+
554
+ const wasmPath = `${__dirname}/walrus_wasm_bg.wasm`;
555
+ const wasmBytes = require('fs').readFileSync(wasmPath);
556
+ const wasmModule = new WebAssembly.Module(wasmBytes);
557
+ const wasm = exports.__wasm = new WebAssembly.Instance(wasmModule, imports).exports;
558
+
559
+ wasm.__wbindgen_start();
560
+
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;