@noir-lang/noirc_abi 0.29.0 → 0.30.0-2e543b4.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.
- package/nodejs/noirc_abi_wasm.d.ts +9 -3
- package/nodejs/noirc_abi_wasm.js +58 -37
- package/nodejs/noirc_abi_wasm_bg.wasm +0 -0
- package/nodejs/noirc_abi_wasm_bg.wasm.d.ts +2 -1
- package/package.json +2 -2
- package/web/noirc_abi_wasm.d.ts +11 -4
- package/web/noirc_abi_wasm.js +53 -32
- package/web/noirc_abi_wasm_bg.wasm +0 -0
- package/web/noirc_abi_wasm_bg.wasm.d.ts +2 -1
|
@@ -18,12 +18,18 @@ export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
|
|
|
18
18
|
* @returns {Uint8Array}
|
|
19
19
|
*/
|
|
20
20
|
export function serializeWitness(witness_map: WitnessMap): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* @param {Abi} abi
|
|
23
|
+
* @param {RawAssertionPayload} raw_error
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
export function abiDecodeError(abi: Abi, raw_error: RawAssertionPayload): any;
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
29
|
+
export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
23
30
|
|
|
24
31
|
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
|
|
33
|
+
export type ABIError = Error;
|
|
28
34
|
|
|
29
35
|
|
package/nodejs/noirc_abi_wasm.js
CHANGED
|
@@ -23,15 +23,6 @@ function takeObject(idx) {
|
|
|
23
23
|
return ret;
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
function addHeapObject(obj) {
|
|
27
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
28
|
-
const idx = heap_next;
|
|
29
|
-
heap_next = heap[idx];
|
|
30
|
-
|
|
31
|
-
heap[idx] = obj;
|
|
32
|
-
return idx;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
26
|
function isLikeNone(x) {
|
|
36
27
|
return x === undefined || x === null;
|
|
37
28
|
}
|
|
@@ -118,6 +109,15 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
118
109
|
return ptr;
|
|
119
110
|
}
|
|
120
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
|
+
|
|
121
121
|
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
|
|
122
122
|
|
|
123
123
|
cachedTextDecoder.decode();
|
|
@@ -196,8 +196,29 @@ module.exports.serializeWitness = function(witness_map) {
|
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
198
|
|
|
199
|
-
|
|
200
|
-
|
|
199
|
+
/**
|
|
200
|
+
* @param {Abi} abi
|
|
201
|
+
* @param {RawAssertionPayload} raw_error
|
|
202
|
+
* @returns {any}
|
|
203
|
+
*/
|
|
204
|
+
module.exports.abiDecodeError = function(abi, raw_error) {
|
|
205
|
+
try {
|
|
206
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
207
|
+
wasm.abiDecodeError(retptr, addHeapObject(abi), addHeapObject(raw_error));
|
|
208
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
209
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
210
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
211
|
+
if (r2) {
|
|
212
|
+
throw takeObject(r1);
|
|
213
|
+
}
|
|
214
|
+
return takeObject(r0);
|
|
215
|
+
} finally {
|
|
216
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
217
|
+
}
|
|
218
|
+
};
|
|
219
|
+
|
|
220
|
+
function __wbg_adapter_28(arg0, arg1, arg2, arg3) {
|
|
221
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4f071862a34e940e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
201
222
|
}
|
|
202
223
|
|
|
203
224
|
function handleError(f, args) {
|
|
@@ -208,30 +229,10 @@ function handleError(f, args) {
|
|
|
208
229
|
}
|
|
209
230
|
}
|
|
210
231
|
|
|
211
|
-
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
212
|
-
const ret = getObject(arg0) === undefined;
|
|
213
|
-
return ret;
|
|
214
|
-
};
|
|
215
|
-
|
|
216
|
-
module.exports.__wbg_constructor_31b8021c87529775 = function(arg0) {
|
|
217
|
-
const ret = new Error(takeObject(arg0));
|
|
218
|
-
return addHeapObject(ret);
|
|
219
|
-
};
|
|
220
|
-
|
|
221
232
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
222
233
|
takeObject(arg0);
|
|
223
234
|
};
|
|
224
235
|
|
|
225
|
-
module.exports.__wbg_new_28eb792b86f6c6a5 = function() {
|
|
226
|
-
const ret = new Map();
|
|
227
|
-
return addHeapObject(ret);
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
module.exports.__wbindgen_number_new = function(arg0) {
|
|
231
|
-
const ret = arg0;
|
|
232
|
-
return addHeapObject(ret);
|
|
233
|
-
};
|
|
234
|
-
|
|
235
236
|
module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
236
237
|
const obj = getObject(arg1);
|
|
237
238
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
@@ -248,6 +249,31 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
248
249
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
249
250
|
};
|
|
250
251
|
|
|
252
|
+
module.exports.__wbg_constructor_f316a911c89e6ad1 = function(arg0) {
|
|
253
|
+
const ret = new Error(takeObject(arg0));
|
|
254
|
+
return addHeapObject(ret);
|
|
255
|
+
};
|
|
256
|
+
|
|
257
|
+
module.exports.__wbg_new_c532f61074fa67e0 = function() {
|
|
258
|
+
const ret = new Map();
|
|
259
|
+
return addHeapObject(ret);
|
|
260
|
+
};
|
|
261
|
+
|
|
262
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
|
263
|
+
const ret = arg0;
|
|
264
|
+
return addHeapObject(ret);
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
268
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
269
|
+
return addHeapObject(ret);
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
273
|
+
const ret = getObject(arg0) === undefined;
|
|
274
|
+
return ret;
|
|
275
|
+
};
|
|
276
|
+
|
|
251
277
|
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
252
278
|
const ret = new Error();
|
|
253
279
|
return addHeapObject(ret);
|
|
@@ -273,11 +299,6 @@ module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
|
|
|
273
299
|
}
|
|
274
300
|
};
|
|
275
301
|
|
|
276
|
-
module.exports.__wbindgen_string_new = function(arg0, arg1) {
|
|
277
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
278
|
-
return addHeapObject(ret);
|
|
279
|
-
};
|
|
280
|
-
|
|
281
302
|
module.exports.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) {
|
|
282
303
|
try {
|
|
283
304
|
var state0 = {a: arg1, b: arg2};
|
|
@@ -285,7 +306,7 @@ module.exports.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) {
|
|
|
285
306
|
const a = state0.a;
|
|
286
307
|
state0.a = 0;
|
|
287
308
|
try {
|
|
288
|
-
return
|
|
309
|
+
return __wbg_adapter_28(a, state0.b, arg0, arg1);
|
|
289
310
|
} finally {
|
|
290
311
|
state0.a = a;
|
|
291
312
|
}
|
|
Binary file
|
|
@@ -4,9 +4,10 @@ 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
6
|
export function serializeWitness(a: number, b: number): void;
|
|
7
|
+
export function abiDecodeError(a: number, b: number, c: number): void;
|
|
7
8
|
export function __wbindgen_malloc(a: number): number;
|
|
8
9
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
9
10
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
10
11
|
export function __wbindgen_free(a: number, b: number): void;
|
|
11
|
-
export function
|
|
12
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h4f071862a34e940e(a: number, b: number, c: number, d: number): void;
|
|
12
13
|
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.
|
|
6
|
+
"version": "0.30.0-2e543b4.nightly",
|
|
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.
|
|
39
|
+
"@noir-lang/types": "0.30.0-2e543b4.nightly"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@esm-bundle/chai": "^4.3.4-fix.0",
|
package/web/noirc_abi_wasm.d.ts
CHANGED
|
@@ -18,13 +18,19 @@ export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
|
|
|
18
18
|
* @returns {Uint8Array}
|
|
19
19
|
*/
|
|
20
20
|
export function serializeWitness(witness_map: WitnessMap): Uint8Array;
|
|
21
|
+
/**
|
|
22
|
+
* @param {Abi} abi
|
|
23
|
+
* @param {RawAssertionPayload} raw_error
|
|
24
|
+
* @returns {any}
|
|
25
|
+
*/
|
|
26
|
+
export function abiDecodeError(abi: Abi, raw_error: RawAssertionPayload): any;
|
|
21
27
|
|
|
22
|
-
|
|
28
|
+
import { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
29
|
+
export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap, RawAssertionPayload } from "@noir-lang/types";
|
|
23
30
|
|
|
24
31
|
|
|
25
32
|
|
|
26
|
-
|
|
27
|
-
export { Field, InputValue, InputMap, Visibility, Sign, AbiType, AbiParameter, Abi, WitnessMap } from "@noir-lang/types";
|
|
33
|
+
export type ABIError = Error;
|
|
28
34
|
|
|
29
35
|
|
|
30
36
|
|
|
@@ -35,11 +41,12 @@ export interface InitOutput {
|
|
|
35
41
|
readonly abiEncode: (a: number, b: number, c: number, d: number) => void;
|
|
36
42
|
readonly abiDecode: (a: number, b: number, c: number) => void;
|
|
37
43
|
readonly serializeWitness: (a: number, b: number) => void;
|
|
44
|
+
readonly abiDecodeError: (a: number, b: number, c: number) => void;
|
|
38
45
|
readonly __wbindgen_malloc: (a: number) => number;
|
|
39
46
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
40
47
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
41
48
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
42
|
-
readonly
|
|
49
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__h4f071862a34e940e: (a: number, b: number, c: number, d: number) => void;
|
|
43
50
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
44
51
|
}
|
|
45
52
|
|
package/web/noirc_abi_wasm.js
CHANGED
|
@@ -20,15 +20,6 @@ function takeObject(idx) {
|
|
|
20
20
|
return ret;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
-
function addHeapObject(obj) {
|
|
24
|
-
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
25
|
-
const idx = heap_next;
|
|
26
|
-
heap_next = heap[idx];
|
|
27
|
-
|
|
28
|
-
heap[idx] = obj;
|
|
29
|
-
return idx;
|
|
30
|
-
}
|
|
31
|
-
|
|
32
23
|
function isLikeNone(x) {
|
|
33
24
|
return x === undefined || x === null;
|
|
34
25
|
}
|
|
@@ -115,6 +106,15 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
115
106
|
return ptr;
|
|
116
107
|
}
|
|
117
108
|
|
|
109
|
+
function addHeapObject(obj) {
|
|
110
|
+
if (heap_next === heap.length) heap.push(heap.length + 1);
|
|
111
|
+
const idx = heap_next;
|
|
112
|
+
heap_next = heap[idx];
|
|
113
|
+
|
|
114
|
+
heap[idx] = obj;
|
|
115
|
+
return idx;
|
|
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(); };
|
|
@@ -193,8 +193,29 @@ export function serializeWitness(witness_map) {
|
|
|
193
193
|
}
|
|
194
194
|
}
|
|
195
195
|
|
|
196
|
-
|
|
197
|
-
|
|
196
|
+
/**
|
|
197
|
+
* @param {Abi} abi
|
|
198
|
+
* @param {RawAssertionPayload} raw_error
|
|
199
|
+
* @returns {any}
|
|
200
|
+
*/
|
|
201
|
+
export function abiDecodeError(abi, raw_error) {
|
|
202
|
+
try {
|
|
203
|
+
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
|
|
204
|
+
wasm.abiDecodeError(retptr, addHeapObject(abi), addHeapObject(raw_error));
|
|
205
|
+
var r0 = getInt32Memory0()[retptr / 4 + 0];
|
|
206
|
+
var r1 = getInt32Memory0()[retptr / 4 + 1];
|
|
207
|
+
var r2 = getInt32Memory0()[retptr / 4 + 2];
|
|
208
|
+
if (r2) {
|
|
209
|
+
throw takeObject(r1);
|
|
210
|
+
}
|
|
211
|
+
return takeObject(r0);
|
|
212
|
+
} finally {
|
|
213
|
+
wasm.__wbindgen_add_to_stack_pointer(16);
|
|
214
|
+
}
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
function __wbg_adapter_28(arg0, arg1, arg2, arg3) {
|
|
218
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__h4f071862a34e940e(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
198
219
|
}
|
|
199
220
|
|
|
200
221
|
function handleError(f, args) {
|
|
@@ -239,25 +260,9 @@ async function __wbg_load(module, imports) {
|
|
|
239
260
|
function __wbg_get_imports() {
|
|
240
261
|
const imports = {};
|
|
241
262
|
imports.wbg = {};
|
|
242
|
-
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
243
|
-
const ret = getObject(arg0) === undefined;
|
|
244
|
-
return ret;
|
|
245
|
-
};
|
|
246
|
-
imports.wbg.__wbg_constructor_31b8021c87529775 = function(arg0) {
|
|
247
|
-
const ret = new Error(takeObject(arg0));
|
|
248
|
-
return addHeapObject(ret);
|
|
249
|
-
};
|
|
250
263
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
251
264
|
takeObject(arg0);
|
|
252
265
|
};
|
|
253
|
-
imports.wbg.__wbg_new_28eb792b86f6c6a5 = function() {
|
|
254
|
-
const ret = new Map();
|
|
255
|
-
return addHeapObject(ret);
|
|
256
|
-
};
|
|
257
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
258
|
-
const ret = arg0;
|
|
259
|
-
return addHeapObject(ret);
|
|
260
|
-
};
|
|
261
266
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
262
267
|
const obj = getObject(arg1);
|
|
263
268
|
const ret = typeof(obj) === 'number' ? obj : undefined;
|
|
@@ -272,6 +277,26 @@ function __wbg_get_imports() {
|
|
|
272
277
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
273
278
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
274
279
|
};
|
|
280
|
+
imports.wbg.__wbg_constructor_f316a911c89e6ad1 = function(arg0) {
|
|
281
|
+
const ret = new Error(takeObject(arg0));
|
|
282
|
+
return addHeapObject(ret);
|
|
283
|
+
};
|
|
284
|
+
imports.wbg.__wbg_new_c532f61074fa67e0 = function() {
|
|
285
|
+
const ret = new Map();
|
|
286
|
+
return addHeapObject(ret);
|
|
287
|
+
};
|
|
288
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
289
|
+
const ret = arg0;
|
|
290
|
+
return addHeapObject(ret);
|
|
291
|
+
};
|
|
292
|
+
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
293
|
+
const ret = getStringFromWasm0(arg0, arg1);
|
|
294
|
+
return addHeapObject(ret);
|
|
295
|
+
};
|
|
296
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
297
|
+
const ret = getObject(arg0) === undefined;
|
|
298
|
+
return ret;
|
|
299
|
+
};
|
|
275
300
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
276
301
|
const ret = new Error();
|
|
277
302
|
return addHeapObject(ret);
|
|
@@ -294,10 +319,6 @@ function __wbg_get_imports() {
|
|
|
294
319
|
wasm.__wbindgen_free(deferred0_0, deferred0_1);
|
|
295
320
|
}
|
|
296
321
|
};
|
|
297
|
-
imports.wbg.__wbindgen_string_new = function(arg0, arg1) {
|
|
298
|
-
const ret = getStringFromWasm0(arg0, arg1);
|
|
299
|
-
return addHeapObject(ret);
|
|
300
|
-
};
|
|
301
322
|
imports.wbg.__wbg_forEach_942772130a8d06a6 = function(arg0, arg1, arg2) {
|
|
302
323
|
try {
|
|
303
324
|
var state0 = {a: arg1, b: arg2};
|
|
@@ -305,7 +326,7 @@ function __wbg_get_imports() {
|
|
|
305
326
|
const a = state0.a;
|
|
306
327
|
state0.a = 0;
|
|
307
328
|
try {
|
|
308
|
-
return
|
|
329
|
+
return __wbg_adapter_28(a, state0.b, arg0, arg1);
|
|
309
330
|
} finally {
|
|
310
331
|
state0.a = a;
|
|
311
332
|
}
|
|
Binary file
|
|
@@ -4,9 +4,10 @@ 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
6
|
export function serializeWitness(a: number, b: number): void;
|
|
7
|
+
export function abiDecodeError(a: number, b: number, c: number): void;
|
|
7
8
|
export function __wbindgen_malloc(a: number): number;
|
|
8
9
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
9
10
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
10
11
|
export function __wbindgen_free(a: number, b: number): void;
|
|
11
|
-
export function
|
|
12
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__h4f071862a34e940e(a: number, b: number, c: number, d: number): void;
|
|
12
13
|
export function __wbindgen_exn_store(a: number): void;
|