@noir-lang/noir_wasm 0.16.0-1b40af8c1 → 0.16.0-37315f8.nightly
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 +34 -5
- package/nodejs/noir_wasm.js +130 -48
- package/nodejs/noir_wasm_bg.wasm +0 -0
- package/nodejs/noir_wasm_bg.wasm.d.ts +8 -3
- package/package.json +6 -4
- package/web/noir_wasm.d.ts +42 -8
- package/web/noir_wasm.js +126 -48
- package/web/noir_wasm_bg.wasm +0 -0
- package/web/noir_wasm_bg.wasm.d.ts +8 -3
package/nodejs/noir_wasm.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {any} args
|
|
5
|
-
* @returns {any}
|
|
6
|
-
*/
|
|
7
|
-
export function compile(args: any): any;
|
|
8
|
-
/**
|
|
9
4
|
* @param {string} level
|
|
10
5
|
*/
|
|
11
6
|
export function init_log_level(level: string): void;
|
|
@@ -23,3 +18,37 @@ export function acir_read_bytes(bytes: Uint8Array): any;
|
|
|
23
18
|
* @returns {Uint8Array}
|
|
24
19
|
*/
|
|
25
20
|
export function acir_write_bytes(acir: any): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} entry_point
|
|
23
|
+
* @param {boolean | undefined} contracts
|
|
24
|
+
* @param {string[] | undefined} dependencies
|
|
25
|
+
* @returns {any}
|
|
26
|
+
*/
|
|
27
|
+
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
|
|
28
|
+
|
|
29
|
+
export type Diagnostic = {
|
|
30
|
+
message: string;
|
|
31
|
+
file_path: string;
|
|
32
|
+
secondaries: ReadonlyArray<{
|
|
33
|
+
message: string;
|
|
34
|
+
start: number;
|
|
35
|
+
end: number;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface CompileError {
|
|
40
|
+
diagnostics: ReadonlyArray<Diagnostic>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*/
|
|
46
|
+
export class CompileError {
|
|
47
|
+
free(): void;
|
|
48
|
+
/**
|
|
49
|
+
*/
|
|
50
|
+
diagnostics: any;
|
|
51
|
+
/**
|
|
52
|
+
*/
|
|
53
|
+
message: string;
|
|
54
|
+
}
|
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,24 +24,6 @@ function takeObject(idx) {
|
|
|
24
24
|
return ret;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
28
|
-
|
|
29
|
-
cachedTextDecoder.decode();
|
|
30
|
-
|
|
31
|
-
let cachedUint8Memory0 = null;
|
|
32
|
-
|
|
33
|
-
function getUint8Memory0() {
|
|
34
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
35
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
36
|
-
}
|
|
37
|
-
return cachedUint8Memory0;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
function getStringFromWasm0(ptr, len) {
|
|
41
|
-
ptr = ptr >>> 0;
|
|
42
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
43
|
-
}
|
|
44
|
-
|
|
45
27
|
function addHeapObject(obj) {
|
|
46
28
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
47
29
|
const idx = heap_next;
|
|
@@ -53,6 +35,15 @@ function addHeapObject(obj) {
|
|
|
53
35
|
|
|
54
36
|
let WASM_VECTOR_LEN = 0;
|
|
55
37
|
|
|
38
|
+
let cachedUint8Memory0 = null;
|
|
39
|
+
|
|
40
|
+
function getUint8Memory0() {
|
|
41
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
42
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
43
|
+
}
|
|
44
|
+
return cachedUint8Memory0;
|
|
45
|
+
}
|
|
46
|
+
|
|
56
47
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
57
48
|
|
|
58
49
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -118,21 +109,14 @@ function getInt32Memory0() {
|
|
|
118
109
|
}
|
|
119
110
|
return cachedInt32Memory0;
|
|
120
111
|
}
|
|
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
112
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
113
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
114
|
+
|
|
115
|
+
cachedTextDecoder.decode();
|
|
116
|
+
|
|
117
|
+
function getStringFromWasm0(ptr, len) {
|
|
118
|
+
ptr = ptr >>> 0;
|
|
119
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
136
120
|
}
|
|
137
121
|
/**
|
|
138
122
|
* @param {string} level
|
|
@@ -183,27 +167,124 @@ module.exports.acir_write_bytes = function(acir) {
|
|
|
183
167
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
184
168
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
185
169
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
186
|
-
wasm.
|
|
170
|
+
wasm.__wbindgen_export_2(r0, r1 * 1);
|
|
187
171
|
return v1;
|
|
188
172
|
} finally {
|
|
189
173
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
190
174
|
}
|
|
191
175
|
};
|
|
192
176
|
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
177
|
+
/**
|
|
178
|
+
* @param {string} entry_point
|
|
179
|
+
* @param {boolean | undefined} contracts
|
|
180
|
+
* @param {string[] | undefined} dependencies
|
|
181
|
+
* @returns {any}
|
|
182
|
+
*/
|
|
183
|
+
module.exports.compile = function(entry_point, contracts, dependencies) {
|
|
184
|
+
try {
|
|
185
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
186
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
187
|
+
const len0 = WASM_VECTOR_LEN;
|
|
188
|
+
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
189
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
190
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
191
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
192
|
+
if (r2) {
|
|
193
|
+
throw takeObject(r1);
|
|
194
|
+
}
|
|
195
|
+
return takeObject(r0);
|
|
196
|
+
} finally {
|
|
197
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
198
|
+
}
|
|
196
199
|
};
|
|
197
200
|
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
+
function handleError(f, args) {
|
|
202
|
+
try {
|
|
203
|
+
return f.apply(this, args);
|
|
204
|
+
} catch (e) {
|
|
205
|
+
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
*/
|
|
210
|
+
class CompileError {
|
|
211
|
+
|
|
212
|
+
static __wrap(ptr) {
|
|
213
|
+
ptr = ptr >>> 0;
|
|
214
|
+
const obj = Object.create(CompileError.prototype);
|
|
215
|
+
obj.__wbg_ptr = ptr;
|
|
216
|
+
|
|
217
|
+
return obj;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
__destroy_into_raw() {
|
|
221
|
+
const ptr = this.__wbg_ptr;
|
|
222
|
+
this.__wbg_ptr = 0;
|
|
223
|
+
|
|
224
|
+
return ptr;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
free() {
|
|
228
|
+
const ptr = this.__destroy_into_raw();
|
|
229
|
+
wasm.__wbg_compileerror_free(ptr);
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* @returns {string}
|
|
233
|
+
*/
|
|
234
|
+
get message() {
|
|
235
|
+
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr);
|
|
236
|
+
return takeObject(ret);
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* @param {string} arg0
|
|
240
|
+
*/
|
|
241
|
+
set message(arg0) {
|
|
242
|
+
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0));
|
|
243
|
+
}
|
|
244
|
+
/**
|
|
245
|
+
* @returns {any}
|
|
246
|
+
*/
|
|
247
|
+
get diagnostics() {
|
|
248
|
+
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr);
|
|
249
|
+
return takeObject(ret);
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* @param {any} arg0
|
|
253
|
+
*/
|
|
254
|
+
set diagnostics(arg0) {
|
|
255
|
+
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0));
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
module.exports.CompileError = CompileError;
|
|
259
|
+
|
|
260
|
+
module.exports.__wbg_compileerror_new = function(arg0) {
|
|
261
|
+
const ret = CompileError.__wrap(arg0);
|
|
262
|
+
return addHeapObject(ret);
|
|
201
263
|
};
|
|
202
264
|
|
|
203
265
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
204
266
|
takeObject(arg0);
|
|
205
267
|
};
|
|
206
268
|
|
|
269
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
270
|
+
const ret = getObject(arg0);
|
|
271
|
+
return addHeapObject(ret);
|
|
272
|
+
};
|
|
273
|
+
|
|
274
|
+
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
275
|
+
const obj = getObject(arg1);
|
|
276
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
277
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
278
|
+
var len1 = WASM_VECTOR_LEN;
|
|
279
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
280
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
281
|
+
};
|
|
282
|
+
|
|
283
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
284
|
+
const ret = getObject(arg0) === undefined;
|
|
285
|
+
return ret;
|
|
286
|
+
};
|
|
287
|
+
|
|
207
288
|
module.exports.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
208
289
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
209
290
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -238,7 +319,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
238
319
|
deferred0_1 = arg1;
|
|
239
320
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
240
321
|
} finally {
|
|
241
|
-
wasm.
|
|
322
|
+
wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
|
|
242
323
|
}
|
|
243
324
|
};
|
|
244
325
|
|
|
@@ -266,13 +347,14 @@ module.exports.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
|
266
347
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
267
348
|
};
|
|
268
349
|
|
|
269
|
-
module.exports.
|
|
270
|
-
const
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
350
|
+
module.exports.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
351
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
352
|
+
return addHeapObject(ret);
|
|
353
|
+
};
|
|
354
|
+
|
|
355
|
+
module.exports.__wbg_length_820c786973abdd8a = function(arg0) {
|
|
356
|
+
const ret = getObject(arg0).length;
|
|
357
|
+
return ret;
|
|
276
358
|
};
|
|
277
359
|
|
|
278
360
|
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
package/nodejs/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function
|
|
4
|
+
export function __wbg_compileerror_free(a: number): void;
|
|
5
|
+
export function __wbg_get_compileerror_message(a: number): number;
|
|
6
|
+
export function __wbg_set_compileerror_message(a: number, b: number): void;
|
|
7
|
+
export function __wbg_get_compileerror_diagnostics(a: number): number;
|
|
8
|
+
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void;
|
|
5
9
|
export function init_log_level(a: number, b: number): void;
|
|
6
10
|
export function build_info(): number;
|
|
7
11
|
export function acir_read_bytes(a: number, b: number): number;
|
|
8
12
|
export function acir_write_bytes(a: number, b: number): void;
|
|
13
|
+
export function compile(a: number, b: number, c: number, d: number, e: number): void;
|
|
9
14
|
export function __wbindgen_export_0(a: number): number;
|
|
10
15
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
11
|
-
export function __wbindgen_export_2(a: number): void;
|
|
12
16
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
13
|
-
export function
|
|
17
|
+
export function __wbindgen_export_2(a: number, b: number): void;
|
|
18
|
+
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-37315f8.nightly",
|
|
7
7
|
"license": "(MIT OR Apache-2.0)",
|
|
8
8
|
"main": "./nodejs/noir_wasm.js",
|
|
9
9
|
"types": "./web/noir_wasm.d.ts",
|
|
@@ -24,12 +24,14 @@
|
|
|
24
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-37315f8.nightly"
|
|
33
35
|
},
|
|
34
36
|
"devDependencies": {
|
|
35
37
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
package/web/noir_wasm.d.ts
CHANGED
|
@@ -1,11 +1,6 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
-
* @param {any} args
|
|
5
|
-
* @returns {any}
|
|
6
|
-
*/
|
|
7
|
-
export function compile(args: any): any;
|
|
8
|
-
/**
|
|
9
4
|
* @param {string} level
|
|
10
5
|
*/
|
|
11
6
|
export function init_log_level(level: string): void;
|
|
@@ -23,21 +18,60 @@ export function acir_read_bytes(bytes: Uint8Array): any;
|
|
|
23
18
|
* @returns {Uint8Array}
|
|
24
19
|
*/
|
|
25
20
|
export function acir_write_bytes(acir: any): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* @param {string} entry_point
|
|
23
|
+
* @param {boolean | undefined} contracts
|
|
24
|
+
* @param {string[] | undefined} dependencies
|
|
25
|
+
* @returns {any}
|
|
26
|
+
*/
|
|
27
|
+
export function compile(entry_point: string, contracts?: boolean, dependencies?: string[]): any;
|
|
28
|
+
|
|
29
|
+
export type Diagnostic = {
|
|
30
|
+
message: string;
|
|
31
|
+
file_path: string;
|
|
32
|
+
secondaries: ReadonlyArray<{
|
|
33
|
+
message: string;
|
|
34
|
+
start: number;
|
|
35
|
+
end: number;
|
|
36
|
+
}>;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface CompileError {
|
|
40
|
+
diagnostics: ReadonlyArray<Diagnostic>;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
*/
|
|
46
|
+
export class CompileError {
|
|
47
|
+
free(): void;
|
|
48
|
+
/**
|
|
49
|
+
*/
|
|
50
|
+
diagnostics: any;
|
|
51
|
+
/**
|
|
52
|
+
*/
|
|
53
|
+
message: string;
|
|
54
|
+
}
|
|
26
55
|
|
|
27
56
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
28
57
|
|
|
29
58
|
export interface InitOutput {
|
|
30
59
|
readonly memory: WebAssembly.Memory;
|
|
31
|
-
readonly
|
|
60
|
+
readonly __wbg_compileerror_free: (a: number) => void;
|
|
61
|
+
readonly __wbg_get_compileerror_message: (a: number) => number;
|
|
62
|
+
readonly __wbg_set_compileerror_message: (a: number, b: number) => void;
|
|
63
|
+
readonly __wbg_get_compileerror_diagnostics: (a: number) => number;
|
|
64
|
+
readonly __wbg_set_compileerror_diagnostics: (a: number, b: number) => void;
|
|
32
65
|
readonly init_log_level: (a: number, b: number) => void;
|
|
33
66
|
readonly build_info: () => number;
|
|
34
67
|
readonly acir_read_bytes: (a: number, b: number) => number;
|
|
35
68
|
readonly acir_write_bytes: (a: number, b: number) => void;
|
|
69
|
+
readonly compile: (a: number, b: number, c: number, d: number, e: number) => void;
|
|
36
70
|
readonly __wbindgen_export_0: (a: number) => number;
|
|
37
71
|
readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;
|
|
38
|
-
readonly __wbindgen_export_2: (a: number) => void;
|
|
39
72
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
40
|
-
readonly
|
|
73
|
+
readonly __wbindgen_export_2: (a: number, b: number) => void;
|
|
74
|
+
readonly __wbindgen_export_3: (a: number) => void;
|
|
41
75
|
}
|
|
42
76
|
|
|
43
77
|
export type SyncInitInput = BufferSource | WebAssembly.Module;
|
package/web/noir_wasm.js
CHANGED
|
@@ -22,24 +22,6 @@ function takeObject(idx) {
|
|
|
22
22
|
return ret;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
26
|
-
|
|
27
|
-
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
28
|
-
|
|
29
|
-
let cachedUint8Memory0 = null;
|
|
30
|
-
|
|
31
|
-
function getUint8Memory0() {
|
|
32
|
-
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
33
|
-
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
34
|
-
}
|
|
35
|
-
return cachedUint8Memory0;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function getStringFromWasm0(ptr, len) {
|
|
39
|
-
ptr = ptr >>> 0;
|
|
40
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
41
|
-
}
|
|
42
|
-
|
|
43
25
|
function addHeapObject(obj) {
|
|
44
26
|
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
45
27
|
const idx = heap_next;
|
|
@@ -51,6 +33,15 @@ function addHeapObject(obj) {
|
|
|
51
33
|
|
|
52
34
|
let WASM_VECTOR_LEN = 0;
|
|
53
35
|
|
|
36
|
+
let cachedUint8Memory0 = null;
|
|
37
|
+
|
|
38
|
+
function getUint8Memory0() {
|
|
39
|
+
if (cachedUint8Memory0 === null || cachedUint8Memory0.byteLength === 0) {
|
|
40
|
+
cachedUint8Memory0 = new Uint8Array(wasm.memory.buffer);
|
|
41
|
+
}
|
|
42
|
+
return cachedUint8Memory0;
|
|
43
|
+
}
|
|
44
|
+
|
|
54
45
|
const cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder('utf-8') : { encode: () => { throw Error('TextEncoder not available') } } );
|
|
55
46
|
|
|
56
47
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -116,21 +107,14 @@ function getInt32Memory0() {
|
|
|
116
107
|
}
|
|
117
108
|
return cachedInt32Memory0;
|
|
118
109
|
}
|
|
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
110
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
111
|
+
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
112
|
+
|
|
113
|
+
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
114
|
+
|
|
115
|
+
function getStringFromWasm0(ptr, len) {
|
|
116
|
+
ptr = ptr >>> 0;
|
|
117
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
134
118
|
}
|
|
135
119
|
/**
|
|
136
120
|
* @param {string} level
|
|
@@ -181,13 +165,95 @@ export function acir_write_bytes(acir) {
|
|
|
181
165
|
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
182
166
|
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
183
167
|
var v1 = getArrayU8FromWasm0(r0, r1).slice();
|
|
184
|
-
wasm.
|
|
168
|
+
wasm.__wbindgen_export_2(r0, r1 * 1);
|
|
185
169
|
return v1;
|
|
186
170
|
} finally {
|
|
187
171
|
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
188
172
|
}
|
|
189
173
|
}
|
|
190
174
|
|
|
175
|
+
/**
|
|
176
|
+
* @param {string} entry_point
|
|
177
|
+
* @param {boolean | undefined} contracts
|
|
178
|
+
* @param {string[] | undefined} dependencies
|
|
179
|
+
* @returns {any}
|
|
180
|
+
*/
|
|
181
|
+
export function compile(entry_point, contracts, dependencies) {
|
|
182
|
+
try {
|
|
183
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
184
|
+
const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
185
|
+
const len0 = WASM_VECTOR_LEN;
|
|
186
|
+
wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependencies) ? 0 : addHeapObject(dependencies));
|
|
187
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
188
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
189
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
190
|
+
if (r2) {
|
|
191
|
+
throw takeObject(r1);
|
|
192
|
+
}
|
|
193
|
+
return takeObject(r0);
|
|
194
|
+
} finally {
|
|
195
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
function handleError(f, args) {
|
|
200
|
+
try {
|
|
201
|
+
return f.apply(this, args);
|
|
202
|
+
} catch (e) {
|
|
203
|
+
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
/**
|
|
207
|
+
*/
|
|
208
|
+
export class CompileError {
|
|
209
|
+
|
|
210
|
+
static __wrap(ptr) {
|
|
211
|
+
ptr = ptr >>> 0;
|
|
212
|
+
const obj = Object.create(CompileError.prototype);
|
|
213
|
+
obj.__wbg_ptr = ptr;
|
|
214
|
+
|
|
215
|
+
return obj;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
__destroy_into_raw() {
|
|
219
|
+
const ptr = this.__wbg_ptr;
|
|
220
|
+
this.__wbg_ptr = 0;
|
|
221
|
+
|
|
222
|
+
return ptr;
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
free() {
|
|
226
|
+
const ptr = this.__destroy_into_raw();
|
|
227
|
+
wasm.__wbg_compileerror_free(ptr);
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* @returns {string}
|
|
231
|
+
*/
|
|
232
|
+
get message() {
|
|
233
|
+
const ret = wasm.__wbg_get_compileerror_message(this.__wbg_ptr);
|
|
234
|
+
return takeObject(ret);
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* @param {string} arg0
|
|
238
|
+
*/
|
|
239
|
+
set message(arg0) {
|
|
240
|
+
wasm.__wbg_set_compileerror_message(this.__wbg_ptr, addHeapObject(arg0));
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* @returns {any}
|
|
244
|
+
*/
|
|
245
|
+
get diagnostics() {
|
|
246
|
+
const ret = wasm.__wbg_get_compileerror_diagnostics(this.__wbg_ptr);
|
|
247
|
+
return takeObject(ret);
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* @param {any} arg0
|
|
251
|
+
*/
|
|
252
|
+
set diagnostics(arg0) {
|
|
253
|
+
wasm.__wbg_set_compileerror_diagnostics(this.__wbg_ptr, addHeapObject(arg0));
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
191
257
|
async function __wbg_load(module, imports) {
|
|
192
258
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
193
259
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -222,17 +288,29 @@ async function __wbg_load(module, imports) {
|
|
|
222
288
|
function __wbg_get_imports() {
|
|
223
289
|
const imports = {};
|
|
224
290
|
imports.wbg = {};
|
|
225
|
-
imports.wbg.
|
|
226
|
-
const ret =
|
|
227
|
-
return ret;
|
|
228
|
-
};
|
|
229
|
-
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
230
|
-
const ret = getObject(arg0) === null;
|
|
231
|
-
return ret;
|
|
291
|
+
imports.wbg.__wbg_compileerror_new = function(arg0) {
|
|
292
|
+
const ret = CompileError.__wrap(arg0);
|
|
293
|
+
return addHeapObject(ret);
|
|
232
294
|
};
|
|
233
295
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
234
296
|
takeObject(arg0);
|
|
235
297
|
};
|
|
298
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
299
|
+
const ret = getObject(arg0);
|
|
300
|
+
return addHeapObject(ret);
|
|
301
|
+
};
|
|
302
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
303
|
+
const obj = getObject(arg1);
|
|
304
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
305
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
306
|
+
var len1 = WASM_VECTOR_LEN;
|
|
307
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
308
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
309
|
+
};
|
|
310
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
311
|
+
const ret = getObject(arg0) === undefined;
|
|
312
|
+
return ret;
|
|
313
|
+
};
|
|
236
314
|
imports.wbg.__wbg_readfile_0c1777c7c5aa8c92 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
237
315
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
238
316
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
@@ -263,7 +341,7 @@ function __wbg_get_imports() {
|
|
|
263
341
|
deferred0_1 = arg1;
|
|
264
342
|
console.error(getStringFromWasm0(arg0, arg1));
|
|
265
343
|
} finally {
|
|
266
|
-
wasm.
|
|
344
|
+
wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
|
|
267
345
|
}
|
|
268
346
|
};
|
|
269
347
|
imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
|
|
@@ -284,13 +362,13 @@ function __wbg_get_imports() {
|
|
|
284
362
|
imports.wbg.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
285
363
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
286
364
|
};
|
|
287
|
-
imports.wbg.
|
|
288
|
-
const
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
365
|
+
imports.wbg.__wbg_get_7303ed2ef026b2f5 = function(arg0, arg1) {
|
|
366
|
+
const ret = getObject(arg0)[arg1 >>> 0];
|
|
367
|
+
return addHeapObject(ret);
|
|
368
|
+
};
|
|
369
|
+
imports.wbg.__wbg_length_820c786973abdd8a = function(arg0) {
|
|
370
|
+
const ret = getObject(arg0).length;
|
|
371
|
+
return ret;
|
|
294
372
|
};
|
|
295
373
|
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
296
374
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
package/web/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,13 +1,18 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
-
export function
|
|
4
|
+
export function __wbg_compileerror_free(a: number): void;
|
|
5
|
+
export function __wbg_get_compileerror_message(a: number): number;
|
|
6
|
+
export function __wbg_set_compileerror_message(a: number, b: number): void;
|
|
7
|
+
export function __wbg_get_compileerror_diagnostics(a: number): number;
|
|
8
|
+
export function __wbg_set_compileerror_diagnostics(a: number, b: number): void;
|
|
5
9
|
export function init_log_level(a: number, b: number): void;
|
|
6
10
|
export function build_info(): number;
|
|
7
11
|
export function acir_read_bytes(a: number, b: number): number;
|
|
8
12
|
export function acir_write_bytes(a: number, b: number): void;
|
|
13
|
+
export function compile(a: number, b: number, c: number, d: number, e: number): void;
|
|
9
14
|
export function __wbindgen_export_0(a: number): number;
|
|
10
15
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
11
|
-
export function __wbindgen_export_2(a: number): void;
|
|
12
16
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
13
|
-
export function
|
|
17
|
+
export function __wbindgen_export_2(a: number, b: number): void;
|
|
18
|
+
export function __wbindgen_export_3(a: number): void;
|