@noir-lang/noir_wasm 0.10.3 → 0.12.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/README.md +0 -3
- package/nodejs/noir_wasm.d.ts +10 -0
- package/nodejs/noir_wasm.js +55 -10
- package/nodejs/noir_wasm_bg.wasm +0 -0
- package/nodejs/noir_wasm_bg.wasm.d.ts +2 -4
- package/package.json +7 -9
- package/web/noir_wasm.d.ts +12 -4
- package/web/noir_wasm.js +50 -10
- package/web/noir_wasm_bg.wasm +0 -0
- package/web/noir_wasm_bg.wasm.d.ts +2 -4
package/README.md
CHANGED
|
@@ -17,6 +17,3 @@ If you are within the noir repo and would like to build local changes, you can u
|
|
|
17
17
|
```bash
|
|
18
18
|
nix build -L #wasm
|
|
19
19
|
```
|
|
20
|
-
|
|
21
|
-
## Tracking
|
|
22
|
-
Built from [noir-lang/noir@2db759f43971c57e2f1f8284c82943e31a555d0c](https://github.com/noir-lang/noir/tree/2db759f43971c57e2f1f8284c82943e31a555d0c)
|
package/nodejs/noir_wasm.d.ts
CHANGED
|
@@ -23,3 +23,13 @@ export function acir_write_bytes(acir: any): Uint8Array;
|
|
|
23
23
|
* @returns {any}
|
|
24
24
|
*/
|
|
25
25
|
export function compile(args: any): any;
|
|
26
|
+
/**
|
|
27
|
+
* A struct representing a Trap
|
|
28
|
+
*/
|
|
29
|
+
export class Trap {
|
|
30
|
+
free(): void;
|
|
31
|
+
/**
|
|
32
|
+
* @returns {Symbol}
|
|
33
|
+
*/
|
|
34
|
+
static __wbgd_downcast_token(): Symbol;
|
|
35
|
+
}
|
package/nodejs/noir_wasm.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
let imports = {};
|
|
2
2
|
imports['__wbindgen_placeholder__'] = module.exports;
|
|
3
3
|
let wasm;
|
|
4
|
-
const { read_file } = require(`@noir-lang/
|
|
4
|
+
const { read_file } = require(`@noir-lang/source-resolver`);
|
|
5
5
|
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
7
|
const heap = new Array(128).fill(undefined);
|
|
@@ -190,6 +190,31 @@ function handleError(f, args) {
|
|
|
190
190
|
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
191
191
|
}
|
|
192
192
|
}
|
|
193
|
+
/**
|
|
194
|
+
* A struct representing a Trap
|
|
195
|
+
*/
|
|
196
|
+
class Trap {
|
|
197
|
+
|
|
198
|
+
__destroy_into_raw() {
|
|
199
|
+
const ptr = this.__wbg_ptr;
|
|
200
|
+
this.__wbg_ptr = 0;
|
|
201
|
+
|
|
202
|
+
return ptr;
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
free() {
|
|
206
|
+
const ptr = this.__destroy_into_raw();
|
|
207
|
+
wasm.__wbg_trap_free(ptr);
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* @returns {Symbol}
|
|
211
|
+
*/
|
|
212
|
+
static __wbgd_downcast_token() {
|
|
213
|
+
const ret = wasm.trap___wbgd_downcast_token();
|
|
214
|
+
return takeObject(ret);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
module.exports.Trap = Trap;
|
|
193
218
|
|
|
194
219
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
195
220
|
takeObject(arg0);
|
|
@@ -235,7 +260,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
235
260
|
}
|
|
236
261
|
};
|
|
237
262
|
|
|
238
|
-
module.exports.
|
|
263
|
+
module.exports.__wbg_readfile_8efacfffd6a3a749 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
239
264
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
240
265
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
241
266
|
const len1 = WASM_VECTOR_LEN;
|
|
@@ -243,6 +268,30 @@ module.exports.__wbg_readfile_6641677e84090077 = function() { return handleError
|
|
|
243
268
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
244
269
|
}, arguments) };
|
|
245
270
|
|
|
271
|
+
module.exports.__wbindgen_object_clone_ref = function(arg0) {
|
|
272
|
+
const ret = getObject(arg0);
|
|
273
|
+
return addHeapObject(ret);
|
|
274
|
+
};
|
|
275
|
+
|
|
276
|
+
module.exports.__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_export_0, wasm.__wbindgen_export_1);
|
|
280
|
+
var len1 = WASM_VECTOR_LEN;
|
|
281
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
282
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
module.exports.__wbg_static_accessor_SYMBOL_45d4d15e3c4aeb33 = function() {
|
|
286
|
+
const ret = Symbol;
|
|
287
|
+
return addHeapObject(ret);
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
module.exports.__wbindgen_is_symbol = function(arg0) {
|
|
291
|
+
const ret = typeof(getObject(arg0)) === 'symbol';
|
|
292
|
+
return ret;
|
|
293
|
+
};
|
|
294
|
+
|
|
246
295
|
module.exports.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
|
|
247
296
|
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
248
297
|
};
|
|
@@ -267,14 +316,10 @@ module.exports.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
|
267
316
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
268
317
|
};
|
|
269
318
|
|
|
270
|
-
module.exports.
|
|
271
|
-
const
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
var len1 = WASM_VECTOR_LEN;
|
|
275
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
276
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
277
|
-
};
|
|
319
|
+
module.exports.__wbg_call_557a2f2deacc4912 = function() { return handleError(function (arg0, arg1) {
|
|
320
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
321
|
+
return addHeapObject(ret);
|
|
322
|
+
}, arguments) };
|
|
278
323
|
|
|
279
324
|
module.exports.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
280
325
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
package/nodejs/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -6,10 +6,8 @@ export function build_info(): number;
|
|
|
6
6
|
export function acir_read_bytes(a: number, b: number): number;
|
|
7
7
|
export function acir_write_bytes(a: number, b: number): void;
|
|
8
8
|
export function compile(a: number): number;
|
|
9
|
-
export function
|
|
10
|
-
export function
|
|
11
|
-
export function rust_psm_stack_pointer(): number;
|
|
12
|
-
export function rust_psm_replace_stack(a: number, b: number, c: number): void;
|
|
9
|
+
export function __wbg_trap_free(a: number): void;
|
|
10
|
+
export function trap___wbgd_downcast_token(): number;
|
|
13
11
|
export function __wbindgen_export_0(a: number): number;
|
|
14
12
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
15
13
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
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.
|
|
6
|
+
"version": "0.12.0",
|
|
7
7
|
"license": "(MIT OR Apache-2.0)",
|
|
8
8
|
"main": "./nodejs/noir_wasm.js",
|
|
9
9
|
"types": "./web/noir_wasm.d.ts",
|
|
@@ -14,27 +14,25 @@
|
|
|
14
14
|
"package.json"
|
|
15
15
|
],
|
|
16
16
|
"sideEffects": false,
|
|
17
|
-
"packageManager": "yarn@3.5.1",
|
|
18
17
|
"repository": {
|
|
19
18
|
"type": "git",
|
|
20
|
-
"url": "https://github.com/noir-lang/
|
|
19
|
+
"url": "https://github.com/noir-lang/noir.git"
|
|
21
20
|
},
|
|
22
21
|
"scripts": {
|
|
22
|
+
"build": "bash ./build.sh",
|
|
23
23
|
"test": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
|
|
24
|
+
"test:node": "env TS_NODE_COMPILER_OPTIONS='{\"module\": \"commonjs\" }' mocha",
|
|
24
25
|
"test:browser": "web-test-runner"
|
|
25
26
|
},
|
|
26
27
|
"peerDependencies": {
|
|
27
|
-
"@noir-lang/
|
|
28
|
+
"@noir-lang/source-resolver": "workspace:*"
|
|
28
29
|
},
|
|
29
30
|
"devDependencies": {
|
|
30
31
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
|
31
|
-
"@noir-lang/noir-source-resolver": "1.1.2",
|
|
32
32
|
"@web/dev-server-esbuild": "^0.3.6",
|
|
33
33
|
"@web/test-runner": "^0.15.3",
|
|
34
34
|
"@web/test-runner-playwright": "^0.10.0",
|
|
35
|
-
"
|
|
36
|
-
"mocha": "^10.2.0"
|
|
37
|
-
"ts-node": "^10.9.1",
|
|
38
|
-
"typescript": "^5.0.4"
|
|
35
|
+
"@web/test-runner-webdriver": "^0.7.0",
|
|
36
|
+
"mocha": "^10.2.0"
|
|
39
37
|
}
|
|
40
38
|
}
|
package/web/noir_wasm.d.ts
CHANGED
|
@@ -23,6 +23,16 @@ export function acir_write_bytes(acir: any): Uint8Array;
|
|
|
23
23
|
* @returns {any}
|
|
24
24
|
*/
|
|
25
25
|
export function compile(args: any): any;
|
|
26
|
+
/**
|
|
27
|
+
* A struct representing a Trap
|
|
28
|
+
*/
|
|
29
|
+
export class Trap {
|
|
30
|
+
free(): void;
|
|
31
|
+
/**
|
|
32
|
+
* @returns {Symbol}
|
|
33
|
+
*/
|
|
34
|
+
static __wbgd_downcast_token(): Symbol;
|
|
35
|
+
}
|
|
26
36
|
|
|
27
37
|
export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
|
|
28
38
|
|
|
@@ -33,10 +43,8 @@ export interface InitOutput {
|
|
|
33
43
|
readonly acir_read_bytes: (a: number, b: number) => number;
|
|
34
44
|
readonly acir_write_bytes: (a: number, b: number) => void;
|
|
35
45
|
readonly compile: (a: number) => number;
|
|
36
|
-
readonly
|
|
37
|
-
readonly
|
|
38
|
-
readonly rust_psm_stack_pointer: () => number;
|
|
39
|
-
readonly rust_psm_replace_stack: (a: number, b: number, c: number) => void;
|
|
46
|
+
readonly __wbg_trap_free: (a: number) => void;
|
|
47
|
+
readonly trap___wbgd_downcast_token: () => number;
|
|
40
48
|
readonly __wbindgen_export_0: (a: number) => number;
|
|
41
49
|
readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;
|
|
42
50
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
package/web/noir_wasm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { read_file } from '@noir-lang/
|
|
1
|
+
import { read_file } from '@noir-lang/source-resolver';
|
|
2
2
|
|
|
3
3
|
let wasm;
|
|
4
4
|
|
|
@@ -188,6 +188,30 @@ function handleError(f, args) {
|
|
|
188
188
|
wasm.__wbindgen_export_3(addHeapObject(e));
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
+
/**
|
|
192
|
+
* A struct representing a Trap
|
|
193
|
+
*/
|
|
194
|
+
export class Trap {
|
|
195
|
+
|
|
196
|
+
__destroy_into_raw() {
|
|
197
|
+
const ptr = this.__wbg_ptr;
|
|
198
|
+
this.__wbg_ptr = 0;
|
|
199
|
+
|
|
200
|
+
return ptr;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
free() {
|
|
204
|
+
const ptr = this.__destroy_into_raw();
|
|
205
|
+
wasm.__wbg_trap_free(ptr);
|
|
206
|
+
}
|
|
207
|
+
/**
|
|
208
|
+
* @returns {Symbol}
|
|
209
|
+
*/
|
|
210
|
+
static __wbgd_downcast_token() {
|
|
211
|
+
const ret = wasm.trap___wbgd_downcast_token();
|
|
212
|
+
return takeObject(ret);
|
|
213
|
+
}
|
|
214
|
+
}
|
|
191
215
|
|
|
192
216
|
async function __wbg_load(module, imports) {
|
|
193
217
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
@@ -260,13 +284,33 @@ function __wbg_get_imports() {
|
|
|
260
284
|
wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
|
|
261
285
|
}
|
|
262
286
|
};
|
|
263
|
-
imports.wbg.
|
|
287
|
+
imports.wbg.__wbg_readfile_8efacfffd6a3a749 = function() { return handleError(function (arg0, arg1, arg2) {
|
|
264
288
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
265
289
|
const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
266
290
|
const len1 = WASM_VECTOR_LEN;
|
|
267
291
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
268
292
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
269
293
|
}, arguments) };
|
|
294
|
+
imports.wbg.__wbindgen_object_clone_ref = function(arg0) {
|
|
295
|
+
const ret = getObject(arg0);
|
|
296
|
+
return addHeapObject(ret);
|
|
297
|
+
};
|
|
298
|
+
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
299
|
+
const obj = getObject(arg1);
|
|
300
|
+
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
301
|
+
var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
302
|
+
var len1 = WASM_VECTOR_LEN;
|
|
303
|
+
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
304
|
+
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
305
|
+
};
|
|
306
|
+
imports.wbg.__wbg_static_accessor_SYMBOL_45d4d15e3c4aeb33 = function() {
|
|
307
|
+
const ret = Symbol;
|
|
308
|
+
return addHeapObject(ret);
|
|
309
|
+
};
|
|
310
|
+
imports.wbg.__wbindgen_is_symbol = function(arg0) {
|
|
311
|
+
const ret = typeof(getObject(arg0)) === 'symbol';
|
|
312
|
+
return ret;
|
|
313
|
+
};
|
|
270
314
|
imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
|
|
271
315
|
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
272
316
|
};
|
|
@@ -285,14 +329,10 @@ function __wbg_get_imports() {
|
|
|
285
329
|
imports.wbg.__wbg_warn_8342bfbc6028193a = function(arg0, arg1, arg2, arg3) {
|
|
286
330
|
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
287
331
|
};
|
|
288
|
-
imports.wbg.
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
var len1 = WASM_VECTOR_LEN;
|
|
293
|
-
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
294
|
-
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
295
|
-
};
|
|
332
|
+
imports.wbg.__wbg_call_557a2f2deacc4912 = function() { return handleError(function (arg0, arg1) {
|
|
333
|
+
const ret = getObject(arg0).call(getObject(arg1));
|
|
334
|
+
return addHeapObject(ret);
|
|
335
|
+
}, arguments) };
|
|
296
336
|
imports.wbg.__wbg_parse_76a8a18ca3f8730b = function() { return handleError(function (arg0, arg1) {
|
|
297
337
|
const ret = JSON.parse(getStringFromWasm0(arg0, arg1));
|
|
298
338
|
return addHeapObject(ret);
|
package/web/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -6,10 +6,8 @@ export function build_info(): number;
|
|
|
6
6
|
export function acir_read_bytes(a: number, b: number): number;
|
|
7
7
|
export function acir_write_bytes(a: number, b: number): void;
|
|
8
8
|
export function compile(a: number): number;
|
|
9
|
-
export function
|
|
10
|
-
export function
|
|
11
|
-
export function rust_psm_stack_pointer(): number;
|
|
12
|
-
export function rust_psm_replace_stack(a: number, b: number, c: number): void;
|
|
9
|
+
export function __wbg_trap_free(a: number): void;
|
|
10
|
+
export function trap___wbgd_downcast_token(): number;
|
|
13
11
|
export function __wbindgen_export_0(a: number): number;
|
|
14
12
|
export function __wbindgen_export_1(a: number, b: number, c: number): number;
|
|
15
13
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|