@noir-lang/noirc_abi
Advanced tools
Comparing version 0.16.0 to 0.17.0-2f0b80d.nightly
@@ -10,3 +10,3 @@ /* tslint:disable */ | ||
export function __wbindgen_free(a: number, b: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h640c0c6add9d0132(a: number, b: number, c: number, d: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h345d08f7c40b28d9(a: number, b: number, c: number, d: number): void; | ||
export function __wbindgen_exn_store(a: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {any} abi | ||
* @param {any} inputs | ||
* @param {any} return_value | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
*/ | ||
export function abiEncode(abi: any, inputs: any, return_value: any): WitnessMap; | ||
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue): WitnessMap; | ||
/** | ||
* @param {any} abi | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
export function abiDecode(abi: any, witness_map: WitnessMap): any; | ||
export function abiDecode(abi: Abi, witness_map: WitnessMap): any; | ||
export type Field = string | number | boolean; | ||
export type InputValue = Field | Field[] | InputMap; | ||
export type InputMap = { [key: string]: InputValue }; | ||
export type Visibility = "public" | "private"; | ||
export type Sign = "unsigned" | "signed"; | ||
export type AbiType = | ||
{ kind: "field" } | | ||
{ kind: "boolean" } | | ||
{ kind: "string", length: number } | | ||
{ kind: "integer", sign: Sign, width: number } | | ||
{ kind: "array", length: number, type: AbiType } | | ||
{ kind: "tuple", fields: AbiType[] } | | ||
{ kind: "struct", path: string, fields: [string, AbiType][] }; | ||
export type AbiParameter = { | ||
name: string, | ||
type: AbiType, | ||
visibility: Visibility, | ||
}; | ||
export type Abi = { | ||
parameters: AbiParameter[], | ||
param_witnesses: Record<string, number[]>, | ||
return_type: AbiType | null, | ||
return_witnesses: number[], | ||
} | ||
// Map from witness index to hex string value of witness. | ||
@@ -18,0 +50,0 @@ export type WitnessMap = Map<number, string>; |
@@ -12,24 +12,2 @@ let imports = {}; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
let heap_next = heap.length; | ||
@@ -122,2 +100,24 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); | ||
@@ -132,5 +132,5 @@ | ||
/** | ||
* @param {any} abi | ||
* @param {any} inputs | ||
* @param {any} return_value | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
@@ -141,3 +141,3 @@ */ | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), addHeapObject(return_value)); | ||
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), isLikeNone(return_value) ? 0 : addHeapObject(return_value)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -156,3 +156,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
/** | ||
* @param {any} abi | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
@@ -177,4 +177,4 @@ * @returns {any} | ||
function __wbg_adapter_28(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h640c0c6add9d0132(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_26(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h345d08f7c40b28d9(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
@@ -190,9 +190,2 @@ | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
module.exports.__wbindgen_object_drop_ref = function(arg0) { | ||
@@ -202,3 +195,8 @@ takeObject(arg0); | ||
module.exports.__wbg_new_b88faf1d36aaeaaf = function() { | ||
module.exports.__wbg_constructor_8b80183f1e67730f = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
module.exports.__wbg_new_31288a3fdd8270cf = function() { | ||
const ret = new Map(); | ||
@@ -222,5 +220,7 @@ return addHeapObject(ret); | ||
module.exports.__wbg_constructor_ee715a20a6d6befb = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
module.exports.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
@@ -233,7 +233,2 @@ | ||
module.exports.__wbindgen_is_null = function(arg0) { | ||
const ret = getObject(arg0) === null; | ||
return ret; | ||
}; | ||
module.exports.__wbg_new_abda76e883ba8a5f = function() { | ||
@@ -276,3 +271,3 @@ const ret = new Error(); | ||
try { | ||
return __wbg_adapter_28(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_26(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -279,0 +274,0 @@ state0.a = a; |
@@ -6,3 +6,3 @@ { | ||
], | ||
"version": "0.16.0", | ||
"version": "0.17.0-2f0b80d.nightly", | ||
"license": "(MIT OR Apache-2.0)", | ||
@@ -30,4 +30,7 @@ "files": [ | ||
"clean": "chmod u+w web nodejs || true && rm -rf ./nodejs ./web ./target ./result", | ||
"publish": "yarn npm publish", | ||
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0" | ||
"nightly:version": "jq --arg new_version \"-$(git rev-parse --short HEAD)$1\" '.version = .version + $new_version' package.json > package-tmp.json && mv package-tmp.json package.json", | ||
"publish": "echo 📡 publishing `$npm_package_name` && yarn npm publish", | ||
"lint": "NODE_NO_WARNINGS=1 eslint . --ext .ts --ignore-path ./.eslintignore --max-warnings 0", | ||
"build:nix": "nix build -L .#noirc_abi_wasm", | ||
"install:from:nix": "yarn clean && yarn build:nix && cp -rL ./result/noirc_abi_wasm/nodejs ./ && cp -rL ./result/noirc_abi_wasm/web ./" | ||
}, | ||
@@ -39,3 +42,2 @@ "devDependencies": { | ||
"@web/test-runner-playwright": "^0.10.0", | ||
"@web/test-runner-webdriver": "^0.7.0", | ||
"eslint": "^8.50.0", | ||
@@ -42,0 +44,0 @@ "mocha": "^10.2.0" |
@@ -10,3 +10,3 @@ /* tslint:disable */ | ||
export function __wbindgen_free(a: number, b: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h640c0c6add9d0132(a: number, b: number, c: number, d: number): void; | ||
export function wasm_bindgen__convert__closures__invoke2_mut__h345d08f7c40b28d9(a: number, b: number, c: number, d: number): void; | ||
export function __wbindgen_exn_store(a: number): void; |
/* tslint:disable */ | ||
/* eslint-disable */ | ||
/** | ||
* @param {any} abi | ||
* @param {any} inputs | ||
* @param {any} return_value | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
*/ | ||
export function abiEncode(abi: any, inputs: any, return_value: any): WitnessMap; | ||
export function abiEncode(abi: Abi, inputs: InputMap, return_value?: InputValue): WitnessMap; | ||
/** | ||
* @param {any} abi | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
* @returns {any} | ||
*/ | ||
export function abiDecode(abi: any, witness_map: WitnessMap): any; | ||
export function abiDecode(abi: Abi, witness_map: WitnessMap): any; | ||
export type Field = string | number | boolean; | ||
export type InputValue = Field | Field[] | InputMap; | ||
export type InputMap = { [key: string]: InputValue }; | ||
export type Visibility = "public" | "private"; | ||
export type Sign = "unsigned" | "signed"; | ||
export type AbiType = | ||
{ kind: "field" } | | ||
{ kind: "boolean" } | | ||
{ kind: "string", length: number } | | ||
{ kind: "integer", sign: Sign, width: number } | | ||
{ kind: "array", length: number, type: AbiType } | | ||
{ kind: "tuple", fields: AbiType[] } | | ||
{ kind: "struct", path: string, fields: [string, AbiType][] }; | ||
export type AbiParameter = { | ||
name: string, | ||
type: AbiType, | ||
visibility: Visibility, | ||
}; | ||
export type Abi = { | ||
parameters: AbiParameter[], | ||
param_witnesses: Record<string, number[]>, | ||
return_type: AbiType | null, | ||
return_witnesses: number[], | ||
} | ||
// Map from witness index to hex string value of witness. | ||
@@ -36,3 +68,3 @@ export type WitnessMap = Map<number, string>; | ||
readonly __wbindgen_free: (a: number, b: number) => void; | ||
readonly wasm_bindgen__convert__closures__invoke2_mut__h640c0c6add9d0132: (a: number, b: number, c: number, d: number) => void; | ||
readonly wasm_bindgen__convert__closures__invoke2_mut__h345d08f7c40b28d9: (a: number, b: number, c: number, d: number) => void; | ||
readonly __wbindgen_exn_store: (a: number) => void; | ||
@@ -39,0 +71,0 @@ } |
@@ -9,24 +9,2 @@ let wasm; | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
let heap_next = heap.length; | ||
@@ -119,2 +97,24 @@ | ||
function isLikeNone(x) { | ||
return x === undefined || x === null; | ||
} | ||
let cachedInt32Memory0 = null; | ||
function getInt32Memory0() { | ||
if (cachedInt32Memory0 === null || cachedInt32Memory0.byteLength === 0) { | ||
cachedInt32Memory0 = new Int32Array(wasm.memory.buffer); | ||
} | ||
return cachedInt32Memory0; | ||
} | ||
let cachedFloat64Memory0 = null; | ||
function getFloat64Memory0() { | ||
if (cachedFloat64Memory0 === null || cachedFloat64Memory0.byteLength === 0) { | ||
cachedFloat64Memory0 = new Float64Array(wasm.memory.buffer); | ||
} | ||
return cachedFloat64Memory0; | ||
} | ||
const cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } ); | ||
@@ -129,5 +129,5 @@ | ||
/** | ||
* @param {any} abi | ||
* @param {any} inputs | ||
* @param {any} return_value | ||
* @param {Abi} abi | ||
* @param {InputMap} inputs | ||
* @param {InputValue | undefined} return_value | ||
* @returns {WitnessMap} | ||
@@ -138,3 +138,3 @@ */ | ||
const retptr = wasm.__wbindgen_add_to_stack_pointer(-16); | ||
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), addHeapObject(return_value)); | ||
wasm.abiEncode(retptr, addHeapObject(abi), addHeapObject(inputs), isLikeNone(return_value) ? 0 : addHeapObject(return_value)); | ||
var r0 = getInt32Memory0()[retptr / 4 + 0]; | ||
@@ -153,3 +153,3 @@ var r1 = getInt32Memory0()[retptr / 4 + 1]; | ||
/** | ||
* @param {any} abi | ||
* @param {Abi} abi | ||
* @param {WitnessMap} witness_map | ||
@@ -174,4 +174,4 @@ * @returns {any} | ||
function __wbg_adapter_28(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h640c0c6add9d0132(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
function __wbg_adapter_26(arg0, arg1, arg2, arg3) { | ||
wasm.wasm_bindgen__convert__closures__invoke2_mut__h345d08f7c40b28d9(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3)); | ||
} | ||
@@ -221,12 +221,10 @@ | ||
imports.wbg = {}; | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
imports.wbg.__wbindgen_object_drop_ref = function(arg0) { | ||
takeObject(arg0); | ||
}; | ||
imports.wbg.__wbg_new_b88faf1d36aaeaaf = function() { | ||
imports.wbg.__wbg_constructor_8b80183f1e67730f = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_new_31288a3fdd8270cf = function() { | ||
const ret = new Map(); | ||
@@ -247,5 +245,7 @@ return addHeapObject(ret); | ||
}; | ||
imports.wbg.__wbg_constructor_ee715a20a6d6befb = function(arg0) { | ||
const ret = new Error(takeObject(arg0)); | ||
return addHeapObject(ret); | ||
imports.wbg.__wbindgen_number_get = function(arg0, arg1) { | ||
const obj = getObject(arg1); | ||
const ret = typeof(obj) === 'number' ? obj : undefined; | ||
getFloat64Memory0()[arg0 / 8 + 1] = isLikeNone(ret) ? 0 : ret; | ||
getInt32Memory0()[arg0 / 4 + 0] = !isLikeNone(ret); | ||
}; | ||
@@ -256,6 +256,2 @@ imports.wbg.__wbindgen_is_undefined = function(arg0) { | ||
}; | ||
imports.wbg.__wbindgen_is_null = function(arg0) { | ||
const ret = getObject(arg0) === null; | ||
return ret; | ||
}; | ||
imports.wbg.__wbg_new_abda76e883ba8a5f = function() { | ||
@@ -294,3 +290,3 @@ const ret = new Error(); | ||
try { | ||
return __wbg_adapter_28(a, state0.b, arg0, arg1); | ||
return __wbg_adapter_26(a, state0.b, arg0, arg1); | ||
} finally { | ||
@@ -297,0 +293,0 @@ state0.a = a; |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
858638
6
684