@aztec/noir-noirc_abi 0.75.0-commit.8a71f57856e217a77b6e50cbc8833c1cd5395b96
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/README.md +3 -0
- package/nodejs/noirc_abi_wasm.d.ts +35 -0
- package/nodejs/noirc_abi_wasm.js +346 -0
- package/nodejs/noirc_abi_wasm_bg.wasm +0 -0
- package/nodejs/noirc_abi_wasm_bg.wasm.d.ts +13 -0
- package/package.json +49 -0
- package/web/noirc_abi_wasm.d.ts +72 -0
- package/web/noirc_abi_wasm.js +409 -0
- package/web/noirc_abi_wasm_bg.wasm +0 -0
- package/web/noirc_abi_wasm_bg.wasm.d.ts +13 -0
package/README.md
ADDED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {Abi} abi
|
|
5
|
+
* @param {InputMap} inputs
|
|
6
|
+
* @param {InputValue | undefined} return_value
|
|
7
|
+
* @returns {WitnessMap}
|
|
8
|
+
*/
|
|
9
|
+
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue): WitnessMap;
|
|
10
|
+
/**
|
|
11
|
+
* @param {Abi} abi
|
|
12
|
+
* @param {WitnessMap} witness_map
|
|
13
|
+
* @returns {any}
|
|
14
|
+
*/
|
|
15
|
+
export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
|
|
16
|
+
/**
|
|
17
|
+
* @param {WitnessMap} witness_map
|
|
18
|
+
* @returns {Uint8Array}
|
|
19
|
+
*/
|
|
20
|
+
export function serializeWitness(witness_map: WitnessMap): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* @param {Abi} abi
|
|
23
|
+
* @param {RawAssertionPayload} raw_error
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
export function abiDecodeError(abi: Abi, raw_error: RawAssertionPayload): any;
|
|
27
|
+
|
|
28
|
+
export type ABIError = Error;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
33
|
+
export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
34
|
+
|
|
35
|
+
|
|
@@ -0,0 +1,346 @@
|
|
|
1
|
+
let imports = {};
|
|
2
|
+
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
|
+
let wasm;
|
|
4
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
5
|
+
|
|
6
|
+
const heap = new Array(128).fill(undefined);
|
|
7
|
+
|
|
8
|
+
heap.push(undefined, null, true, false);
|
|
9
|
+
|
|
10
|
+
function getObject(idx) { return heap[idx]; }
|
|
11
|
+
|
|
12
|
+
function isLikeNone(x) {
|
|
13
|
+
return x === undefined || x === null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
let cachedFloat64Memory0 = null;
|
|
17
|
+
|
|
18
|
+
function getFloat64Memory0() {
|
|
19
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
20
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
21
|
+
}
|
|
22
|
+
return cachedFloat64Memory0;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
let cachedInt32Memory0 = null;
|
|
26
|
+
|
|
27
|
+
function getInt32Memory0() {
|
|
28
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
29
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
30
|
+
}
|
|
31
|
+
return cachedInt32Memory0;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
let heap_next = heap.length;
|
|
35
|
+
|
|
36
|
+
function dropObject(idx) {
|
|
37
|
+
if (idx < 132) return;
|
|
38
|
+
heap[idx] = heap_next;
|
|
39
|
+
heap_next = idx;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function takeObject(idx) {
|
|
43
|
+
const ret = getObject(idx);
|
|
44
|
+
dropObject(idx);
|
|
45
|
+
return ret;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
let WASM_VECTOR_LEN = 0;
|
|
49
|
+
|
|
50
|
+
let cachedUint8Memory0 = null;
|
|
51
|
+
|
|
52
|
+
function getUint8Memory0() {
|
|
53
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
54
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
55
|
+
}
|
|
56
|
+
return cachedUint8Memory0;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
60
|
+
|
|
61
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
62
|
+
? function (arg, view) {
|
|
63
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
64
|
+
}
|
|
65
|
+
: function (arg, view) {
|
|
66
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
67
|
+
view.set(buf);
|
|
68
|
+
return {
|
|
69
|
+
read: arg.length,
|
|
70
|
+
written: buf.length
|
|
71
|
+
};
|
|
72
|
+
});
|
|
73
|
+
|
|
74
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
75
|
+
|
|
76
|
+
if (realloc === undefined) {
|
|
77
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
78
|
+
const ptr = malloc(buf.length) >>> 0;
|
|
79
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
80
|
+
WASM_VECTOR_LEN = buf.length;
|
|
81
|
+
return ptr;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let len = arg.length;
|
|
85
|
+
let ptr = malloc(len) >>> 0;
|
|
86
|
+
|
|
87
|
+
const mem = getUint8Memory0();
|
|
88
|
+
|
|
89
|
+
let offset = 0;
|
|
90
|
+
|
|
91
|
+
for (; offset < len; offset++) {
|
|
92
|
+
const code = arg.charCodeAt(offset);
|
|
93
|
+
if (code > 0x7F) break;
|
|
94
|
+
mem[ptr + offset] = code;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
if (offset !== len) {
|
|
98
|
+
if (offset !== 0) {
|
|
99
|
+
arg = arg.slice(offset);
|
|
100
|
+
}
|
|
101
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0;
|
|
102
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
103
|
+
const ret = encodeString(arg, view);
|
|
104
|
+
|
|
105
|
+
offset += ret.written;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
WASM_VECTOR_LEN = offset;
|
|
109
|
+
return ptr;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
function addHeapObject(obj) {
|
|
113
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
114
|
+
const idx = heap_next;
|
|
115
|
+
heap_next = heap[idx];
|
|
116
|
+
|
|
117
|
+
heap[idx] = obj;
|
|
118
|
+
return idx;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
122
|
+
|
|
123
|
+
cachedTextDecoder.decode();
|
|
124
|
+
|
|
125
|
+
function getStringFromWasm0(ptr, len) {
|
|
126
|
+
ptr = ptr >>> 0;
|
|
127
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* @param {Abi} abi
|
|
131
|
+
* @param {InputMap} inputs
|
|
132
|
+
* @param {InputValue | undefined} return_value
|
|
133
|
+
* @returns {WitnessMap}
|
|
134
|
+
*/
|
|
135
|
+
module.exports.abiEncode = function(abi, inputs, return_value) {
|
|
136
|
+
try {
|
|
137
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
138
|
+
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), isLikeNone(return_value) ? 0 : addHeapObject(return_value));
|
|
139
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
140
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
141
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
142
|
+
if (r2) {
|
|
143
|
+
throw takeObject(r1);
|
|
144
|
+
}
|
|
145
|
+
return takeObject(r0);
|
|
146
|
+
} finally {
|
|
147
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
148
|
+
}
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* @param {Abi} abi
|
|
153
|
+
* @param {WitnessMap} witness_map
|
|
154
|
+
* @returns {any}
|
|
155
|
+
*/
|
|
156
|
+
module.exports.abiDecode = function(abi, witness_map) {
|
|
157
|
+
try {
|
|
158
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
159
|
+
wasm.abiDecode(retptr, addHeapObject(abi), addHeapObject(witness_map));
|
|
160
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
161
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
162
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
163
|
+
if (r2) {
|
|
164
|
+
throw takeObject(r1);
|
|
165
|
+
}
|
|
166
|
+
return takeObject(r0);
|
|
167
|
+
} finally {
|
|
168
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
169
|
+
}
|
|
170
|
+
};
|
|
171
|
+
|
|
172
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
173
|
+
ptr = ptr >>> 0;
|
|
174
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* @param {WitnessMap} witness_map
|
|
178
|
+
* @returns {Uint8Array}
|
|
179
|
+
*/
|
|
180
|
+
module.exports.serializeWitness = function(witness_map) {
|
|
181
|
+
try {
|
|
182
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
183
|
+
wasm.serializeWitness(retptr, addHeapObject(witness_map));
|
|
184
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
185
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
186
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
187
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
188
|
+
if (r3) {
|
|
189
|
+
throw takeObject(r2);
|
|
190
|
+
}
|
|
191
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
192
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
193
|
+
return v1;
|
|
194
|
+
} finally {
|
|
195
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* @param {Abi} abi
|
|
201
|
+
* @param {RawAssertionPayload} raw_error
|
|
202
|
+
* @returns {any}
|
|
203
|
+
*/
|
|
204
|
+
module.exports.abiDecodeError = function(abi, raw_error) {
|
|
205
|
+
try {
|
|
206
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
207
|
+
wasm.abiDecodeError(retptr, addHeapObject(abi), addHeapObject(raw_error));
|
|
208
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
209
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
210
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
211
|
+
if (r2) {
|
|
212
|
+
throw takeObject(r1);
|
|
213
|
+
}
|
|
214
|
+
return takeObject(r0);
|
|
215
|
+
} finally {
|
|
216
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
function __wbg_adapter_28(arg0, arg1, arg2, arg3) {
|
|
221
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h57a2220e5f1e0a1e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
function handleError(f, args) {
|
|
225
|
+
try {
|
|
226
|
+
return f.apply(this, args);
|
|
227
|
+
} catch (e) {
|
|
228
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
module.exports.__wbg_constructor_48f7463f903b7cef = function(arg0) {
|
|
233
|
+
const ret = new Error(takeObject(arg0));
|
|
234
|
+
return addHeapObject(ret);
|
|
235
|
+
};
|
|
236
|
+
|
|
237
|
+
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
238
|
+
const obj = getObject(arg1);
|
|
239
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
240
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
241
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
242
|
+
};
|
|
243
|
+
|
|
244
|
+
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
245
|
+
takeObject(arg0);
|
|
246
|
+
};
|
|
247
|
+
|
|
248
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
249
|
+
const obj = getObject(arg1);
|
|
250
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
251
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
252
|
+
var len1 = WASM_VECTOR_LEN;
|
|
253
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
254
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
module.exports.__wbg_new_b44272d7763dffe3 = function() {
|
|
258
|
+
const ret = new Map();
|
|
259
|
+
return addHeapObject(ret);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
|
263
|
+
const ret = arg0;
|
|
264
|
+
return addHeapObject(ret);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
268
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
269
|
+
return addHeapObject(ret);
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
273
|
+
const ret = getObject(arg0) === undefined;
|
|
274
|
+
return ret;
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
278
|
+
const ret = new Error();
|
|
279
|
+
return addHeapObject(ret);
|
|
280
|
+
};
|
|
281
|
+
|
|
282
|
+
module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
283
|
+
const ret = getObject(arg1).stack;
|
|
284
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
285
|
+
const len1 = WASM_VECTOR_LEN;
|
|
286
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
287
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
291
|
+
let deferred0_0;
|
|
292
|
+
let deferred0_1;
|
|
293
|
+
try {
|
|
294
|
+
deferred0_0 = arg0;
|
|
295
|
+
deferred0_1 = arg1;
|
|
296
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
297
|
+
} finally {
|
|
298
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
|
|
302
|
+
module.exports.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) {
|
|
303
|
+
try {
|
|
304
|
+
var state0 = {a: arg1, b: arg2};
|
|
305
|
+
var cb0 = (arg0, arg1) => {
|
|
306
|
+
const a = state0.a;
|
|
307
|
+
state0.a = 0;
|
|
308
|
+
try {
|
|
309
|
+
return __wbg_adapter_28(a, state0.b, arg0, arg1);
|
|
310
|
+
} finally {
|
|
311
|
+
state0.a = a;
|
|
312
|
+
}
|
|
313
|
+
};
|
|
314
|
+
getObject(arg0).forEach(cb0);
|
|
315
|
+
} finally {
|
|
316
|
+
state0.a = state0.b = 0;
|
|
317
|
+
}
|
|
318
|
+
};
|
|
319
|
+
|
|
320
|
+
module.exports.__wbg_set_da7be7bf0e037b14 = function(arg0, arg1, arg2) {
|
|
321
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
322
|
+
return addHeapObject(ret);
|
|
323
|
+
};
|
|
324
|
+
|
|
325
|
+
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
326
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
327
|
+
return addHeapObject(ret);
|
|
328
|
+
}, arguments) };
|
|
329
|
+
|
|
330
|
+
module.exports.__wbg_stringify_d06ad2addc54d51e = function() { return handleError(function (arg0) {
|
|
331
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
332
|
+
return addHeapObject(ret);
|
|
333
|
+
}, arguments) };
|
|
334
|
+
|
|
335
|
+
module.exports.__wbindgen_throw = function(arg0, arg1) {
|
|
336
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
337
|
+
};
|
|
338
|
+
|
|
339
|
+
const path = require('path').join(__dirname, 'noirc_abi_wasm_bg.wasm');
|
|
340
|
+
const bytes = require('fs').readFileSync(path);
|
|
341
|
+
|
|
342
|
+
const wasmModule = new WebAssembly.Module(bytes);
|
|
343
|
+
const wasmInstance = new WebAssembly.Instance(wasmModule, imports);
|
|
344
|
+
wasm = wasmInstance.exports;
|
|
345
|
+
module.exports.__wasm = wasm;
|
|
346
|
+
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function abiEncode(a: number, b: number, c: number, d: number): void;
|
|
5
|
+
export function abiDecode(a: number, b: number, c: number): void;
|
|
6
|
+
export function serializeWitness(a: number, b: number): void;
|
|
7
|
+
export function abiDecodeError(a: number, b: number, c: number): void;
|
|
8
|
+
export function __wbindgen_malloc(a: number): number;
|
|
9
|
+
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
10
|
+
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
11
|
+
export function __wbindgen_free(a: number, b: number): void;
|
|
12
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h57a2220e5f1e0a1e(a: number, b: number, c: number, d: number): void;
|
|
13
|
+
export function __wbindgen_exn_store(a: number): void;
|
package/package.json
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@aztec/noir-noirc_abi",
|
|
3
|
+
"contributors": [
|
|
4
|
+
"The Noir Team <team@noir-lang.org>"
|
|
5
|
+
],
|
|
6
|
+
"version": "0.75.0-commit.8a71f57856e217a77b6e50cbc8833c1cd5395b96",
|
|
7
|
+
"license": "(MIT OR Apache-2.0)",
|
|
8
|
+
"homepage": "https://noir-lang.org/",
|
|
9
|
+
"repository": {
|
|
10
|
+
"url": "https://github.com/noir-lang/noir.git",
|
|
11
|
+
"directory": "tooling/noirc_abi_wasm",
|
|
12
|
+
"type": "git"
|
|
13
|
+
},
|
|
14
|
+
"bugs": {
|
|
15
|
+
"url": "https://github.com/noir-lang/noir/issues"
|
|
16
|
+
},
|
|
17
|
+
"files": [
|
|
18
|
+
"nodejs",
|
|
19
|
+
"web",
|
|
20
|
+
"package.json"
|
|
21
|
+
],
|
|
22
|
+
"publishConfig": {
|
|
23
|
+
"access": "public"
|
|
24
|
+
},
|
|
25
|
+
"main": "./nodejs/noirc_abi_wasm.js",
|
|
26
|
+
"types": "./web/noirc_abi_wasm.d.ts",
|
|
27
|
+
"module": "./web/noirc_abi_wasm.js",
|
|
28
|
+
"sideEffects": false,
|
|
29
|
+
"scripts": {
|
|
30
|
+
"build": "bash ./build.sh",
|
|
31
|
+
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
|
|
32
|
+
"test:browser": "web-test-runner",
|
|
33
|
+
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result",
|
|
34
|
+
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
|
|
35
|
+
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
|
|
36
|
+
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@aztec/noir-types": "0.75.0-commit.8a71f57856e217a77b6e50cbc8833c1cd5395b96"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
43
|
+
"@web/dev-server-esbuild": "^0.3.6",
|
|
44
|
+
"@web/test-runner": "^0.18.1",
|
|
45
|
+
"@web/test-runner-playwright": "^0.11.0",
|
|
46
|
+
"eslint": "^8.57.0",
|
|
47
|
+
"mocha": "^10.2.0"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
/**
|
|
4
|
+
* @param {Abi} abi
|
|
5
|
+
* @param {InputMap} inputs
|
|
6
|
+
* @param {InputValue | undefined} return_value
|
|
7
|
+
* @returns {WitnessMap}
|
|
8
|
+
*/
|
|
9
|
+
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue): WitnessMap;
|
|
10
|
+
/**
|
|
11
|
+
* @param {Abi} abi
|
|
12
|
+
* @param {WitnessMap} witness_map
|
|
13
|
+
* @returns {any}
|
|
14
|
+
*/
|
|
15
|
+
export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
|
|
16
|
+
/**
|
|
17
|
+
* @param {WitnessMap} witness_map
|
|
18
|
+
* @returns {Uint8Array}
|
|
19
|
+
*/
|
|
20
|
+
export function serializeWitness(witness_map: WitnessMap): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* @param {Abi} abi
|
|
23
|
+
* @param {RawAssertionPayload} raw_error
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
export function abiDecodeError(abi: Abi, raw_error: RawAssertionPayload): any;
|
|
27
|
+
|
|
28
|
+
export type ABIError = Error;
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
33
|
+
export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
38
|
+
|
|
39
|
+
export interface InitOutput {
|
|
40
|
+
readonly memory: WebAssembly.Memory;
|
|
41
|
+
readonly abiEncode: (a: number, b: number, c: number, d: number) => void;
|
|
42
|
+
readonly abiDecode: (a: number, b: number, c: number) => void;
|
|
43
|
+
readonly serializeWitness: (a: number, b: number) => void;
|
|
44
|
+
readonly abiDecodeError: (a: number, b: number, c: number) => void;
|
|
45
|
+
readonly __wbindgen_malloc: (a: number) => number;
|
|
46
|
+
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
47
|
+
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
48
|
+
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
49
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h57a2220e5f1e0a1e: (a: number, b: number, c: number, d: number) => void;
|
|
50
|
+
readonly __wbindgen_exn_store: (a: number) => void;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
|
54
|
+
/**
|
|
55
|
+
* Instantiates the given `module`, which can either be bytes or
|
|
56
|
+
* a precompiled `WebAssembly.Module`.
|
|
57
|
+
*
|
|
58
|
+
* @param {SyncInitInput} module
|
|
59
|
+
*
|
|
60
|
+
* @returns {InitOutput}
|
|
61
|
+
*/
|
|
62
|
+
export function initSync(module: SyncInitInput): InitOutput;
|
|
63
|
+
|
|
64
|
+
/**
|
|
65
|
+
* If `module_or_path` is {RequestInfo} or {URL}, makes a request and
|
|
66
|
+
* for everything else, calls `WebAssembly.instantiate` directly.
|
|
67
|
+
*
|
|
68
|
+
* @param {InitInput | Promise<InitInput>} module_or_path
|
|
69
|
+
*
|
|
70
|
+
* @returns {Promise<InitOutput>}
|
|
71
|
+
*/
|
|
72
|
+
export default function __wbg_init (module_or_path?: InitInput | Promise<InitInput>): Promise<InitOutput>;
|
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
let wasm;
|
|
2
|
+
|
|
3
|
+
const heap = new Array(128).fill(undefined);
|
|
4
|
+
|
|
5
|
+
heap.push(undefined, null, true, false);
|
|
6
|
+
|
|
7
|
+
function getObject(idx) { return heap[idx]; }
|
|
8
|
+
|
|
9
|
+
function isLikeNone(x) {
|
|
10
|
+
return x === undefined || x === null;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
let cachedFloat64Memory0 = null;
|
|
14
|
+
|
|
15
|
+
function getFloat64Memory0() {
|
|
16
|
+
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
|
|
17
|
+
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
|
|
18
|
+
}
|
|
19
|
+
return cachedFloat64Memory0;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
let cachedInt32Memory0 = null;
|
|
23
|
+
|
|
24
|
+
function getInt32Memory0() {
|
|
25
|
+
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
|
|
26
|
+
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
|
|
27
|
+
}
|
|
28
|
+
return cachedInt32Memory0;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
let heap_next = heap.length;
|
|
32
|
+
|
|
33
|
+
function dropObject(idx) {
|
|
34
|
+
if (idx < 132) return;
|
|
35
|
+
heap[idx] = heap_next;
|
|
36
|
+
heap_next = idx;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
function takeObject(idx) {
|
|
40
|
+
const ret = getObject(idx);
|
|
41
|
+
dropObject(idx);
|
|
42
|
+
return ret;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
let WASM_VECTOR_LEN = 0;
|
|
46
|
+
|
|
47
|
+
let cachedUint8Memory0 = null;
|
|
48
|
+
|
|
49
|
+
function getUint8Memory0() {
|
|
50
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
51
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
52
|
+
}
|
|
53
|
+
return cachedUint8Memory0;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
57
|
+
|
|
58
|
+
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
59
|
+
? function (arg, view) {
|
|
60
|
+
return cachedTextEncoder.encodeInto(arg, view);
|
|
61
|
+
}
|
|
62
|
+
: function (arg, view) {
|
|
63
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
64
|
+
view.set(buf);
|
|
65
|
+
return {
|
|
66
|
+
read: arg.length,
|
|
67
|
+
written: buf.length
|
|
68
|
+
};
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
function passStringToWasm0(arg, malloc, realloc) {
|
|
72
|
+
|
|
73
|
+
if (realloc === undefined) {
|
|
74
|
+
const buf = cachedTextEncoder.encode(arg);
|
|
75
|
+
const ptr = malloc(buf.length) >>> 0;
|
|
76
|
+
getUint8Memory0().subarray(ptr, ptr + buf.length).set(buf);
|
|
77
|
+
WASM_VECTOR_LEN = buf.length;
|
|
78
|
+
return ptr;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
let len = arg.length;
|
|
82
|
+
let ptr = malloc(len) >>> 0;
|
|
83
|
+
|
|
84
|
+
const mem = getUint8Memory0();
|
|
85
|
+
|
|
86
|
+
let offset = 0;
|
|
87
|
+
|
|
88
|
+
for (; offset < len; offset++) {
|
|
89
|
+
const code = arg.charCodeAt(offset);
|
|
90
|
+
if (code > 0x7F) break;
|
|
91
|
+
mem[ptr + offset] = code;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
if (offset !== len) {
|
|
95
|
+
if (offset !== 0) {
|
|
96
|
+
arg = arg.slice(offset);
|
|
97
|
+
}
|
|
98
|
+
ptr = realloc(ptr, len, len = offset + arg.length * 3) >>> 0;
|
|
99
|
+
const view = getUint8Memory0().subarray(ptr + offset, ptr + len);
|
|
100
|
+
const ret = encodeString(arg, view);
|
|
101
|
+
|
|
102
|
+
offset += ret.written;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
WASM_VECTOR_LEN = offset;
|
|
106
|
+
return ptr;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
function addHeapObject(obj) {
|
|
110
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
111
|
+
const idx = heap_next;
|
|
112
|
+
heap_next = heap[idx];
|
|
113
|
+
|
|
114
|
+
heap[idx] = obj;
|
|
115
|
+
return idx;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
119
|
+
|
|
120
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
121
|
+
|
|
122
|
+
function getStringFromWasm0(ptr, len) {
|
|
123
|
+
ptr = ptr >>> 0;
|
|
124
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* @param {Abi} abi
|
|
128
|
+
* @param {InputMap} inputs
|
|
129
|
+
* @param {InputValue | undefined} return_value
|
|
130
|
+
* @returns {WitnessMap}
|
|
131
|
+
*/
|
|
132
|
+
export function abiEncode(abi, inputs, return_value) {
|
|
133
|
+
try {
|
|
134
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
135
|
+
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), isLikeNone(return_value) ? 0 : addHeapObject(return_value));
|
|
136
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
137
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
138
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
139
|
+
if (r2) {
|
|
140
|
+
throw takeObject(r1);
|
|
141
|
+
}
|
|
142
|
+
return takeObject(r0);
|
|
143
|
+
} finally {
|
|
144
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* @param {Abi} abi
|
|
150
|
+
* @param {WitnessMap} witness_map
|
|
151
|
+
* @returns {any}
|
|
152
|
+
*/
|
|
153
|
+
export function abiDecode(abi, witness_map) {
|
|
154
|
+
try {
|
|
155
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
156
|
+
wasm.abiDecode(retptr, addHeapObject(abi), addHeapObject(witness_map));
|
|
157
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
158
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
159
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
160
|
+
if (r2) {
|
|
161
|
+
throw takeObject(r1);
|
|
162
|
+
}
|
|
163
|
+
return takeObject(r0);
|
|
164
|
+
} finally {
|
|
165
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function getArrayU8FromWasm0(ptr, len) {
|
|
170
|
+
ptr = ptr >>> 0;
|
|
171
|
+
return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
|
|
172
|
+
}
|
|
173
|
+
/**
|
|
174
|
+
* @param {WitnessMap} witness_map
|
|
175
|
+
* @returns {Uint8Array}
|
|
176
|
+
*/
|
|
177
|
+
export function serializeWitness(witness_map) {
|
|
178
|
+
try {
|
|
179
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
180
|
+
wasm.serializeWitness(retptr, addHeapObject(witness_map));
|
|
181
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
182
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
183
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
184
|
+
var r3 = getInt32Memory0()[retptr / 4 + 3];
|
|
185
|
+
if (r3) {
|
|
186
|
+
throw takeObject(r2);
|
|
187
|
+
}
|
|
188
|
+
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
189
|
+
wasm.__wbindgen_free(r0, r1 * 1);
|
|
190
|
+
return v1;
|
|
191
|
+
} finally {
|
|
192
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* @param {Abi} abi
|
|
198
|
+
* @param {RawAssertionPayload} raw_error
|
|
199
|
+
* @returns {any}
|
|
200
|
+
*/
|
|
201
|
+
export function abiDecodeError(abi, raw_error) {
|
|
202
|
+
try {
|
|
203
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
204
|
+
wasm.abiDecodeError(retptr, addHeapObject(abi), addHeapObject(raw_error));
|
|
205
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
206
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
207
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
208
|
+
if (r2) {
|
|
209
|
+
throw takeObject(r1);
|
|
210
|
+
}
|
|
211
|
+
return takeObject(r0);
|
|
212
|
+
} finally {
|
|
213
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function __wbg_adapter_28(arg0, arg1, arg2, arg3) {
|
|
218
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h57a2220e5f1e0a1e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
function handleError(f, args) {
|
|
222
|
+
try {
|
|
223
|
+
return f.apply(this, args);
|
|
224
|
+
} catch (e) {
|
|
225
|
+
wasm.__wbindgen_exn_store(addHeapObject(e));
|
|
226
|
+
}
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
async function __wbg_load(module, imports) {
|
|
230
|
+
if (typeof Response === 'function' && module instanceof Response) {
|
|
231
|
+
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
232
|
+
try {
|
|
233
|
+
return await WebAssembly.instantiateStreaming(module, imports);
|
|
234
|
+
|
|
235
|
+
} catch (e) {
|
|
236
|
+
if (module.headers.get('Content-Type') != 'application/wasm') {
|
|
237
|
+
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);
|
|
238
|
+
|
|
239
|
+
} else {
|
|
240
|
+
throw e;
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
const bytes = await module.arrayBuffer();
|
|
246
|
+
return await WebAssembly.instantiate(bytes, imports);
|
|
247
|
+
|
|
248
|
+
} else {
|
|
249
|
+
const instance = await WebAssembly.instantiate(module, imports);
|
|
250
|
+
|
|
251
|
+
if (instance instanceof WebAssembly.Instance) {
|
|
252
|
+
return { instance, module };
|
|
253
|
+
|
|
254
|
+
} else {
|
|
255
|
+
return instance;
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
function __wbg_get_imports() {
|
|
261
|
+
const imports = {};
|
|
262
|
+
imports.wbg = {};
|
|
263
|
+
imports.wbg.__wbg_constructor_48f7463f903b7cef = function(arg0) {
|
|
264
|
+
const ret = new Error(takeObject(arg0));
|
|
265
|
+
return addHeapObject(ret);
|
|
266
|
+
};
|
|
267
|
+
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
268
|
+
const obj = getObject(arg1);
|
|
269
|
+
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
270
|
+
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
271
|
+
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
272
|
+
};
|
|
273
|
+
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
274
|
+
takeObject(arg0);
|
|
275
|
+
};
|
|
276
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
277
|
+
const obj = getObject(arg1);
|
|
278
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
279
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
280
|
+
var len1 = WASM_VECTOR_LEN;
|
|
281
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
282
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
283
|
+
};
|
|
284
|
+
imports.wbg.__wbg_new_b44272d7763dffe3 = function() {
|
|
285
|
+
const ret = new Map();
|
|
286
|
+
return addHeapObject(ret);
|
|
287
|
+
};
|
|
288
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
289
|
+
const ret = arg0;
|
|
290
|
+
return addHeapObject(ret);
|
|
291
|
+
};
|
|
292
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
293
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
294
|
+
return addHeapObject(ret);
|
|
295
|
+
};
|
|
296
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
297
|
+
const ret = getObject(arg0) === undefined;
|
|
298
|
+
return ret;
|
|
299
|
+
};
|
|
300
|
+
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
301
|
+
const ret = new Error();
|
|
302
|
+
return addHeapObject(ret);
|
|
303
|
+
};
|
|
304
|
+
imports.wbg.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
|
|
305
|
+
const ret = getObject(arg1).stack;
|
|
306
|
+
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
307
|
+
const len1 = WASM_VECTOR_LEN;
|
|
308
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
309
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
310
|
+
};
|
|
311
|
+
imports.wbg.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
312
|
+
let deferred0_0;
|
|
313
|
+
let deferred0_1;
|
|
314
|
+
try {
|
|
315
|
+
deferred0_0 = arg0;
|
|
316
|
+
deferred0_1 = arg1;
|
|
317
|
+
console.error(getStringFromWasm0(arg0, arg1));
|
|
318
|
+
} finally {
|
|
319
|
+
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
320
|
+
}
|
|
321
|
+
};
|
|
322
|
+
imports.wbg.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) {
|
|
323
|
+
try {
|
|
324
|
+
var state0 = {a: arg1, b: arg2};
|
|
325
|
+
var cb0 = (arg0, arg1) => {
|
|
326
|
+
const a = state0.a;
|
|
327
|
+
state0.a = 0;
|
|
328
|
+
try {
|
|
329
|
+
return __wbg_adapter_28(a, state0.b, arg0, arg1);
|
|
330
|
+
} finally {
|
|
331
|
+
state0.a = a;
|
|
332
|
+
}
|
|
333
|
+
};
|
|
334
|
+
getObject(arg0).forEach(cb0);
|
|
335
|
+
} finally {
|
|
336
|
+
state0.a = state0.b = 0;
|
|
337
|
+
}
|
|
338
|
+
};
|
|
339
|
+
imports.wbg.__wbg_set_da7be7bf0e037b14 = function(arg0, arg1, arg2) {
|
|
340
|
+
const ret = getObject(arg0).set(getObject(arg1), getObject(arg2));
|
|
341
|
+
return addHeapObject(ret);
|
|
342
|
+
};
|
|
343
|
+
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
344
|
+
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
345
|
+
return addHeapObject(ret);
|
|
346
|
+
}, arguments) };
|
|
347
|
+
imports.wbg.__wbg_stringify_d06ad2addc54d51e = function() { return handleError(function (arg0) {
|
|
348
|
+
const ret = JSON.stringify(getObject(arg0));
|
|
349
|
+
return addHeapObject(ret);
|
|
350
|
+
}, arguments) };
|
|
351
|
+
imports.wbg.__wbindgen_throw = function(arg0, arg1) {
|
|
352
|
+
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
return imports;
|
|
356
|
+
}
|
|
357
|
+
|
|
358
|
+
function __wbg_init_memory(imports, maybe_memory) {
|
|
359
|
+
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
function __wbg_finalize_init(instance, module) {
|
|
363
|
+
wasm = instance.exports;
|
|
364
|
+
__wbg_init.__wbindgen_wasm_module = module;
|
|
365
|
+
cachedFloat64Memory0 = null;
|
|
366
|
+
cachedInt32Memory0 = null;
|
|
367
|
+
cachedUint8Memory0 = null;
|
|
368
|
+
|
|
369
|
+
|
|
370
|
+
return wasm;
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
function initSync(module) {
|
|
374
|
+
if (wasm !== undefined) return wasm;
|
|
375
|
+
|
|
376
|
+
const imports = __wbg_get_imports();
|
|
377
|
+
|
|
378
|
+
__wbg_init_memory(imports);
|
|
379
|
+
|
|
380
|
+
if (!(module instanceof WebAssembly.Module)) {
|
|
381
|
+
module = new WebAssembly.Module(module);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
const instance = new WebAssembly.Instance(module, imports);
|
|
385
|
+
|
|
386
|
+
return __wbg_finalize_init(instance, module);
|
|
387
|
+
}
|
|
388
|
+
|
|
389
|
+
async function __wbg_init(input) {
|
|
390
|
+
if (wasm !== undefined) return wasm;
|
|
391
|
+
|
|
392
|
+
if (typeof input === 'undefined') {
|
|
393
|
+
input = new URL('noirc_abi_wasm_bg.wasm', import.meta.url);
|
|
394
|
+
}
|
|
395
|
+
const imports = __wbg_get_imports();
|
|
396
|
+
|
|
397
|
+
if (typeof input === 'string' || (typeof Request === 'function' && input instanceof Request) || (typeof URL === 'function' && input instanceof URL)) {
|
|
398
|
+
input = fetch(input);
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
__wbg_init_memory(imports);
|
|
402
|
+
|
|
403
|
+
const { instance, module } = await __wbg_load(await input, imports);
|
|
404
|
+
|
|
405
|
+
return __wbg_finalize_init(instance, module);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
export { initSync }
|
|
409
|
+
export default __wbg_init;
|
|
Binary file
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/* tslint:disable */
|
|
2
|
+
/* eslint-disable */
|
|
3
|
+
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function abiEncode(a: number, b: number, c: number, d: number): void;
|
|
5
|
+
export function abiDecode(a: number, b: number, c: number): void;
|
|
6
|
+
export function serializeWitness(a: number, b: number): void;
|
|
7
|
+
export function abiDecodeError(a: number, b: number, c: number): void;
|
|
8
|
+
export function __wbindgen_malloc(a: number): number;
|
|
9
|
+
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
10
|
+
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
11
|
+
export function __wbindgen_free(a: number, b: number): void;
|
|
12
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h57a2220e5f1e0a1e(a: number, b: number, c: number, d: number): void;
|
|
13
|
+
export function __wbindgen_exn_store(a: number): void;
|