@waku/rln 0.1.8-e224c05.0 → 0.1.8-e800af3.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/bundle/_virtual/utils.js +2 -2
- package/bundle/_virtual/utils2.js +2 -2
- package/bundle/index.js +6 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/_sha2.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/hmac.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/pbkdf2.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/scrypt.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha256.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha512.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/utils.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +2 -2
- package/bundle/node_modules/@chainsafe/is-ip/lib/is-ip.js +12 -0
- package/bundle/node_modules/@chainsafe/is-ip/lib/parse.js +26 -0
- package/bundle/node_modules/@chainsafe/is-ip/lib/parser.js +202 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/constants.js +43 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/errors.js +17 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/registry.js +245 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/utils.js +191 -0
- package/bundle/node_modules/@multiformats/multiaddr/dist/src/validation.js +30 -0
- package/bundle/node_modules/@noble/hashes/esm/hmac.js +88 -0
- package/bundle/node_modules/@noble/hashes/esm/sha3.js +1 -1
- package/bundle/node_modules/@noble/hashes/esm/utils.js +8 -1
- package/bundle/node_modules/@waku/zerokit-rln-wasm/rln_wasm.js +517 -255
- package/bundle/node_modules/it-length-prefixed/dist/src/decode.js +6 -0
- package/bundle/node_modules/multiformats/dist/src/bases/base10.js +3 -1
- package/bundle/node_modules/multiformats/dist/src/bases/base16.js +4 -2
- package/bundle/node_modules/multiformats/dist/src/bases/base2.js +3 -1
- package/bundle/node_modules/multiformats/dist/src/bases/base256emoji.js +3 -1
- package/bundle/node_modules/multiformats/dist/src/bases/base32.js +11 -9
- package/bundle/node_modules/multiformats/dist/src/bases/base36.js +4 -2
- package/bundle/node_modules/multiformats/dist/src/bases/base58.js +4 -2
- package/bundle/node_modules/multiformats/dist/src/bases/base64.js +6 -4
- package/bundle/node_modules/multiformats/dist/src/bases/base8.js +3 -1
- package/bundle/node_modules/multiformats/dist/src/bases/identity.js +3 -1
- package/bundle/node_modules/multiformats/dist/src/basics.js +15 -0
- package/bundle/node_modules/multiformats/dist/src/bytes.js +15 -1
- package/bundle/node_modules/multiformats/dist/src/cid.js +371 -0
- package/bundle/node_modules/multiformats/dist/src/hashes/digest.js +62 -0
- package/bundle/node_modules/multiformats/dist/src/varint.js +15 -0
- package/bundle/node_modules/multiformats/dist/src/vendor/varint.js +78 -0
- package/bundle/node_modules/protons-runtime/dist/src/codec.js +20 -0
- package/bundle/node_modules/protons-runtime/dist/src/codecs/enum.js +24 -0
- package/bundle/node_modules/protons-runtime/dist/src/codecs/message.js +7 -0
- package/bundle/node_modules/protons-runtime/dist/src/decode.js +8 -0
- package/bundle/node_modules/protons-runtime/dist/src/encode.js +11 -0
- package/bundle/node_modules/protons-runtime/dist/src/index.js +30 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/float.js +54 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/longbits.js +175 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/pool.js +28 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/reader.js +367 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/utf8.js +99 -0
- package/bundle/node_modules/protons-runtime/dist/src/utils/writer.js +438 -0
- package/bundle/node_modules/uint8-varint/dist/src/index.js +124 -0
- package/bundle/node_modules/uint8arrays/dist/src/alloc.js +17 -0
- package/bundle/node_modules/uint8arrays/dist/src/concat.js +20 -0
- package/bundle/node_modules/uint8arrays/dist/src/from-string.js +19 -0
- package/bundle/node_modules/uint8arrays/dist/src/to-string.js +19 -0
- package/bundle/node_modules/uint8arrays/dist/src/util/as-uint8array.js +9 -0
- package/bundle/node_modules/uint8arrays/dist/src/util/bases.js +49 -0
- package/bundle/packages/core/dist/lib/connection_manager/connection_limiter.js +18 -0
- package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +24 -0
- package/bundle/packages/core/dist/lib/connection_manager/dialer.js +14 -0
- package/bundle/packages/core/dist/lib/connection_manager/discovery_dialer.js +14 -0
- package/bundle/packages/core/dist/lib/connection_manager/keep_alive_manager.js +15 -0
- package/bundle/packages/core/dist/lib/connection_manager/shard_reader.js +14 -0
- package/bundle/packages/core/dist/lib/filter/filter.js +28 -0
- package/bundle/packages/core/dist/lib/light_push/light_push.js +28 -0
- package/bundle/packages/core/dist/lib/message/version_0.js +172 -0
- package/bundle/packages/core/dist/lib/metadata/metadata.js +28 -0
- package/bundle/packages/core/dist/lib/store/store.js +24 -0
- package/bundle/packages/interfaces/dist/connection_manager.js +9 -0
- package/bundle/packages/interfaces/dist/health_status.js +17 -0
- package/bundle/packages/interfaces/dist/protocols.js +92 -0
- package/bundle/packages/interfaces/dist/waku.js +7 -0
- package/bundle/packages/proto/dist/generated/filter.js +447 -0
- package/bundle/packages/proto/dist/generated/filter_v2.js +426 -0
- package/bundle/packages/proto/dist/generated/light_push.js +550 -0
- package/bundle/packages/proto/dist/generated/message.js +215 -0
- package/bundle/packages/proto/dist/generated/metadata.js +132 -0
- package/bundle/packages/proto/dist/generated/peer_exchange.js +211 -0
- package/bundle/packages/proto/dist/generated/sds_message.js +172 -0
- package/bundle/packages/proto/dist/generated/store_v3.js +492 -0
- package/bundle/packages/proto/dist/generated/topic_only_message.js +63 -0
- package/bundle/packages/rln/dist/codec.js +92 -0
- package/bundle/packages/rln/dist/contract/constants.js +14 -7
- package/bundle/packages/rln/dist/contract/rln_base_contract.js +2 -1
- package/bundle/packages/rln/dist/contract/rln_contract.js +109 -0
- package/bundle/packages/rln/dist/credentials_manager.js +45 -4
- package/bundle/packages/rln/dist/identity.js +2 -1
- package/bundle/packages/rln/dist/keystore/keystore.js +30 -9
- package/bundle/packages/rln/dist/message.js +59 -0
- package/bundle/packages/rln/dist/proof.js +54 -0
- package/bundle/packages/rln/dist/resources/verification_key.js +112 -0
- package/bundle/packages/rln/dist/resources/witness_calculator.js +1 -1
- package/bundle/packages/rln/dist/rln.js +36 -4
- package/bundle/packages/rln/dist/root_tracker.js +76 -0
- package/bundle/packages/rln/dist/utils/bytes.js +70 -31
- package/bundle/packages/rln/dist/utils/epoch.js +23 -1
- package/bundle/packages/rln/dist/utils/hash.js +10 -0
- package/bundle/packages/rln/dist/zerokit.js +99 -2
- package/bundle/packages/utils/dist/bytes/index.js +31 -0
- package/bundle/resources/rln.wasm +0 -0
- package/bundle/resources/rln_final.zkey +0 -0
- package/bundle/resources/verification_key.d.ts +13 -0
- package/bundle/resources/verification_key.js +112 -0
- package/bundle/resources/witness_calculator.d.ts +7 -21
- package/bundle/resources/witness_calculator.js +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/codec.d.ts +40 -0
- package/dist/codec.js +79 -0
- package/dist/codec.js.map +1 -0
- package/dist/codec.test-utils.d.ts +37 -0
- package/dist/codec.test-utils.js +61 -0
- package/dist/codec.test-utils.js.map +1 -0
- package/dist/contract/constants.d.ts +10 -3
- package/dist/contract/constants.js +13 -6
- package/dist/contract/constants.js.map +1 -1
- package/dist/contract/index.d.ts +1 -0
- package/dist/contract/index.js +1 -0
- package/dist/contract/index.js.map +1 -1
- package/dist/contract/rln_base_contract.js +2 -1
- package/dist/contract/rln_base_contract.js.map +1 -1
- package/dist/contract/rln_contract.d.ts +17 -0
- package/dist/contract/rln_contract.js +107 -0
- package/dist/contract/rln_contract.js.map +1 -0
- package/dist/contract/test_setup.d.ts +26 -0
- package/dist/contract/test_setup.js +56 -0
- package/dist/contract/test_setup.js.map +1 -0
- package/dist/contract/test_utils.d.ts +39 -0
- package/dist/contract/test_utils.js +118 -0
- package/dist/contract/test_utils.js.map +1 -0
- package/dist/credentials_manager.d.ts +14 -2
- package/dist/credentials_manager.js +45 -4
- package/dist/credentials_manager.js.map +1 -1
- package/dist/identity.js +2 -1
- package/dist/identity.js.map +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/dist/keystore/keystore.js +30 -9
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/message.d.ts +19 -0
- package/dist/message.js +51 -0
- package/dist/message.js.map +1 -0
- package/dist/proof.d.ts +21 -0
- package/dist/proof.js +50 -0
- package/dist/proof.js.map +1 -0
- package/dist/resources/rln.wasm +0 -0
- package/dist/resources/rln_final.zkey +0 -0
- package/dist/resources/verification_key.d.ts +13 -0
- package/dist/resources/verification_key.js +112 -0
- package/dist/resources/witness_calculator.d.ts +7 -21
- package/dist/resources/witness_calculator.js +1 -1
- package/dist/rln.d.ts +9 -0
- package/dist/rln.js +32 -4
- package/dist/rln.js.map +1 -1
- package/dist/root_tracker.d.ts +10 -0
- package/dist/root_tracker.js +75 -0
- package/dist/root_tracker.js.map +1 -0
- package/dist/utils/bytes.d.ts +31 -9
- package/dist/utils/bytes.js +70 -31
- package/dist/utils/bytes.js.map +1 -1
- package/dist/zerokit.d.ts +11 -0
- package/dist/zerokit.js +97 -1
- package/dist/zerokit.js.map +1 -1
- package/package.json +1 -1
- package/src/codec.test-utils.ts +88 -0
- package/src/codec.ts +138 -0
- package/src/contract/constants.ts +16 -6
- package/src/contract/index.ts +1 -0
- package/src/contract/rln_base_contract.ts +2 -1
- package/src/contract/rln_contract.ts +147 -0
- package/src/contract/test_setup.ts +86 -0
- package/src/contract/test_utils.ts +179 -0
- package/src/credentials_manager.ts +72 -8
- package/src/identity.ts +2 -1
- package/src/index.ts +11 -1
- package/src/keystore/keystore.ts +32 -9
- package/src/message.ts +73 -0
- package/src/proof.ts +69 -0
- package/src/resources/verification_key.d.ts +13 -0
- package/src/resources/witness_calculator.d.ts +7 -21
- package/src/rln.ts +65 -5
- package/src/root_tracker.ts +92 -0
- package/src/utils/bytes.ts +73 -36
- package/src/zerokit.ts +217 -1
|
@@ -1,16 +1,53 @@
|
|
|
1
1
|
let wasm;
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
const heap = new Array(128).fill(undefined);
|
|
4
|
+
|
|
5
|
+
heap.push(undefined, null, true, false);
|
|
6
|
+
|
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
|
4
8
|
|
|
5
|
-
let
|
|
9
|
+
let heap_next = heap.length;
|
|
10
|
+
|
|
11
|
+
function dropObject(idx) {
|
|
12
|
+
if (idx < 132) return;
|
|
13
|
+
heap[idx] = heap_next;
|
|
14
|
+
heap_next = idx;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function takeObject(idx) {
|
|
18
|
+
const ret = getObject(idx);
|
|
19
|
+
dropObject(idx);
|
|
20
|
+
return ret;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
6
24
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
25
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }
|
|
26
|
+
let cachedUint8Memory0 = null;
|
|
27
|
+
|
|
28
|
+
function getUint8Memory0() {
|
|
29
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
30
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
10
31
|
}
|
|
11
|
-
return
|
|
32
|
+
return cachedUint8Memory0;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function getStringFromWasm0(ptr, len) {
|
|
36
|
+
ptr = ptr >>> 0;
|
|
37
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
12
38
|
}
|
|
13
39
|
|
|
40
|
+
function addHeapObject(obj) {
|
|
41
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
42
|
+
const idx = heap_next;
|
|
43
|
+
heap_next = heap[idx];
|
|
44
|
+
|
|
45
|
+
heap[idx] = obj;
|
|
46
|
+
return idx;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
let WASM_VECTOR_LEN = 0;
|
|
50
|
+
|
|
14
51
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
15
52
|
|
|
16
53
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -30,16 +67,16 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
30
67
|
|
|
31
68
|
if (realloc === undefined) {
|
|
32
69
|
const buf = cachedTextEncoder.encode(arg);
|
|
33
|
-
const ptr = malloc(buf.length
|
|
34
|
-
|
|
70
|
+
const ptr = malloc(buf.length) >>> 0;
|
|
71
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
35
72
|
WASM_VECTOR_LEN = buf.length;
|
|
36
73
|
return ptr;
|
|
37
74
|
}
|
|
38
75
|
|
|
39
76
|
let len = arg.length;
|
|
40
|
-
let ptr = malloc(len
|
|
77
|
+
let ptr = malloc(len) >>> 0;
|
|
41
78
|
|
|
42
|
-
const mem =
|
|
79
|
+
const mem = getUint8Memory0();
|
|
43
80
|
|
|
44
81
|
let offset = 0;
|
|
45
82
|
|
|
@@ -53,52 +90,28 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
53
90
|
if (offset !== 0) {
|
|
54
91
|
arg = arg.slice(offset);
|
|
55
92
|
}
|
|
56
|
-
ptr = realloc(ptr, len, len = offset + arg.length * 3
|
|
57
|
-
const view =
|
|
93
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0;
|
|
94
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
58
95
|
const ret = encodeString(arg, view);
|
|
59
96
|
|
|
60
97
|
offset += ret.written;
|
|
61
|
-
ptr = realloc(ptr, len, offset, 1) >>> 0;
|
|
62
98
|
}
|
|
63
99
|
|
|
64
100
|
WASM_VECTOR_LEN = offset;
|
|
65
101
|
return ptr;
|
|
66
102
|
}
|
|
67
103
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
function getDataViewMemory0() {
|
|
71
|
-
if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
|
|
72
|
-
cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
|
|
73
|
-
}
|
|
74
|
-
return cachedDataViewMemory0;
|
|
104
|
+
function isLikeNone(x) {
|
|
105
|
+
return x === undefined || x === null;
|
|
75
106
|
}
|
|
76
107
|
|
|
77
|
-
|
|
78
|
-
const idx = wasm.__externref_table_alloc();
|
|
79
|
-
wasm.__wbindgen_export_4.set(idx, obj);
|
|
80
|
-
return idx;
|
|
81
|
-
}
|
|
108
|
+
let cachedInt32Memory0 = null;
|
|
82
109
|
|
|
83
|
-
function
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} catch (e) {
|
|
87
|
-
const idx = addToExternrefTable0(e);
|
|
88
|
-
wasm.__wbindgen_exn_store(idx);
|
|
110
|
+
function getInt32Memory0() {
|
|
111
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
112
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
89
113
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
93
|
-
|
|
94
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); }
|
|
95
|
-
function getStringFromWasm0(ptr, len) {
|
|
96
|
-
ptr = ptr >>> 0;
|
|
97
|
-
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
function isLikeNone(x) {
|
|
101
|
-
return x === undefined || x === null;
|
|
114
|
+
return cachedInt32Memory0;
|
|
102
115
|
}
|
|
103
116
|
|
|
104
117
|
function debugString(val) {
|
|
@@ -142,7 +155,7 @@ function debugString(val) {
|
|
|
142
155
|
// Test for built-in
|
|
143
156
|
const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
|
|
144
157
|
let className;
|
|
145
|
-
if (builtInMatches
|
|
158
|
+
if (builtInMatches.length > 1) {
|
|
146
159
|
className = builtInMatches[1];
|
|
147
160
|
} else {
|
|
148
161
|
// Failed to match the standard '[object ClassName]'
|
|
@@ -165,44 +178,304 @@ function debugString(val) {
|
|
|
165
178
|
// TODO we could test for more things here, like `Set`s and `Map`s.
|
|
166
179
|
return className;
|
|
167
180
|
}
|
|
181
|
+
/**
|
|
182
|
+
*/
|
|
183
|
+
function init_panic_hook() {
|
|
184
|
+
wasm.init_panic_hook();
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* @param {number} tree_height
|
|
189
|
+
* @param {Uint8Array} zkey
|
|
190
|
+
* @param {Uint8Array} vk
|
|
191
|
+
* @returns {number}
|
|
192
|
+
*/
|
|
193
|
+
function newRLN(tree_height, zkey, vk) {
|
|
194
|
+
try {
|
|
195
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
196
|
+
wasm.newRLN(retptr, tree_height, addHeapObject(zkey), addHeapObject(vk));
|
|
197
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
198
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
199
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
200
|
+
if (r2) {
|
|
201
|
+
throw takeObject(r1);
|
|
202
|
+
}
|
|
203
|
+
return r0;
|
|
204
|
+
} finally {
|
|
205
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* @param {number} ctx
|
|
211
|
+
* @param {Uint8Array} input
|
|
212
|
+
* @returns {Uint8Array}
|
|
213
|
+
*/
|
|
214
|
+
function getSerializedRLNWitness(ctx, input) {
|
|
215
|
+
try {
|
|
216
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
217
|
+
wasm.getSerializedRLNWitness(retptr, ctx, addHeapObject(input));
|
|
218
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
219
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
220
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
221
|
+
if (r2) {
|
|
222
|
+
throw takeObject(r1);
|
|
223
|
+
}
|
|
224
|
+
return takeObject(r0);
|
|
225
|
+
} finally {
|
|
226
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* @param {number} ctx
|
|
232
|
+
* @param {Uint8Array} input
|
|
233
|
+
*/
|
|
234
|
+
function insertMember(ctx, input) {
|
|
235
|
+
try {
|
|
236
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
237
|
+
wasm.insertMember(retptr, ctx, addHeapObject(input));
|
|
238
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
239
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
240
|
+
if (r1) {
|
|
241
|
+
throw takeObject(r0);
|
|
242
|
+
}
|
|
243
|
+
} finally {
|
|
244
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* @param {number} ctx
|
|
250
|
+
* @param {number} index
|
|
251
|
+
* @param {Uint8Array} input
|
|
252
|
+
*/
|
|
253
|
+
function setLeavesFrom(ctx, index, input) {
|
|
254
|
+
try {
|
|
255
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
256
|
+
wasm.setLeavesFrom(retptr, ctx, index, addHeapObject(input));
|
|
257
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
258
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
259
|
+
if (r1) {
|
|
260
|
+
throw takeObject(r0);
|
|
261
|
+
}
|
|
262
|
+
} finally {
|
|
263
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
168
266
|
|
|
169
|
-
|
|
170
|
-
|
|
267
|
+
/**
|
|
268
|
+
* @param {number} ctx
|
|
269
|
+
* @param {number} index
|
|
270
|
+
*/
|
|
271
|
+
function deleteLeaf(ctx, index) {
|
|
272
|
+
try {
|
|
273
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
274
|
+
wasm.deleteLeaf(retptr, ctx, index);
|
|
275
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
276
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
277
|
+
if (r1) {
|
|
278
|
+
throw takeObject(r0);
|
|
279
|
+
}
|
|
280
|
+
} finally {
|
|
281
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
282
|
+
}
|
|
171
283
|
}
|
|
172
284
|
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
285
|
+
/**
|
|
286
|
+
* @param {number} ctx
|
|
287
|
+
* @param {Uint8Array} serialized_witness
|
|
288
|
+
* @returns {object}
|
|
289
|
+
*/
|
|
290
|
+
function RLNWitnessToJson(ctx, serialized_witness) {
|
|
291
|
+
try {
|
|
292
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
293
|
+
wasm.RLNWitnessToJson(retptr, ctx, addHeapObject(serialized_witness));
|
|
294
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
295
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
296
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
297
|
+
if (r2) {
|
|
298
|
+
throw takeObject(r1);
|
|
299
|
+
}
|
|
300
|
+
return takeObject(r0);
|
|
301
|
+
} finally {
|
|
302
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
let cachedUint32Memory0 = null;
|
|
307
|
+
|
|
308
|
+
function getUint32Memory0() {
|
|
309
|
+
if (cachedUint32Memory0 === null || cachedUint32Memory0.byteLength === 0) {
|
|
310
|
+
cachedUint32Memory0 = new Uint32Array(wasm.memory.buffer);
|
|
311
|
+
}
|
|
312
|
+
return cachedUint32Memory0;
|
|
177
313
|
}
|
|
314
|
+
|
|
315
|
+
function passArrayJsValueToWasm0(array, malloc) {
|
|
316
|
+
const ptr = malloc(array.length * 4) >>> 0;
|
|
317
|
+
const mem = getUint32Memory0();
|
|
318
|
+
for (let i = 0; i < array.length; i++) {
|
|
319
|
+
mem[ptr / 4 + i] = addHeapObject(array[i]);
|
|
320
|
+
}
|
|
321
|
+
WASM_VECTOR_LEN = array.length;
|
|
322
|
+
return ptr;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* @param {number} ctx
|
|
326
|
+
* @param {(bigint)[]} calculated_witness
|
|
327
|
+
* @param {Uint8Array} serialized_witness
|
|
328
|
+
* @returns {Uint8Array}
|
|
329
|
+
*/
|
|
330
|
+
function generate_rln_proof_with_witness(ctx, calculated_witness, serialized_witness) {
|
|
331
|
+
try {
|
|
332
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
333
|
+
const ptr0 = passArrayJsValueToWasm0(calculated_witness, wasm.__wbindgen_malloc);
|
|
334
|
+
const len0 = WASM_VECTOR_LEN;
|
|
335
|
+
wasm.generate_rln_proof_with_witness(retptr, ctx, ptr0, len0, addHeapObject(serialized_witness));
|
|
336
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
337
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
338
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
339
|
+
if (r2) {
|
|
340
|
+
throw takeObject(r1);
|
|
341
|
+
}
|
|
342
|
+
return takeObject(r0);
|
|
343
|
+
} finally {
|
|
344
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
|
|
178
348
|
/**
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
function
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
349
|
+
* @param {number} ctx
|
|
350
|
+
* @returns {Uint8Array}
|
|
351
|
+
*/
|
|
352
|
+
function generateExtendedMembershipKey(ctx) {
|
|
353
|
+
try {
|
|
354
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
355
|
+
wasm.generateExtendedMembershipKey(retptr, ctx);
|
|
356
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
357
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
358
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
359
|
+
if (r2) {
|
|
360
|
+
throw takeObject(r1);
|
|
361
|
+
}
|
|
362
|
+
return takeObject(r0);
|
|
363
|
+
} finally {
|
|
364
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
365
|
+
}
|
|
188
366
|
}
|
|
189
367
|
|
|
190
368
|
/**
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
369
|
+
* @param {number} ctx
|
|
370
|
+
* @param {Uint8Array} seed
|
|
371
|
+
* @returns {Uint8Array}
|
|
372
|
+
*/
|
|
195
373
|
function generateSeededExtendedMembershipKey(ctx, seed) {
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
374
|
+
try {
|
|
375
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
376
|
+
wasm.generateSeededExtendedMembershipKey(retptr, ctx, addHeapObject(seed));
|
|
377
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
378
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
379
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
380
|
+
if (r2) {
|
|
381
|
+
throw takeObject(r1);
|
|
382
|
+
}
|
|
383
|
+
return takeObject(r0);
|
|
384
|
+
} finally {
|
|
385
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
199
386
|
}
|
|
200
|
-
return takeFromExternrefTable0(ret[0]);
|
|
201
387
|
}
|
|
202
388
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
389
|
+
/**
|
|
390
|
+
* @param {number} ctx
|
|
391
|
+
* @param {Uint8Array} proof
|
|
392
|
+
* @returns {boolean}
|
|
393
|
+
*/
|
|
394
|
+
function verifyRLNProof(ctx, proof) {
|
|
395
|
+
try {
|
|
396
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
397
|
+
wasm.verifyRLNProof(retptr, ctx, addHeapObject(proof));
|
|
398
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
399
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
400
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
401
|
+
if (r2) {
|
|
402
|
+
throw takeObject(r1);
|
|
403
|
+
}
|
|
404
|
+
return r0 !== 0;
|
|
405
|
+
} finally {
|
|
406
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* @param {number} ctx
|
|
412
|
+
* @param {Uint8Array} proof
|
|
413
|
+
* @param {Uint8Array} roots
|
|
414
|
+
* @returns {boolean}
|
|
415
|
+
*/
|
|
416
|
+
function verifyWithRoots(ctx, proof, roots) {
|
|
417
|
+
try {
|
|
418
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
419
|
+
wasm.verifyWithRoots(retptr, ctx, addHeapObject(proof), addHeapObject(roots));
|
|
420
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
421
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
422
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
423
|
+
if (r2) {
|
|
424
|
+
throw takeObject(r1);
|
|
425
|
+
}
|
|
426
|
+
return r0 !== 0;
|
|
427
|
+
} finally {
|
|
428
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
429
|
+
}
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/**
|
|
433
|
+
* @param {number} ctx
|
|
434
|
+
* @returns {Uint8Array}
|
|
435
|
+
*/
|
|
436
|
+
function getRoot(ctx) {
|
|
437
|
+
try {
|
|
438
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
439
|
+
wasm.getRoot(retptr, ctx);
|
|
440
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
441
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
442
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
443
|
+
if (r2) {
|
|
444
|
+
throw takeObject(r1);
|
|
445
|
+
}
|
|
446
|
+
return takeObject(r0);
|
|
447
|
+
} finally {
|
|
448
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* @param {Uint8Array} input
|
|
454
|
+
* @returns {Uint8Array}
|
|
455
|
+
*/
|
|
456
|
+
function poseidonHash(input) {
|
|
457
|
+
try {
|
|
458
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
459
|
+
wasm.poseidonHash(retptr, addHeapObject(input));
|
|
460
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
461
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
462
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
463
|
+
if (r2) {
|
|
464
|
+
throw takeObject(r1);
|
|
465
|
+
}
|
|
466
|
+
return takeObject(r0);
|
|
467
|
+
} finally {
|
|
468
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
|
|
472
|
+
function handleError(f, args) {
|
|
473
|
+
try {
|
|
474
|
+
return f.apply(this, args);
|
|
475
|
+
} catch (e) {
|
|
476
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
477
|
+
}
|
|
478
|
+
}
|
|
206
479
|
|
|
207
480
|
async function __wbg_load(module, imports) {
|
|
208
481
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
@@ -212,7 +485,7 @@ async function __wbg_load(module, imports) {
|
|
|
212
485
|
|
|
213
486
|
} catch (e) {
|
|
214
487
|
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
215
|
-
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve
|
|
488
|
+
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
216
489
|
|
|
217
490
|
} else {
|
|
218
491
|
throw e;
|
|
@@ -238,30 +511,72 @@ async function __wbg_load(module, imports) {
|
|
|
238
511
|
function __wbg_get_imports() {
|
|
239
512
|
const imports = {};
|
|
240
513
|
imports.wbg = {};
|
|
241
|
-
imports.wbg.
|
|
242
|
-
|
|
243
|
-
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
244
|
-
const len1 = WASM_VECTOR_LEN;
|
|
245
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
246
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
514
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
515
|
+
takeObject(arg0);
|
|
247
516
|
};
|
|
248
|
-
imports.wbg.
|
|
249
|
-
const ret = arg0
|
|
250
|
-
return ret;
|
|
517
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
518
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
519
|
+
return addHeapObject(ret);
|
|
251
520
|
};
|
|
252
|
-
imports.wbg.
|
|
253
|
-
const
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
521
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
522
|
+
const obj = getObject(arg1);
|
|
523
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
524
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
525
|
+
var len1 = WASM_VECTOR_LEN;
|
|
526
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
527
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
528
|
+
};
|
|
529
|
+
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
530
|
+
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
531
|
+
return addHeapObject(ret);
|
|
532
|
+
};
|
|
533
|
+
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
534
|
+
const ret = typeof(getObject(arg0)) === 'string';
|
|
258
535
|
return ret;
|
|
259
|
-
}
|
|
260
|
-
imports.wbg.
|
|
261
|
-
const ret = arg0
|
|
536
|
+
};
|
|
537
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
538
|
+
const ret = getObject(arg0);
|
|
539
|
+
return addHeapObject(ret);
|
|
540
|
+
};
|
|
541
|
+
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
542
|
+
const val = getObject(arg0);
|
|
543
|
+
const ret = typeof(val) === 'object' && val !== null;
|
|
262
544
|
return ret;
|
|
263
545
|
};
|
|
264
|
-
imports.wbg.
|
|
546
|
+
imports.wbg.__wbg_String_91fba7ded13ba54c = function(arg0, arg1) {
|
|
547
|
+
const ret = String(getObject(arg1));
|
|
548
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
549
|
+
const len1 = WASM_VECTOR_LEN;
|
|
550
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
551
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
552
|
+
};
|
|
553
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
554
|
+
const ret = arg0;
|
|
555
|
+
return addHeapObject(ret);
|
|
556
|
+
};
|
|
557
|
+
imports.wbg.__wbindgen_bigint_from_i64 = function(arg0) {
|
|
558
|
+
const ret = arg0;
|
|
559
|
+
return addHeapObject(ret);
|
|
560
|
+
};
|
|
561
|
+
imports.wbg.__wbindgen_bigint_from_u64 = function(arg0) {
|
|
562
|
+
const ret = BigInt.asUintN(64, arg0);
|
|
563
|
+
return addHeapObject(ret);
|
|
564
|
+
};
|
|
565
|
+
imports.wbg.__wbg_set_20cbc34131e76824 = function(arg0, arg1, arg2) {
|
|
566
|
+
getObject(arg0)[takeObject(arg1)] = takeObject(arg2);
|
|
567
|
+
};
|
|
568
|
+
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
569
|
+
const ret = new Error();
|
|
570
|
+
return addHeapObject(ret);
|
|
571
|
+
};
|
|
572
|
+
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
573
|
+
const ret = getObject(arg1).stack;
|
|
574
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
575
|
+
const len1 = WASM_VECTOR_LEN;
|
|
576
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
577
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
578
|
+
};
|
|
579
|
+
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
265
580
|
let deferred0_0;
|
|
266
581
|
let deferred0_1;
|
|
267
582
|
try {
|
|
@@ -269,186 +584,142 @@ function __wbg_get_imports() {
|
|
|
269
584
|
deferred0_1 = arg1;
|
|
270
585
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
271
586
|
} finally {
|
|
272
|
-
wasm.__wbindgen_free(deferred0_0, deferred0_1
|
|
587
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
273
588
|
}
|
|
274
589
|
};
|
|
275
|
-
imports.wbg.
|
|
276
|
-
const ret =
|
|
277
|
-
return ret;
|
|
278
|
-
}, arguments) };
|
|
279
|
-
imports.wbg.__wbg_getRandomValues_b8f5dbd5f3995a9e = function() { return handleError(function (arg0, arg1) {
|
|
280
|
-
arg0.getRandomValues(arg1);
|
|
281
|
-
}, arguments) };
|
|
282
|
-
imports.wbg.__wbg_length_a446193dc22c12f8 = function(arg0) {
|
|
283
|
-
const ret = arg0.length;
|
|
284
|
-
return ret;
|
|
285
|
-
};
|
|
286
|
-
imports.wbg.__wbg_msCrypto_a61aeb35a24c1329 = function(arg0) {
|
|
287
|
-
const ret = arg0.msCrypto;
|
|
288
|
-
return ret;
|
|
289
|
-
};
|
|
290
|
-
imports.wbg.__wbg_new_405e22f390576ce2 = function() {
|
|
291
|
-
const ret = new Object();
|
|
292
|
-
return ret;
|
|
293
|
-
};
|
|
294
|
-
imports.wbg.__wbg_new_5e0be73521bc8c17 = function() {
|
|
295
|
-
const ret = new Map();
|
|
296
|
-
return ret;
|
|
297
|
-
};
|
|
298
|
-
imports.wbg.__wbg_new_78feb108b6472713 = function() {
|
|
299
|
-
const ret = new Array();
|
|
300
|
-
return ret;
|
|
301
|
-
};
|
|
302
|
-
imports.wbg.__wbg_new_8a6f238a6ece86ea = function() {
|
|
303
|
-
const ret = new Error();
|
|
590
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
591
|
+
const ret = getObject(arg0) === undefined;
|
|
304
592
|
return ret;
|
|
305
593
|
};
|
|
306
|
-
imports.wbg.
|
|
307
|
-
const ret =
|
|
308
|
-
return ret;
|
|
594
|
+
imports.wbg.__wbg_crypto_70a96de3b6b73dac = function(arg0) {
|
|
595
|
+
const ret = getObject(arg0).crypto;
|
|
596
|
+
return addHeapObject(ret);
|
|
309
597
|
};
|
|
310
|
-
imports.wbg.
|
|
311
|
-
const ret =
|
|
312
|
-
return ret;
|
|
598
|
+
imports.wbg.__wbg_process_dd1577445152112e = function(arg0) {
|
|
599
|
+
const ret = getObject(arg0).process;
|
|
600
|
+
return addHeapObject(ret);
|
|
313
601
|
};
|
|
314
|
-
imports.wbg.
|
|
315
|
-
const ret =
|
|
316
|
-
return ret;
|
|
602
|
+
imports.wbg.__wbg_versions_58036bec3add9e6f = function(arg0) {
|
|
603
|
+
const ret = getObject(arg0).versions;
|
|
604
|
+
return addHeapObject(ret);
|
|
317
605
|
};
|
|
318
|
-
imports.wbg.
|
|
319
|
-
const ret =
|
|
320
|
-
return ret;
|
|
606
|
+
imports.wbg.__wbg_node_6a9d28205ed5b0d8 = function(arg0) {
|
|
607
|
+
const ret = getObject(arg0).node;
|
|
608
|
+
return addHeapObject(ret);
|
|
321
609
|
};
|
|
322
|
-
imports.wbg.
|
|
323
|
-
const ret = arg0.
|
|
324
|
-
return ret;
|
|
610
|
+
imports.wbg.__wbg_msCrypto_adbc770ec9eca9c7 = function(arg0) {
|
|
611
|
+
const ret = getObject(arg0).msCrypto;
|
|
612
|
+
return addHeapObject(ret);
|
|
325
613
|
};
|
|
326
|
-
imports.wbg.
|
|
327
|
-
const ret =
|
|
614
|
+
imports.wbg.__wbg_require_f05d779769764e82 = function() { return handleError(function () {
|
|
615
|
+
const ret = module.require;
|
|
616
|
+
return addHeapObject(ret);
|
|
617
|
+
}, arguments) };
|
|
618
|
+
imports.wbg.__wbindgen_is_function = function(arg0) {
|
|
619
|
+
const ret = typeof(getObject(arg0)) === 'function';
|
|
328
620
|
return ret;
|
|
329
621
|
};
|
|
330
|
-
imports.wbg.
|
|
331
|
-
arg0.
|
|
622
|
+
imports.wbg.__wbg_getRandomValues_3774744e221a22ad = function() { return handleError(function (arg0, arg1) {
|
|
623
|
+
getObject(arg0).getRandomValues(getObject(arg1));
|
|
332
624
|
}, arguments) };
|
|
333
|
-
imports.wbg.
|
|
334
|
-
|
|
335
|
-
return ret;
|
|
625
|
+
imports.wbg.__wbg_randomFillSync_e950366c42764a07 = function() { return handleError(function (arg0, arg1) {
|
|
626
|
+
getObject(arg0).randomFillSync(takeObject(arg1));
|
|
336
627
|
}, arguments) };
|
|
337
|
-
imports.wbg.
|
|
338
|
-
|
|
628
|
+
imports.wbg.__wbg_new_18bc2084e9a3e1ff = function() {
|
|
629
|
+
const ret = new Array();
|
|
630
|
+
return addHeapObject(ret);
|
|
339
631
|
};
|
|
340
|
-
imports.wbg.
|
|
341
|
-
|
|
632
|
+
imports.wbg.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) {
|
|
633
|
+
const ret = new Function(getStringFromWasm0(arg0, arg1));
|
|
634
|
+
return addHeapObject(ret);
|
|
342
635
|
};
|
|
343
|
-
imports.wbg.
|
|
344
|
-
|
|
636
|
+
imports.wbg.__wbg_new_b6fd0149e79ffce8 = function() {
|
|
637
|
+
const ret = new Map();
|
|
638
|
+
return addHeapObject(ret);
|
|
345
639
|
};
|
|
346
|
-
imports.wbg.
|
|
347
|
-
const ret = arg0.
|
|
348
|
-
return ret;
|
|
640
|
+
imports.wbg.__wbg_call_f96b398515635514 = function() { return handleError(function (arg0, arg1) {
|
|
641
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
642
|
+
return addHeapObject(ret);
|
|
643
|
+
}, arguments) };
|
|
644
|
+
imports.wbg.__wbg_new_7befa02319b36069 = function() {
|
|
645
|
+
const ret = new Object();
|
|
646
|
+
return addHeapObject(ret);
|
|
349
647
|
};
|
|
350
|
-
imports.wbg.
|
|
351
|
-
const ret =
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
648
|
+
imports.wbg.__wbg_self_b9aad7f1c618bfaf = function() { return handleError(function () {
|
|
649
|
+
const ret = self.self;
|
|
650
|
+
return addHeapObject(ret);
|
|
651
|
+
}, arguments) };
|
|
652
|
+
imports.wbg.__wbg_window_55e469842c98b086 = function() { return handleError(function () {
|
|
653
|
+
const ret = window.window;
|
|
654
|
+
return addHeapObject(ret);
|
|
655
|
+
}, arguments) };
|
|
656
|
+
imports.wbg.__wbg_globalThis_d0957e302752547e = function() { return handleError(function () {
|
|
657
|
+
const ret = globalThis.globalThis;
|
|
658
|
+
return addHeapObject(ret);
|
|
659
|
+
}, arguments) };
|
|
660
|
+
imports.wbg.__wbg_global_ae2f87312b8987fb = function() { return handleError(function () {
|
|
661
|
+
const ret = global.global;
|
|
662
|
+
return addHeapObject(ret);
|
|
663
|
+
}, arguments) };
|
|
664
|
+
imports.wbg.__wbg_set_aee8682c7ee9ac44 = function(arg0, arg1, arg2) {
|
|
665
|
+
getObject(arg0)[arg1 >>> 0] = takeObject(arg2);
|
|
356
666
|
};
|
|
357
|
-
imports.wbg.
|
|
358
|
-
const ret =
|
|
359
|
-
return
|
|
667
|
+
imports.wbg.__wbg_toString_27ba0397f8cf84a6 = function() { return handleError(function (arg0, arg1) {
|
|
668
|
+
const ret = getObject(arg0).toString(arg1);
|
|
669
|
+
return addHeapObject(ret);
|
|
670
|
+
}, arguments) };
|
|
671
|
+
imports.wbg.__wbg_call_35782e9a1aa5e091 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
672
|
+
const ret = getObject(arg0).call(getObject(arg1), getObject(arg2));
|
|
673
|
+
return addHeapObject(ret);
|
|
674
|
+
}, arguments) };
|
|
675
|
+
imports.wbg.__wbg_set_6c1b2b7b73337778 = function(arg0, arg1, arg2) {
|
|
676
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
677
|
+
return addHeapObject(ret);
|
|
360
678
|
};
|
|
361
|
-
imports.wbg.
|
|
362
|
-
const ret =
|
|
363
|
-
return
|
|
679
|
+
imports.wbg.__wbg_fromEntries_10a57760b5d7d9b8 = function() { return handleError(function (arg0) {
|
|
680
|
+
const ret = Object.fromEntries(getObject(arg0));
|
|
681
|
+
return addHeapObject(ret);
|
|
682
|
+
}, arguments) };
|
|
683
|
+
imports.wbg.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) {
|
|
684
|
+
const ret = getObject(arg0).buffer;
|
|
685
|
+
return addHeapObject(ret);
|
|
364
686
|
};
|
|
365
|
-
imports.wbg.
|
|
366
|
-
const ret =
|
|
367
|
-
return
|
|
687
|
+
imports.wbg.__wbg_newwithbyteoffsetandlength_92c251989c485785 = function(arg0, arg1, arg2) {
|
|
688
|
+
const ret = new Uint8Array(getObject(arg0), arg1 >>> 0, arg2 >>> 0);
|
|
689
|
+
return addHeapObject(ret);
|
|
368
690
|
};
|
|
369
|
-
imports.wbg.
|
|
370
|
-
const ret =
|
|
371
|
-
return
|
|
691
|
+
imports.wbg.__wbg_new_bc5d9aad3f9ac80e = function(arg0) {
|
|
692
|
+
const ret = new Uint8Array(getObject(arg0));
|
|
693
|
+
return addHeapObject(ret);
|
|
372
694
|
};
|
|
373
|
-
imports.wbg.
|
|
374
|
-
|
|
375
|
-
return ret;
|
|
695
|
+
imports.wbg.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) {
|
|
696
|
+
getObject(arg0).set(getObject(arg1), arg2 >>> 0);
|
|
376
697
|
};
|
|
377
|
-
imports.wbg.
|
|
378
|
-
const ret = arg0.
|
|
379
|
-
return ret;
|
|
380
|
-
}, arguments) };
|
|
381
|
-
imports.wbg.__wbg_versions_c01dfd4722a88165 = function(arg0) {
|
|
382
|
-
const ret = arg0.versions;
|
|
698
|
+
imports.wbg.__wbg_length_d9c4ded7e708c6a1 = function(arg0) {
|
|
699
|
+
const ret = getObject(arg0).length;
|
|
383
700
|
return ret;
|
|
384
701
|
};
|
|
385
|
-
imports.wbg.
|
|
386
|
-
const ret = arg0;
|
|
387
|
-
return ret;
|
|
702
|
+
imports.wbg.__wbg_newwithlength_89eca18f2603a999 = function(arg0) {
|
|
703
|
+
const ret = new Uint8Array(arg0 >>> 0);
|
|
704
|
+
return addHeapObject(ret);
|
|
388
705
|
};
|
|
389
|
-
imports.wbg.
|
|
390
|
-
const ret =
|
|
391
|
-
return ret;
|
|
706
|
+
imports.wbg.__wbg_subarray_7649d027b2b141b3 = function(arg0, arg1, arg2) {
|
|
707
|
+
const ret = getObject(arg0).subarray(arg1 >>> 0, arg2 >>> 0);
|
|
708
|
+
return addHeapObject(ret);
|
|
392
709
|
};
|
|
393
710
|
imports.wbg.__wbindgen_debug_string = function(arg0, arg1) {
|
|
394
|
-
const ret = debugString(arg1);
|
|
711
|
+
const ret = debugString(getObject(arg1));
|
|
395
712
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
396
713
|
const len1 = WASM_VECTOR_LEN;
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
};
|
|
400
|
-
imports.wbg.__wbindgen_error_new = function(arg0, arg1) {
|
|
401
|
-
const ret = new Error(getStringFromWasm0(arg0, arg1));
|
|
402
|
-
return ret;
|
|
403
|
-
};
|
|
404
|
-
imports.wbg.__wbindgen_init_externref_table = function() {
|
|
405
|
-
const table = wasm.__wbindgen_export_4;
|
|
406
|
-
const offset = table.grow(4);
|
|
407
|
-
table.set(0, undefined);
|
|
408
|
-
table.set(offset + 0, undefined);
|
|
409
|
-
table.set(offset + 1, null);
|
|
410
|
-
table.set(offset + 2, true);
|
|
411
|
-
table.set(offset + 3, false);
|
|
714
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
715
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
412
716
|
};
|
|
413
|
-
imports.wbg.
|
|
414
|
-
|
|
415
|
-
return ret;
|
|
416
|
-
};
|
|
417
|
-
imports.wbg.__wbindgen_is_object = function(arg0) {
|
|
418
|
-
const val = arg0;
|
|
419
|
-
const ret = typeof(val) === 'object' && val !== null;
|
|
420
|
-
return ret;
|
|
421
|
-
};
|
|
422
|
-
imports.wbg.__wbindgen_is_string = function(arg0) {
|
|
423
|
-
const ret = typeof(arg0) === 'string';
|
|
424
|
-
return ret;
|
|
425
|
-
};
|
|
426
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
427
|
-
const ret = arg0 === undefined;
|
|
428
|
-
return ret;
|
|
717
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
718
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
429
719
|
};
|
|
430
720
|
imports.wbg.__wbindgen_memory = function() {
|
|
431
721
|
const ret = wasm.memory;
|
|
432
|
-
return ret;
|
|
433
|
-
};
|
|
434
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
435
|
-
const ret = arg0;
|
|
436
|
-
return ret;
|
|
437
|
-
};
|
|
438
|
-
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
439
|
-
const obj = arg1;
|
|
440
|
-
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
441
|
-
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
442
|
-
var len1 = WASM_VECTOR_LEN;
|
|
443
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true);
|
|
444
|
-
getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true);
|
|
445
|
-
};
|
|
446
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
447
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
448
|
-
return ret;
|
|
449
|
-
};
|
|
450
|
-
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
451
|
-
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
722
|
+
return addHeapObject(ret);
|
|
452
723
|
};
|
|
453
724
|
|
|
454
725
|
return imports;
|
|
@@ -457,38 +728,29 @@ function __wbg_get_imports() {
|
|
|
457
728
|
function __wbg_finalize_init(instance, module) {
|
|
458
729
|
wasm = instance.exports;
|
|
459
730
|
__wbg_init.__wbindgen_wasm_module = module;
|
|
460
|
-
|
|
461
|
-
|
|
731
|
+
cachedInt32Memory0 = null;
|
|
732
|
+
cachedUint32Memory0 = null;
|
|
733
|
+
cachedUint8Memory0 = null;
|
|
462
734
|
|
|
463
735
|
|
|
464
|
-
wasm.__wbindgen_start();
|
|
465
736
|
return wasm;
|
|
466
737
|
}
|
|
467
738
|
|
|
468
|
-
async function __wbg_init(
|
|
739
|
+
async function __wbg_init(input) {
|
|
469
740
|
if (wasm !== undefined) return wasm;
|
|
470
741
|
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
if (Object.getPrototypeOf(module_or_path) === Object.prototype) {
|
|
474
|
-
({module_or_path} = module_or_path);
|
|
475
|
-
} else {
|
|
476
|
-
console.warn('using deprecated parameters for the initialization function; pass a single object instead');
|
|
477
|
-
}
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
if (typeof module_or_path === 'undefined') {
|
|
481
|
-
module_or_path = new URL('rln_wasm_bg.wasm', import.meta.url);
|
|
742
|
+
if (typeof input === 'undefined') {
|
|
743
|
+
input = new URL('rln_wasm_bg.wasm', import.meta.url);
|
|
482
744
|
}
|
|
483
745
|
const imports = __wbg_get_imports();
|
|
484
746
|
|
|
485
|
-
if (typeof
|
|
486
|
-
|
|
747
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
748
|
+
input = fetch(input);
|
|
487
749
|
}
|
|
488
750
|
|
|
489
|
-
const { instance, module } = await __wbg_load(await
|
|
751
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
490
752
|
|
|
491
753
|
return __wbg_finalize_init(instance, module);
|
|
492
754
|
}
|
|
493
755
|
|
|
494
|
-
export { __wbg_init as default, generateSeededExtendedMembershipKey,
|
|
756
|
+
export { RLNWitnessToJson, __wbg_init as default, deleteLeaf, generateExtendedMembershipKey, generateSeededExtendedMembershipKey, generate_rln_proof_with_witness, getRoot, getSerializedRLNWitness, init_panic_hook, insertMember, newRLN, poseidonHash, setLeavesFrom, verifyRLNProof, verifyWithRoots };
|