@noir-lang/noir_wasm 1.0.0-beta.3-f0c1c7b.nightly → 1.0.0-beta.3-fdd2fe7.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,90 +1,97 @@
1
- export function compile_program_(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
2
- export function compile_contract_(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
1
+ export function compile_program_(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
2
+ export function compile_contract_(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
3
3
  export function init_log_level(level: string): void;
4
4
  export function build_info(): any;
5
- export function compile_program(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
6
- export function compile_contract(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
7
- export function __wbindgen_object_drop_ref(arg0: any): void;
8
- export function __wbg_constructor_e81ab801e8a0ffd1(arg0: any): number;
9
- export function __wbg_constructor_c09d82b787c1aa69(): number;
5
+ export function compile_program(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
6
+ export function compile_contract(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
7
+ export function __wbg_constructor_84b51f8183439483(): Object;
8
+ export function __wbg_constructor_a70e1aaea07e80fd(): Object;
9
+ export function __wbg_constructor_dcd6c3e173d3b88b(arg0: any): Error;
10
+ export function __wbg_debug_3cb59063b29f58c1(arg0: any): void;
11
+ export function __wbg_debug_e17b51583ca6a632(arg0: any, arg1: any, arg2: any, arg3: any): void;
12
+ export function __wbg_error_524f506f44df1645(arg0: any): void;
13
+ export function __wbg_error_7534b8e9a36f1ab4(arg0: any, arg1: any): void;
14
+ export function __wbg_error_80de38b3f7cc3c3c(arg0: any, arg1: any, arg2: any, arg3: any): void;
15
+ export function __wbg_getTime_46267b1c24877e30(arg0: any): any;
16
+ export function __wbg_info_033d8b8a0838f1d3(arg0: any, arg1: any, arg2: any, arg3: any): void;
17
+ export function __wbg_info_3daf2e093e091b66(arg0: any): void;
18
+ export function __wbg_new0_f788a2397c7ca929(): Date;
19
+ export function __wbg_new_8a6f238a6ece86ea(): Error;
20
+ export function __wbg_parse_def2e24ef1252aff(...args: any[]): any;
21
+ export function __wbg_set_bb8cecf6a62b9f46(...args: any[]): any;
22
+ export function __wbg_stack_0ed75d68575b0f3c(arg0: any, arg1: any): void;
23
+ export function __wbg_stringify_f7ed6987935b4a24(...args: any[]): any;
24
+ export function __wbg_warn_4ca3906c248c47c4(arg0: any): void;
25
+ export function __wbg_warn_aaf1f4664a035bd6(arg0: any, arg1: any, arg2: any, arg3: any): void;
26
+ export function __wbindgen_debug_string(arg0: any, arg1: any): void;
27
+ export function __wbindgen_init_externref_table(): void;
10
28
  export function __wbindgen_is_undefined(arg0: any): boolean;
11
- export function __wbg_new_abda76e883ba8a5f(): number;
12
- export function __wbg_stack_658279fe44541cf6(arg0: any, arg1: any): void;
13
- export function __wbg_error_f851667af71bcfc6(arg0: any, arg1: any): void;
14
- export function __wbindgen_string_new(arg0: any, arg1: any): number;
15
- export function __wbg_debug_e3f6a1578e6d45ca(arg0: any): void;
16
- export function __wbg_debug_efabe4eb183aa5d4(arg0: any, arg1: any, arg2: any, arg3: any): void;
17
- export function __wbg_error_a7e23606158b68b9(arg0: any): void;
18
- export function __wbg_error_50f42b952a595a23(arg0: any, arg1: any, arg2: any, arg3: any): void;
19
- export function __wbg_info_05db236d79f1b785(arg0: any): void;
20
- export function __wbg_info_24d8f53d98f12b95(arg0: any, arg1: any, arg2: any, arg3: any): void;
21
- export function __wbg_warn_9bdd743e9f5fe1e0(arg0: any): void;
22
- export function __wbg_warn_8342bfbc6028193a(arg0: any, arg1: any, arg2: any, arg3: any): void;
23
29
  export function __wbindgen_string_get(arg0: any, arg1: any): void;
24
- export function __wbg_getTime_40bd09e020e8bc8c(arg0: any): any;
25
- export function __wbg_new0_494c19a27871d56f(): number;
26
- export function __wbg_parse_76a8a18ca3f8730b(...args: any[]): any;
27
- export function __wbg_stringify_d06ad2addc54d51e(...args: any[]): any;
28
- export function __wbg_set_07da13cc24b69217(...args: any[]): any;
29
- export function __wbindgen_debug_string(arg0: any, arg1: any): void;
30
+ export function __wbindgen_string_new(arg0: any, arg1: any): string;
30
31
  export function __wbindgen_throw(arg0: any, arg1: any): never;
31
32
  /**
32
- */
33
+ * This is map contains the paths of all of the files in the entry-point crate and
34
+ * the transitive dependencies of the entry-point crate.
35
+ *
36
+ * This is for all intents and purposes the file system that the compiler will use to resolve/compile
37
+ * files in the crate being compiled and its dependencies.
38
+ *
39
+ * Using a `BTreeMap` to add files to the [FileManager] in a deterministic order,
40
+ * which affects the `FileId` in the `Location`s in the AST on which the `hash` is based.
41
+ * Note that we cannot expect to match the IDs assigned by the `FileManager` used by `nargo`,
42
+ * because there the order is determined by the dependency graph as well as the file name.
43
+ */
33
44
  export class PathToFileSourceMap {
34
- static __wrap(ptr: any): any;
35
- __destroy_into_raw(): number | undefined;
36
- __wbg_ptr: number | undefined;
45
+ __destroy_into_raw(): number;
46
+ __wbg_ptr: number;
37
47
  free(): void;
38
48
  /**
39
- * @param {string} path
40
- * @param {string} source_code
41
- * @returns {boolean}
42
- */
49
+ * @param {string} path
50
+ * @param {string} source_code
51
+ * @returns {boolean}
52
+ */
43
53
  add_source_code(path: string, source_code: string): boolean;
44
54
  }
45
55
  /**
46
- * This is a wrapper class that is wasm-bindgen compatible
47
- * We do not use js_name and rename it like CrateId because
48
- * then the impl block is not picked up in javascript.
49
- */
56
+ * This is a wrapper class that is wasm-bindgen compatible
57
+ * We do not use js_name and rename it like CrateId because
58
+ * then the impl block is not picked up in javascript.
59
+ */
50
60
  export class CompilerContext {
51
- static __wrap(ptr: any): any;
52
61
  /**
53
- * @param {PathToFileSourceMap} source_map
54
- */
62
+ * @param {PathToFileSourceMap} source_map
63
+ */
55
64
  constructor(source_map: PathToFileSourceMap);
56
- __destroy_into_raw(): number | undefined;
57
- __wbg_ptr: number | undefined;
65
+ __destroy_into_raw(): number;
66
+ __wbg_ptr: number;
58
67
  free(): void;
59
68
  /**
60
- * @param {string} path_to_crate
61
- * @returns {CrateId}
62
- */
69
+ * @param {string} path_to_crate
70
+ * @returns {CrateId}
71
+ */
63
72
  process_root_crate(path_to_crate: string): CrateId;
64
73
  /**
65
- * @param {string} path_to_crate
66
- * @returns {CrateId}
67
- */
74
+ * @param {string} path_to_crate
75
+ * @returns {CrateId}
76
+ */
68
77
  process_dependency_crate(path_to_crate: string): CrateId;
69
78
  /**
70
- * @param {string} crate_name
71
- * @param {CrateId} from
72
- * @param {CrateId} to
73
- */
79
+ * @param {string} crate_name
80
+ * @param {CrateId} from
81
+ * @param {CrateId} to
82
+ */
74
83
  add_dependency_edge(crate_name: string, from: CrateId, to: CrateId): void;
75
84
  /**
76
- * @param {number} program_width
77
- * @returns {ProgramCompileResult}
78
- */
85
+ * @param {number} program_width
86
+ * @returns {ProgramCompileResult}
87
+ */
79
88
  compile_program(program_width: number): ProgramCompileResult;
80
89
  /**
81
- * @param {number} program_width
82
- * @returns {ContractCompileResult}
83
- */
90
+ * @param {number} program_width
91
+ * @returns {ContractCompileResult}
92
+ */
84
93
  compile_contract(program_width: number): ContractCompileResult;
85
94
  }
86
- /**
87
- */
88
95
  export class CrateId {
89
96
  static __wrap(ptr: any): any;
90
97
  __destroy_into_raw(): number | undefined;
@@ -1,86 +1,83 @@
1
1
  /**
2
- * This is a method that exposes the same API as `compile`
3
- * But uses the Context based APi internally
4
- * @param {string} entry_point
5
- * @param {DependencyGraph | undefined} dependency_graph
6
- * @param {PathToFileSourceMap} file_source_map
7
- * @returns {ProgramCompileResult}
8
- */
9
- export function compile_program_(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
2
+ * This is a method that exposes the same API as `compile`
3
+ * But uses the Context based APi internally
4
+ * @param {string} entry_point
5
+ * @param {DependencyGraph | null | undefined} dependency_graph
6
+ * @param {PathToFileSourceMap} file_source_map
7
+ * @returns {ProgramCompileResult}
8
+ */
9
+ export function compile_program_(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
10
10
  /**
11
- * This is a method that exposes the same API as `compile`
12
- * But uses the Context based APi internally
13
- * @param {string} entry_point
14
- * @param {DependencyGraph | undefined} dependency_graph
15
- * @param {PathToFileSourceMap} file_source_map
16
- * @returns {ContractCompileResult}
17
- */
18
- export function compile_contract_(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
11
+ * This is a method that exposes the same API as `compile`
12
+ * But uses the Context based APi internally
13
+ * @param {string} entry_point
14
+ * @param {DependencyGraph | null | undefined} dependency_graph
15
+ * @param {PathToFileSourceMap} file_source_map
16
+ * @returns {ContractCompileResult}
17
+ */
18
+ export function compile_contract_(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
19
19
  /**
20
- * @param {string} level
21
- */
20
+ * @param {string} level
21
+ */
22
22
  export function init_log_level(level: string): void;
23
23
  /**
24
- * @returns {any}
25
- */
24
+ * @returns {any}
25
+ */
26
26
  export function build_info(): any;
27
27
  /**
28
- * @param {string} entry_point
29
- * @param {DependencyGraph | undefined} dependency_graph
30
- * @param {PathToFileSourceMap} file_source_map
31
- * @returns {ProgramCompileResult}
32
- */
33
- export function compile_program(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
28
+ * @param {string} entry_point
29
+ * @param {DependencyGraph | null | undefined} dependency_graph
30
+ * @param {PathToFileSourceMap} file_source_map
31
+ * @returns {ProgramCompileResult}
32
+ */
33
+ export function compile_program(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ProgramCompileResult;
34
34
  /**
35
- * @param {string} entry_point
36
- * @param {DependencyGraph | undefined} dependency_graph
37
- * @param {PathToFileSourceMap} file_source_map
38
- * @returns {ContractCompileResult}
39
- */
40
- export function compile_contract(entry_point: string, dependency_graph: DependencyGraph | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
35
+ * @param {string} entry_point
36
+ * @param {DependencyGraph | null | undefined} dependency_graph
37
+ * @param {PathToFileSourceMap} file_source_map
38
+ * @returns {ContractCompileResult}
39
+ */
40
+ export function compile_contract(entry_point: string, dependency_graph: DependencyGraph | null | undefined, file_source_map: PathToFileSourceMap): ContractCompileResult;
41
41
  /**
42
- * This is a wrapper class that is wasm-bindgen compatible
43
- * We do not use js_name and rename it like CrateId because
44
- * then the impl block is not picked up in javascript.
45
- */
42
+ * This is a wrapper class that is wasm-bindgen compatible
43
+ * We do not use js_name and rename it like CrateId because
44
+ * then the impl block is not picked up in javascript.
45
+ */
46
46
  export class CompilerContext {
47
- static __wrap(ptr: any): any;
48
47
  /**
49
- * @param {PathToFileSourceMap} source_map
50
- */
48
+ * @param {PathToFileSourceMap} source_map
49
+ */
51
50
  constructor(source_map: PathToFileSourceMap);
52
- __destroy_into_raw(): number | undefined;
53
- __wbg_ptr: number | undefined;
51
+ __destroy_into_raw(): number;
52
+ __wbg_ptr: number;
54
53
  free(): void;
55
54
  /**
56
- * @param {string} path_to_crate
57
- * @returns {CrateId}
58
- */
55
+ * @param {string} path_to_crate
56
+ * @returns {CrateId}
57
+ */
59
58
  process_root_crate(path_to_crate: string): CrateId;
60
59
  /**
61
- * @param {string} path_to_crate
62
- * @returns {CrateId}
63
- */
60
+ * @param {string} path_to_crate
61
+ * @returns {CrateId}
62
+ */
64
63
  process_dependency_crate(path_to_crate: string): CrateId;
65
64
  /**
66
- * @param {string} crate_name
67
- * @param {CrateId} from
68
- * @param {CrateId} to
69
- */
65
+ * @param {string} crate_name
66
+ * @param {CrateId} from
67
+ * @param {CrateId} to
68
+ */
70
69
  add_dependency_edge(crate_name: string, from: CrateId, to: CrateId): void;
71
70
  /**
72
- * @param {number} program_width
73
- * @returns {ProgramCompileResult}
74
- */
71
+ * @param {number} program_width
72
+ * @returns {ProgramCompileResult}
73
+ */
75
74
  compile_program(program_width: number): ProgramCompileResult;
76
75
  /**
77
- * @param {number} program_width
78
- * @returns {ContractCompileResult}
79
- */
76
+ * @param {number} program_width
77
+ * @returns {ContractCompileResult}
78
+ */
80
79
  compile_contract(program_width: number): ContractCompileResult;
81
80
  }
82
- /**
83
- */
84
81
  export class CrateId {
85
82
  static __wrap(ptr: any): any;
86
83
  __destroy_into_raw(): number | undefined;
@@ -88,19 +85,28 @@ export class CrateId {
88
85
  free(): void;
89
86
  }
90
87
  /**
91
- */
88
+ * This is map contains the paths of all of the files in the entry-point crate and
89
+ * the transitive dependencies of the entry-point crate.
90
+ *
91
+ * This is for all intents and purposes the file system that the compiler will use to resolve/compile
92
+ * files in the crate being compiled and its dependencies.
93
+ *
94
+ * Using a `BTreeMap` to add files to the [FileManager] in a deterministic order,
95
+ * which affects the `FileId` in the `Location`s in the AST on which the `hash` is based.
96
+ * Note that we cannot expect to match the IDs assigned by the `FileManager` used by `nargo`,
97
+ * because there the order is determined by the dependency graph as well as the file name.
98
+ */
92
99
  export class PathToFileSourceMap {
93
- static __wrap(ptr: any): any;
94
- __destroy_into_raw(): number | undefined;
95
- __wbg_ptr: number | undefined;
100
+ __destroy_into_raw(): number;
101
+ __wbg_ptr: number;
96
102
  free(): void;
97
103
  /**
98
- * @param {string} path
99
- * @param {string} source_code
100
- * @returns {boolean}
101
- */
104
+ * @param {string} path
105
+ * @param {string} source_code
106
+ * @returns {boolean}
107
+ */
102
108
  add_source_code(path: string, source_code: string): boolean;
103
109
  }
104
110
  export default __wbg_init;
105
111
  export function initSync(module: any): any;
106
- declare function __wbg_init(input: any): Promise<any>;
112
+ declare function __wbg_init(module_or_path: any): Promise<any>;
@@ -47,6 +47,8 @@ export interface ABIVariable {
47
47
  export interface NoirFunctionEntry {
48
48
  /** The name of the function. */
49
49
  name: string;
50
+ /** The hash of the circuit. */
51
+ hash?: string;
50
52
  /** Whether the function is unconstrained. */
51
53
  is_unconstrained: boolean;
52
54
  /** The custom attributes applied to the function. */
@@ -82,7 +84,7 @@ export interface ProgramArtifact {
82
84
  /** Version of noir used for the build. */
83
85
  noir_version: string;
84
86
  /** The hash of the circuit. */
85
- hash?: number;
87
+ hash?: string;
86
88
  /** * The ABI of the function. */
87
89
  abi: Abi;
88
90
  /** The bytecode of the circuit in base64. */