@typeberry/native 0.0.1-64ee5ed

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.
Binary file
Binary file
Binary file
package/index.js ADDED
@@ -0,0 +1,555 @@
1
+ //#region rolldown:runtime
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (target, all) => {
4
+ for (var name in all) __defProp(target, name, {
5
+ get: all[name],
6
+ enumerable: true
7
+ });
8
+ };
9
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, { get: (a, b) => (typeof require !== "undefined" ? require : a)[b] }) : x)(function(x) {
10
+ if (typeof require !== "undefined") return require.apply(this, arguments);
11
+ throw Error("Calling `require` for \"" + x + "\" in an environment that doesn't expose the `require` function.");
12
+ });
13
+
14
+ //#endregion
15
+ //#region \0wasmHelpers.js
16
+ function _loadWasmModule(sync, filepath, src, imports) {
17
+ function _instantiateOrCompile(source, imports$1, stream) {
18
+ var instantiateFunc = stream ? WebAssembly.instantiateStreaming : WebAssembly.instantiate;
19
+ var compileFunc = stream ? WebAssembly.compileStreaming : WebAssembly.compile;
20
+ if (imports$1) return instantiateFunc(source, imports$1);
21
+ else return compileFunc(source);
22
+ }
23
+ var buf = null;
24
+ var isNode = typeof process !== "undefined" && process.versions != null && process.versions.node != null;
25
+ if (filepath && isNode) {
26
+ var fs = __require("fs");
27
+ var path = __require("path");
28
+ return new Promise((resolve, reject) => {
29
+ fs.readFile(path.resolve(__dirname, filepath), (error, buffer) => {
30
+ if (error != null) reject(error);
31
+ else resolve(_instantiateOrCompile(buffer, imports, false));
32
+ });
33
+ });
34
+ } else if (filepath) return _instantiateOrCompile(fetch(filepath), imports, true);
35
+ if (isNode) buf = Buffer.from(src, "base64");
36
+ else {
37
+ var raw = globalThis.atob(src);
38
+ var rawLength = raw.length;
39
+ buf = new Uint8Array(new ArrayBuffer(rawLength));
40
+ for (var i = 0; i < rawLength; i++) buf[i] = raw.charCodeAt(i);
41
+ }
42
+ if (sync) {
43
+ var mod = new WebAssembly.Module(buf);
44
+ return imports ? new WebAssembly.Instance(mod, imports) : mod;
45
+ } else return _instantiateOrCompile(buf, imports, false);
46
+ }
47
+
48
+ //#endregion
49
+ //#region bandersnatch/pkg/bandersnatch_bg.wasm
50
+ var bandersnatch_bg_exports = {};
51
+ __export(bandersnatch_bg_exports, { default: () => bandersnatch_bg_default });
52
+ function bandersnatch_bg_default(imports) {
53
+ return _loadWasmModule(0, "6cfc4680c1b51f91.wasm", null, imports);
54
+ }
55
+
56
+ //#endregion
57
+ //#region bandersnatch/pkg/bandersnatch_bg.js
58
+ let wasm$2;
59
+ function __wbg_set_wasm$2(val) {
60
+ wasm$2 = val;
61
+ }
62
+ let cachedUint8Memory0 = null;
63
+ function getUint8Memory0() {
64
+ if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) cachedUint8Memory0 = new Uint8Array(wasm$2.memory.buffer);
65
+ return cachedUint8Memory0;
66
+ }
67
+ let WASM_VECTOR_LEN$1 = 0;
68
+ function passArray8ToWasm0$1(arg, malloc) {
69
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
70
+ getUint8Memory0().set(arg, ptr / 1);
71
+ WASM_VECTOR_LEN$1 = arg.length;
72
+ return ptr;
73
+ }
74
+ let cachedInt32Memory0 = null;
75
+ function getInt32Memory0() {
76
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) cachedInt32Memory0 = new Int32Array(wasm$2.memory.buffer);
77
+ return cachedInt32Memory0;
78
+ }
79
+ function getArrayU8FromWasm0$1(ptr, len) {
80
+ ptr = ptr >>> 0;
81
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
82
+ }
83
+ /**
84
+ * @param {Uint8Array} keys
85
+ * @returns {Uint8Array}
86
+ */
87
+ function ring_commitment(keys) {
88
+ try {
89
+ const retptr = wasm$2.__wbindgen_add_to_stack_pointer(-16);
90
+ const ptr0 = passArray8ToWasm0$1(keys, wasm$2.__wbindgen_malloc);
91
+ const len0 = WASM_VECTOR_LEN$1;
92
+ wasm$2.ring_commitment(retptr, ptr0, len0);
93
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
94
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
95
+ var v2 = getArrayU8FromWasm0$1(r0, r1).slice();
96
+ wasm$2.__wbindgen_free(r0, r1 * 1, 1);
97
+ return v2;
98
+ } finally {
99
+ wasm$2.__wbindgen_add_to_stack_pointer(16);
100
+ }
101
+ }
102
+ /**
103
+ * Derive Private and Public Key from Seed
104
+ *
105
+ * returns: `Vec<u8>` containing the exit (1 byte) status followed by the (32 bytes) public key
106
+ * @param {Uint8Array} seed
107
+ * @returns {Uint8Array}
108
+ */
109
+ function derive_public_key(seed) {
110
+ try {
111
+ const retptr = wasm$2.__wbindgen_add_to_stack_pointer(-16);
112
+ const ptr0 = passArray8ToWasm0$1(seed, wasm$2.__wbindgen_malloc);
113
+ const len0 = WASM_VECTOR_LEN$1;
114
+ wasm$2.derive_public_key(retptr, ptr0, len0);
115
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
116
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
117
+ var v2 = getArrayU8FromWasm0$1(r0, r1).slice();
118
+ wasm$2.__wbindgen_free(r0, r1 * 1, 1);
119
+ return v2;
120
+ } finally {
121
+ wasm$2.__wbindgen_add_to_stack_pointer(16);
122
+ }
123
+ }
124
+ /**
125
+ * Seal verification as defined in:
126
+ * https://graypaper.fluffylabs.dev/#/68eaa1f/0eff000eff00?v=0.6.4
127
+ * or
128
+ * https://graypaper.fluffylabs.dev/#/68eaa1f/0e54010e5401?v=0.6.4
129
+ * @param {Uint8Array} keys
130
+ * @param {number} signer_key_index
131
+ * @param {Uint8Array} seal_data
132
+ * @param {Uint8Array} payload
133
+ * @param {Uint8Array} aux_data
134
+ * @returns {Uint8Array}
135
+ */
136
+ function verify_seal(keys, signer_key_index, seal_data, payload, aux_data) {
137
+ try {
138
+ const retptr = wasm$2.__wbindgen_add_to_stack_pointer(-16);
139
+ const ptr0 = passArray8ToWasm0$1(keys, wasm$2.__wbindgen_malloc);
140
+ const len0 = WASM_VECTOR_LEN$1;
141
+ const ptr1 = passArray8ToWasm0$1(seal_data, wasm$2.__wbindgen_malloc);
142
+ const len1 = WASM_VECTOR_LEN$1;
143
+ const ptr2 = passArray8ToWasm0$1(payload, wasm$2.__wbindgen_malloc);
144
+ const len2 = WASM_VECTOR_LEN$1;
145
+ const ptr3 = passArray8ToWasm0$1(aux_data, wasm$2.__wbindgen_malloc);
146
+ const len3 = WASM_VECTOR_LEN$1;
147
+ wasm$2.verify_seal(retptr, ptr0, len0, signer_key_index, ptr1, len1, ptr2, len2, ptr3, len3);
148
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
149
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
150
+ var v5 = getArrayU8FromWasm0$1(r0, r1).slice();
151
+ wasm$2.__wbindgen_free(r0, r1 * 1, 1);
152
+ return v5;
153
+ } finally {
154
+ wasm$2.__wbindgen_add_to_stack_pointer(16);
155
+ }
156
+ }
157
+ /**
158
+ * Verify multiple tickets at once as defined in:
159
+ * https://graypaper.fluffylabs.dev/#/68eaa1f/0f3e000f3e00?v=0.6.4
160
+ *
161
+ * NOTE: the aux_data of VRF function is empty!
162
+ * @param {Uint8Array} keys
163
+ * @param {Uint8Array} tickets_data
164
+ * @param {number} vrf_input_data_len
165
+ * @returns {Uint8Array}
166
+ */
167
+ function batch_verify_tickets(keys, tickets_data, vrf_input_data_len) {
168
+ try {
169
+ const retptr = wasm$2.__wbindgen_add_to_stack_pointer(-16);
170
+ const ptr0 = passArray8ToWasm0$1(keys, wasm$2.__wbindgen_malloc);
171
+ const len0 = WASM_VECTOR_LEN$1;
172
+ const ptr1 = passArray8ToWasm0$1(tickets_data, wasm$2.__wbindgen_malloc);
173
+ const len1 = WASM_VECTOR_LEN$1;
174
+ wasm$2.batch_verify_tickets(retptr, ptr0, len0, ptr1, len1, vrf_input_data_len);
175
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
176
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
177
+ var v3 = getArrayU8FromWasm0$1(r0, r1).slice();
178
+ wasm$2.__wbindgen_free(r0, r1 * 1, 1);
179
+ return v3;
180
+ } finally {
181
+ wasm$2.__wbindgen_add_to_stack_pointer(16);
182
+ }
183
+ }
184
+
185
+ //#endregion
186
+ //#region bandersnatch/pkg/bandersnatch.js
187
+ var bandersnatch_exports = {};
188
+ __export(bandersnatch_exports, {
189
+ __wbg_set_wasm: () => __wbg_set_wasm$2,
190
+ batch_verify_tickets: () => batch_verify_tickets,
191
+ derive_public_key: () => derive_public_key,
192
+ ring_commitment: () => ring_commitment,
193
+ verify_seal: () => verify_seal
194
+ });
195
+ __wbg_set_wasm$2(bandersnatch_bg_exports);
196
+
197
+ //#endregion
198
+ //#region ed25519/pkg/ed25519_wasm_bg.wasm
199
+ var ed25519_wasm_bg_exports = {};
200
+ __export(ed25519_wasm_bg_exports, { default: () => ed25519_wasm_bg_default });
201
+ function ed25519_wasm_bg_default(imports) {
202
+ return _loadWasmModule(0, "5941c010ea533d2f.wasm", null, imports);
203
+ }
204
+
205
+ //#endregion
206
+ //#region ed25519/pkg/ed25519_wasm_bg.js
207
+ let wasm$1;
208
+ function __wbg_set_wasm$1(val) {
209
+ wasm$1 = val;
210
+ }
211
+ let cachedUint8ArrayMemory0$1 = null;
212
+ function getUint8ArrayMemory0$1() {
213
+ if (cachedUint8ArrayMemory0$1 === null || cachedUint8ArrayMemory0$1.byteLength === 0) cachedUint8ArrayMemory0$1 = new Uint8Array(wasm$1.memory.buffer);
214
+ return cachedUint8ArrayMemory0$1;
215
+ }
216
+ let WASM_VECTOR_LEN = 0;
217
+ function passArray8ToWasm0(arg, malloc) {
218
+ const ptr = malloc(arg.length * 1, 1) >>> 0;
219
+ getUint8ArrayMemory0$1().set(arg, ptr / 1);
220
+ WASM_VECTOR_LEN = arg.length;
221
+ return ptr;
222
+ }
223
+ function getArrayU8FromWasm0(ptr, len) {
224
+ ptr = ptr >>> 0;
225
+ return getUint8ArrayMemory0$1().subarray(ptr / 1, ptr / 1 + len);
226
+ }
227
+ /**
228
+ *
229
+ * * Verify Ed25519 signatures one by one using strict verification.
230
+ * *
231
+ * * This function is slower but does strict verification.
232
+ *
233
+ * @param {Uint8Array} data
234
+ * @returns {Uint8Array}
235
+ */
236
+ function verify_ed25519(data) {
237
+ const ptr0 = passArray8ToWasm0(data, wasm$1.__wbindgen_malloc);
238
+ const len0 = WASM_VECTOR_LEN;
239
+ const ret = wasm$1.verify_ed25519(ptr0, len0);
240
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
241
+ wasm$1.__wbindgen_free(ret[0], ret[1] * 1, 1);
242
+ return v2;
243
+ }
244
+ /**
245
+ *
246
+ * * Verify Ed25519 signatures using build-in batch verification.
247
+ * *
248
+ * * This function is faster but does not do strict verification.
249
+ * * See https://crates.io/crates/ed25519-dalek#batch-verification for more information.
250
+ *
251
+ * @param {Uint8Array} data
252
+ * @returns {boolean}
253
+ */
254
+ function verify_ed25519_batch(data) {
255
+ const ptr0 = passArray8ToWasm0(data, wasm$1.__wbindgen_malloc);
256
+ const len0 = WASM_VECTOR_LEN;
257
+ return wasm$1.verify_ed25519_batch(ptr0, len0) !== 0;
258
+ }
259
+ function __wbindgen_init_externref_table() {
260
+ const table = wasm$1.__wbindgen_export_0;
261
+ const offset = table.grow(4);
262
+ table.set(0, void 0);
263
+ table.set(offset + 0, void 0);
264
+ table.set(offset + 1, null);
265
+ table.set(offset + 2, true);
266
+ table.set(offset + 3, false);
267
+ }
268
+
269
+ //#endregion
270
+ //#region ed25519/pkg/ed25519_wasm.js
271
+ var ed25519_wasm_exports = {};
272
+ __export(ed25519_wasm_exports, {
273
+ __wbg_set_wasm: () => __wbg_set_wasm$1,
274
+ __wbindgen_init_externref_table: () => __wbindgen_init_externref_table,
275
+ verify_ed25519: () => verify_ed25519,
276
+ verify_ed25519_batch: () => verify_ed25519_batch
277
+ });
278
+ __wbg_set_wasm$1(ed25519_wasm_bg_exports);
279
+ (void 0)();
280
+
281
+ //#endregion
282
+ //#region reed-solomon/pkg/reed_solomon_wasm_bg.wasm
283
+ var reed_solomon_wasm_bg_exports = {};
284
+ __export(reed_solomon_wasm_bg_exports, { default: () => reed_solomon_wasm_bg_default });
285
+ function reed_solomon_wasm_bg_default(imports) {
286
+ return _loadWasmModule(0, "d8c79d763f7586dd.wasm", null, imports);
287
+ }
288
+
289
+ //#endregion
290
+ //#region reed-solomon/pkg/reed_solomon_wasm_bg.js
291
+ let wasm;
292
+ function __wbg_set_wasm(val) {
293
+ wasm = val;
294
+ }
295
+ const heap = new Array(128).fill(void 0);
296
+ heap.push(void 0, null, true, false);
297
+ let heap_next = heap.length;
298
+ function addHeapObject(obj) {
299
+ if (heap_next === heap.length) heap.push(heap.length + 1);
300
+ const idx = heap_next;
301
+ heap_next = heap[idx];
302
+ heap[idx] = obj;
303
+ return idx;
304
+ }
305
+ function getObject(idx) {
306
+ return heap[idx];
307
+ }
308
+ function dropObject(idx) {
309
+ if (idx < 132) return;
310
+ heap[idx] = heap_next;
311
+ heap_next = idx;
312
+ }
313
+ function takeObject(idx) {
314
+ const ret = getObject(idx);
315
+ dropObject(idx);
316
+ return ret;
317
+ }
318
+ let cachedTextDecoder = new (typeof TextDecoder === "undefined" ? (0, module.require)("util").TextDecoder : TextDecoder)("utf-8", {
319
+ ignoreBOM: true,
320
+ fatal: true
321
+ });
322
+ cachedTextDecoder.decode();
323
+ let cachedUint8ArrayMemory0 = null;
324
+ function getUint8ArrayMemory0() {
325
+ if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
326
+ return cachedUint8ArrayMemory0;
327
+ }
328
+ function getStringFromWasm0(ptr, len) {
329
+ ptr = ptr >>> 0;
330
+ return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
331
+ }
332
+ function isLikeNone(x) {
333
+ return x === void 0 || x === null;
334
+ }
335
+ function _assertClass(instance, klass) {
336
+ if (!(instance instanceof klass)) throw new Error(`expected instance of ${klass.name}`);
337
+ return instance.ptr;
338
+ }
339
+ let cachedDataViewMemory0 = null;
340
+ function getDataViewMemory0() {
341
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
342
+ return cachedDataViewMemory0;
343
+ }
344
+ /**
345
+ * @param {number} recovery_count
346
+ * @param {ShardsCollection} shards
347
+ * @returns {ShardsCollection}
348
+ */
349
+ function encode(recovery_count, shards) {
350
+ try {
351
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
352
+ _assertClass(shards, ShardsCollection);
353
+ var ptr0 = shards.__destroy_into_raw();
354
+ wasm.encode(retptr, recovery_count, ptr0);
355
+ var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
356
+ var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
357
+ if (getDataViewMemory0().getInt32(retptr + 8, true)) throw takeObject(r1);
358
+ return ShardsCollection.__wrap(r0);
359
+ } finally {
360
+ wasm.__wbindgen_add_to_stack_pointer(16);
361
+ }
362
+ }
363
+ /**
364
+ * @param {number} original_count
365
+ * @param {number} recovery_count
366
+ * @param {ShardsCollection} shards
367
+ * @returns {ShardsCollection}
368
+ */
369
+ function decode(original_count, recovery_count, shards) {
370
+ try {
371
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
372
+ _assertClass(shards, ShardsCollection);
373
+ var ptr0 = shards.__destroy_into_raw();
374
+ wasm.decode(retptr, original_count, recovery_count, ptr0);
375
+ var r0 = getDataViewMemory0().getInt32(retptr + 0, true);
376
+ var r1 = getDataViewMemory0().getInt32(retptr + 4, true);
377
+ if (getDataViewMemory0().getInt32(retptr + 8, true)) throw takeObject(r1);
378
+ return ShardsCollection.__wrap(r0);
379
+ } finally {
380
+ wasm.__wbindgen_add_to_stack_pointer(16);
381
+ }
382
+ }
383
+ const ShardsCollectionFinalization = typeof FinalizationRegistry === "undefined" ? {
384
+ register: () => {},
385
+ unregister: () => {}
386
+ } : new FinalizationRegistry((ptr) => wasm.__wbg_shardscollection_free(ptr >>> 0, 1));
387
+ /**
388
+ * Collection of shards (either input or output).
389
+ *
390
+ * To efficiently pass data between JS and WASM all of the shards
391
+ * are passed as one big vector of bytes.
392
+ * It's assumed that every shard has the same length (`shard_len`).
393
+ * If the shards are NOT passed in the exact order they were created
394
+ * it's possible to pass `indices` array.
395
+ * A value of `indices` array at position `idx` is the shard index
396
+ * that resides at `[ idx * shard_len .. idx * shard_len + shard_len )`
397
+ * in `data` array.
398
+ *
399
+ * This collection is only used to get the data from JS or pass the data back.
400
+ * Internally we convert it to [`RsShardsCollection`], which copies
401
+ * the memory to/from WASM.
402
+ */
403
+ var ShardsCollection = class ShardsCollection {
404
+ static __wrap(ptr) {
405
+ ptr = ptr >>> 0;
406
+ const obj = Object.create(ShardsCollection.prototype);
407
+ obj.__wbg_ptr = ptr;
408
+ ShardsCollectionFinalization.register(obj, obj.__wbg_ptr, obj);
409
+ return obj;
410
+ }
411
+ __destroy_into_raw() {
412
+ const ptr = this.__wbg_ptr;
413
+ this.__wbg_ptr = 0;
414
+ ShardsCollectionFinalization.unregister(this);
415
+ return ptr;
416
+ }
417
+ free() {
418
+ const ptr = this.__destroy_into_raw();
419
+ wasm.__wbg_shardscollection_free(ptr, 0);
420
+ }
421
+ /**
422
+ * Number of shards within the collection.
423
+ * @returns {number}
424
+ */
425
+ get length() {
426
+ return wasm.__wbg_get_shardscollection_length(this.__wbg_ptr) >>> 0;
427
+ }
428
+ /**
429
+ * Number of shards within the collection.
430
+ * @param {number} arg0
431
+ */
432
+ set length(arg0) {
433
+ wasm.__wbg_set_shardscollection_length(this.__wbg_ptr, arg0);
434
+ }
435
+ /**
436
+ * The length of each shard.
437
+ * @returns {number}
438
+ */
439
+ get shard_len() {
440
+ return wasm.__wbg_get_shardscollection_shard_len(this.__wbg_ptr);
441
+ }
442
+ /**
443
+ * The length of each shard.
444
+ * @param {number} arg0
445
+ */
446
+ set shard_len(arg0) {
447
+ wasm.__wbg_set_shardscollection_shard_len(this.__wbg_ptr, arg0);
448
+ }
449
+ /**
450
+ * @param {number} shard_len
451
+ * @param {Uint8Array} data
452
+ * @param {Uint16Array | undefined} [indices]
453
+ */
454
+ constructor(shard_len, data, indices) {
455
+ this.__wbg_ptr = wasm.shardscollection_new(shard_len, addHeapObject(data), isLikeNone(indices) ? 0 : addHeapObject(indices)) >>> 0;
456
+ ShardsCollectionFinalization.register(this, this.__wbg_ptr, this);
457
+ return this;
458
+ }
459
+ /**
460
+ * Extract the `indices` from this shards container.
461
+ *
462
+ * Should be called on the JS side to avoid copying.
463
+ * NOTE that subsequent calls to that method will return `None`.
464
+ * @returns {Uint16Array | undefined}
465
+ */
466
+ take_indices() {
467
+ const ret = wasm.shardscollection_take_indices(this.__wbg_ptr);
468
+ return takeObject(ret);
469
+ }
470
+ /**
471
+ * Take the underlying `data` to the JS side.
472
+ *
473
+ * NOTE this object is destroyed after the data is consumed,
474
+ * so make sure to [`take_indices`] first.
475
+ * @returns {Uint8Array}
476
+ */
477
+ take_data() {
478
+ const ptr = this.__destroy_into_raw();
479
+ const ret = wasm.shardscollection_take_data(ptr);
480
+ return takeObject(ret);
481
+ }
482
+ };
483
+ function __wbindgen_memory() {
484
+ const ret = wasm.memory;
485
+ return addHeapObject(ret);
486
+ }
487
+ function __wbg_buffer_b7b08af79b0b0974(arg0) {
488
+ const ret = getObject(arg0).buffer;
489
+ return addHeapObject(ret);
490
+ }
491
+ function __wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9(arg0, arg1, arg2) {
492
+ const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
493
+ return addHeapObject(ret);
494
+ }
495
+ function __wbindgen_object_drop_ref(arg0) {
496
+ takeObject(arg0);
497
+ }
498
+ function __wbg_new_ea1883e1e5e86686(arg0) {
499
+ const ret = new Uint8Array(getObject(arg0));
500
+ return addHeapObject(ret);
501
+ }
502
+ function __wbg_newwithbyteoffsetandlength_bd3d5191e8925067(arg0, arg1, arg2) {
503
+ const ret = new Uint16Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
504
+ return addHeapObject(ret);
505
+ }
506
+ function __wbg_new_51798470384ee5a8(arg0) {
507
+ const ret = new Uint16Array(getObject(arg0));
508
+ return addHeapObject(ret);
509
+ }
510
+ function __wbg_length_8339fcf5d8ecd12e(arg0) {
511
+ return getObject(arg0).length;
512
+ }
513
+ function __wbg_length_ff22981e43417ccf(arg0) {
514
+ return getObject(arg0).length;
515
+ }
516
+ function __wbindgen_string_new(arg0, arg1) {
517
+ const ret = getStringFromWasm0(arg0, arg1);
518
+ return addHeapObject(ret);
519
+ }
520
+ function __wbg_set_d1e79e2388520f18(arg0, arg1, arg2) {
521
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
522
+ }
523
+ function __wbg_set_e83c20bbf4b38a6b(arg0, arg1, arg2) {
524
+ getObject(arg0).set(getObject(arg1), arg2 >>> 0);
525
+ }
526
+ function __wbindgen_throw(arg0, arg1) {
527
+ throw new Error(getStringFromWasm0(arg0, arg1));
528
+ }
529
+
530
+ //#endregion
531
+ //#region reed-solomon/pkg/reed_solomon_wasm.js
532
+ var reed_solomon_wasm_exports = {};
533
+ __export(reed_solomon_wasm_exports, {
534
+ ShardsCollection: () => ShardsCollection,
535
+ __wbg_buffer_b7b08af79b0b0974: () => __wbg_buffer_b7b08af79b0b0974,
536
+ __wbg_length_8339fcf5d8ecd12e: () => __wbg_length_8339fcf5d8ecd12e,
537
+ __wbg_length_ff22981e43417ccf: () => __wbg_length_ff22981e43417ccf,
538
+ __wbg_new_51798470384ee5a8: () => __wbg_new_51798470384ee5a8,
539
+ __wbg_new_ea1883e1e5e86686: () => __wbg_new_ea1883e1e5e86686,
540
+ __wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9: () => __wbg_newwithbyteoffsetandlength_8a2cb9ca96b27ec9,
541
+ __wbg_newwithbyteoffsetandlength_bd3d5191e8925067: () => __wbg_newwithbyteoffsetandlength_bd3d5191e8925067,
542
+ __wbg_set_d1e79e2388520f18: () => __wbg_set_d1e79e2388520f18,
543
+ __wbg_set_e83c20bbf4b38a6b: () => __wbg_set_e83c20bbf4b38a6b,
544
+ __wbg_set_wasm: () => __wbg_set_wasm,
545
+ __wbindgen_memory: () => __wbindgen_memory,
546
+ __wbindgen_object_drop_ref: () => __wbindgen_object_drop_ref,
547
+ __wbindgen_string_new: () => __wbindgen_string_new,
548
+ __wbindgen_throw: () => __wbindgen_throw,
549
+ decode: () => decode,
550
+ encode: () => encode
551
+ });
552
+ __wbg_set_wasm(reed_solomon_wasm_bg_exports);
553
+
554
+ //#endregion
555
+ export { bandersnatch_exports as bandersnatch, ed25519_wasm_exports as ed25519, reed_solomon_wasm_exports as reedSolomon };
package/package.json ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "name": "@typeberry/native",
3
+ "version": "0.0.1-64ee5ed",
4
+ "main": "./index.js",
5
+ "type": "module",
6
+ "author": "Fluffy Labs",
7
+ "license": "MPL-2.0",
8
+ "scripts": {
9
+ "lint": "true",
10
+ "test": "true",
11
+ "build": "true"
12
+ }
13
+ }