@noir-lang/noir_wasm 0.16.0-1b40af8c1 → 0.16.0-38acee5.aztec
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/nodejs/noir_wasm.d.ts +15 -9
- package/nodejs/noir_wasm.js +88 -61
- package/nodejs/noir_wasm_bg.wasm +0 -0
- package/nodejs/noir_wasm_bg.wasm.d.ts +5 -5
- package/package.json +8 -6
- package/web/noir_wasm.d.ts +20 -14
- package/web/noir_wasm.js +84 -59
- package/web/noir_wasm_bg.wasm +0 -0
- package/web/noir_wasm_bg.wasm.d.ts +5 -5
package/nodejs/noir_wasm.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {Uint8Array} bytes
|
|
5
5
|
* @returns {any}
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function acir_read_bytes(bytes: Uint8Array): any;
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} acir
|
|
10
|
+
* @returns {Uint8Array}
|
|
11
|
+
*/
|
|
12
|
+
export function acir_write_bytes(acir: any): Uint8Array;
|
|
8
13
|
/**
|
|
9
14
|
* @param {string} level
|
|
10
15
|
*/
|
|
@@ -14,12 +19,13 @@ export function init_log_level(level: string): void;
|
|
|
14
19
|
*/
|
|
15
20
|
export function build_info(): any;
|
|
16
21
|
/**
|
|
17
|
-
* @param {
|
|
22
|
+
* @param {string} entry_point
|
|
23
|
+
* @param {boolean | undefined} contracts
|
|
24
|
+
* @param {string[] | undefined} dependencies
|
|
18
25
|
* @returns {any}
|
|
19
26
|
*/
|
|
20
|
-
export function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export function acir_write_bytes(acir: any): Uint8Array;
|
|
27
|
+
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
|
|
28
|
+
|
|
29
|
+
export type CompileError = Error;
|
|
30
|
+
|
|
31
|
+
|
package/nodejs/noir_wasm.js
CHANGED
|
@@ -2,7 +2,7 @@ let imports = {};
|
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
4
|
const { read_file } = require(`@noir-lang/source-resolver`);
|
|
5
|
-
const {
|
|
5
|
+
const { TextEncoder, TextDecoder } = require(`util`);
|
|
6
6
|
|
|
7
7
|
const heap = new Array(128).fill(undefined);
|
|
8
8
|
|
|
@@ -24,9 +24,7 @@ function takeObject(idx) {
|
|
|
24
24
|
return ret;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
let
|
|
28
|
-
|
|
29
|
-
cachedTextDecoder.decode();
|
|
27
|
+
let WASM_VECTOR_LEN = 0;
|
|
30
28
|
|
|
31
29
|
let cachedUint8Memory0 = null;
|
|
32
30
|
|
|
@@ -37,22 +35,6 @@ function getUint8Memory0() {
|
|
|
37
35
|
return cachedUint8Memory0;
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
function getStringFromWasm0(ptr, len) {
|
|
41
|
-
ptr = ptr >>> 0;
|
|
42
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
function addHeapObject(obj) {
|
|
46
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
|
-
const idx = heap_next;
|
|
48
|
-
heap_next = heap[idx];
|
|
49
|
-
|
|
50
|
-
heap[idx] = obj;
|
|
51
|
-
return idx;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
let WASM_VECTOR_LEN = 0;
|
|
55
|
-
|
|
56
38
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
57
39
|
|
|
58
40
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -118,38 +100,24 @@ function getInt32Memory0() {
|
|
|
118
100
|
}
|
|
119
101
|
return cachedInt32Memory0;
|
|
120
102
|
}
|
|
121
|
-
/**
|
|
122
|
-
* @param {any} args
|
|
123
|
-
* @returns {any}
|
|
124
|
-
*/
|
|
125
|
-
module.exports.compile = function(args) {
|
|
126
|
-
const ret = wasm.compile(addHeapObject(args));
|
|
127
|
-
return takeObject(ret);
|
|
128
|
-
};
|
|
129
103
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
104
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
105
|
+
|
|
106
|
+
cachedTextDecoder.decode();
|
|
107
|
+
|
|
108
|
+
function getStringFromWasm0(ptr, len) {
|
|
109
|
+
ptr = ptr >>> 0;
|
|
110
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
136
111
|
}
|
|
137
|
-
/**
|
|
138
|
-
* @param {string} level
|
|
139
|
-
*/
|
|
140
|
-
module.exports.init_log_level = function(level) {
|
|
141
|
-
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
142
|
-
const len0 = WASM_VECTOR_LEN;
|
|
143
|
-
wasm.init_log_level(ptr0, len0);
|
|
144
|
-
};
|
|
145
112
|
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
113
|
+
function addHeapObject(obj) {
|
|
114
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
115
|
+
const idx = heap_next;
|
|
116
|
+
heap_next = heap[idx];
|
|
117
|
+
|
|
118
|
+
heap[idx] = obj;
|
|
119
|
+
return idx;
|
|
120
|
+
}
|
|
153
121
|
|
|
154
122
|
function passArray8ToWasm0(arg, malloc) {
|
|
155
123
|
const ptr = malloc(arg.length * 1) >>> 0;
|
|
@@ -183,27 +151,85 @@ module.exports.acir_write_bytes = function(acir) {
|
|
|
183
151
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
184
152
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
185
153
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
186
|
-
wasm.
|
|
154
|
+
wasm.__wbindgen_export_2(r0, r1 * 1);
|
|
187
155
|
return v1;
|
|
188
156
|
} finally {
|
|
189
157
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
190
158
|
}
|
|
191
159
|
};
|
|
192
160
|
|
|
161
|
+
/**
|
|
162
|
+
* @param {string} level
|
|
163
|
+
*/
|
|
164
|
+
module.exports.init_log_level = function(level) {
|
|
165
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
166
|
+
const len0 = WASM_VECTOR_LEN;
|
|
167
|
+
wasm.init_log_level(ptr0, len0);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* @returns {any}
|
|
172
|
+
*/
|
|
173
|
+
module.exports.build_info = function() {
|
|
174
|
+
const ret = wasm.build_info();
|
|
175
|
+
return takeObject(ret);
|
|
176
|
+
};
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @param {string} entry_point
|
|
180
|
+
* @param {boolean | undefined} contracts
|
|
181
|
+
* @param {string[] | undefined} dependencies
|
|
182
|
+
* @returns {any}
|
|
183
|
+
*/
|
|
184
|
+
module.exports.compile = function(entry_point, contracts, dependencies) {
|
|
185
|
+
try {
|
|
186
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
187
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
188
|
+
const len0 = WASM_VECTOR_LEN;
|
|
189
|
+
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
190
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
191
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
192
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
193
|
+
if (r2) {
|
|
194
|
+
throw takeObject(r1);
|
|
195
|
+
}
|
|
196
|
+
return takeObject(r0);
|
|
197
|
+
} finally {
|
|
198
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
function handleError(f, args) {
|
|
203
|
+
try {
|
|
204
|
+
return f.apply(this, args);
|
|
205
|
+
} catch (e) {
|
|
206
|
+
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
|
|
193
210
|
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
194
211
|
const ret = getObject(arg0) === undefined;
|
|
195
212
|
return ret;
|
|
196
213
|
};
|
|
197
214
|
|
|
198
|
-
module.exports.
|
|
199
|
-
const ret =
|
|
200
|
-
return ret;
|
|
215
|
+
module.exports.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) {
|
|
216
|
+
const ret = new Error(takeObject(arg0));
|
|
217
|
+
return addHeapObject(ret);
|
|
201
218
|
};
|
|
202
219
|
|
|
203
220
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
204
221
|
takeObject(arg0);
|
|
205
222
|
};
|
|
206
223
|
|
|
224
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
225
|
+
const obj = getObject(arg1);
|
|
226
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
227
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
228
|
+
var len1 = WASM_VECTOR_LEN;
|
|
229
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
230
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
231
|
+
};
|
|
232
|
+
|
|
207
233
|
module.exports.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
208
234
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
209
235
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -238,7 +264,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
238
264
|
deferred0_1 = arg1;
|
|
239
265
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
240
266
|
} finally {
|
|
241
|
-
wasm.
|
|
267
|
+
wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
|
|
242
268
|
}
|
|
243
269
|
};
|
|
244
270
|
|
|
@@ -266,13 +292,14 @@ module.exports.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
|
266
292
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
267
293
|
};
|
|
268
294
|
|
|
269
|
-
module.exports.
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
295
|
+
module.exports.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
296
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
297
|
+
return addHeapObject(ret);
|
|
298
|
+
};
|
|
299
|
+
|
|
300
|
+
module.exports.__wbg_length_820c786973abdd8a = function(arg0) {
|
|
301
|
+
const ret = getObject(arg0).length;
|
|
302
|
+
return ret;
|
|
276
303
|
};
|
|
277
304
|
|
|
278
305
|
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
package/nodejs/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function compile(a: number): number;
|
|
5
|
-
export function init_log_level(a: number, b: number): void;
|
|
6
|
-
export function build_info(): number;
|
|
7
4
|
export function acir_read_bytes(a: number, b: number): number;
|
|
8
5
|
export function acir_write_bytes(a: number, b: number): void;
|
|
6
|
+
export function init_log_level(a: number, b: number): void;
|
|
7
|
+
export function build_info(): number;
|
|
8
|
+
export function compile(a: number, b: number, c: number, d: number, e: number): void;
|
|
9
9
|
export function __wbindgen_export_0(a: number): number;
|
|
10
10
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
11
|
-
export function __wbindgen_export_2(a: number): void;
|
|
12
11
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
13
|
-
export function
|
|
12
|
+
export function __wbindgen_export_2(a: number, b: number): void;
|
|
13
|
+
export function __wbindgen_export_3(a: number): void;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"collaborators": [
|
|
4
4
|
"The Noir Team <team@noir-lang.org>"
|
|
5
5
|
],
|
|
6
|
-
"version": "0.16.0-
|
|
6
|
+
"version": "0.16.0-38acee5.aztec",
|
|
7
7
|
"license": "(MIT OR Apache-2.0)",
|
|
8
8
|
"main": "./nodejs/noir_wasm.js",
|
|
9
9
|
"types": "./web/noir_wasm.d.ts",
|
|
@@ -20,16 +20,18 @@
|
|
|
20
20
|
},
|
|
21
21
|
"scripts": {
|
|
22
22
|
"build": "bash ./build.sh",
|
|
23
|
-
"test": "
|
|
24
|
-
"test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\"}' mocha",
|
|
23
|
+
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
|
|
24
|
+
"test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
|
|
25
25
|
"test:browser": "web-test-runner",
|
|
26
26
|
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result",
|
|
27
|
-
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json",
|
|
27
|
+
"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",
|
|
28
28
|
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish",
|
|
29
|
-
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
|
|
29
|
+
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0",
|
|
30
|
+
"build:nix": "nix build -L .#noir_wasm",
|
|
31
|
+
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/noir_wasm/nodejs ./ && cp -rL ./result/noir_wasm/web ./"
|
|
30
32
|
},
|
|
31
33
|
"peerDependencies": {
|
|
32
|
-
"@noir-lang/source-resolver": "0.16.0-
|
|
34
|
+
"@noir-lang/source-resolver": "0.16.0-38acee5.aztec"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
package/web/noir_wasm.d.ts
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {
|
|
4
|
+
* @param {Uint8Array} bytes
|
|
5
5
|
* @returns {any}
|
|
6
6
|
*/
|
|
7
|
-
export function
|
|
7
|
+
export function acir_read_bytes(bytes: Uint8Array): any;
|
|
8
|
+
/**
|
|
9
|
+
* @param {any} acir
|
|
10
|
+
* @returns {Uint8Array}
|
|
11
|
+
*/
|
|
12
|
+
export function acir_write_bytes(acir: any): Uint8Array;
|
|
8
13
|
/**
|
|
9
14
|
* @param {string} level
|
|
10
15
|
*/
|
|
@@ -14,30 +19,31 @@ export function init_log_level(level: string): void;
|
|
|
14
19
|
*/
|
|
15
20
|
export function build_info(): any;
|
|
16
21
|
/**
|
|
17
|
-
* @param {
|
|
22
|
+
* @param {string} entry_point
|
|
23
|
+
* @param {boolean | undefined} contracts
|
|
24
|
+
* @param {string[] | undefined} dependencies
|
|
18
25
|
* @returns {any}
|
|
19
26
|
*/
|
|
20
|
-
export function
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
export function acir_write_bytes(acir: any): Uint8Array;
|
|
27
|
+
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
|
|
28
|
+
|
|
29
|
+
export type CompileError = Error;
|
|
30
|
+
|
|
31
|
+
|
|
26
32
|
|
|
27
33
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
28
34
|
|
|
29
35
|
export interface InitOutput {
|
|
30
36
|
readonly memory: WebAssembly.Memory;
|
|
31
|
-
readonly compile: (a: number) => number;
|
|
32
|
-
readonly init_log_level: (a: number, b: number) => void;
|
|
33
|
-
readonly build_info: () => number;
|
|
34
37
|
readonly acir_read_bytes: (a: number, b: number) => number;
|
|
35
38
|
readonly acir_write_bytes: (a: number, b: number) => void;
|
|
39
|
+
readonly init_log_level: (a: number, b: number) => void;
|
|
40
|
+
readonly build_info: () => number;
|
|
41
|
+
readonly compile: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
36
42
|
readonly __wbindgen_export_0: (a: number) => number;
|
|
37
43
|
readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;
|
|
38
|
-
readonly __wbindgen_export_2: (a: number) => void;
|
|
39
44
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
40
|
-
readonly
|
|
45
|
+
readonly __wbindgen_export_2: (a: number, b: number) => void;
|
|
46
|
+
readonly __wbindgen_export_3: (a: number) => void;
|
|
41
47
|
}
|
|
42
48
|
|
|
43
49
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/web/noir_wasm.js
CHANGED
|
@@ -22,9 +22,7 @@ function takeObject(idx) {
|
|
|
22
22
|
return ret;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
25
|
+
let WASM_VECTOR_LEN = 0;
|
|
28
26
|
|
|
29
27
|
let cachedUint8Memory0 = null;
|
|
30
28
|
|
|
@@ -35,22 +33,6 @@ function getUint8Memory0() {
|
|
|
35
33
|
return cachedUint8Memory0;
|
|
36
34
|
}
|
|
37
35
|
|
|
38
|
-
function getStringFromWasm0(ptr, len) {
|
|
39
|
-
ptr = ptr >>> 0;
|
|
40
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
function addHeapObject(obj) {
|
|
44
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
45
|
-
const idx = heap_next;
|
|
46
|
-
heap_next = heap[idx];
|
|
47
|
-
|
|
48
|
-
heap[idx] = obj;
|
|
49
|
-
return idx;
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
let WASM_VECTOR_LEN = 0;
|
|
53
|
-
|
|
54
36
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
55
37
|
|
|
56
38
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -116,37 +98,23 @@ function getInt32Memory0() {
|
|
|
116
98
|
}
|
|
117
99
|
return cachedInt32Memory0;
|
|
118
100
|
}
|
|
119
|
-
/**
|
|
120
|
-
* @param {any} args
|
|
121
|
-
* @returns {any}
|
|
122
|
-
*/
|
|
123
|
-
export function compile(args) {
|
|
124
|
-
const ret = wasm.compile(addHeapObject(args));
|
|
125
|
-
return takeObject(ret);
|
|
126
|
-
}
|
|
127
101
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* @param {string} level
|
|
137
|
-
*/
|
|
138
|
-
export function init_log_level(level) {
|
|
139
|
-
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
140
|
-
const len0 = WASM_VECTOR_LEN;
|
|
141
|
-
wasm.init_log_level(ptr0, len0);
|
|
102
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
103
|
+
|
|
104
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
105
|
+
|
|
106
|
+
function getStringFromWasm0(ptr, len) {
|
|
107
|
+
ptr = ptr >>> 0;
|
|
108
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
142
109
|
}
|
|
143
110
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
111
|
+
function addHeapObject(obj) {
|
|
112
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
113
|
+
const idx = heap_next;
|
|
114
|
+
heap_next = heap[idx];
|
|
115
|
+
|
|
116
|
+
heap[idx] = obj;
|
|
117
|
+
return idx;
|
|
150
118
|
}
|
|
151
119
|
|
|
152
120
|
function passArray8ToWasm0(arg, malloc) {
|
|
@@ -181,13 +149,62 @@ export function acir_write_bytes(acir) {
|
|
|
181
149
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
182
150
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
183
151
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
184
|
-
wasm.
|
|
152
|
+
wasm.__wbindgen_export_2(r0, r1 * 1);
|
|
185
153
|
return v1;
|
|
186
154
|
} finally {
|
|
187
155
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
188
156
|
}
|
|
189
157
|
}
|
|
190
158
|
|
|
159
|
+
/**
|
|
160
|
+
* @param {string} level
|
|
161
|
+
*/
|
|
162
|
+
export function init_log_level(level) {
|
|
163
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
164
|
+
const len0 = WASM_VECTOR_LEN;
|
|
165
|
+
wasm.init_log_level(ptr0, len0);
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* @returns {any}
|
|
170
|
+
*/
|
|
171
|
+
export function build_info() {
|
|
172
|
+
const ret = wasm.build_info();
|
|
173
|
+
return takeObject(ret);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
/**
|
|
177
|
+
* @param {string} entry_point
|
|
178
|
+
* @param {boolean | undefined} contracts
|
|
179
|
+
* @param {string[] | undefined} dependencies
|
|
180
|
+
* @returns {any}
|
|
181
|
+
*/
|
|
182
|
+
export function compile(entry_point, contracts, dependencies) {
|
|
183
|
+
try {
|
|
184
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
185
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
186
|
+
const len0 = WASM_VECTOR_LEN;
|
|
187
|
+
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
188
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
189
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
190
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
191
|
+
if (r2) {
|
|
192
|
+
throw takeObject(r1);
|
|
193
|
+
}
|
|
194
|
+
return takeObject(r0);
|
|
195
|
+
} finally {
|
|
196
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
function handleError(f, args) {
|
|
201
|
+
try {
|
|
202
|
+
return f.apply(this, args);
|
|
203
|
+
} catch (e) {
|
|
204
|
+
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
191
208
|
async function __wbg_load(module, imports) {
|
|
192
209
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
193
210
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -226,13 +243,21 @@ function __wbg_get_imports() {
|
|
|
226
243
|
const ret = getObject(arg0) === undefined;
|
|
227
244
|
return ret;
|
|
228
245
|
};
|
|
229
|
-
imports.wbg.
|
|
230
|
-
const ret =
|
|
231
|
-
return ret;
|
|
246
|
+
imports.wbg.__wbg_constructor_ac1f808f67a5f1e9 = function(arg0) {
|
|
247
|
+
const ret = new Error(takeObject(arg0));
|
|
248
|
+
return addHeapObject(ret);
|
|
232
249
|
};
|
|
233
250
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
234
251
|
takeObject(arg0);
|
|
235
252
|
};
|
|
253
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
254
|
+
const obj = getObject(arg1);
|
|
255
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
256
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
257
|
+
var len1 = WASM_VECTOR_LEN;
|
|
258
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
259
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
260
|
+
};
|
|
236
261
|
imports.wbg.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
237
262
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
238
263
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -263,7 +288,7 @@ function __wbg_get_imports() {
|
|
|
263
288
|
deferred0_1 = arg1;
|
|
264
289
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
265
290
|
} finally {
|
|
266
|
-
wasm.
|
|
291
|
+
wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
|
|
267
292
|
}
|
|
268
293
|
};
|
|
269
294
|
imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
|
|
@@ -284,13 +309,13 @@ function __wbg_get_imports() {
|
|
|
284
309
|
imports.wbg.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
285
310
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
286
311
|
};
|
|
287
|
-
imports.wbg.
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
312
|
+
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
313
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
314
|
+
return addHeapObject(ret);
|
|
315
|
+
};
|
|
316
|
+
imports.wbg.__wbg_length_820c786973abdd8a = function(arg0) {
|
|
317
|
+
const ret = getObject(arg0).length;
|
|
318
|
+
return ret;
|
|
294
319
|
};
|
|
295
320
|
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
296
321
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
package/web/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function compile(a: number): number;
|
|
5
|
-
export function init_log_level(a: number, b: number): void;
|
|
6
|
-
export function build_info(): number;
|
|
7
4
|
export function acir_read_bytes(a: number, b: number): number;
|
|
8
5
|
export function acir_write_bytes(a: number, b: number): void;
|
|
6
|
+
export function init_log_level(a: number, b: number): void;
|
|
7
|
+
export function build_info(): number;
|
|
8
|
+
export function compile(a: number, b: number, c: number, d: number, e: number): void;
|
|
9
9
|
export function __wbindgen_export_0(a: number): number;
|
|
10
10
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
11
|
-
export function __wbindgen_export_2(a: number): void;
|
|
12
11
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
13
|
-
export function
|
|
12
|
+
export function __wbindgen_export_2(a: number, b: number): void;
|
|
13
|
+
export function __wbindgen_export_3(a: number): void;
|