@noir-lang/noir_wasm 0.3.1-7955b1e → 0.3.2-bcdfd526
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 +1 -1
- package/nodejs/noir_wasm.d.ts +4 -0
- package/nodejs/noir_wasm.js +62 -19
- package/nodejs/noir_wasm_bg.wasm +0 -0
- package/nodejs/noir_wasm_bg.wasm.d.ts +1 -0
- package/package.json +3 -3
- package/web/noir_wasm.d.ts +5 -0
- package/web/noir_wasm.js +52 -17
- package/web/noir_wasm_bg.wasm +0 -0
- package/web/noir_wasm_bg.wasm.d.ts +1 -0
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
# Noir Lang WASM JavaScript Package
|
|
2
2
|
|
|
3
3
|
## Tracks
|
|
4
|
-
Noir lang Repository [noir-lang/noir@
|
|
4
|
+
Noir lang Repository [noir-lang/noir@bcdfd526](https://github.com/noir-lang/noir/tree/bcdfd526fe2b5339cfad487a00e9fcbdb70c45dc)
|
package/nodejs/noir_wasm.d.ts
CHANGED
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/noir-source-resolver`);
|
|
5
|
-
const {
|
|
5
|
+
const { TextDecoder, TextEncoder } = require(`util`);
|
|
6
6
|
|
|
7
7
|
const heap = new Array(128).fill(undefined);
|
|
8
8
|
|
|
@@ -24,7 +24,9 @@ function takeObject(idx) {
|
|
|
24
24
|
return ret;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
let
|
|
27
|
+
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
28
|
+
|
|
29
|
+
cachedTextDecoder.decode();
|
|
28
30
|
|
|
29
31
|
let cachedUint8Memory0 = null;
|
|
30
32
|
|
|
@@ -35,6 +37,21 @@ function getUint8Memory0() {
|
|
|
35
37
|
return cachedUint8Memory0;
|
|
36
38
|
}
|
|
37
39
|
|
|
40
|
+
function getStringFromWasm0(ptr, len) {
|
|
41
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function addHeapObject(obj) {
|
|
45
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
46
|
+
const idx = heap_next;
|
|
47
|
+
heap_next = heap[idx];
|
|
48
|
+
|
|
49
|
+
heap[idx] = obj;
|
|
50
|
+
return idx;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
let WASM_VECTOR_LEN = 0;
|
|
54
|
+
|
|
38
55
|
let cachedTextEncoder = new TextEncoder('utf-8');
|
|
39
56
|
|
|
40
57
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -100,23 +117,15 @@ function getInt32Memory0() {
|
|
|
100
117
|
}
|
|
101
118
|
return cachedInt32Memory0;
|
|
102
119
|
}
|
|
120
|
+
/**
|
|
121
|
+
* @param {string} level
|
|
122
|
+
*/
|
|
123
|
+
module.exports.init_log_level = function(level) {
|
|
124
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
125
|
+
const len0 = WASM_VECTOR_LEN;
|
|
126
|
+
wasm.init_log_level(ptr0, len0);
|
|
127
|
+
};
|
|
103
128
|
|
|
104
|
-
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
105
|
-
|
|
106
|
-
cachedTextDecoder.decode();
|
|
107
|
-
|
|
108
|
-
function getStringFromWasm0(ptr, len) {
|
|
109
|
-
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
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
129
|
/**
|
|
121
130
|
* @param {any} args
|
|
122
131
|
* @returns {any}
|
|
@@ -214,6 +223,11 @@ module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
|
214
223
|
return ret;
|
|
215
224
|
};
|
|
216
225
|
|
|
226
|
+
module.exports.__wbindgen_is_null = function(arg0) {
|
|
227
|
+
const ret = getObject(arg0) === null;
|
|
228
|
+
return ret;
|
|
229
|
+
};
|
|
230
|
+
|
|
217
231
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
218
232
|
takeObject(arg0);
|
|
219
233
|
};
|
|
@@ -239,7 +253,12 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
239
253
|
}
|
|
240
254
|
};
|
|
241
255
|
|
|
242
|
-
module.exports.
|
|
256
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
257
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
258
|
+
return addHeapObject(ret);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
module.exports.__wbg_readfile_a43240e6f11dd5eb = function() { return handleError(function (arg0, arg1, arg2) {
|
|
243
262
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
244
263
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
245
264
|
const len0 = WASM_VECTOR_LEN;
|
|
@@ -247,6 +266,30 @@ module.exports.__wbg_readfile_1583649552f79b9c = function() { return handleError
|
|
|
247
266
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
248
267
|
}, arguments) };
|
|
249
268
|
|
|
269
|
+
module.exports.__wbg_debug_7960d327fd96f71a = function(arg0, arg1, arg2, arg3) {
|
|
270
|
+
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
271
|
+
};
|
|
272
|
+
|
|
273
|
+
module.exports.__wbg_error_fe807da27c4a4ced = function(arg0) {
|
|
274
|
+
console.error(getObject(arg0));
|
|
275
|
+
};
|
|
276
|
+
|
|
277
|
+
module.exports.__wbg_error_fd84ca2a8a977774 = function(arg0, arg1, arg2, arg3) {
|
|
278
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
279
|
+
};
|
|
280
|
+
|
|
281
|
+
module.exports.__wbg_info_5566be377f5b52ae = function(arg0, arg1, arg2, arg3) {
|
|
282
|
+
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
283
|
+
};
|
|
284
|
+
|
|
285
|
+
module.exports.__wbg_log_7b690f184ae4519b = function(arg0, arg1, arg2, arg3) {
|
|
286
|
+
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
287
|
+
};
|
|
288
|
+
|
|
289
|
+
module.exports.__wbg_warn_48cbddced45e5414 = function(arg0, arg1, arg2, arg3) {
|
|
290
|
+
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
291
|
+
};
|
|
292
|
+
|
|
250
293
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
251
294
|
const obj = getObject(arg1);
|
|
252
295
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
package/nodejs/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function init_log_level(a: number, b: number): void;
|
|
4
5
|
export function compile(a: number): number;
|
|
5
6
|
export function acir_from_bytes(a: number, b: number): number;
|
|
6
7
|
export function acir_to_bytes(a: number, b: number): void;
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"collaborators": [
|
|
4
4
|
"The Noir Team <kevtheappdev@gmail.com>"
|
|
5
5
|
],
|
|
6
|
-
"version": "0.3.
|
|
6
|
+
"version": "0.3.2-bcdfd526",
|
|
7
7
|
"files": [
|
|
8
8
|
"nodejs",
|
|
9
9
|
"web",
|
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"module": "./web/noir_wasm.js",
|
|
15
15
|
"sideEffects": false,
|
|
16
16
|
"peerDependencies": {
|
|
17
|
-
"@noir-lang/noir-source-resolver": "1.
|
|
17
|
+
"@noir-lang/noir-source-resolver": "1.1.0"
|
|
18
18
|
},
|
|
19
19
|
"repository": {
|
|
20
20
|
"type": "git",
|
|
21
21
|
"url": "https://github.com/noir-lang/noir_wasm.git"
|
|
22
22
|
},
|
|
23
23
|
"compiler": {
|
|
24
|
-
"versionHash": "
|
|
24
|
+
"versionHash": "bcdfd526fe2b5339cfad487a00e9fcbdb70c45dc"
|
|
25
25
|
}
|
|
26
26
|
}
|
package/web/noir_wasm.d.ts
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
/**
|
|
4
|
+
* @param {string} level
|
|
5
|
+
*/
|
|
6
|
+
export function init_log_level(level: string): void;
|
|
7
|
+
/**
|
|
4
8
|
* @param {any} args
|
|
5
9
|
* @returns {any}
|
|
6
10
|
*/
|
|
@@ -34,6 +38,7 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
34
38
|
|
|
35
39
|
export interface InitOutput {
|
|
36
40
|
readonly memory: WebAssembly.Memory;
|
|
41
|
+
readonly init_log_level: (a: number, b: number) => void;
|
|
37
42
|
readonly compile: (a: number) => number;
|
|
38
43
|
readonly acir_from_bytes: (a: number, b: number) => number;
|
|
39
44
|
readonly acir_to_bytes: (a: number, b: number) => void;
|
package/web/noir_wasm.js
CHANGED
|
@@ -22,7 +22,9 @@ function takeObject(idx) {
|
|
|
22
22
|
return ret;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
25
|
+
const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
26
|
+
|
|
27
|
+
cachedTextDecoder.decode();
|
|
26
28
|
|
|
27
29
|
let cachedUint8Memory0 = null;
|
|
28
30
|
|
|
@@ -33,6 +35,21 @@ function getUint8Memory0() {
|
|
|
33
35
|
return cachedUint8Memory0;
|
|
34
36
|
}
|
|
35
37
|
|
|
38
|
+
function getStringFromWasm0(ptr, len) {
|
|
39
|
+
return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len));
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
function addHeapObject(obj) {
|
|
43
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
44
|
+
const idx = heap_next;
|
|
45
|
+
heap_next = heap[idx];
|
|
46
|
+
|
|
47
|
+
heap[idx] = obj;
|
|
48
|
+
return idx;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let WASM_VECTOR_LEN = 0;
|
|
52
|
+
|
|
36
53
|
const cachedTextEncoder = new TextEncoder('utf-8');
|
|
37
54
|
|
|
38
55
|
const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
|
|
@@ -98,23 +115,15 @@ function getInt32Memory0() {
|
|
|
98
115
|
}
|
|
99
116
|
return cachedInt32Memory0;
|
|
100
117
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
118
|
+
/**
|
|
119
|
+
* @param {string} level
|
|
120
|
+
*/
|
|
121
|
+
export function init_log_level(level) {
|
|
122
|
+
const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
123
|
+
const len0 = WASM_VECTOR_LEN;
|
|
124
|
+
wasm.init_log_level(ptr0, len0);
|
|
108
125
|
}
|
|
109
126
|
|
|
110
|
-
function addHeapObject(obj) {
|
|
111
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
112
|
-
const idx = heap_next;
|
|
113
|
-
heap_next = heap[idx];
|
|
114
|
-
|
|
115
|
-
heap[idx] = obj;
|
|
116
|
-
return idx;
|
|
117
|
-
}
|
|
118
127
|
/**
|
|
119
128
|
* @param {any} args
|
|
120
129
|
* @returns {any}
|
|
@@ -245,6 +254,10 @@ function getImports() {
|
|
|
245
254
|
const ret = getObject(arg0) === undefined;
|
|
246
255
|
return ret;
|
|
247
256
|
};
|
|
257
|
+
imports.wbg.__wbindgen_is_null = function(arg0) {
|
|
258
|
+
const ret = getObject(arg0) === null;
|
|
259
|
+
return ret;
|
|
260
|
+
};
|
|
248
261
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
249
262
|
takeObject(arg0);
|
|
250
263
|
};
|
|
@@ -266,13 +279,35 @@ function getImports() {
|
|
|
266
279
|
wasm.__wbindgen_export_2(arg0, arg1);
|
|
267
280
|
}
|
|
268
281
|
};
|
|
269
|
-
imports.wbg.
|
|
282
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
283
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
284
|
+
return addHeapObject(ret);
|
|
285
|
+
};
|
|
286
|
+
imports.wbg.__wbg_readfile_a43240e6f11dd5eb = function() { return handleError(function (arg0, arg1, arg2) {
|
|
270
287
|
const ret = read_file(getStringFromWasm0(arg1, arg2));
|
|
271
288
|
const ptr0 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
|
|
272
289
|
const len0 = WASM_VECTOR_LEN;
|
|
273
290
|
getInt32Memory0()[arg0 / 4 + 1] = len0;
|
|
274
291
|
getInt32Memory0()[arg0 / 4 + 0] = ptr0;
|
|
275
292
|
}, arguments) };
|
|
293
|
+
imports.wbg.__wbg_debug_7960d327fd96f71a = function(arg0, arg1, arg2, arg3) {
|
|
294
|
+
console.debug(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
295
|
+
};
|
|
296
|
+
imports.wbg.__wbg_error_fe807da27c4a4ced = function(arg0) {
|
|
297
|
+
console.error(getObject(arg0));
|
|
298
|
+
};
|
|
299
|
+
imports.wbg.__wbg_error_fd84ca2a8a977774 = function(arg0, arg1, arg2, arg3) {
|
|
300
|
+
console.error(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
301
|
+
};
|
|
302
|
+
imports.wbg.__wbg_info_5566be377f5b52ae = function(arg0, arg1, arg2, arg3) {
|
|
303
|
+
console.info(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
304
|
+
};
|
|
305
|
+
imports.wbg.__wbg_log_7b690f184ae4519b = function(arg0, arg1, arg2, arg3) {
|
|
306
|
+
console.log(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
307
|
+
};
|
|
308
|
+
imports.wbg.__wbg_warn_48cbddced45e5414 = function(arg0, arg1, arg2, arg3) {
|
|
309
|
+
console.warn(getObject(arg0), getObject(arg1), getObject(arg2), getObject(arg3));
|
|
310
|
+
};
|
|
276
311
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
277
312
|
const obj = getObject(arg1);
|
|
278
313
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
package/web/noir_wasm_bg.wasm
CHANGED
|
Binary file
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/* tslint:disable */
|
|
2
2
|
/* eslint-disable */
|
|
3
3
|
export const memory: WebAssembly.Memory;
|
|
4
|
+
export function init_log_level(a: number, b: number): void;
|
|
4
5
|
export function compile(a: number): number;
|
|
5
6
|
export function acir_from_bytes(a: number, b: number): number;
|
|
6
7
|
export function acir_to_bytes(a: number, b: number): void;
|