@noir-lang/noirc_abi 0.27.0 → 0.28.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.
@@ -13,12 +13,17 @@ export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue)
13
13
  * @returns {any}
14
14
  */
15
15
  export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
16
+ /**
17
+ * @param {WitnessMap} witness_map
18
+ * @returns {Uint8Array}
19
+ */
20
+ export function serializeWitness(witness_map: WitnessMap): Uint8Array;
16
21
 
17
- import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
18
- export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
22
+ export type ABIError = Error;
19
23
 
20
24
 
21
25
 
22
- export type ABIError = Error;
26
+ import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
27
+ export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
23
28
 
24
29
 
@@ -169,8 +169,35 @@ module.exports.abiDecode = function(abi, witness_map) {
169
169
  }
170
170
  };
171
171
 
172
- function __wbg_adapter_26(arg0, arg1, arg2, arg3) {
173
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h6cdb28bf0237c46b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
172
+ function getArrayU8FromWasm0(ptr, len) {
173
+ ptr = ptr >>> 0;
174
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
175
+ }
176
+ /**
177
+ * @param {WitnessMap} witness_map
178
+ * @returns {Uint8Array}
179
+ */
180
+ module.exports.serializeWitness = function(witness_map) {
181
+ try {
182
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
183
+ wasm.serializeWitness(retptr, addHeapObject(witness_map));
184
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
185
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
186
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
187
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
188
+ if (r3) {
189
+ throw takeObject(r2);
190
+ }
191
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
192
+ wasm.__wbindgen_free(r0, r1 * 1);
193
+ return v1;
194
+ } finally {
195
+ wasm.__wbindgen_add_to_stack_pointer(16);
196
+ }
197
+ };
198
+
199
+ function __wbg_adapter_27(arg0, arg1, arg2, arg3) {
200
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h4cc254837aac6d0e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
174
201
  }
175
202
 
176
203
  function handleError(f, args) {
@@ -181,21 +208,21 @@ function handleError(f, args) {
181
208
  }
182
209
  }
183
210
 
184
- module.exports.__wbindgen_object_drop_ref = function(arg0) {
185
- takeObject(arg0);
211
+ module.exports.__wbindgen_is_undefined = function(arg0) {
212
+ const ret = getObject(arg0) === undefined;
213
+ return ret;
186
214
  };
187
215
 
188
- module.exports.__wbg_constructor_311fc8beeab98bd6 = function(arg0) {
216
+ module.exports.__wbg_constructor_af0e51fc6fc179a6 = function(arg0) {
189
217
  const ret = new Error(takeObject(arg0));
190
218
  return addHeapObject(ret);
191
219
  };
192
220
 
193
- module.exports.__wbindgen_is_undefined = function(arg0) {
194
- const ret = getObject(arg0) === undefined;
195
- return ret;
221
+ module.exports.__wbindgen_object_drop_ref = function(arg0) {
222
+ takeObject(arg0);
196
223
  };
197
224
 
198
- module.exports.__wbg_new_6699176386b67a04 = function() {
225
+ module.exports.__wbg_new_52c2273397b0b9e7 = function() {
199
226
  const ret = new Map();
200
227
  return addHeapObject(ret);
201
228
  };
@@ -258,7 +285,7 @@ module.exports.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) {
258
285
  const a = state0.a;
259
286
  state0.a = 0;
260
287
  try {
261
- return __wbg_adapter_26(a, state0.b, arg0, arg1);
288
+ return __wbg_adapter_27(a, state0.b, arg0, arg1);
262
289
  } finally {
263
290
  state0.a = a;
264
291
  }
Binary file
@@ -3,9 +3,10 @@
3
3
  export const memory: WebAssembly.Memory;
4
4
  export function abiEncode(a: number, b: number, c: number, d: number): void;
5
5
  export function abiDecode(a: number, b: number, c: number): void;
6
+ export function serializeWitness(a: number, b: number): void;
6
7
  export function __wbindgen_malloc(a: number): number;
7
8
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
8
9
  export function __wbindgen_add_to_stack_pointer(a: number): number;
9
10
  export function __wbindgen_free(a: number, b: number): void;
10
- export function wasm_bindgen__convert__closures__invoke2_mut__h6cdb28bf0237c46b(a: number, b: number, c: number, d: number): void;
11
+ export function wasm_bindgen__convert__closures__invoke2_mut__h4cc254837aac6d0e(a: number, b: number, c: number, d: number): void;
11
12
  export function __wbindgen_exn_store(a: number): void;
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "contributors": [
4
4
  "The Noir Team <team@noir-lang.org>"
5
5
  ],
6
- "version": "0.27.0",
6
+ "version": "0.28.0",
7
7
  "license": "(MIT OR Apache-2.0)",
8
8
  "homepage": "https://noir-lang.org/",
9
9
  "repository": {
@@ -36,7 +36,7 @@
36
36
  "lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0"
37
37
  },
38
38
  "dependencies": {
39
- "@noir-lang/types": "0.27.0"
39
+ "@noir-lang/types": "0.28.0"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@esm-bundle/chai": "^4.3.4-fix.0",
@@ -13,13 +13,18 @@ export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue)
13
13
  * @returns {any}
14
14
  */
15
15
  export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
16
+ /**
17
+ * @param {WitnessMap} witness_map
18
+ * @returns {Uint8Array}
19
+ */
20
+ export function serializeWitness(witness_map: WitnessMap): Uint8Array;
16
21
 
17
- import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
18
- export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
22
+ export type ABIError = Error;
19
23
 
20
24
 
21
25
 
22
- export type ABIError = Error;
26
+ import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
27
+ export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
23
28
 
24
29
 
25
30
 
@@ -29,11 +34,12 @@ export interface InitOutput {
29
34
  readonly memory: WebAssembly.Memory;
30
35
  readonly abiEncode: (a: number, b: number, c: number, d: number) => void;
31
36
  readonly abiDecode: (a: number, b: number, c: number) => void;
37
+ readonly serializeWitness: (a: number, b: number) => void;
32
38
  readonly __wbindgen_malloc: (a: number) => number;
33
39
  readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
34
40
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
35
41
  readonly __wbindgen_free: (a: number, b: number) => void;
36
- readonly wasm_bindgen__convert__closures__invoke2_mut__h6cdb28bf0237c46b: (a: number, b: number, c: number, d: number) => void;
42
+ readonly wasm_bindgen__convert__closures__invoke2_mut__h4cc254837aac6d0e: (a: number, b: number, c: number, d: number) => void;
37
43
  readonly __wbindgen_exn_store: (a: number) => void;
38
44
  }
39
45
 
@@ -166,8 +166,35 @@ export function abiDecode(abi, witness_map) {
166
166
  }
167
167
  }
168
168
 
169
- function __wbg_adapter_26(arg0, arg1, arg2, arg3) {
170
- wasm.wasm_bindgen__convert__closures__invoke2_mut__h6cdb28bf0237c46b(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
169
+ function getArrayU8FromWasm0(ptr, len) {
170
+ ptr = ptr >>> 0;
171
+ return getUint8Memory0().subarray(ptr / 1, ptr / 1 + len);
172
+ }
173
+ /**
174
+ * @param {WitnessMap} witness_map
175
+ * @returns {Uint8Array}
176
+ */
177
+ export function serializeWitness(witness_map) {
178
+ try {
179
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
180
+ wasm.serializeWitness(retptr, addHeapObject(witness_map));
181
+ var r0 = getInt32Memory0()[retptr / 4 + 0];
182
+ var r1 = getInt32Memory0()[retptr / 4 + 1];
183
+ var r2 = getInt32Memory0()[retptr / 4 + 2];
184
+ var r3 = getInt32Memory0()[retptr / 4 + 3];
185
+ if (r3) {
186
+ throw takeObject(r2);
187
+ }
188
+ var v1 = getArrayU8FromWasm0(r0, r1).slice();
189
+ wasm.__wbindgen_free(r0, r1 * 1);
190
+ return v1;
191
+ } finally {
192
+ wasm.__wbindgen_add_to_stack_pointer(16);
193
+ }
194
+ }
195
+
196
+ function __wbg_adapter_27(arg0, arg1, arg2, arg3) {
197
+ wasm.wasm_bindgen__convert__closures__invoke2_mut__h4cc254837aac6d0e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
171
198
  }
172
199
 
173
200
  function handleError(f, args) {
@@ -212,18 +239,18 @@ async function __wbg_load(module, imports) {
212
239
  function __wbg_get_imports() {
213
240
  const imports = {};
214
241
  imports.wbg = {};
215
- imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
216
- takeObject(arg0);
242
+ imports.wbg.__wbindgen_is_undefined = function(arg0) {
243
+ const ret = getObject(arg0) === undefined;
244
+ return ret;
217
245
  };
218
- imports.wbg.__wbg_constructor_311fc8beeab98bd6 = function(arg0) {
246
+ imports.wbg.__wbg_constructor_af0e51fc6fc179a6 = function(arg0) {
219
247
  const ret = new Error(takeObject(arg0));
220
248
  return addHeapObject(ret);
221
249
  };
222
- imports.wbg.__wbindgen_is_undefined = function(arg0) {
223
- const ret = getObject(arg0) === undefined;
224
- return ret;
250
+ imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
251
+ takeObject(arg0);
225
252
  };
226
- imports.wbg.__wbg_new_6699176386b67a04 = function() {
253
+ imports.wbg.__wbg_new_52c2273397b0b9e7 = function() {
227
254
  const ret = new Map();
228
255
  return addHeapObject(ret);
229
256
  };
@@ -278,7 +305,7 @@ function __wbg_get_imports() {
278
305
  const a = state0.a;
279
306
  state0.a = 0;
280
307
  try {
281
- return __wbg_adapter_26(a, state0.b, arg0, arg1);
308
+ return __wbg_adapter_27(a, state0.b, arg0, arg1);
282
309
  } finally {
283
310
  state0.a = a;
284
311
  }
Binary file
@@ -3,9 +3,10 @@
3
3
  export const memory: WebAssembly.Memory;
4
4
  export function abiEncode(a: number, b: number, c: number, d: number): void;
5
5
  export function abiDecode(a: number, b: number, c: number): void;
6
+ export function serializeWitness(a: number, b: number): void;
6
7
  export function __wbindgen_malloc(a: number): number;
7
8
  export function __wbindgen_realloc(a: number, b: number, c: number): number;
8
9
  export function __wbindgen_add_to_stack_pointer(a: number): number;
9
10
  export function __wbindgen_free(a: number, b: number): void;
10
- export function wasm_bindgen__convert__closures__invoke2_mut__h6cdb28bf0237c46b(a: number, b: number, c: number, d: number): void;
11
+ export function wasm_bindgen__convert__closures__invoke2_mut__h4cc254837aac6d0e(a: number, b: number, c: number, d: number): void;
11
12
  export function __wbindgen_exn_store(a: number): void;