diff --git a/bundler/wasm_bg.js b/bundler/wasm_bg.js index b1e91bb8..eb565aae 100644 --- a/bundler/wasm_bg.js +++ b/bundler/wasm_bg.js @@ -4,6 +4,26 @@ export function __wbg_set_wasm(val) { } +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); @@ -23,12 +43,6 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } -const heap = new Array(128).fill(undefined); - -heap.push(undefined, null, true, false); - -let heap_next = heap.length; - function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); const idx = heap_next; @@ -38,8 +52,6 @@ function addHeapObject(obj) { return idx; } -function getObject(idx) { return heap[idx]; } - let WASM_VECTOR_LEN = 0; const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; @@ -106,18 +118,6 @@ function getInt32Memory0() { return cachedInt32Memory0; } -function dropObject(idx) { - if (idx < 132) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - function debugString(val) { // primitive types const type = typeof val; @@ -3817,8 +3817,12 @@ export class ZorroScalar { } } -export function __wbindgen_json_parse(arg0, arg1) { - const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); +export function __wbindgen_object_drop_ref(arg0) { + takeObject(arg0); +}; + +export function __wbindgen_string_new(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }; @@ -3831,17 +3835,8 @@ export function __wbindgen_json_serialize(arg0, arg1) { getInt32Memory0()[arg0 / 4 + 0] = ptr0; }; -export function __wbindgen_object_drop_ref(arg0) { - takeObject(arg0); -}; - -export function __wbindgen_string_new(arg0, arg1) { - const ret = getStringFromWasm0(arg0, arg1); - return addHeapObject(ret); -}; - -export function __wbindgen_object_clone_ref(arg0) { - const ret = getObject(arg0); +export function __wbindgen_json_parse(arg0, arg1) { + const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }; @@ -3850,15 +3845,12 @@ export function __wbg_now_c644db5194be8437(arg0) { return ret; }; -export function __wbg_getRandomValues_37fa2ca9e4e07fab() { return handleError(function (arg0, arg1) { - getObject(arg0).getRandomValues(getObject(arg1)); -}, arguments) }; - -export function __wbg_randomFillSync_dc1e9a60c158336d() { return handleError(function (arg0, arg1) { - getObject(arg0).randomFillSync(takeObject(arg1)); -}, arguments) }; +export function __wbindgen_object_clone_ref(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); +}; -export function __wbg_crypto_c48a774b022d20ac(arg0) { +export function __wbg_crypto_d05b68a3572bb8ca(arg0) { const ret = getObject(arg0).crypto; return addHeapObject(ret); }; @@ -3869,17 +3861,17 @@ export function __wbindgen_is_object(arg0) { return ret; }; -export function __wbg_process_298734cf255a885d(arg0) { +export function __wbg_process_b02b3570280d0366(arg0) { const ret = getObject(arg0).process; return addHeapObject(ret); }; -export function __wbg_versions_e2e78e134e3e5d01(arg0) { +export function __wbg_versions_c1cb42213cedf0f5(arg0) { const ret = getObject(arg0).versions; return addHeapObject(ret); }; -export function __wbg_node_1cd7a5d853dbea79(arg0) { +export function __wbg_node_43b1089f407e4ec2(arg0) { const ret = getObject(arg0).node; return addHeapObject(ret); }; @@ -3889,12 +3881,12 @@ export function __wbindgen_is_string(arg0) { return ret; }; -export function __wbg_msCrypto_bcb970640f50a1e8(arg0) { +export function __wbg_msCrypto_10fc94afee92bd76(arg0) { const ret = getObject(arg0).msCrypto; return addHeapObject(ret); }; -export function __wbg_require_8f08ceecec0f4fee() { return handleError(function () { +export function __wbg_require_9a7e0f667ead4995() { return handleError(function () { const ret = module.require; return addHeapObject(ret); }, arguments) }; @@ -3904,13 +3896,13 @@ export function __wbindgen_is_function(arg0) { return ret; }; -export function __wbg_randomFillSync_85b3f4c52c56c313(arg0, arg1, arg2) { - getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); -}; +export function __wbg_randomFillSync_b70ccbdf4926a99d() { return handleError(function (arg0, arg1) { + getObject(arg0).randomFillSync(takeObject(arg1)); +}, arguments) }; -export function __wbg_getRandomValues_cd175915511f705e(arg0, arg1) { +export function __wbg_getRandomValues_7e42b4fb8779dc6d() { return handleError(function (arg0, arg1) { getObject(arg0).getRandomValues(getObject(arg1)); -}; +}, arguments) }; export function __wbg_self_7eede1f4488bf346() { return handleError(function () { const ret = self.self; @@ -3947,6 +3939,14 @@ export function __wbg_getRandomValues_307049345d0bd88c(arg0) { return addHeapObject(ret); }; +export function __wbg_getRandomValues_cd175915511f705e(arg0, arg1) { + getObject(arg0).getRandomValues(getObject(arg1)); +}; + +export function __wbg_randomFillSync_85b3f4c52c56c313(arg0, arg1, arg2) { + getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); +}; + export function __wbg_newnoargs_2b8b6bd7753c76ba(arg0, arg1) { const ret = new Function(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); diff --git a/bundler/wasm_bg.wasm b/bundler/wasm_bg.wasm index e7afef23..50a7a7d2 100644 Binary files a/bundler/wasm_bg.wasm and b/bundler/wasm_bg.wasm differ diff --git a/bundler/wasm_bg.wasm.d.ts b/bundler/wasm_bg.wasm.d.ts index 094458ad..2d2a48fa 100644 --- a/bundler/wasm_bg.wasm.d.ts +++ b/bundler/wasm_bg.wasm.d.ts @@ -85,13 +85,13 @@ export function restore_keypair_from_mnemonic_default(a: number, b: number, c: n export function restore_keypair_from_mnemonic_bip44(a: number, b: number, c: number, d: number, e: number, f: number): void; export function restore_keypair_from_mnemonic_bip49(a: number, b: number, c: number, d: number, e: number, f: number): void; export function fra_get_asset_code(a: number): void; +export function fra_get_minimal_fee(): number; export function fra_get_dest_pubkey(): number; export function get_coinbase_address(a: number): void; -export function get_delegation_target_address(a: number): void; -export function get_coinbase_principal_address(a: number): void; -export function fra_get_minimal_fee(): number; export function get_delegation_min_amount(): number; export function get_delegation_max_amount(): number; +export function get_delegation_target_address(a: number): void; +export function get_coinbase_principal_address(a: number): void; export function __wbg_publicparams_free(a: number): void; export function publicparams_new(): number; export function __wbg_txoref_free(a: number): void; @@ -149,22 +149,22 @@ export function assetrules_set_decimals(a: number, b: number, c: number): void; export function __wbg_credentialsignature_free(a: number): void; export function __wbg_xpublickey_free(a: number): void; export function __wbg_xsecretkey_free(a: number): void; -export function __wbg_zorrofq_free(a: number): void; -export function __wbg_secq256k1g1_free(a: number): void; -export function __wbg_zorrog1_free(a: number): void; -export function __wbg_blsg1_free(a: number): void; +export function __wbg_blsscalar_free(a: number): void; export function __wbg_blsg2_free(a: number): void; export function __wbg_secp256k1g1_free(a: number): void; +export function __wbg_zorroscalar_free(a: number): void; +export function __wbg_zorrog1_free(a: number): void; +export function __wbg_ed25519scalar_free(a: number): void; +export function __wbg_blsgt_free(a: number): void; export function __wbg_ed25519point_free(a: number): void; -export function __wbg_blsscalar_free(a: number): void; -export function __wbg_secq256k1scalar_free(a: number): void; +export function __wbg_blsg1_free(a: number): void; +export function __wbg_zorrofq_free(a: number): void; export function __wbg_secp256k1scalar_free(a: number): void; export function __wbg_blsfq_free(a: number): void; -export function __wbg_blsgt_free(a: number): void; -export function __wbg_ed25519scalar_free(a: number): void; -export function __wbg_zorroscalar_free(a: number): void; +export function __wbg_secq256k1scalar_free(a: number): void; +export function __wbg_secq256k1g1_free(a: number): void; export function __wbg_jubjubscalar_free(a: number): void; -export function ring_core_0_17_5_bn_mul_mont(a: number, b: number, c: number, d: number, e: number, f: number): void; +export function ring_core_0_17_8_bn_mul_mont(a: number, b: number, c: number, d: number, e: number, f: number): void; export function __wbg_credissuersecretkey_free(a: number): void; export function __wbg_credissuerpublickey_free(a: number): void; export function __wbg_creduserpublickey_free(a: number): void; diff --git a/nodejs/wasm.js b/nodejs/wasm.js index 89330600..3a06823b 100644 --- a/nodejs/wasm.js +++ b/nodejs/wasm.js @@ -3,6 +3,26 @@ imports['__wbindgen_placeholder__'] = module.exports; let wasm; const { TextDecoder, TextEncoder } = require(`util`); +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); @@ -20,12 +40,6 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } -const heap = new Array(128).fill(undefined); - -heap.push(undefined, null, true, false); - -let heap_next = heap.length; - function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); const idx = heap_next; @@ -35,8 +49,6 @@ function addHeapObject(obj) { return idx; } -function getObject(idx) { return heap[idx]; } - let WASM_VECTOR_LEN = 0; let cachedTextEncoder = new TextEncoder('utf-8'); @@ -101,18 +113,6 @@ function getInt32Memory0() { return cachedInt32Memory0; } -function dropObject(idx) { - if (idx < 132) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - function debugString(val) { // primitive types const type = typeof val; @@ -3859,8 +3859,12 @@ class ZorroScalar { } module.exports.ZorroScalar = ZorroScalar; -module.exports.__wbindgen_json_parse = function(arg0, arg1) { - const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); +module.exports.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); +}; + +module.exports.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }; @@ -3873,17 +3877,8 @@ module.exports.__wbindgen_json_serialize = function(arg0, arg1) { getInt32Memory0()[arg0 / 4 + 0] = ptr0; }; -module.exports.__wbindgen_object_drop_ref = function(arg0) { - takeObject(arg0); -}; - -module.exports.__wbindgen_string_new = function(arg0, arg1) { - const ret = getStringFromWasm0(arg0, arg1); - return addHeapObject(ret); -}; - -module.exports.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); +module.exports.__wbindgen_json_parse = function(arg0, arg1) { + const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }; @@ -3892,15 +3887,12 @@ module.exports.__wbg_now_c644db5194be8437 = function(arg0) { return ret; }; -module.exports.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) { - getObject(arg0).getRandomValues(getObject(arg1)); -}, arguments) }; - -module.exports.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) { - getObject(arg0).randomFillSync(takeObject(arg1)); -}, arguments) }; +module.exports.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); +}; -module.exports.__wbg_crypto_c48a774b022d20ac = function(arg0) { +module.exports.__wbg_crypto_d05b68a3572bb8ca = function(arg0) { const ret = getObject(arg0).crypto; return addHeapObject(ret); }; @@ -3911,17 +3903,17 @@ module.exports.__wbindgen_is_object = function(arg0) { return ret; }; -module.exports.__wbg_process_298734cf255a885d = function(arg0) { +module.exports.__wbg_process_b02b3570280d0366 = function(arg0) { const ret = getObject(arg0).process; return addHeapObject(ret); }; -module.exports.__wbg_versions_e2e78e134e3e5d01 = function(arg0) { +module.exports.__wbg_versions_c1cb42213cedf0f5 = function(arg0) { const ret = getObject(arg0).versions; return addHeapObject(ret); }; -module.exports.__wbg_node_1cd7a5d853dbea79 = function(arg0) { +module.exports.__wbg_node_43b1089f407e4ec2 = function(arg0) { const ret = getObject(arg0).node; return addHeapObject(ret); }; @@ -3931,12 +3923,12 @@ module.exports.__wbindgen_is_string = function(arg0) { return ret; }; -module.exports.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) { +module.exports.__wbg_msCrypto_10fc94afee92bd76 = function(arg0) { const ret = getObject(arg0).msCrypto; return addHeapObject(ret); }; -module.exports.__wbg_require_8f08ceecec0f4fee = function() { return handleError(function () { +module.exports.__wbg_require_9a7e0f667ead4995 = function() { return handleError(function () { const ret = module.require; return addHeapObject(ret); }, arguments) }; @@ -3946,13 +3938,13 @@ module.exports.__wbindgen_is_function = function(arg0) { return ret; }; -module.exports.__wbg_randomFillSync_85b3f4c52c56c313 = function(arg0, arg1, arg2) { - getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); -}; +module.exports.__wbg_randomFillSync_b70ccbdf4926a99d = function() { return handleError(function (arg0, arg1) { + getObject(arg0).randomFillSync(takeObject(arg1)); +}, arguments) }; -module.exports.__wbg_getRandomValues_cd175915511f705e = function(arg0, arg1) { +module.exports.__wbg_getRandomValues_7e42b4fb8779dc6d = function() { return handleError(function (arg0, arg1) { getObject(arg0).getRandomValues(getObject(arg1)); -}; +}, arguments) }; module.exports.__wbg_self_7eede1f4488bf346 = function() { return handleError(function () { const ret = self.self; @@ -3989,6 +3981,14 @@ module.exports.__wbg_getRandomValues_307049345d0bd88c = function(arg0) { return addHeapObject(ret); }; +module.exports.__wbg_getRandomValues_cd175915511f705e = function(arg0, arg1) { + getObject(arg0).getRandomValues(getObject(arg1)); +}; + +module.exports.__wbg_randomFillSync_85b3f4c52c56c313 = function(arg0, arg1, arg2) { + getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); +}; + module.exports.__wbg_newnoargs_2b8b6bd7753c76ba = function(arg0, arg1) { const ret = new Function(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); diff --git a/nodejs/wasm_bg.wasm b/nodejs/wasm_bg.wasm index 1c0f49c3..2b39d762 100644 Binary files a/nodejs/wasm_bg.wasm and b/nodejs/wasm_bg.wasm differ diff --git a/nodejs/wasm_bg.wasm.d.ts b/nodejs/wasm_bg.wasm.d.ts index 094458ad..2d2a48fa 100644 --- a/nodejs/wasm_bg.wasm.d.ts +++ b/nodejs/wasm_bg.wasm.d.ts @@ -85,13 +85,13 @@ export function restore_keypair_from_mnemonic_default(a: number, b: number, c: n export function restore_keypair_from_mnemonic_bip44(a: number, b: number, c: number, d: number, e: number, f: number): void; export function restore_keypair_from_mnemonic_bip49(a: number, b: number, c: number, d: number, e: number, f: number): void; export function fra_get_asset_code(a: number): void; +export function fra_get_minimal_fee(): number; export function fra_get_dest_pubkey(): number; export function get_coinbase_address(a: number): void; -export function get_delegation_target_address(a: number): void; -export function get_coinbase_principal_address(a: number): void; -export function fra_get_minimal_fee(): number; export function get_delegation_min_amount(): number; export function get_delegation_max_amount(): number; +export function get_delegation_target_address(a: number): void; +export function get_coinbase_principal_address(a: number): void; export function __wbg_publicparams_free(a: number): void; export function publicparams_new(): number; export function __wbg_txoref_free(a: number): void; @@ -149,22 +149,22 @@ export function assetrules_set_decimals(a: number, b: number, c: number): void; export function __wbg_credentialsignature_free(a: number): void; export function __wbg_xpublickey_free(a: number): void; export function __wbg_xsecretkey_free(a: number): void; -export function __wbg_zorrofq_free(a: number): void; -export function __wbg_secq256k1g1_free(a: number): void; -export function __wbg_zorrog1_free(a: number): void; -export function __wbg_blsg1_free(a: number): void; +export function __wbg_blsscalar_free(a: number): void; export function __wbg_blsg2_free(a: number): void; export function __wbg_secp256k1g1_free(a: number): void; +export function __wbg_zorroscalar_free(a: number): void; +export function __wbg_zorrog1_free(a: number): void; +export function __wbg_ed25519scalar_free(a: number): void; +export function __wbg_blsgt_free(a: number): void; export function __wbg_ed25519point_free(a: number): void; -export function __wbg_blsscalar_free(a: number): void; -export function __wbg_secq256k1scalar_free(a: number): void; +export function __wbg_blsg1_free(a: number): void; +export function __wbg_zorrofq_free(a: number): void; export function __wbg_secp256k1scalar_free(a: number): void; export function __wbg_blsfq_free(a: number): void; -export function __wbg_blsgt_free(a: number): void; -export function __wbg_ed25519scalar_free(a: number): void; -export function __wbg_zorroscalar_free(a: number): void; +export function __wbg_secq256k1scalar_free(a: number): void; +export function __wbg_secq256k1g1_free(a: number): void; export function __wbg_jubjubscalar_free(a: number): void; -export function ring_core_0_17_5_bn_mul_mont(a: number, b: number, c: number, d: number, e: number, f: number): void; +export function ring_core_0_17_8_bn_mul_mont(a: number, b: number, c: number, d: number, e: number, f: number): void; export function __wbg_credissuersecretkey_free(a: number): void; export function __wbg_credissuerpublickey_free(a: number): void; export function __wbg_creduserpublickey_free(a: number): void; diff --git a/web/wasm.d.ts b/web/wasm.d.ts index 3f5360f2..3b4e50ca 100644 --- a/web/wasm.d.ts +++ b/web/wasm.d.ts @@ -1437,13 +1437,13 @@ export interface InitOutput { readonly restore_keypair_from_mnemonic_bip44: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly restore_keypair_from_mnemonic_bip49: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly fra_get_asset_code: (a: number) => void; + readonly fra_get_minimal_fee: () => number; readonly fra_get_dest_pubkey: () => number; readonly get_coinbase_address: (a: number) => void; - readonly get_delegation_target_address: (a: number) => void; - readonly get_coinbase_principal_address: (a: number) => void; - readonly fra_get_minimal_fee: () => number; readonly get_delegation_min_amount: () => number; readonly get_delegation_max_amount: () => number; + readonly get_delegation_target_address: (a: number) => void; + readonly get_coinbase_principal_address: (a: number) => void; readonly __wbg_publicparams_free: (a: number) => void; readonly publicparams_new: () => number; readonly __wbg_txoref_free: (a: number) => void; @@ -1501,22 +1501,22 @@ export interface InitOutput { readonly __wbg_credentialsignature_free: (a: number) => void; readonly __wbg_xpublickey_free: (a: number) => void; readonly __wbg_xsecretkey_free: (a: number) => void; - readonly __wbg_zorrofq_free: (a: number) => void; - readonly __wbg_secq256k1g1_free: (a: number) => void; - readonly __wbg_zorrog1_free: (a: number) => void; - readonly __wbg_blsg1_free: (a: number) => void; + readonly __wbg_blsscalar_free: (a: number) => void; readonly __wbg_blsg2_free: (a: number) => void; readonly __wbg_secp256k1g1_free: (a: number) => void; + readonly __wbg_zorroscalar_free: (a: number) => void; + readonly __wbg_zorrog1_free: (a: number) => void; + readonly __wbg_ed25519scalar_free: (a: number) => void; + readonly __wbg_blsgt_free: (a: number) => void; readonly __wbg_ed25519point_free: (a: number) => void; - readonly __wbg_blsscalar_free: (a: number) => void; - readonly __wbg_secq256k1scalar_free: (a: number) => void; + readonly __wbg_blsg1_free: (a: number) => void; + readonly __wbg_zorrofq_free: (a: number) => void; readonly __wbg_secp256k1scalar_free: (a: number) => void; readonly __wbg_blsfq_free: (a: number) => void; - readonly __wbg_blsgt_free: (a: number) => void; - readonly __wbg_ed25519scalar_free: (a: number) => void; - readonly __wbg_zorroscalar_free: (a: number) => void; + readonly __wbg_secq256k1scalar_free: (a: number) => void; + readonly __wbg_secq256k1g1_free: (a: number) => void; readonly __wbg_jubjubscalar_free: (a: number) => void; - readonly ring_core_0_17_5_bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void; + readonly ring_core_0_17_8_bn_mul_mont: (a: number, b: number, c: number, d: number, e: number, f: number) => void; readonly __wbg_credissuersecretkey_free: (a: number) => void; readonly __wbg_credissuerpublickey_free: (a: number) => void; readonly __wbg_creduserpublickey_free: (a: number) => void; diff --git a/web/wasm.js b/web/wasm.js index 79c6076f..3905b26c 100644 --- a/web/wasm.js +++ b/web/wasm.js @@ -1,5 +1,25 @@ let wasm; +const heap = new Array(128).fill(undefined); + +heap.push(undefined, null, true, false); + +function getObject(idx) { return heap[idx]; } + +let heap_next = heap.length; + +function dropObject(idx) { + if (idx < 132) return; + heap[idx] = heap_next; + heap_next = idx; +} + +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} + const cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); @@ -17,12 +37,6 @@ function getStringFromWasm0(ptr, len) { return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); } -const heap = new Array(128).fill(undefined); - -heap.push(undefined, null, true, false); - -let heap_next = heap.length; - function addHeapObject(obj) { if (heap_next === heap.length) heap.push(heap.length + 1); const idx = heap_next; @@ -32,8 +46,6 @@ function addHeapObject(obj) { return idx; } -function getObject(idx) { return heap[idx]; } - let WASM_VECTOR_LEN = 0; const cachedTextEncoder = new TextEncoder('utf-8'); @@ -98,18 +110,6 @@ function getInt32Memory0() { return cachedInt32Memory0; } -function dropObject(idx) { - if (idx < 132) return; - heap[idx] = heap_next; - heap_next = idx; -} - -function takeObject(idx) { - const ret = getObject(idx); - dropObject(idx); - return ret; -} - function debugString(val) { // primitive types const type = typeof val; @@ -3843,8 +3843,11 @@ async function load(module, imports) { function getImports() { const imports = {}; imports.wbg = {}; - imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { - const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbindgen_string_new = function(arg0, arg1) { + const ret = getStringFromWasm0(arg0, arg1); return addHeapObject(ret); }; imports.wbg.__wbindgen_json_serialize = function(arg0, arg1) { @@ -3855,28 +3858,19 @@ function getImports() { getInt32Memory0()[arg0 / 4 + 1] = len0; getInt32Memory0()[arg0 / 4 + 0] = ptr0; }; - imports.wbg.__wbindgen_object_drop_ref = function(arg0) { - takeObject(arg0); - }; - imports.wbg.__wbindgen_string_new = function(arg0, arg1) { - const ret = getStringFromWasm0(arg0, arg1); - return addHeapObject(ret); - }; - imports.wbg.__wbindgen_object_clone_ref = function(arg0) { - const ret = getObject(arg0); + imports.wbg.__wbindgen_json_parse = function(arg0, arg1) { + const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); }; imports.wbg.__wbg_now_c644db5194be8437 = function(arg0) { const ret = getObject(arg0).now(); return ret; }; - imports.wbg.__wbg_getRandomValues_37fa2ca9e4e07fab = function() { return handleError(function (arg0, arg1) { - getObject(arg0).getRandomValues(getObject(arg1)); - }, arguments) }; - imports.wbg.__wbg_randomFillSync_dc1e9a60c158336d = function() { return handleError(function (arg0, arg1) { - getObject(arg0).randomFillSync(takeObject(arg1)); - }, arguments) }; - imports.wbg.__wbg_crypto_c48a774b022d20ac = function(arg0) { + imports.wbg.__wbindgen_object_clone_ref = function(arg0) { + const ret = getObject(arg0); + return addHeapObject(ret); + }; + imports.wbg.__wbg_crypto_d05b68a3572bb8ca = function(arg0) { const ret = getObject(arg0).crypto; return addHeapObject(ret); }; @@ -3885,15 +3879,15 @@ function getImports() { const ret = typeof(val) === 'object' && val !== null; return ret; }; - imports.wbg.__wbg_process_298734cf255a885d = function(arg0) { + imports.wbg.__wbg_process_b02b3570280d0366 = function(arg0) { const ret = getObject(arg0).process; return addHeapObject(ret); }; - imports.wbg.__wbg_versions_e2e78e134e3e5d01 = function(arg0) { + imports.wbg.__wbg_versions_c1cb42213cedf0f5 = function(arg0) { const ret = getObject(arg0).versions; return addHeapObject(ret); }; - imports.wbg.__wbg_node_1cd7a5d853dbea79 = function(arg0) { + imports.wbg.__wbg_node_43b1089f407e4ec2 = function(arg0) { const ret = getObject(arg0).node; return addHeapObject(ret); }; @@ -3901,11 +3895,11 @@ function getImports() { const ret = typeof(getObject(arg0)) === 'string'; return ret; }; - imports.wbg.__wbg_msCrypto_bcb970640f50a1e8 = function(arg0) { + imports.wbg.__wbg_msCrypto_10fc94afee92bd76 = function(arg0) { const ret = getObject(arg0).msCrypto; return addHeapObject(ret); }; - imports.wbg.__wbg_require_8f08ceecec0f4fee = function() { return handleError(function () { + imports.wbg.__wbg_require_9a7e0f667ead4995 = function() { return handleError(function () { const ret = module.require; return addHeapObject(ret); }, arguments) }; @@ -3913,12 +3907,12 @@ function getImports() { const ret = typeof(getObject(arg0)) === 'function'; return ret; }; - imports.wbg.__wbg_randomFillSync_85b3f4c52c56c313 = function(arg0, arg1, arg2) { - getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); - }; - imports.wbg.__wbg_getRandomValues_cd175915511f705e = function(arg0, arg1) { + imports.wbg.__wbg_randomFillSync_b70ccbdf4926a99d = function() { return handleError(function (arg0, arg1) { + getObject(arg0).randomFillSync(takeObject(arg1)); + }, arguments) }; + imports.wbg.__wbg_getRandomValues_7e42b4fb8779dc6d = function() { return handleError(function (arg0, arg1) { getObject(arg0).getRandomValues(getObject(arg1)); - }; + }, arguments) }; imports.wbg.__wbg_self_7eede1f4488bf346 = function() { return handleError(function () { const ret = self.self; return addHeapObject(ret); @@ -3947,6 +3941,12 @@ function getImports() { const ret = getObject(arg0).getRandomValues; return addHeapObject(ret); }; + imports.wbg.__wbg_getRandomValues_cd175915511f705e = function(arg0, arg1) { + getObject(arg0).getRandomValues(getObject(arg1)); + }; + imports.wbg.__wbg_randomFillSync_85b3f4c52c56c313 = function(arg0, arg1, arg2) { + getObject(arg0).randomFillSync(getArrayU8FromWasm0(arg1, arg2)); + }; imports.wbg.__wbg_newnoargs_2b8b6bd7753c76ba = function(arg0, arg1) { const ret = new Function(getStringFromWasm0(arg0, arg1)); return addHeapObject(ret); diff --git a/web/wasm_bg.wasm b/web/wasm_bg.wasm index 59f81d0e..ca8eb599 100644 Binary files a/web/wasm_bg.wasm and b/web/wasm_bg.wasm differ diff --git a/web/wasm_bg.wasm.d.ts b/web/wasm_bg.wasm.d.ts index 094458ad..2d2a48fa 100644 --- a/web/wasm_bg.wasm.d.ts +++ b/web/wasm_bg.wasm.d.ts @@ -85,13 +85,13 @@ export function restore_keypair_from_mnemonic_default(a: number, b: number, c: n export function restore_keypair_from_mnemonic_bip44(a: number, b: number, c: number, d: number, e: number, f: number): void; export function restore_keypair_from_mnemonic_bip49(a: number, b: number, c: number, d: number, e: number, f: number): void; export function fra_get_asset_code(a: number): void; +export function fra_get_minimal_fee(): number; export function fra_get_dest_pubkey(): number; export function get_coinbase_address(a: number): void; -export function get_delegation_target_address(a: number): void; -export function get_coinbase_principal_address(a: number): void; -export function fra_get_minimal_fee(): number; export function get_delegation_min_amount(): number; export function get_delegation_max_amount(): number; +export function get_delegation_target_address(a: number): void; +export function get_coinbase_principal_address(a: number): void; export function __wbg_publicparams_free(a: number): void; export function publicparams_new(): number; export function __wbg_txoref_free(a: number): void; @@ -149,22 +149,22 @@ export function assetrules_set_decimals(a: number, b: number, c: number): void; export function __wbg_credentialsignature_free(a: number): void; export function __wbg_xpublickey_free(a: number): void; export function __wbg_xsecretkey_free(a: number): void; -export function __wbg_zorrofq_free(a: number): void; -export function __wbg_secq256k1g1_free(a: number): void; -export function __wbg_zorrog1_free(a: number): void; -export function __wbg_blsg1_free(a: number): void; +export function __wbg_blsscalar_free(a: number): void; export function __wbg_blsg2_free(a: number): void; export function __wbg_secp256k1g1_free(a: number): void; +export function __wbg_zorroscalar_free(a: number): void; +export function __wbg_zorrog1_free(a: number): void; +export function __wbg_ed25519scalar_free(a: number): void; +export function __wbg_blsgt_free(a: number): void; export function __wbg_ed25519point_free(a: number): void; -export function __wbg_blsscalar_free(a: number): void; -export function __wbg_secq256k1scalar_free(a: number): void; +export function __wbg_blsg1_free(a: number): void; +export function __wbg_zorrofq_free(a: number): void; export function __wbg_secp256k1scalar_free(a: number): void; export function __wbg_blsfq_free(a: number): void; -export function __wbg_blsgt_free(a: number): void; -export function __wbg_ed25519scalar_free(a: number): void; -export function __wbg_zorroscalar_free(a: number): void; +export function __wbg_secq256k1scalar_free(a: number): void; +export function __wbg_secq256k1g1_free(a: number): void; export function __wbg_jubjubscalar_free(a: number): void; -export function ring_core_0_17_5_bn_mul_mont(a: number, b: number, c: number, d: number, e: number, f: number): void; +export function ring_core_0_17_8_bn_mul_mont(a: number, b: number, c: number, d: number, e: number, f: number): void; export function __wbg_credissuersecretkey_free(a: number): void; export function __wbg_credissuerpublickey_free(a: number): void; export function __wbg_creduserpublickey_free(a: number): void;