@noir-lang/noir_wasm 0.18.0-56ee9e3.aztec → 0.18.0-778e620.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.
@@ -1,13 +1,12 @@
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
+ * @param {string} entry_point
5
+ * @param {boolean | undefined} contracts
6
+ * @param {DependencyGraph | undefined} dependency_graph
8
7
  * @returns {any}
9
8
  */
10
- export function build_info(): any;
9
+ export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): any;
11
10
  /**
12
11
  * @param {Uint8Array} bytes
13
12
  * @returns {any}
@@ -19,12 +18,20 @@ export function acir_read_bytes(bytes: Uint8Array): any;
19
18
  */
20
19
  export function acir_write_bytes(acir: any): Uint8Array;
21
20
  /**
22
- * @param {string} entry_point
23
- * @param {boolean | undefined} contracts
24
- * @param {DependencyGraph | undefined} dependency_graph
25
- * @returns {CompileResult}
21
+ * @param {string} level
26
22
  */
27
- export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): CompileResult;
23
+ export function init_log_level(level: string): void;
24
+ /**
25
+ * @returns {any}
26
+ */
27
+ export function build_info(): any;
28
+
29
+ export type DependencyGraph = {
30
+ root_dependencies: readonly string[];
31
+ library_dependencies: Readonly<Record<string, readonly string[]>>;
32
+ }
33
+
34
+
28
35
 
29
36
  export type Diagnostic = {
30
37
  message: string;
@@ -42,41 +49,3 @@ export interface CompileError extends Error {
42
49
  }
43
50
 
44
51
 
45
-
46
- export type DependencyGraph = {
47
- root_dependencies: readonly string[];
48
- library_dependencies: Readonly<Record<string, readonly string[]>>;
49
- }
50
-
51
- export type CompiledContract = {
52
- noir_version: string;
53
- name: string;
54
- backend: string;
55
- functions: Array<any>;
56
- events: Array<any>;
57
- };
58
-
59
- export type CompiledProgram = {
60
- noir_version: string;
61
- backend: string;
62
- abi: any;
63
- bytecode: string;
64
- }
65
-
66
- export type DebugArtifact = {
67
- debug_symbols: Array<any>;
68
- file_map: Record<number, any>;
69
- };
70
-
71
- export type CompileResult = (
72
- | {
73
- contract: CompiledContract;
74
- debug: DebugArtifact;
75
- }
76
- | {
77
- program: CompiledProgram;
78
- debug: DebugArtifact;
79
- }
80
- );
81
-
82
-
@@ -184,22 +184,37 @@ function debugString(val) {
184
184
  return className;
185
185
  }
186
186
  /**
187
- * @param {string} level
188
- */
189
- module.exports.init_log_level = function(level) {
190
- const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
191
- const len0 = WASM_VECTOR_LEN;
192
- wasm.init_log_level(ptr0, len0);
193
- };
194
-
195
- /**
187
+ * @param {string} entry_point
188
+ * @param {boolean | undefined} contracts
189
+ * @param {DependencyGraph | undefined} dependency_graph
196
190
  * @returns {any}
197
191
  */
198
- module.exports.build_info = function() {
199
- const ret = wasm.build_info();
200
- return takeObject(ret);
192
+ module.exports.compile = function(entry_point, contracts, dependency_graph) {
193
+ try {
194
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
195
+ const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
196
+ const len0 = WASM_VECTOR_LEN;
197
+ wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph));
198
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
199
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
200
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
201
+ if (r2) {
202
+ throw takeObject(r1);
203
+ }
204
+ return takeObject(r0);
205
+ } finally {
206
+ wasm.__wbindgen_add_to_stack_pointer(16);
207
+ }
201
208
  };
202
209
 
210
+ function handleError(f, args) {
211
+ try {
212
+ return f.apply(this, args);
213
+ } catch (e) {
214
+ wasm.__wbindgen_export_2(addHeapObject(e));
215
+ }
216
+ }
217
+
203
218
  function passArray8ToWasm0(arg, malloc) {
204
219
  const ptr = malloc(arg.length * 1) >>> 0;
205
220
  getUint8Memory0().set(arg, ptr / 1);
@@ -232,7 +247,7 @@ module.exports.acir_write_bytes = function(acir) {
232
247
  var r0 = getInt32Memory0()[retptr / 4 + 0];
233
248
  var r1 = getInt32Memory0()[retptr / 4 + 1];
234
249
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
235
- wasm.__wbindgen_export_2(r0, r1 * 1);
250
+ wasm.__wbindgen_export_3(r0, r1 * 1);
236
251
  return v1;
237
252
  } finally {
238
253
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -240,56 +255,31 @@ module.exports.acir_write_bytes = function(acir) {
240
255
  };
241
256
 
242
257
  /**
243
- * @param {string} entry_point
244
- * @param {boolean | undefined} contracts
245
- * @param {DependencyGraph | undefined} dependency_graph
246
- * @returns {CompileResult}
258
+ * @param {string} level
247
259
  */
248
- module.exports.compile = function(entry_point, contracts, dependency_graph) {
249
- try {
250
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
251
- const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
252
- const len0 = WASM_VECTOR_LEN;
253
- wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph));
254
- var r0 = getInt32Memory0()[retptr / 4 + 0];
255
- var r1 = getInt32Memory0()[retptr / 4 + 1];
256
- var r2 = getInt32Memory0()[retptr / 4 + 2];
257
- if (r2) {
258
- throw takeObject(r1);
259
- }
260
- return takeObject(r0);
261
- } finally {
262
- wasm.__wbindgen_add_to_stack_pointer(16);
263
- }
260
+ module.exports.init_log_level = function(level) {
261
+ const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
262
+ const len0 = WASM_VECTOR_LEN;
263
+ wasm.init_log_level(ptr0, len0);
264
264
  };
265
265
 
266
- function handleError(f, args) {
267
- try {
268
- return f.apply(this, args);
269
- } catch (e) {
270
- wasm.__wbindgen_export_3(addHeapObject(e));
271
- }
272
- }
266
+ /**
267
+ * @returns {any}
268
+ */
269
+ module.exports.build_info = function() {
270
+ const ret = wasm.build_info();
271
+ return takeObject(ret);
272
+ };
273
273
 
274
274
  module.exports.__wbindgen_object_drop_ref = function(arg0) {
275
275
  takeObject(arg0);
276
276
  };
277
277
 
278
- module.exports.__wbindgen_is_undefined = function(arg0) {
279
- const ret = getObject(arg0) === undefined;
280
- return ret;
281
- };
282
-
283
278
  module.exports.__wbg_constructor_bc58db5a3b38f16c = function(arg0) {
284
279
  const ret = new Error(takeObject(arg0));
285
280
  return addHeapObject(ret);
286
281
  };
287
282
 
288
- module.exports.__wbg_constructor_e29c95824faa216c = function() {
289
- const ret = new Object();
290
- return addHeapObject(ret);
291
- };
292
-
293
283
  module.exports.__wbg_readfile_a8c4f775fbe0578e = function() { return handleError(function (arg0, arg1, arg2) {
294
284
  const ret = read_file(getStringFromWasm0(arg1, arg2));
295
285
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -298,6 +288,11 @@ module.exports.__wbg_readfile_a8c4f775fbe0578e = function() { return handleError
298
288
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
299
289
  }, arguments) };
300
290
 
291
+ module.exports.__wbindgen_is_undefined = function(arg0) {
292
+ const ret = getObject(arg0) === undefined;
293
+ return ret;
294
+ };
295
+
301
296
  module.exports.__wbindgen_string_new = function(arg0, arg1) {
302
297
  const ret = getStringFromWasm0(arg0, arg1);
303
298
  return addHeapObject(ret);
@@ -324,7 +319,7 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
324
319
  deferred0_1 = arg1;
325
320
  console.error(getStringFromWasm0(arg0, arg1));
326
321
  } finally {
327
- wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
322
+ wasm.__wbindgen_export_3(deferred0_0, deferred0_1);
328
323
  }
329
324
  };
330
325
 
Binary file
@@ -1,13 +1,13 @@
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;
5
- export function build_info(): number;
4
+ export function compile(a: number, b: number, c: number, d: number, e: number): void;
6
5
  export function acir_read_bytes(a: number, b: number): number;
7
6
  export function acir_write_bytes(a: number, b: number): void;
8
- export function compile(a: number, b: number, c: number, d: number, e: number): void;
7
+ export function init_log_level(a: number, b: number): void;
8
+ export function build_info(): number;
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
11
  export function __wbindgen_add_to_stack_pointer(a: number): number;
12
- export function __wbindgen_export_2(a: number, b: number): void;
13
- export function __wbindgen_export_3(a: number): void;
12
+ export function __wbindgen_export_2(a: number): void;
13
+ export function __wbindgen_export_3(a: number, b: 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.18.0-56ee9e3.aztec",
6
+ "version": "0.18.0-778e620.nightly",
7
7
  "license": "(MIT OR Apache-2.0)",
8
8
  "main": "./nodejs/noir_wasm.js",
9
9
  "types": "./web/noir_wasm.d.ts",
@@ -31,7 +31,7 @@
31
31
  "install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/noir_wasm/nodejs ./ && cp -rL ./result/noir_wasm/web ./"
32
32
  },
33
33
  "peerDependencies": {
34
- "@noir-lang/source-resolver": "0.18.0-56ee9e3.aztec"
34
+ "@noir-lang/source-resolver": "0.18.0-778e620.nightly"
35
35
  },
36
36
  "devDependencies": {
37
37
  "@esm-bundle/chai": "^4.3.4-fix.0",
@@ -1,13 +1,12 @@
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
+ * @param {string} entry_point
5
+ * @param {boolean | undefined} contracts
6
+ * @param {DependencyGraph | undefined} dependency_graph
8
7
  * @returns {any}
9
8
  */
10
- export function build_info(): any;
9
+ export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): any;
11
10
  /**
12
11
  * @param {Uint8Array} bytes
13
12
  * @returns {any}
@@ -19,12 +18,20 @@ export function acir_read_bytes(bytes: Uint8Array): any;
19
18
  */
20
19
  export function acir_write_bytes(acir: any): Uint8Array;
21
20
  /**
22
- * @param {string} entry_point
23
- * @param {boolean | undefined} contracts
24
- * @param {DependencyGraph | undefined} dependency_graph
25
- * @returns {CompileResult}
21
+ * @param {string} level
22
+ */
23
+ export function init_log_level(level: string): void;
24
+ /**
25
+ * @returns {any}
26
26
  */
27
- export function compile(entry_point: string, contracts?: boolean, dependency_graph?: DependencyGraph): CompileResult;
27
+ export function build_info(): any;
28
+
29
+ export type DependencyGraph = {
30
+ root_dependencies: readonly string[];
31
+ library_dependencies: Readonly<Record<string, readonly string[]>>;
32
+ }
33
+
34
+
28
35
 
29
36
  export type Diagnostic = {
30
37
  message: string;
@@ -43,58 +50,20 @@ export interface CompileError extends Error {
43
50
 
44
51
 
45
52
 
46
- export type DependencyGraph = {
47
- root_dependencies: readonly string[];
48
- library_dependencies: Readonly<Record<string, readonly string[]>>;
49
- }
50
-
51
- export type CompiledContract = {
52
- noir_version: string;
53
- name: string;
54
- backend: string;
55
- functions: Array<any>;
56
- events: Array<any>;
57
- };
58
-
59
- export type CompiledProgram = {
60
- noir_version: string;
61
- backend: string;
62
- abi: any;
63
- bytecode: string;
64
- }
65
-
66
- export type DebugArtifact = {
67
- debug_symbols: Array<any>;
68
- file_map: Record<number, any>;
69
- };
70
-
71
- export type CompileResult = (
72
- | {
73
- contract: CompiledContract;
74
- debug: DebugArtifact;
75
- }
76
- | {
77
- program: CompiledProgram;
78
- debug: DebugArtifact;
79
- }
80
- );
81
-
82
-
83
-
84
53
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
85
54
 
86
55
  export interface InitOutput {
87
56
  readonly memory: WebAssembly.Memory;
88
- readonly init_log_level: (a: number, b: number) => void;
89
- readonly build_info: () => number;
57
+ readonly compile: (a: number, b: number, c: number, d: number, e: number) => void;
90
58
  readonly acir_read_bytes: (a: number, b: number) => number;
91
59
  readonly acir_write_bytes: (a: number, b: number) => void;
92
- readonly compile: (a: number, b: number, c: number, d: number, e: number) => void;
60
+ readonly init_log_level: (a: number, b: number) => void;
61
+ readonly build_info: () => number;
93
62
  readonly __wbindgen_export_0: (a: number) => number;
94
63
  readonly __wbindgen_export_1: (a: number, b: number, c: number) => number;
95
64
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
96
- readonly __wbindgen_export_2: (a: number, b: number) => void;
97
- readonly __wbindgen_export_3: (a: number) => void;
65
+ readonly __wbindgen_export_2: (a: number) => void;
66
+ readonly __wbindgen_export_3: (a: number, b: number) => void;
98
67
  }
99
68
 
100
69
  export type SyncInitInput = BufferSource | WebAssembly.Module;
package/web/noir_wasm.js CHANGED
@@ -182,20 +182,35 @@ function debugString(val) {
182
182
  return className;
183
183
  }
184
184
  /**
185
- * @param {string} level
185
+ * @param {string} entry_point
186
+ * @param {boolean | undefined} contracts
187
+ * @param {DependencyGraph | undefined} dependency_graph
188
+ * @returns {any}
186
189
  */
187
- export function init_log_level(level) {
188
- const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
189
- const len0 = WASM_VECTOR_LEN;
190
- wasm.init_log_level(ptr0, len0);
190
+ export function compile(entry_point, contracts, dependency_graph) {
191
+ try {
192
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
193
+ const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
194
+ const len0 = WASM_VECTOR_LEN;
195
+ wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph));
196
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
197
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
198
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
199
+ if (r2) {
200
+ throw takeObject(r1);
201
+ }
202
+ return takeObject(r0);
203
+ } finally {
204
+ wasm.__wbindgen_add_to_stack_pointer(16);
205
+ }
191
206
  }
192
207
 
193
- /**
194
- * @returns {any}
195
- */
196
- export function build_info() {
197
- const ret = wasm.build_info();
198
- return takeObject(ret);
208
+ function handleError(f, args) {
209
+ try {
210
+ return f.apply(this, args);
211
+ } catch (e) {
212
+ wasm.__wbindgen_export_2(addHeapObject(e));
213
+ }
199
214
  }
200
215
 
201
216
  function passArray8ToWasm0(arg, malloc) {
@@ -230,7 +245,7 @@ export function acir_write_bytes(acir) {
230
245
  var r0 = getInt32Memory0()[retptr / 4 + 0];
231
246
  var r1 = getInt32Memory0()[retptr / 4 + 1];
232
247
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
233
- wasm.__wbindgen_export_2(r0, r1 * 1);
248
+ wasm.__wbindgen_export_3(r0, r1 * 1);
234
249
  return v1;
235
250
  } finally {
236
251
  wasm.__wbindgen_add_to_stack_pointer(16);
@@ -238,35 +253,20 @@ export function acir_write_bytes(acir) {
238
253
  }
239
254
 
240
255
  /**
241
- * @param {string} entry_point
242
- * @param {boolean | undefined} contracts
243
- * @param {DependencyGraph | undefined} dependency_graph
244
- * @returns {CompileResult}
256
+ * @param {string} level
245
257
  */
246
- export function compile(entry_point, contracts, dependency_graph) {
247
- try {
248
- const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
249
- const ptr0 = passStringToWasm0(entry_point, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
250
- const len0 = WASM_VECTOR_LEN;
251
- wasm.compile(retptr, ptr0, len0, isLikeNone(contracts) ? 0xFFFFFF : contracts ? 1 : 0, isLikeNone(dependency_graph) ? 0 : addHeapObject(dependency_graph));
252
- var r0 = getInt32Memory0()[retptr / 4 + 0];
253
- var r1 = getInt32Memory0()[retptr / 4 + 1];
254
- var r2 = getInt32Memory0()[retptr / 4 + 2];
255
- if (r2) {
256
- throw takeObject(r1);
257
- }
258
- return takeObject(r0);
259
- } finally {
260
- wasm.__wbindgen_add_to_stack_pointer(16);
261
- }
258
+ export function init_log_level(level) {
259
+ const ptr0 = passStringToWasm0(level, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
260
+ const len0 = WASM_VECTOR_LEN;
261
+ wasm.init_log_level(ptr0, len0);
262
262
  }
263
263
 
264
- function handleError(f, args) {
265
- try {
266
- return f.apply(this, args);
267
- } catch (e) {
268
- wasm.__wbindgen_export_3(addHeapObject(e));
269
- }
264
+ /**
265
+ * @returns {any}
266
+ */
267
+ export function build_info() {
268
+ const ret = wasm.build_info();
269
+ return takeObject(ret);
270
270
  }
271
271
 
272
272
  async function __wbg_load(module, imports) {
@@ -306,18 +306,10 @@ function __wbg_get_imports() {
306
306
  imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
307
307
  takeObject(arg0);
308
308
  };
309
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
310
- const ret = getObject(arg0) === undefined;
311
- return ret;
312
- };
313
309
  imports.wbg.__wbg_constructor_bc58db5a3b38f16c = function(arg0) {
314
310
  const ret = new Error(takeObject(arg0));
315
311
  return addHeapObject(ret);
316
312
  };
317
- imports.wbg.__wbg_constructor_e29c95824faa216c = function() {
318
- const ret = new Object();
319
- return addHeapObject(ret);
320
- };
321
313
  imports.wbg.__wbg_readfile_a8c4f775fbe0578e = function() { return handleError(function (arg0, arg1, arg2) {
322
314
  const ret = read_file(getStringFromWasm0(arg1, arg2));
323
315
  const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_export_0, wasm.__wbindgen_export_1);
@@ -325,6 +317,10 @@ function __wbg_get_imports() {
325
317
  getInt32Memory0()[arg0 / 4 + 1] = len1;
326
318
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
327
319
  }, arguments) };
320
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
321
+ const ret = getObject(arg0) === undefined;
322
+ return ret;
323
+ };
328
324
  imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
329
325
  const ret = getStringFromWasm0(arg0, arg1);
330
326
  return addHeapObject(ret);
@@ -348,7 +344,7 @@ function __wbg_get_imports() {
348
344
  deferred0_1 = arg1;
349
345
  console.error(getStringFromWasm0(arg0, arg1));
350
346
  } finally {
351
- wasm.__wbindgen_export_2(deferred0_0, deferred0_1);
347
+ wasm.__wbindgen_export_3(deferred0_0, deferred0_1);
352
348
  }
353
349
  };
354
350
  imports.wbg.__wbg_debug_efabe4eb183aa5d4 = function(arg0, arg1, arg2, arg3) {
Binary file
@@ -1,13 +1,13 @@
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;
5
- export function build_info(): number;
4
+ export function compile(a: number, b: number, c: number, d: number, e: number): void;
6
5
  export function acir_read_bytes(a: number, b: number): number;
7
6
  export function acir_write_bytes(a: number, b: number): void;
8
- export function compile(a: number, b: number, c: number, d: number, e: number): void;
7
+ export function init_log_level(a: number, b: number): void;
8
+ export function build_info(): number;
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
11
  export function __wbindgen_add_to_stack_pointer(a: number): number;
12
- export function __wbindgen_export_2(a: number, b: number): void;
13
- export function __wbindgen_export_3(a: number): void;
12
+ export function __wbindgen_export_2(a: number): void;
13
+ export function __wbindgen_export_3(a: number, b: number): void;