@noir-lang/noirc_abi 0.18.0 → 0.19.0-e5a1f78.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 +7 -7
- package/nodejs/noirc_abi_wasm.js +25 -25
- package/nodejs/noirc_abi_wasm_bg.wasm +0 -0
- package/nodejs/noirc_abi_wasm_bg.wasm.d.ts +1 -1
- package/package.json +1 -1
- package/web/noirc_abi_wasm.d.ts +8 -8
- package/web/noirc_abi_wasm.js +23 -23
- package/web/noirc_abi_wasm_bg.wasm +0 -0
- package/web/noirc_abi_wasm_bg.wasm.d.ts +1 -1
|
@@ -14,6 +14,11 @@ export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue)
|
|
|
14
14
|
*/
|
|
15
15
|
export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
|
|
16
16
|
|
|
17
|
+
// Map from witness index to hex string value of witness.
|
|
18
|
+
export type WitnessMap = Map<number, string>;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
export type Field = string | number | boolean;
|
|
18
23
|
export type InputValue = Field | Field[] | InputMap;
|
|
19
24
|
export type InputMap = { [key: string]: InputValue };
|
|
@@ -30,7 +35,7 @@ export type AbiType =
|
|
|
30
35
|
{ kind: "array", length: number, type: AbiType } |
|
|
31
36
|
{ kind: "tuple", fields: AbiType[] } |
|
|
32
37
|
{ kind: "struct", path: string, fields: [string, AbiType][] };
|
|
33
|
-
|
|
38
|
+
|
|
34
39
|
export type AbiParameter = {
|
|
35
40
|
name: string,
|
|
36
41
|
type: AbiType,
|
|
@@ -39,18 +44,13 @@ export type AbiParameter = {
|
|
|
39
44
|
|
|
40
45
|
export type Abi = {
|
|
41
46
|
parameters: AbiParameter[],
|
|
42
|
-
param_witnesses: Record<string, number[]>,
|
|
47
|
+
param_witnesses: Record<string, {start: number, end: number}[]>,
|
|
43
48
|
return_type: AbiType | null,
|
|
44
49
|
return_witnesses: number[],
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
|
|
48
53
|
|
|
49
|
-
// Map from witness index to hex string value of witness.
|
|
50
|
-
export type WitnessMap = Map<number, string>;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
54
|
export type ABIError = Error;
|
|
55
55
|
|
|
56
56
|
|
package/nodejs/noirc_abi_wasm.js
CHANGED
|
@@ -23,6 +23,15 @@ 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
|
+
|
|
26
35
|
function isLikeNone(x) {
|
|
27
36
|
return x === undefined || x === null;
|
|
28
37
|
}
|
|
@@ -45,15 +54,6 @@ function getInt32Memory0() {
|
|
|
45
54
|
return cachedInt32Memory0;
|
|
46
55
|
}
|
|
47
56
|
|
|
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
57
|
let WASM_VECTOR_LEN = 0;
|
|
58
58
|
|
|
59
59
|
let cachedUint8Memory0 = null;
|
|
@@ -170,7 +170,7 @@ module.exports.abiDecode = function(abi, witness_map) {
|
|
|
170
170
|
};
|
|
171
171
|
|
|
172
172
|
function __wbg_adapter_26(arg0, arg1, arg2, arg3) {
|
|
173
|
-
wasm.
|
|
173
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__hb71d0e9d93bb5497(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
174
174
|
}
|
|
175
175
|
|
|
176
176
|
function handleError(f, args) {
|
|
@@ -181,12 +181,22 @@ function handleError(f, args) {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
|
|
184
|
+
module.exports.__wbindgen_is_undefined = function(arg0) {
|
|
185
|
+
const ret = getObject(arg0) === undefined;
|
|
186
|
+
return ret;
|
|
187
|
+
};
|
|
188
|
+
|
|
184
189
|
module.exports.__wbindgen_object_drop_ref = function(arg0) {
|
|
185
190
|
takeObject(arg0);
|
|
186
191
|
};
|
|
187
192
|
|
|
188
|
-
module.exports.
|
|
189
|
-
const ret = new
|
|
193
|
+
module.exports.__wbg_new_7eda00598b2a27a7 = function() {
|
|
194
|
+
const ret = new Map();
|
|
195
|
+
return addHeapObject(ret);
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
module.exports.__wbindgen_number_new = function(arg0) {
|
|
199
|
+
const ret = arg0;
|
|
190
200
|
return addHeapObject(ret);
|
|
191
201
|
};
|
|
192
202
|
|
|
@@ -197,16 +207,6 @@ module.exports.__wbindgen_number_get = function(arg0, arg1) {
|
|
|
197
207
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
198
208
|
};
|
|
199
209
|
|
|
200
|
-
module.exports.__wbg_new_dfafeb8d771fdf1a = function() {
|
|
201
|
-
const ret = new Map();
|
|
202
|
-
return addHeapObject(ret);
|
|
203
|
-
};
|
|
204
|
-
|
|
205
|
-
module.exports.__wbindgen_number_new = function(arg0) {
|
|
206
|
-
const ret = arg0;
|
|
207
|
-
return addHeapObject(ret);
|
|
208
|
-
};
|
|
209
|
-
|
|
210
210
|
module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
211
211
|
const obj = getObject(arg1);
|
|
212
212
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -216,9 +216,9 @@ module.exports.__wbindgen_string_get = function(arg0, arg1) {
|
|
|
216
216
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
217
217
|
};
|
|
218
218
|
|
|
219
|
-
module.exports.
|
|
220
|
-
const ret =
|
|
221
|
-
return ret;
|
|
219
|
+
module.exports.__wbg_constructor_ae68cc6e1c98bfd5 = function(arg0) {
|
|
220
|
+
const ret = new Error(takeObject(arg0));
|
|
221
|
+
return addHeapObject(ret);
|
|
222
222
|
};
|
|
223
223
|
|
|
224
224
|
module.exports.__wbg_new_abda76e883ba8a5f = function() {
|
|
Binary file
|
|
@@ -7,5 +7,5 @@ export function __wbindgen_malloc(a: number): number;
|
|
|
7
7
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
8
8
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
9
9
|
export function __wbindgen_free(a: number, b: number): void;
|
|
10
|
-
export function
|
|
10
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__hb71d0e9d93bb5497(a: number, b: number, c: number, d: number): void;
|
|
11
11
|
export function __wbindgen_exn_store(a: number): void;
|
package/package.json
CHANGED
package/web/noirc_abi_wasm.d.ts
CHANGED
|
@@ -14,6 +14,11 @@ export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue)
|
|
|
14
14
|
*/
|
|
15
15
|
export function abiDecode(abi: Abi, witness_map: WitnessMap): any;
|
|
16
16
|
|
|
17
|
+
// Map from witness index to hex string value of witness.
|
|
18
|
+
export type WitnessMap = Map<number, string>;
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
17
22
|
export type Field = string | number | boolean;
|
|
18
23
|
export type InputValue = Field | Field[] | InputMap;
|
|
19
24
|
export type InputMap = { [key: string]: InputValue };
|
|
@@ -30,7 +35,7 @@ export type AbiType =
|
|
|
30
35
|
{ kind: "array", length: number, type: AbiType } |
|
|
31
36
|
{ kind: "tuple", fields: AbiType[] } |
|
|
32
37
|
{ kind: "struct", path: string, fields: [string, AbiType][] };
|
|
33
|
-
|
|
38
|
+
|
|
34
39
|
export type AbiParameter = {
|
|
35
40
|
name: string,
|
|
36
41
|
type: AbiType,
|
|
@@ -39,18 +44,13 @@ export type AbiParameter = {
|
|
|
39
44
|
|
|
40
45
|
export type Abi = {
|
|
41
46
|
parameters: AbiParameter[],
|
|
42
|
-
param_witnesses: Record<string, number[]>,
|
|
47
|
+
param_witnesses: Record<string, {start: number, end: number}[]>,
|
|
43
48
|
return_type: AbiType | null,
|
|
44
49
|
return_witnesses: number[],
|
|
45
50
|
}
|
|
46
51
|
|
|
47
52
|
|
|
48
53
|
|
|
49
|
-
// Map from witness index to hex string value of witness.
|
|
50
|
-
export type WitnessMap = Map<number, string>;
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
54
|
export type ABIError = Error;
|
|
55
55
|
|
|
56
56
|
|
|
@@ -65,7 +65,7 @@ export interface InitOutput {
|
|
|
65
65
|
readonly __wbindgen_realloc: (a: number, b: number, c: number) => number;
|
|
66
66
|
readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
|
|
67
67
|
readonly __wbindgen_free: (a: number, b: number) => void;
|
|
68
|
-
readonly
|
|
68
|
+
readonly wasm_bindgen__convert__closures__invoke2_mut__hb71d0e9d93bb5497: (a: number, b: number, c: number, d: number) => void;
|
|
69
69
|
readonly __wbindgen_exn_store: (a: number) => void;
|
|
70
70
|
}
|
|
71
71
|
|
package/web/noirc_abi_wasm.js
CHANGED
|
@@ -20,6 +20,15 @@ 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
|
+
|
|
23
32
|
function isLikeNone(x) {
|
|
24
33
|
return x === undefined || x === null;
|
|
25
34
|
}
|
|
@@ -42,15 +51,6 @@ function getInt32Memory0() {
|
|
|
42
51
|
return cachedInt32Memory0;
|
|
43
52
|
}
|
|
44
53
|
|
|
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
54
|
let WASM_VECTOR_LEN = 0;
|
|
55
55
|
|
|
56
56
|
let cachedUint8Memory0 = null;
|
|
@@ -167,7 +167,7 @@ export function abiDecode(abi, witness_map) {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
function __wbg_adapter_26(arg0, arg1, arg2, arg3) {
|
|
170
|
-
wasm.
|
|
170
|
+
wasm.wasm_bindgen__convert__closures__invoke2_mut__hb71d0e9d93bb5497(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));
|
|
171
171
|
}
|
|
172
172
|
|
|
173
173
|
function handleError(f, args) {
|
|
@@ -212,11 +212,19 @@ async function __wbg_load(module, imports) {
|
|
|
212
212
|
function __wbg_get_imports() {
|
|
213
213
|
const imports = {};
|
|
214
214
|
imports.wbg = {};
|
|
215
|
+
imports.wbg.__wbindgen_is_undefined = function(arg0) {
|
|
216
|
+
const ret = getObject(arg0) === undefined;
|
|
217
|
+
return ret;
|
|
218
|
+
};
|
|
215
219
|
imports.wbg.__wbindgen_object_drop_ref = function(arg0) {
|
|
216
220
|
takeObject(arg0);
|
|
217
221
|
};
|
|
218
|
-
imports.wbg.
|
|
219
|
-
const ret = new
|
|
222
|
+
imports.wbg.__wbg_new_7eda00598b2a27a7 = function() {
|
|
223
|
+
const ret = new Map();
|
|
224
|
+
return addHeapObject(ret);
|
|
225
|
+
};
|
|
226
|
+
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
227
|
+
const ret = arg0;
|
|
220
228
|
return addHeapObject(ret);
|
|
221
229
|
};
|
|
222
230
|
imports.wbg.__wbindgen_number_get = function(arg0, arg1) {
|
|
@@ -225,14 +233,6 @@ function __wbg_get_imports() {
|
|
|
225
233
|
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret;
|
|
226
234
|
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret);
|
|
227
235
|
};
|
|
228
|
-
imports.wbg.__wbg_new_dfafeb8d771fdf1a = function() {
|
|
229
|
-
const ret = new Map();
|
|
230
|
-
return addHeapObject(ret);
|
|
231
|
-
};
|
|
232
|
-
imports.wbg.__wbindgen_number_new = function(arg0) {
|
|
233
|
-
const ret = arg0;
|
|
234
|
-
return addHeapObject(ret);
|
|
235
|
-
};
|
|
236
236
|
imports.wbg.__wbindgen_string_get = function(arg0, arg1) {
|
|
237
237
|
const obj = getObject(arg1);
|
|
238
238
|
const ret = typeof(obj) === 'string' ? obj : undefined;
|
|
@@ -241,9 +241,9 @@ function __wbg_get_imports() {
|
|
|
241
241
|
getInt32Memory0()[arg0 / 4 + 1] = len1;
|
|
242
242
|
getInt32Memory0()[arg0 / 4 + 0] = ptr1;
|
|
243
243
|
};
|
|
244
|
-
imports.wbg.
|
|
245
|
-
const ret =
|
|
246
|
-
return ret;
|
|
244
|
+
imports.wbg.__wbg_constructor_ae68cc6e1c98bfd5 = function(arg0) {
|
|
245
|
+
const ret = new Error(takeObject(arg0));
|
|
246
|
+
return addHeapObject(ret);
|
|
247
247
|
};
|
|
248
248
|
imports.wbg.__wbg_new_abda76e883ba8a5f = function() {
|
|
249
249
|
const ret = new Error();
|
|
Binary file
|
|
@@ -7,5 +7,5 @@ export function __wbindgen_malloc(a: number): number;
|
|
|
7
7
|
export function __wbindgen_realloc(a: number, b: number, c: number): number;
|
|
8
8
|
export function __wbindgen_add_to_stack_pointer(a: number): number;
|
|
9
9
|
export function __wbindgen_free(a: number, b: number): void;
|
|
10
|
-
export function
|
|
10
|
+
export function wasm_bindgen__convert__closures__invoke2_mut__hb71d0e9d93bb5497(a: number, b: number, c: number, d: number): void;
|
|
11
11
|
export function __wbindgen_exn_store(a: number): void;
|