@noir-lang/noirc_abi 0.19.0 → 0.19.2

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.
@@ -19,10 +19,6 @@ export type WitnessMap = Map<number, string>;
19
19
 
20
20
 
21
21
 
22
- export type ABIError = Error;
23
-
24
-
25
-
26
22
  export type Field = string | number | boolean;
27
23
  export type InputValue = Field | Field[] | InputMap;
28
24
  export type InputMap = { [key: string]: InputValue };
@@ -39,7 +35,7 @@ export type AbiType =
39
35
  { kind: "array", length: number, type: AbiType } |
40
36
  { kind: "tuple", fields: AbiType[] } |
41
37
  { kind: "struct", path: string, fields: [string, AbiType][] };
42
-
38
+
43
39
  export type AbiParameter = {
44
40
  name: string,
45
41
  type: AbiType,
@@ -48,9 +44,13 @@ export type AbiParameter = {
48
44
 
49
45
  export type Abi = {
50
46
  parameters: AbiParameter[],
51
- param_witnesses: Record<string, number[]>,
47
+ param_witnesses: Record<string, {start: number, end: number}[]>,
52
48
  return_type: AbiType | null,
53
49
  return_witnesses: number[],
54
50
  }
55
51
 
56
52
 
53
+
54
+ export type ABIError = Error;
55
+
56
+
@@ -9,30 +9,17 @@ heap.push(undefined, null, true, false);
9
9
 
10
10
  function getObject(idx) { return heap[idx]; }
11
11
 
12
- function isLikeNone(x) {
13
- return x === undefined || x === null;
14
- }
15
-
16
- let cachedFloat64Memory0 = null;
17
-
18
- function getFloat64Memory0() {
19
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
20
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
21
- }
22
- return cachedFloat64Memory0;
23
- }
12
+ let heap_next = heap.length;
24
13
 
25
- let cachedInt32Memory0 = null;
14
+ function addHeapObject(obj) {
15
+ if (heap_next === heap.length) heap.push(heap.length + 1);
16
+ const idx = heap_next;
17
+ heap_next = heap[idx];
26
18
 
27
- function getInt32Memory0() {
28
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
29
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
30
- }
31
- return cachedInt32Memory0;
19
+ heap[idx] = obj;
20
+ return idx;
32
21
  }
33
22
 
34
- let heap_next = heap.length;
35
-
36
23
  function dropObject(idx) {
37
24
  if (idx < 132) return;
38
25
  heap[idx] = heap_next;
@@ -45,15 +32,6 @@ function takeObject(idx) {
45
32
  return ret;
46
33
  }
47
34
 
48
- function addHeapObject(obj) {
49
- if (heap_next === heap.length) heap.push(heap.length + 1);
50
- const idx = heap_next;
51
- heap_next = heap[idx];
52
-
53
- heap[idx] = obj;
54
- return idx;
55
- }
56
-
57
35
  let WASM_VECTOR_LEN = 0;
58
36
 
59
37
  let cachedUint8Memory0 = null;
@@ -118,6 +96,28 @@ function passStringToWasm0(arg, malloc, realloc) {
118
96
  return ptr;
119
97
  }
120
98
 
99
+ function isLikeNone(x) {
100
+ return x === undefined || x === null;
101
+ }
102
+
103
+ let cachedInt32Memory0 = null;
104
+
105
+ function getInt32Memory0() {
106
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
107
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
108
+ }
109
+ return cachedInt32Memory0;
110
+ }
111
+
112
+ let cachedFloat64Memory0 = null;
113
+
114
+ function getFloat64Memory0() {
115
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
116
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
117
+ }
118
+ return cachedFloat64Memory0;
119
+ }
120
+
121
121
  let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
122
122
 
123
123
  cachedTextDecoder.decode();
@@ -181,23 +181,12 @@ function handleError(f, args) {
181
181
  }
182
182
  }
183
183
 
184
- module.exports.__wbindgen_number_get = function(arg0, arg1) {
185
- const obj = getObject(arg1);
186
- const ret = typeof(obj) === 'number' ? obj : undefined;
187
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
188
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
189
- };
190
-
191
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
192
- takeObject(arg0);
193
- };
194
-
195
184
  module.exports.__wbindgen_is_undefined = function(arg0) {
196
185
  const ret = getObject(arg0) === undefined;
197
186
  return ret;
198
187
  };
199
188
 
200
- module.exports.__wbg_new_7eda00598b2a27a7 = function() {
189
+ module.exports.__wbg_new_dec74db9055a25fb = function() {
201
190
  const ret = new Map();
202
191
  return addHeapObject(ret);
203
192
  };
@@ -207,6 +196,10 @@ module.exports.__wbindgen_number_new = function(arg0) {
207
196
  return addHeapObject(ret);
208
197
  };
209
198
 
199
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
200
+ takeObject(arg0);
201
+ };
202
+
210
203
  module.exports.__wbindgen_string_get = function(arg0, arg1) {
211
204
  const obj = getObject(arg1);
212
205
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -216,7 +209,14 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
216
209
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
217
210
  };
218
211
 
219
- module.exports.__wbg_constructor_ae68cc6e1c98bfd5 = function(arg0) {
212
+ module.exports.__wbindgen_number_get = function(arg0, arg1) {
213
+ const obj = getObject(arg1);
214
+ const ret = typeof(obj) === 'number' ? obj : undefined;
215
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
216
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
217
+ };
218
+
219
+ module.exports.__wbg_constructor_f5d778cb78d63c37 = function(arg0) {
220
220
  const ret = new Error(takeObject(arg0));
221
221
  return addHeapObject(ret);
222
222
  };
Binary file
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.19.0",
6
+ "version": "0.19.2",
7
7
  "license": "(MIT OR Apache-2.0)",
8
8
  "files": [
9
9
  "nodejs",
@@ -19,10 +19,6 @@ export type WitnessMap = Map<number, string>;
19
19
 
20
20
 
21
21
 
22
- export type ABIError = Error;
23
-
24
-
25
-
26
22
  export type Field = string | number | boolean;
27
23
  export type InputValue = Field | Field[] | InputMap;
28
24
  export type InputMap = { [key: string]: InputValue };
@@ -39,7 +35,7 @@ export type AbiType =
39
35
  { kind: "array", length: number, type: AbiType } |
40
36
  { kind: "tuple", fields: AbiType[] } |
41
37
  { kind: "struct", path: string, fields: [string, AbiType][] };
42
-
38
+
43
39
  export type AbiParameter = {
44
40
  name: string,
45
41
  type: AbiType,
@@ -48,13 +44,17 @@ export type AbiParameter = {
48
44
 
49
45
  export type Abi = {
50
46
  parameters: AbiParameter[],
51
- param_witnesses: Record<string, number[]>,
47
+ param_witnesses: Record<string, {start: number, end: number}[]>,
52
48
  return_type: AbiType | null,
53
49
  return_witnesses: number[],
54
50
  }
55
51
 
56
52
 
57
53
 
54
+ export type ABIError = Error;
55
+
56
+
57
+
58
58
  export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembly.Module;
59
59
 
60
60
  export interface InitOutput {
@@ -6,30 +6,17 @@ heap.push(undefined, null, true, false);
6
6
 
7
7
  function getObject(idx) { return heap[idx]; }
8
8
 
9
- function isLikeNone(x) {
10
- return x === undefined || x === null;
11
- }
12
-
13
- let cachedFloat64Memory0 = null;
14
-
15
- function getFloat64Memory0() {
16
- if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
17
- cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
18
- }
19
- return cachedFloat64Memory0;
20
- }
9
+ let heap_next = heap.length;
21
10
 
22
- let cachedInt32Memory0 = null;
11
+ function addHeapObject(obj) {
12
+ if (heap_next === heap.length) heap.push(heap.length + 1);
13
+ const idx = heap_next;
14
+ heap_next = heap[idx];
23
15
 
24
- function getInt32Memory0() {
25
- if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
26
- cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
27
- }
28
- return cachedInt32Memory0;
16
+ heap[idx] = obj;
17
+ return idx;
29
18
  }
30
19
 
31
- let heap_next = heap.length;
32
-
33
20
  function dropObject(idx) {
34
21
  if (idx < 132) return;
35
22
  heap[idx] = heap_next;
@@ -42,15 +29,6 @@ function takeObject(idx) {
42
29
  return ret;
43
30
  }
44
31
 
45
- function addHeapObject(obj) {
46
- if (heap_next === heap.length) heap.push(heap.length + 1);
47
- const idx = heap_next;
48
- heap_next = heap[idx];
49
-
50
- heap[idx] = obj;
51
- return idx;
52
- }
53
-
54
32
  let WASM_VECTOR_LEN = 0;
55
33
 
56
34
  let cachedUint8Memory0 = null;
@@ -115,6 +93,28 @@ function passStringToWasm0(arg, malloc, realloc) {
115
93
  return ptr;
116
94
  }
117
95
 
96
+ function isLikeNone(x) {
97
+ return x === undefined || x === null;
98
+ }
99
+
100
+ let cachedInt32Memory0 = null;
101
+
102
+ function getInt32Memory0() {
103
+ if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) {
104
+ cachedInt32Memory0 = new Int32Array(wasm.memory.buffer);
105
+ }
106
+ return cachedInt32Memory0;
107
+ }
108
+
109
+ let cachedFloat64Memory0 = null;
110
+
111
+ function getFloat64Memory0() {
112
+ if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) {
113
+ cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer);
114
+ }
115
+ return cachedFloat64Memory0;
116
+ }
117
+
118
118
  const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
119
119
 
120
120
  if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
@@ -212,20 +212,11 @@ async function __wbg_load(module, imports) {
212
212
  function __wbg_get_imports() {
213
213
  const imports = {};
214
214
  imports.wbg = {};
215
- imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
216
- const obj = getObject(arg1);
217
- const ret = typeof(obj) === 'number' ? obj : undefined;
218
- getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
219
- getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
220
- };
221
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
222
- takeObject(arg0);
223
- };
224
215
  imports.wbg.__wbindgen_is_undefined = function(arg0) {
225
216
  const ret = getObject(arg0) === undefined;
226
217
  return ret;
227
218
  };
228
- imports.wbg.__wbg_new_7eda00598b2a27a7 = function() {
219
+ imports.wbg.__wbg_new_dec74db9055a25fb = function() {
229
220
  const ret = new Map();
230
221
  return addHeapObject(ret);
231
222
  };
@@ -233,6 +224,9 @@ function __wbg_get_imports() {
233
224
  const ret = arg0;
234
225
  return addHeapObject(ret);
235
226
  };
227
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
228
+ takeObject(arg0);
229
+ };
236
230
  imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
237
231
  const obj = getObject(arg1);
238
232
  const ret = typeof(obj) === 'string' ? obj : undefined;
@@ -241,7 +235,13 @@ function __wbg_get_imports() {
241
235
  getInt32Memory0()[arg0 / 4 + 1] = len1;
242
236
  getInt32Memory0()[arg0 / 4 + 0] = ptr1;
243
237
  };
244
- imports.wbg.__wbg_constructor_ae68cc6e1c98bfd5 = function(arg0) {
238
+ imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
239
+ const obj = getObject(arg1);
240
+ const ret = typeof(obj) === 'number' ? obj : undefined;
241
+ getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
242
+ getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
243
+ };
244
+ imports.wbg.__wbg_constructor_f5d778cb78d63c37 = function(arg0) {
245
245
  const ret = new Error(takeObject(arg0));
246
246
  return addHeapObject(ret);
247
247
  };
Binary file