let wasm; export function __wbg_set_wasm(val) { wasm = val; } let cachedUint8ArrayMemory0 = null; function getUint8ArrayMemory0() { if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) { cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer); } return cachedUint8ArrayMemory0; } const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder; let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); const MAX_SAFARI_DECODE_BYTES = 2146435072; let numBytesDecoded = 0; function decodeText(ptr, len) { numBytesDecoded += len; if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) { cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true }); cachedTextDecoder.decode(); numBytesDecoded = len; } return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len)); } function getStringFromWasm0(ptr, len) { ptr = ptr >>> 0; return decodeText(ptr, len); } function logError(f, args) { try { return f.apply(this, args); } catch (e) { let error = (function () { try { return e instanceof Error ? `${e.message}\n\nStack:\n${e.stack}` : e.toString(); } catch(_) { return ""; } }()); console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error); throw e; } } let WASM_VECTOR_LEN = 0; const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder; const cachedTextEncoder = new lTextEncoder('utf-8'); const encodeString = (typeof cachedTextEncoder.encodeInto === 'function' ? function (arg, view) { return cachedTextEncoder.encodeInto(arg, view); } : function (arg, view) { const buf = cachedTextEncoder.encode(arg); view.set(buf); return { read: arg.length, written: buf.length }; }); function passStringToWasm0(arg, malloc, realloc) { if (typeof(arg) !== 'string') throw new Error(`expected a string argument, found ${typeof(arg)}`); if (realloc === undefined) { const buf = cachedTextEncoder.encode(arg); const ptr = malloc(buf.length, 1) >>> 0; getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf); WASM_VECTOR_LEN = buf.length; return ptr; } let len = arg.length; let ptr = malloc(len, 1) >>> 0; const mem = getUint8ArrayMemory0(); let offset = 0; for (; offset < len; offset++) { const code = arg.charCodeAt(offset); if (code > 0x7F) break; mem[ptr + offset] = code; } if (offset !== len) { if (offset !== 0) { arg = arg.slice(offset); } ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0; const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len); const ret = encodeString(arg, view); if (ret.read !== arg.length) throw new Error('failed to pass whole string'); offset += ret.written; ptr = realloc(ptr, len, offset, 1) >>> 0; } WASM_VECTOR_LEN = offset; return ptr; } let cachedDataViewMemory0 = null; function getDataViewMemory0() { if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) { cachedDataViewMemory0 = new DataView(wasm.memory.buffer); } return cachedDataViewMemory0; } function addToExternrefTable0(obj) { const idx = wasm.__externref_table_alloc(); wasm.__wbindgen_export_4.set(idx, obj); return idx; } function handleError(f, args) { try { return f.apply(this, args); } catch (e) { const idx = addToExternrefTable0(e); wasm.__wbindgen_exn_store(idx); } } function _assertBoolean(n) { if (typeof(n) !== 'boolean') { throw new Error(`expected a boolean argument, found ${typeof(n)}`); } } function _assertNum(n) { if (typeof(n) !== 'number') throw new Error(`expected a number argument, found ${typeof(n)}`); } function getArrayU8FromWasm0(ptr, len) { ptr = ptr >>> 0; return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len); } function isLikeNone(x) { return x === undefined || x === null; } function _assertBigInt(n) { if (typeof(n) !== 'bigint') throw new Error(`expected a bigint argument, found ${typeof(n)}`); } function debugString(val) { // primitive types const type = typeof val; if (type == 'number' || type == 'boolean' || val == null) { return `${val}`; } if (type == 'string') { return `"${val}"`; } if (type == 'symbol') { const description = val.description; if (description == null) { return 'Symbol'; } else { return `Symbol(${description})`; } } if (type == 'function') { const name = val.name; if (typeof name == 'string' && name.length > 0) { return `Function(${name})`; } else { return 'Function'; } } // objects if (Array.isArray(val)) { const length = val.length; let debug = '['; if (length > 0) { debug += debugString(val[0]); } for(let i = 1; i < length; i++) { debug += ', ' + debugString(val[i]); } debug += ']'; return debug; } // Test for built-in const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val)); let className; if (builtInMatches && builtInMatches.length > 1) { className = builtInMatches[1]; } else { // Failed to match the standard '[object ClassName]' return toString.call(val); } if (className == 'Object') { // we're a user defined class or Object // JSON.stringify avoids problems with cycles, and is generally much // easier than looping through ownProperties of `val`. try { return 'Object(' + JSON.stringify(val) + ')'; } catch (_) { return 'Object'; } } // errors if (val instanceof Error) { return `${val.name}: ${val.message}\n${val.stack}`; } // TODO we could test for more things here, like `Set`s and `Map`s. return className; } const CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined') ? { register: () => {}, unregister: () => {} } : new FinalizationRegistry( state => { wasm.__wbindgen_export_5.get(state.dtor)(state.a, state.b); } ); function makeMutClosure(arg0, arg1, dtor, f) { const state = { a: arg0, b: arg1, cnt: 1, dtor }; const real = (...args) => { // First up with a closure we increment the internal reference // count. This ensures that the Rust closure environment won't // be deallocated while we're invoking it. state.cnt++; const a = state.a; state.a = 0; try { return f(a, state.b, ...args); } finally { if (--state.cnt === 0) { wasm.__wbindgen_export_5.get(state.dtor)(a, state.b); CLOSURE_DTORS.unregister(state); } else { state.a = a; } } }; real.original = state; CLOSURE_DTORS.register(real, state, state); return real; } export function setup() { wasm.setup(); } function takeFromExternrefTable0(idx) { const value = wasm.__wbindgen_export_4.get(idx); wasm.__externref_table_dealloc(idx); return value; } /** * @returns {string} */ export function get_address() { let deferred2_0; let deferred2_1; try { const ret = wasm.get_address(); var ptr1 = ret[0]; var len1 = ret[1]; if (ret[3]) { ptr1 = 0; len1 = 0; throw takeFromExternrefTable0(ret[2]); } deferred2_0 = ptr1; deferred2_1 = len1; return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); } } /** * @returns {Member} */ export function get_member() { const ret = wasm.get_member(); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {any} device */ export function restore_device(device) { const ret = wasm.restore_device(device); if (ret[1]) { throw takeFromExternrefTable0(ret[0]); } } /** * @param {string} sp_wallet * @returns {string} */ export function create_device_from_sp_wallet(sp_wallet) { let deferred3_0; let deferred3_1; try { const ptr0 = passStringToWasm0(sp_wallet, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.create_device_from_sp_wallet(ptr0, len0); var ptr2 = ret[0]; var len2 = ret[1]; if (ret[3]) { ptr2 = 0; len2 = 0; throw takeFromExternrefTable0(ret[2]); } deferred3_0 = ptr2; deferred3_1 = len2; return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); } } /** * @param {number} birthday * @param {string} network_str * @returns {string} */ export function create_new_device(birthday, network_str) { let deferred3_0; let deferred3_1; try { _assertNum(birthday); const ptr0 = passStringToWasm0(network_str, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.create_new_device(birthday, ptr0, len0); var ptr2 = ret[0]; var len2 = ret[1]; if (ret[3]) { ptr2 = 0; len2 = 0; throw takeFromExternrefTable0(ret[2]); } deferred3_0 = ptr2; deferred3_1 = len2; return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); } } /** * @param {number} tip_height * @param {string} blindbit_url * @returns {Promise} */ export function scan_blocks(tip_height, blindbit_url) { _assertNum(tip_height); const ptr0 = passStringToWasm0(blindbit_url, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.scan_blocks(tip_height, ptr0, len0); return ret; } /** * @returns {boolean} */ export function is_paired() { const ret = wasm.is_paired(); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return ret[0] !== 0; } function passArrayJsValueToWasm0(array, malloc) { const ptr = malloc(array.length * 4, 4) >>> 0; for (let i = 0; i < array.length; i++) { const add = addToExternrefTable0(array[i]); getDataViewMemory0().setUint32(ptr + 4 * i, add, true); } WASM_VECTOR_LEN = array.length; return ptr; } /** * @param {string} process_id * @param {string[]} sp_addresses */ export function pair_device(process_id, sp_addresses) { const ptr0 = passStringToWasm0(process_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ptr1 = passArrayJsValueToWasm0(sp_addresses, wasm.__wbindgen_malloc); const len1 = WASM_VECTOR_LEN; const ret = wasm.pair_device(ptr0, len0, ptr1, len1); if (ret[1]) { throw takeFromExternrefTable0(ret[0]); } } export function unpair_device() { const ret = wasm.unpair_device(); if (ret[1]) { throw takeFromExternrefTable0(ret[0]); } } /** * @returns {string} */ export function dump_wallet() { let deferred2_0; let deferred2_1; try { const ret = wasm.dump_wallet(); var ptr1 = ret[0]; var len1 = ret[1]; if (ret[3]) { ptr1 = 0; len1 = 0; throw takeFromExternrefTable0(ret[2]); } deferred2_0 = ptr1; deferred2_1 = len1; return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); } } export function reset_shared_secrets() { const ret = wasm.reset_shared_secrets(); if (ret[1]) { throw takeFromExternrefTable0(ret[0]); } } /** * @param {string} secrets */ export function set_shared_secrets(secrets) { const ptr0 = passStringToWasm0(secrets, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.set_shared_secrets(ptr0, len0); if (ret[1]) { throw takeFromExternrefTable0(ret[0]); } } /** * @returns {string} */ export function get_pairing_process_id() { let deferred2_0; let deferred2_1; try { const ret = wasm.get_pairing_process_id(); var ptr1 = ret[0]; var len1 = ret[1]; if (ret[3]) { ptr1 = 0; len1 = 0; throw takeFromExternrefTable0(ret[2]); } deferred2_0 = ptr1; deferred2_1 = len1; return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); } } /** * @returns {Device} */ export function dump_device() { const ret = wasm.dump_device(); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @returns {Device} */ export function dump_neutered_device() { const ret = wasm.dump_neutered_device(); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } export function reset_device() { const ret = wasm.reset_device(); if (ret[1]) { throw takeFromExternrefTable0(ret[0]); } } /** * @param {string} transaction * @returns {string} */ export function get_txid(transaction) { let deferred3_0; let deferred3_1; try { const ptr0 = passStringToWasm0(transaction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.get_txid(ptr0, len0); var ptr2 = ret[0]; var len2 = ret[1]; if (ret[3]) { ptr2 = 0; len2 = 0; throw takeFromExternrefTable0(ret[2]); } deferred3_0 = ptr2; deferred3_1 = len2; return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); } } function getArrayJsValueFromWasm0(ptr, len) { ptr = ptr >>> 0; const mem = getDataViewMemory0(); const result = []; for (let i = ptr; i < ptr + 4 * len; i += 4) { result.push(wasm.__wbindgen_export_4.get(mem.getUint32(i, true))); } wasm.__externref_drop_slice(ptr, len); return result; } /** * @param {string} transaction * @returns {string[]} */ export function get_prevouts(transaction) { const ptr0 = passStringToWasm0(transaction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.get_prevouts(ptr0, len0); if (ret[3]) { throw takeFromExternrefTable0(ret[2]); } var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice(); wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); return v2; } /** * @param {string} transaction * @returns {string} */ export function get_opreturn(transaction) { let deferred3_0; let deferred3_1; try { const ptr0 = passStringToWasm0(transaction, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.get_opreturn(ptr0, len0); var ptr2 = ret[0]; var len2 = ret[1]; if (ret[3]) { ptr2 = 0; len2 = 0; throw takeFromExternrefTable0(ret[2]); } deferred3_0 = ptr2; deferred3_1 = len2; return getStringFromWasm0(ptr2, len2); } finally { wasm.__wbindgen_free(deferred3_0, deferred3_1, 1); } } /** * @param {Process} process * @param {string} state_id * @param {string} new_tip * @returns {Process} */ export function process_commit_new_state(process, state_id, new_tip) { const ptr0 = passStringToWasm0(state_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ptr1 = passStringToWasm0(new_tip, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len1 = WASM_VECTOR_LEN; const ret = wasm.process_commit_new_state(process, ptr0, len0, ptr1, len1); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {string} new_tx_msg * @param {number} block_height * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function parse_new_tx(new_tx_msg, block_height, members_list) { const ptr0 = passStringToWasm0(new_tx_msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; _assertNum(block_height); const ret = wasm.parse_new_tx(ptr0, len0, block_height, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {string} cipher_msg * @param {OutPointMemberMap} members_list * @param {OutPointProcessMap} processes * @returns {ApiReturn} */ export function parse_cipher(cipher_msg, members_list, processes) { const ptr0 = passStringToWasm0(cipher_msg, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.parse_cipher(ptr0, len0, members_list, processes); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @returns {any} */ export function get_outputs() { const ret = wasm.get_outputs(); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @returns {bigint} */ export function get_available_amount() { const ret = wasm.get_available_amount(); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return BigInt.asUintN(64, ret[0]); } /** * We send a transaction that pays at least one output to each address * The goal can be to establish a shared_secret to be used as an encryption key for further communication * or if the recipient is a relay it can be the init transaction for a new process * @param {string[]} addresses * @param {number} fee_rate * @returns {ApiReturn} */ export function create_transaction(addresses, fee_rate) { const ptr0 = passArrayJsValueToWasm0(addresses, wasm.__wbindgen_malloc); const len0 = WASM_VECTOR_LEN; _assertNum(fee_rate); const ret = wasm.create_transaction(ptr0, len0, fee_rate); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {TsUnsignedTransaction} partial_tx * @returns {ApiReturn} */ export function sign_transaction(partial_tx) { const ret = wasm.sign_transaction(partial_tx); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Pcd} private_data * @param {Roles} roles * @param {Pcd} public_data * @param {string} relay_address * @param {number} fee_rate * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function create_new_process(private_data, roles, public_data, relay_address, fee_rate, members_list) { const ptr0 = passStringToWasm0(relay_address, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; _assertNum(fee_rate); const ret = wasm.create_new_process(private_data, roles, public_data, ptr0, len0, fee_rate, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Process} process * @param {Pcd} new_attributes * @param {Roles} roles * @param {Pcd} new_public_data * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function update_process(process, new_attributes, roles, new_public_data, members_list) { const ret = wasm.update_process(process, new_attributes, roles, new_public_data, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {string} process_id * @param {string[]} state_ids_str * @param {any} roles * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function request_data(process_id, state_ids_str, roles, members_list) { const ptr0 = passStringToWasm0(process_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ptr1 = passArrayJsValueToWasm0(state_ids_str, wasm.__wbindgen_malloc); const len1 = WASM_VECTOR_LEN; const ret = wasm.request_data(ptr0, len0, ptr1, len1, roles, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Process} process * @param {string} state_id * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function create_update_message(process, state_id, members_list) { const ptr0 = passStringToWasm0(state_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.create_update_message(process, ptr0, len0, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Process} process * @param {string} state_id * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function validate_state(process, state_id, members_list) { const ptr0 = passStringToWasm0(state_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.validate_state(process, ptr0, len0, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Process} process * @param {string} state_id * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function refuse_state(process, state_id, members_list) { const ptr0 = passStringToWasm0(state_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.refuse_state(process, ptr0, len0, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Process} process * @param {string} state_id * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function evaluate_state(process, state_id, members_list) { const ptr0 = passStringToWasm0(state_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.evaluate_state(process, ptr0, len0, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Process} process * @param {string} state_id * @param {OutPointMemberMap} members_list * @returns {ApiReturn} */ export function create_response_prd(process, state_id, members_list) { const ptr0 = passStringToWasm0(state_id, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.create_response_prd(process, ptr0, len0, members_list); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @returns {string} */ export function create_faucet_msg() { let deferred2_0; let deferred2_1; try { const ret = wasm.create_faucet_msg(); var ptr1 = ret[0]; var len1 = ret[1]; if (ret[3]) { ptr1 = 0; len1 = 0; throw takeFromExternrefTable0(ret[2]); } deferred2_0 = ptr1; deferred2_1 = len1; return getStringFromWasm0(ptr1, len1); } finally { wasm.__wbindgen_free(deferred2_0, deferred2_1, 1); } } /** * @param {string} process_outpoint * @returns {string[]} */ export function get_storages(process_outpoint) { const ptr0 = passStringToWasm0(process_outpoint, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.get_storages(ptr0, len0); if (ret[3]) { throw takeFromExternrefTable0(ret[2]); } var v2 = getArrayJsValueFromWasm0(ret[0], ret[1]).slice(); wasm.__wbindgen_free(ret[0], ret[1] * 4, 4); return v2; } /** * @param {string} parent_roles * @param {string} child_roles */ export function is_child_role(parent_roles, child_roles) { const ptr0 = passStringToWasm0(parent_roles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ptr1 = passStringToWasm0(child_roles, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len1 = WASM_VECTOR_LEN; const ret = wasm.is_child_role(ptr0, len0, ptr1, len1); if (ret[1]) { throw takeFromExternrefTable0(ret[0]); } } function passArray8ToWasm0(arg, malloc) { const ptr = malloc(arg.length * 1, 1) >>> 0; getUint8ArrayMemory0().set(arg, ptr / 1); WASM_VECTOR_LEN = arg.length; return ptr; } /** * @param {Uint8Array} key * @param {Uint8Array} data * @returns {Uint8Array} */ export function decrypt_data(key, data) { const ptr0 = passArray8ToWasm0(key, wasm.__wbindgen_malloc); const len0 = WASM_VECTOR_LEN; const ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc); const len1 = WASM_VECTOR_LEN; const ret = wasm.decrypt_data(ptr0, len0, ptr1, len1); if (ret[3]) { throw takeFromExternrefTable0(ret[2]); } var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice(); wasm.__wbindgen_free(ret[0], ret[1] * 1, 1); return v3; } /** * @param {any} data * @returns {Pcd} */ export function encode_binary(data) { const ret = wasm.encode_binary(data); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {any} json_data * @returns {Pcd} */ export function encode_json(json_data) { const ret = wasm.encode_json(json_data); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {Uint8Array} value * @returns {any} */ export function decode_value(value) { const ptr0 = passArray8ToWasm0(value, wasm.__wbindgen_malloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.decode_value(ptr0, len0); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * @param {any} value * @param {string} commited_in * @param {string} label * @returns {string} */ export function hash_value(value, commited_in, label) { let deferred4_0; let deferred4_1; try { const ptr0 = passStringToWasm0(commited_in, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ptr1 = passStringToWasm0(label, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len1 = WASM_VECTOR_LEN; const ret = wasm.hash_value(value, ptr0, len0, ptr1, len1); var ptr3 = ret[0]; var len3 = ret[1]; if (ret[3]) { ptr3 = 0; len3 = 0; throw takeFromExternrefTable0(ret[2]); } deferred4_0 = ptr3; deferred4_1 = len3; return getStringFromWasm0(ptr3, len3); } finally { wasm.__wbindgen_free(deferred4_0, deferred4_1, 1); } } /** * Generate a merkle proof for a specific attribute in a process state. * * This function creates a merkle proof that proves the existence of a specific attribute * in a given state of a process. The proof can be used to verify that the attribute * was indeed part of the state without revealing the entire state. * * # Arguments * * `process_state` - The process state object as a JavaScript value * * `attribute_name` - The name of the attribute to generate a proof for * * # Returns * A MerkleProofResult object containing: * * `proof` - The merkle proof as a hex string * * `root` - The merkle root (state_id) as a hex string * * `attribute` - The attribute name that was proven * * `attribute_index` - The index of the attribute in the merkle tree * * `total_leaves_count` - The total number of leaves in the merkle tree * * # Errors * * "Failed to deserialize process state" - If the process state cannot be deserialized from JsValue * * "Attribute not found in state" - If the attribute doesn't exist in the state * @param {any} process_state * @param {string} attribute_name * @returns {MerkleProofResult} */ export function get_merkle_proof(process_state, attribute_name) { const ptr0 = passStringToWasm0(attribute_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.get_merkle_proof(process_state, ptr0, len0); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return takeFromExternrefTable0(ret[0]); } /** * Validate a merkle proof for a specific attribute. * * This function verifies that a merkle proof is valid and proves the existence * of a specific attribute in a given state. It checks that the proof correctly * leads to the claimed root when combined with the attribute hash. * * # Arguments * * `proof_result` - a JsValue expected to contain a MerkleProofResult with the proof and metadata * * `hash` - The hash of the attribute data as a hex string (the leaf value) * * # Returns * A boolean indicating whether the proof is valid * * # Errors * * "serde_wasm_bindgen deserialization error" - If the proof is not a valid MerkleProofResult * * "Invalid proof format" - If the proof cannot be parsed * * "Invalid hash format" - If the hash is not a valid 32-byte hex string * * "Invalid root format" - If the root is not a valid 32-byte hex string * @param {any} proof_result * @param {string} hash * @returns {boolean} */ export function validate_merkle_proof(proof_result, hash) { const ptr0 = passStringToWasm0(hash, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len0 = WASM_VECTOR_LEN; const ret = wasm.validate_merkle_proof(proof_result, ptr0, len0); if (ret[2]) { throw takeFromExternrefTable0(ret[1]); } return ret[0] !== 0; } function __wbg_adapter_8(arg0, arg1, arg2) { _assertNum(arg0); _assertNum(arg1); wasm.closure681_externref_shim(arg0, arg1, arg2); } function __wbg_adapter_13(arg0, arg1) { _assertNum(arg0); _assertNum(arg1); wasm.wasm_bindgen__convert__closures_____invoke__hc142e2252e76ee8b(arg0, arg1); } function __wbg_adapter_195(arg0, arg1, arg2, arg3) { _assertNum(arg0); _assertNum(arg1); wasm.closure1281_externref_shim(arg0, arg1, arg2, arg3); } const __wbindgen_enum_RequestCache = ["default", "no-store", "reload", "no-cache", "force-cache", "only-if-cached"]; const __wbindgen_enum_RequestCredentials = ["omit", "same-origin", "include"]; const __wbindgen_enum_RequestMode = ["same-origin", "no-cors", "cors", "navigate"]; export function __wbg_Error_1f3748b298f99708() { return logError(function (arg0, arg1) { const ret = Error(getStringFromWasm0(arg0, arg1)); return ret; }, arguments) }; export function __wbg_Number_577a493fc95ea223() { return logError(function (arg0) { const ret = Number(arg0); return ret; }, arguments) }; export function __wbg_String_8f0eb39a4a4c2f66() { return logError(function (arg0, arg1) { const ret = String(arg1); const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }, arguments) }; export function __wbg_abort_6665281623826052() { return logError(function (arg0) { arg0.abort(); }, arguments) }; export function __wbg_abort_c11a5d245a242912() { return logError(function (arg0, arg1) { arg0.abort(arg1); }, arguments) }; export function __wbg_append_3e86b0cd6215edd8() { return handleError(function (arg0, arg1, arg2, arg3, arg4) { arg0.append(getStringFromWasm0(arg1, arg2), getStringFromWasm0(arg3, arg4)); }, arguments) }; export function __wbg_call_2f8d426a20a307fe() { return handleError(function (arg0, arg1) { const ret = arg0.call(arg1); return ret; }, arguments) }; export function __wbg_call_f53f0647ceb9c567() { return handleError(function (arg0, arg1, arg2) { const ret = arg0.call(arg1, arg2); return ret; }, arguments) }; export function __wbg_clearTimeout_6222fede17abcb1a() { return logError(function (arg0) { const ret = clearTimeout(arg0); return ret; }, arguments) }; export function __wbg_crypto_574e78ad8b13b65f() { return logError(function (arg0) { const ret = arg0.crypto; return ret; }, arguments) }; export function __wbg_debug_75215abdc8f82abb() { return logError(function (arg0, arg1, arg2, arg3) { console.debug(arg0, arg1, arg2, arg3); }, arguments) }; export function __wbg_done_4a7743b6f942c9f3() { return logError(function (arg0) { const ret = arg0.done; _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_entries_17f7acbc2d691c0d() { return logError(function (arg0) { const ret = Object.entries(arg0); return ret; }, arguments) }; export function __wbg_error_29e66bad9fc546cd() { return logError(function (arg0, arg1, arg2, arg3) { console.error(arg0, arg1, arg2, arg3); }, arguments) }; export function __wbg_error_41f0589870426ea4() { return logError(function (arg0) { console.error(arg0); }, arguments) }; export function __wbg_fetch_9885d2e26ad251bb() { return logError(function (arg0, arg1) { const ret = arg0.fetch(arg1); return ret; }, arguments) }; export function __wbg_fetch_f156d10be9a5c88a() { return logError(function (arg0) { const ret = fetch(arg0); return ret; }, arguments) }; export function __wbg_getRandomValues_b8f5dbd5f3995a9e() { return handleError(function (arg0, arg1) { arg0.getRandomValues(arg1); }, arguments) }; export function __wbg_get_27b4bcbec57323ca() { return handleError(function (arg0, arg1) { const ret = Reflect.get(arg0, arg1); return ret; }, arguments) }; export function __wbg_get_59c6316d15f9f1d0() { return logError(function (arg0, arg1) { const ret = arg0[arg1 >>> 0]; return ret; }, arguments) }; export function __wbg_getwithrefkey_1dc361bd10053bfe() { return logError(function (arg0, arg1) { const ret = arg0[arg1]; return ret; }, arguments) }; export function __wbg_has_85abdd8aeb8edebf() { return handleError(function (arg0, arg1) { const ret = Reflect.has(arg0, arg1); _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_headers_177bc880a5823968() { return logError(function (arg0) { const ret = arg0.headers; return ret; }, arguments) }; export function __wbg_info_4c14802bfaf2f5be() { return logError(function (arg0, arg1, arg2, arg3) { console.info(arg0, arg1, arg2, arg3); }, arguments) }; export function __wbg_instanceof_ArrayBuffer_59339a3a6f0c10ea() { return logError(function (arg0) { let result; try { result = arg0 instanceof ArrayBuffer; } catch (_) { result = false; } const ret = result; _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_instanceof_Map_dd89a82d76d1b25f() { return logError(function (arg0) { let result; try { result = arg0 instanceof Map; } catch (_) { result = false; } const ret = result; _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_instanceof_Response_0ab386c6818f788a() { return logError(function (arg0) { let result; try { result = arg0 instanceof Response; } catch (_) { result = false; } const ret = result; _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_instanceof_Uint8Array_91f3c5adee7e6672() { return logError(function (arg0) { let result; try { result = arg0 instanceof Uint8Array; } catch (_) { result = false; } const ret = result; _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_isArray_bc2498eba6fcb71f() { return logError(function (arg0) { const ret = Array.isArray(arg0); _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_isSafeInteger_6091d6e3ee1b65fd() { return logError(function (arg0) { const ret = Number.isSafeInteger(arg0); _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_iterator_96378c3c9a17347c() { return logError(function () { const ret = Symbol.iterator; return ret; }, arguments) }; export function __wbg_length_246fa1f85a0dea5b() { return logError(function (arg0) { const ret = arg0.length; _assertNum(ret); return ret; }, arguments) }; export function __wbg_length_904c0910ed998bf3() { return logError(function (arg0) { const ret = arg0.length; _assertNum(ret); return ret; }, arguments) }; export function __wbg_log_cd247da40b37223b() { return logError(function (arg0, arg1, arg2, arg3) { console.log(arg0, arg1, arg2, arg3); }, arguments) }; export function __wbg_msCrypto_a61aeb35a24c1329() { return logError(function (arg0) { const ret = arg0.msCrypto; return ret; }, arguments) }; export function __wbg_new_12588505388d0897() { return handleError(function () { const ret = new Headers(); return ret; }, arguments) }; export function __wbg_new_1930cbb8d9ffc31b() { return logError(function () { const ret = new Object(); return ret; }, arguments) }; export function __wbg_new_56407f99198feff7() { return logError(function () { const ret = new Map(); return ret; }, arguments) }; export function __wbg_new_6a8b180049d9484e() { return handleError(function () { const ret = new AbortController(); return ret; }, arguments) }; export function __wbg_new_9190433fb67ed635() { return logError(function (arg0) { const ret = new Uint8Array(arg0); return ret; }, arguments) }; export function __wbg_new_d5e3800b120e37e1() { return logError(function (arg0, arg1) { try { var state0 = {a: arg0, b: arg1}; var cb0 = (arg0, arg1) => { const a = state0.a; state0.a = 0; try { return __wbg_adapter_195(a, state0.b, arg0, arg1); } finally { state0.a = a; } }; const ret = new Promise(cb0); return ret; } finally { state0.a = state0.b = 0; } }, arguments) }; export function __wbg_new_e969dc3f68d25093() { return logError(function () { const ret = new Array(); return ret; }, arguments) }; export function __wbg_newfromslice_d0d56929c6d9c842() { return logError(function (arg0, arg1) { const ret = new Uint8Array(getArrayU8FromWasm0(arg0, arg1)); return ret; }, arguments) }; export function __wbg_newnoargs_a81330f6e05d8aca() { return logError(function (arg0, arg1) { const ret = new Function(getStringFromWasm0(arg0, arg1)); return ret; }, arguments) }; export function __wbg_newwithlength_ed0ee6c1edca86fc() { return logError(function (arg0) { const ret = new Uint8Array(arg0 >>> 0); return ret; }, arguments) }; export function __wbg_newwithstrandinit_e8e22e9851f3c2fe() { return handleError(function (arg0, arg1, arg2) { const ret = new Request(getStringFromWasm0(arg0, arg1), arg2); return ret; }, arguments) }; export function __wbg_next_2e6b37020ac5fe58() { return handleError(function (arg0) { const ret = arg0.next(); return ret; }, arguments) }; export function __wbg_next_3de8f2669431a3ff() { return logError(function (arg0) { const ret = arg0.next; return ret; }, arguments) }; export function __wbg_node_905d3e251edff8a2() { return logError(function (arg0) { const ret = arg0.node; return ret; }, arguments) }; export function __wbg_now_2c95c9de01293173() { return logError(function (arg0) { const ret = arg0.now(); return ret; }, arguments) }; export function __wbg_parse_0eaa937cfd6388c4() { return handleError(function (arg0, arg1) { const ret = JSON.parse(getStringFromWasm0(arg0, arg1)); return ret; }, arguments) }; export function __wbg_performance_7a3ffd0b17f663ad() { return logError(function (arg0) { const ret = arg0.performance; return ret; }, arguments) }; export function __wbg_process_dc0fbacc7c1c06f7() { return logError(function (arg0) { const ret = arg0.process; return ret; }, arguments) }; export function __wbg_prototypesetcall_c5f74efd31aea86b() { return logError(function (arg0, arg1, arg2) { Uint8Array.prototype.set.call(getArrayU8FromWasm0(arg0, arg1), arg2); }, arguments) }; export function __wbg_queueMicrotask_bcc6e26d899696db() { return logError(function (arg0) { const ret = arg0.queueMicrotask; return ret; }, arguments) }; export function __wbg_queueMicrotask_f24a794d09c42640() { return logError(function (arg0) { queueMicrotask(arg0); }, arguments) }; export function __wbg_randomFillSync_ac0988aba3254290() { return handleError(function (arg0, arg1) { arg0.randomFillSync(arg1); }, arguments) }; export function __wbg_require_60cc747a6bc5215a() { return handleError(function () { const ret = module.require; return ret; }, arguments) }; export function __wbg_resolve_5775c0ef9222f556() { return logError(function (arg0) { const ret = Promise.resolve(arg0); return ret; }, arguments) }; export function __wbg_setTimeout_2b339866a2aa3789() { return logError(function (arg0, arg1) { const ret = setTimeout(arg0, arg1); return ret; }, arguments) }; export function __wbg_set_31197016f65a6a19() { return logError(function (arg0, arg1, arg2) { const ret = arg0.set(arg1, arg2); return ret; }, arguments) }; export function __wbg_set_3f1d0b984ed272ed() { return logError(function (arg0, arg1, arg2) { arg0[arg1] = arg2; }, arguments) }; export function __wbg_set_b33e7a98099eed58() { return handleError(function (arg0, arg1, arg2) { const ret = Reflect.set(arg0, arg1, arg2); _assertBoolean(ret); return ret; }, arguments) }; export function __wbg_set_d636a0463acf1dbc() { return logError(function (arg0, arg1, arg2) { arg0[arg1 >>> 0] = arg2; }, arguments) }; export function __wbg_setbody_e324371c31597f2a() { return logError(function (arg0, arg1) { arg0.body = arg1; }, arguments) }; export function __wbg_setcache_7c95e3469a5bfb76() { return logError(function (arg0, arg1) { arg0.cache = __wbindgen_enum_RequestCache[arg1]; }, arguments) }; export function __wbg_setcredentials_55a9317ed2777533() { return logError(function (arg0, arg1) { arg0.credentials = __wbindgen_enum_RequestCredentials[arg1]; }, arguments) }; export function __wbg_setheaders_ac0b1e4890a949cd() { return logError(function (arg0, arg1) { arg0.headers = arg1; }, arguments) }; export function __wbg_setmethod_9ce6e95af1ae0eaf() { return logError(function (arg0, arg1, arg2) { arg0.method = getStringFromWasm0(arg1, arg2); }, arguments) }; export function __wbg_setmode_b89d1784e7e7f118() { return logError(function (arg0, arg1) { arg0.mode = __wbindgen_enum_RequestMode[arg1]; }, arguments) }; export function __wbg_setsignal_e663c6d962763cd5() { return logError(function (arg0, arg1) { arg0.signal = arg1; }, arguments) }; export function __wbg_signal_bdb003fe19e53a13() { return logError(function (arg0) { const ret = arg0.signal; return ret; }, arguments) }; export function __wbg_static_accessor_GLOBAL_1f13249cc3acc96d() { return logError(function () { const ret = typeof global === 'undefined' ? null : global; return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); }, arguments) }; export function __wbg_static_accessor_GLOBAL_THIS_df7ae94b1e0ed6a3() { return logError(function () { const ret = typeof globalThis === 'undefined' ? null : globalThis; return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); }, arguments) }; export function __wbg_static_accessor_SELF_6265471db3b3c228() { return logError(function () { const ret = typeof self === 'undefined' ? null : self; return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); }, arguments) }; export function __wbg_static_accessor_WINDOW_16fb482f8ec52863() { return logError(function () { const ret = typeof window === 'undefined' ? null : window; return isLikeNone(ret) ? 0 : addToExternrefTable0(ret); }, arguments) }; export function __wbg_status_31874648c8651949() { return logError(function (arg0) { const ret = arg0.status; _assertNum(ret); return ret; }, arguments) }; export function __wbg_stringify_1f41b6198e0932e0() { return handleError(function (arg0) { const ret = JSON.stringify(arg0); return ret; }, arguments) }; export function __wbg_subarray_a219824899e59712() { return logError(function (arg0, arg1, arg2) { const ret = arg0.subarray(arg1 >>> 0, arg2 >>> 0); return ret; }, arguments) }; export function __wbg_text_42c080764c927da6() { return handleError(function (arg0) { const ret = arg0.text(); return ret; }, arguments) }; export function __wbg_then_8d2fcccde5380a03() { return logError(function (arg0, arg1, arg2) { const ret = arg0.then(arg1, arg2); return ret; }, arguments) }; export function __wbg_then_9cc266be2bf537b6() { return logError(function (arg0, arg1) { const ret = arg0.then(arg1); return ret; }, arguments) }; export function __wbg_url_d5273b9e10503471() { return logError(function (arg0, arg1) { const ret = arg1.url; const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }, arguments) }; export function __wbg_value_09d0b4eaab48b91d() { return logError(function (arg0) { const ret = arg0.value; return ret; }, arguments) }; export function __wbg_versions_c01dfd4722a88165() { return logError(function (arg0) { const ret = arg0.versions; return ret; }, arguments) }; export function __wbg_warn_426509218f81762d() { return logError(function (arg0, arg1, arg2, arg3) { console.warn(arg0, arg1, arg2, arg3); }, arguments) }; export function __wbg_wbindgenbigintgetasi64_7637cb1a7fb9a81e(arg0, arg1) { const v = arg1; const ret = typeof(v) === 'bigint' ? v : undefined; if (!isLikeNone(ret)) { _assertBigInt(ret); } getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); }; export function __wbg_wbindgenbooleanget_59f830b1a70d2530(arg0) { const v = arg0; const ret = typeof(v) === 'boolean' ? v : undefined; if (!isLikeNone(ret)) { _assertBoolean(ret); } return isLikeNone(ret) ? 0xFFFFFF : ret ? 1 : 0; }; export function __wbg_wbindgencbdrop_a85ed476c6a370b9(arg0) { const obj = arg0.original; if (obj.cnt-- == 1) { obj.a = 0; return true; } const ret = false; _assertBoolean(ret); return ret; }; export function __wbg_wbindgendebugstring_bb652b1bc2061b6d(arg0, arg1) { const ret = debugString(arg1); const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); const len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; export function __wbg_wbindgenin_192b210aa1c401e9(arg0, arg1) { const ret = arg0 in arg1; _assertBoolean(ret); return ret; }; export function __wbg_wbindgenisbigint_7d76a1ca6454e439(arg0) { const ret = typeof(arg0) === 'bigint'; _assertBoolean(ret); return ret; }; export function __wbg_wbindgenisfunction_ea72b9d66a0e1705(arg0) { const ret = typeof(arg0) === 'function'; _assertBoolean(ret); return ret; }; export function __wbg_wbindgenisobject_dfe064a121d87553(arg0) { const val = arg0; const ret = typeof(val) === 'object' && val !== null; _assertBoolean(ret); return ret; }; export function __wbg_wbindgenisstring_4b74e4111ba029e6(arg0) { const ret = typeof(arg0) === 'string'; _assertBoolean(ret); return ret; }; export function __wbg_wbindgenisundefined_71f08a6ade4354e7(arg0) { const ret = arg0 === undefined; _assertBoolean(ret); return ret; }; export function __wbg_wbindgenjsvaleq_f27272c0a890df7f(arg0, arg1) { const ret = arg0 === arg1; _assertBoolean(ret); return ret; }; export function __wbg_wbindgenjsvallooseeq_9dd7bb4b95ac195c(arg0, arg1) { const ret = arg0 == arg1; _assertBoolean(ret); return ret; }; export function __wbg_wbindgennumberget_d855f947247a3fbc(arg0, arg1) { const obj = arg1; const ret = typeof(obj) === 'number' ? obj : undefined; if (!isLikeNone(ret)) { _assertNum(ret); } getDataViewMemory0().setFloat64(arg0 + 8 * 1, isLikeNone(ret) ? 0 : ret, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true); }; export function __wbg_wbindgenstringget_43fe05afe34b0cb1(arg0, arg1) { const obj = arg1; const ret = typeof(obj) === 'string' ? obj : undefined; var ptr1 = isLikeNone(ret) ? 0 : passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); var len1 = WASM_VECTOR_LEN; getDataViewMemory0().setInt32(arg0 + 4 * 1, len1, true); getDataViewMemory0().setInt32(arg0 + 4 * 0, ptr1, true); }; export function __wbg_wbindgenthrow_4c11a24fca429ccf(arg0, arg1) { throw new Error(getStringFromWasm0(arg0, arg1)); }; export function __wbindgen_cast_2241b6af4c4b2941() { return logError(function (arg0, arg1) { // Cast intrinsic for `Ref(String) -> Externref`. const ret = getStringFromWasm0(arg0, arg1); return ret; }, arguments) }; export function __wbindgen_cast_4625c577ab2ec9ee() { return logError(function (arg0) { // Cast intrinsic for `U64 -> Externref`. const ret = BigInt.asUintN(64, arg0); return ret; }, arguments) }; export function __wbindgen_cast_58494022e70f54b0() { return logError(function (arg0, arg1) { // Cast intrinsic for `Closure(Closure { dtor_idx: 680, function: Function { arguments: [Externref], shim_idx: 681, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. const ret = makeMutClosure(arg0, arg1, 680, __wbg_adapter_8); return ret; }, arguments) }; export function __wbindgen_cast_9ae0607507abb057() { return logError(function (arg0) { // Cast intrinsic for `I64 -> Externref`. const ret = arg0; return ret; }, arguments) }; export function __wbindgen_cast_cb9088102bce6b30() { return logError(function (arg0, arg1) { // Cast intrinsic for `Ref(Slice(U8)) -> NamedExternref("Uint8Array")`. const ret = getArrayU8FromWasm0(arg0, arg1); return ret; }, arguments) }; export function __wbindgen_cast_d6cd19b81560fd6e() { return logError(function (arg0) { // Cast intrinsic for `F64 -> Externref`. const ret = arg0; return ret; }, arguments) }; export function __wbindgen_cast_e4869fcaa62df339() { return logError(function (arg0, arg1) { // Cast intrinsic for `Closure(Closure { dtor_idx: 663, function: Function { arguments: [], shim_idx: 664, ret: Unit, inner_ret: Some(Unit) }, mutable: true }) -> Externref`. const ret = makeMutClosure(arg0, arg1, 663, __wbg_adapter_13); return ret; }, arguments) }; export function __wbindgen_init_externref_table() { const table = wasm.__wbindgen_export_4; const offset = table.grow(4); table.set(0, undefined); table.set(offset + 0, undefined); table.set(offset + 1, null); table.set(offset + 2, true); table.set(offset + 3, false); ; };