@provablehq/wasm
Version:
SnarkVM WASM binaries with javascript bindings
1 lines • 1.33 MB
Source Map (JSON)
{"version":3,"file":"index.cjs","sources":["tmp/index.js","tmp/aleo_wasm_custom.js"],"sourcesContent":["function spawnWorker(url, module, memory, address) {\n return new Promise((resolve) => {\n const worker = new Worker(url, {\n type: \"module\",\n });\n\n worker.addEventListener(\"message\", (event) => {\n // This is needed in Node to wait one extra tick, so that way\n // the Worker can fully initialize before we return.\n setTimeout(() => {\n resolve(worker);\n\n // When running in Node, this allows the process to exit\n // even though the Worker is still running.\n if (worker.unref) {\n worker.unref();\n }\n }, 0);\n }, {\n capture: true,\n once: true,\n });\n\n worker.postMessage({\n module,\n memory,\n address,\n });\n });\n }\n\nlet wasm;\n\nlet heap = new Array(128).fill(undefined);\n\nheap.push(undefined, null, true, false);\n\nfunction getObject(idx) { return heap[idx]; }\n\nfunction isLikeNone(x) {\n return x === undefined || x === null;\n}\n\nfunction debugString(val) {\n // primitive types\n const type = typeof val;\n if (type == 'number' || type == 'boolean' || val == null) {\n return `${val}`;\n }\n if (type == 'string') {\n return `\"${val}\"`;\n }\n if (type == 'symbol') {\n const description = val.description;\n if (description == null) {\n return 'Symbol';\n } else {\n return `Symbol(${description})`;\n }\n }\n if (type == 'function') {\n const name = val.name;\n if (typeof name == 'string' && name.length > 0) {\n return `Function(${name})`;\n } else {\n return 'Function';\n }\n }\n // objects\n if (Array.isArray(val)) {\n const length = val.length;\n let debug = '[';\n if (length > 0) {\n debug += debugString(val[0]);\n }\n for(let i = 1; i < length; i++) {\n debug += ', ' + debugString(val[i]);\n }\n debug += ']';\n return debug;\n }\n // Test for built-in\n const builtInMatches = /\\[object ([^\\]]+)\\]/.exec(toString.call(val));\n let className;\n if (builtInMatches && builtInMatches.length > 1) {\n className = builtInMatches[1];\n } else {\n // Failed to match the standard '[object ClassName]'\n return toString.call(val);\n }\n if (className == 'Object') {\n // we're a user defined class or Object\n // JSON.stringify avoids problems with cycles, and is generally much\n // easier than looping through ownProperties of `val`.\n try {\n return 'Object(' + JSON.stringify(val) + ')';\n } catch (_) {\n return 'Object';\n }\n }\n // errors\n if (val instanceof Error) {\n return `${val.name}: ${val.message}\\n${val.stack}`;\n }\n // TODO we could test for more things here, like `Set`s and `Map`s.\n return className;\n}\n\nlet WASM_VECTOR_LEN = 0;\n\nlet cachedUint8ArrayMemory0 = null;\n\nfunction getUint8ArrayMemory0() {\n if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.buffer !== wasm.memory.buffer) {\n cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);\n }\n return cachedUint8ArrayMemory0;\n}\n\nconst cachedTextEncoder = (typeof TextEncoder !== 'undefined' ? new TextEncoder() : undefined);\n\nif (cachedTextEncoder) {\n cachedTextEncoder.encodeInto = function (arg, view) {\n const buf = cachedTextEncoder.encode(arg);\n view.set(buf);\n return {\n read: arg.length,\n written: buf.length\n };\n };\n}\n\nfunction passStringToWasm0(arg, malloc, realloc) {\n\n if (realloc === undefined) {\n const buf = cachedTextEncoder.encode(arg);\n const ptr = malloc(buf.length, 1) >>> 0;\n getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);\n WASM_VECTOR_LEN = buf.length;\n return ptr;\n }\n\n let len = arg.length;\n let ptr = malloc(len, 1) >>> 0;\n\n const mem = getUint8ArrayMemory0();\n\n let offset = 0;\n\n for (; offset < len; offset++) {\n const code = arg.charCodeAt(offset);\n if (code > 0x7F) break;\n mem[ptr + offset] = code;\n }\n\n if (offset !== len) {\n if (offset !== 0) {\n arg = arg.slice(offset);\n }\n ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;\n const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);\n const ret = cachedTextEncoder.encodeInto(arg, view);\n\n offset += ret.written;\n ptr = realloc(ptr, len, offset, 1) >>> 0;\n }\n\n WASM_VECTOR_LEN = offset;\n return ptr;\n}\n\nlet cachedDataViewMemory0 = null;\n\nfunction getDataViewMemory0() {\n if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer !== wasm.memory.buffer) {\n cachedDataViewMemory0 = new DataView(wasm.memory.buffer);\n }\n return cachedDataViewMemory0;\n}\n\nlet heap_next = heap.length;\n\nfunction addHeapObject(obj) {\n if (heap_next === heap.length) heap.push(heap.length + 1);\n const idx = heap_next;\n heap_next = heap[idx];\n\n heap[idx] = obj;\n return idx;\n}\n\nfunction dropObject(idx) {\n if (idx < 132) return;\n heap[idx] = heap_next;\n heap_next = idx;\n}\n\nfunction takeObject(idx) {\n const ret = getObject(idx);\n dropObject(idx);\n return ret;\n}\n\nlet cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : undefined);\n\nif (cachedTextDecoder) cachedTextDecoder.decode();\n\nconst MAX_SAFARI_DECODE_BYTES = 2146435072;\nlet numBytesDecoded = 0;\nfunction decodeText(ptr, len) {\n numBytesDecoded += len;\n if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {\n cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });\n cachedTextDecoder.decode();\n numBytesDecoded = len;\n }\n return cachedTextDecoder.decode(getUint8ArrayMemory0().slice(ptr, ptr + len));\n}\n\nfunction getStringFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return decodeText(ptr, len);\n}\n\nfunction handleError(f, args) {\n try {\n return f.apply(this, args);\n } catch (e) {\n wasm.__wbindgen_export3(addHeapObject(e));\n }\n}\n\nfunction getArrayU8FromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);\n}\n\nconst CLOSURE_DTORS = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(state => state.dtor(state.a, state.b));\n\nfunction makeMutClosure(arg0, arg1, dtor, f) {\n const state = { a: arg0, b: arg1, cnt: 1, dtor };\n const real = (...args) => {\n\n // First up with a closure we increment the internal reference\n // count. This ensures that the Rust closure environment won't\n // be deallocated while we're invoking it.\n state.cnt++;\n const a = state.a;\n state.a = 0;\n try {\n return f(a, state.b, ...args);\n } finally {\n state.a = a;\n real._wbg_cb_unref();\n }\n };\n real._wbg_cb_unref = () => {\n if (--state.cnt === 0) {\n state.dtor(state.a, state.b);\n state.a = 0;\n CLOSURE_DTORS.unregister(state);\n }\n };\n CLOSURE_DTORS.register(real, state, state);\n return real;\n}\n\nfunction _assertClass(instance, klass) {\n if (!(instance instanceof klass)) {\n throw new Error(`expected instance of ${klass.name}`);\n }\n}\n\nfunction passArray8ToWasm0(arg, malloc) {\n const ptr = malloc(arg.length * 1, 1) >>> 0;\n getUint8ArrayMemory0().set(arg, ptr / 1);\n WASM_VECTOR_LEN = arg.length;\n return ptr;\n}\n/**\n * @param {number} receiver\n */\nfunction runRayonThread(receiver) {\n wasm.runRayonThread(receiver);\n}\n\n/**\n * @param {URL} url\n * @param {number} num_threads\n * @returns {Promise<void>}\n */\nfunction initThreadPool(url, num_threads) {\n const ret = wasm.initThreadPool(addHeapObject(url), num_threads);\n return takeObject(ret);\n}\n\n/**\n * Set the WASM log level from JS. Called automatically by the SDK's\n * `setLogLevel(level)` to keep TS and WASM logging in sync.\n * Levels: 0=silent, 1=error, 2=warn, 3=info (default), 4=debug.\n * Values above 4 are clamped to debug.\n * @param {number} level\n */\nfunction setWasmLogLevel(level) {\n wasm.setWasmLogLevel(level);\n}\n\nlet stack_pointer = 128;\n\nfunction addBorrowedObject(obj) {\n if (stack_pointer == 1) throw new Error('out of js stack');\n heap[--stack_pointer] = obj;\n return stack_pointer;\n}\n/**\n * Verify a batch SNARK proof against multiple verifying keys and their corresponding public inputs.\n *\n * This function verifies a batch proof produced by Aleo programs that may not be deployed on chain.\n * Each verifying key is paired with one or more sets of public inputs (instances).\n *\n * @param {Array<string>} verifying_keys Array of verifying key strings, one per circuit\n * @param {Array<Array<Array<string>>>} inputs 3D array of field element strings [circuit_idx][instance_idx][field_idx]\n * @param {Proof} proof The batch proof to verify\n * @returns {boolean} True if the batch proof is valid, false otherwise\n * @param {Array<any>} verifying_keys\n * @param {Array<any>} inputs\n * @param {Proof} proof\n * @returns {boolean}\n */\nfunction snarkVerifyBatch(verifying_keys, inputs, proof) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(proof, Proof);\n wasm.snarkVerifyBatch(retptr, addHeapObject(verifying_keys), addHeapObject(inputs), proof.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return r0 !== 0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Verify a SNARK proof against a verifying key and public inputs.\n *\n * This function verifies a proof produced by an Aleo program that may not be deployed on chain.\n * It directly invokes the Varuna proof verification from snarkVM.\n *\n * @param {VerifyingKey} verifying_key The verifying key for the circuit\n * @param {Array<string>} inputs Array of field element strings representing public inputs (e.g. [\"1field\", \"2field\"])\n * @param {Proof} proof The proof to verify\n * @returns {boolean} True if the proof is valid, false otherwise\n * @param {VerifyingKey} verifying_key\n * @param {Array<any>} inputs\n * @param {Proof} proof\n * @returns {boolean}\n */\nfunction snarkVerify(verifying_key, inputs, proof) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(verifying_key, VerifyingKey);\n _assertClass(proof, Proof);\n wasm.snarkVerify(retptr, verifying_key.__wbg_ptr, addHeapObject(inputs), proof.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return r0 !== 0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Verify an execution. Executions with multiple transitions must have the program source code and\n * verifying keys of imported functions supplied from outside to correctly verify. Also, this does\n * not verify that the state root of the execution is included in the Aleo Network ledger.\n *\n * @param {Execution} execution The function execution to verify\n * @param {VerifyingKey} verifying_key The verifying key for the function\n * @param {Program} program The program that the function execution belongs to\n * @param {String} function_id The name of the function that was executed\n * @param {Object} imports The imports for the program in the form of { \"program_id.aleo\":\"source code\", ... }\n * @param {Object} import_verifying_keys The verifying keys for the imports in the form of { \"program_id.aleo\": [[\"function, \"verifying_key\"], ...], ...}\n * @returns {boolean} True if the execution is valid, false otherwise\n * @param {Execution} execution\n * @param {VerifyingKey} verifying_key\n * @param {Program} program\n * @param {string} function_id\n * @param {object | null | undefined} imports\n * @param {object | null | undefined} imported_verifying_keys\n * @param {number} block_height\n * @param {ProgramImports | null} [program_imports]\n * @returns {boolean}\n */\nfunction verifyFunctionExecution(execution, verifying_key, program, function_id, imports, imported_verifying_keys, block_height, program_imports) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(execution, Execution);\n _assertClass(verifying_key, VerifyingKey);\n _assertClass(program, Program);\n const ptr0 = passStringToWasm0(function_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n const len0 = WASM_VECTOR_LEN;\n let ptr1 = 0;\n if (!isLikeNone(program_imports)) {\n _assertClass(program_imports, ProgramImports);\n ptr1 = program_imports.__destroy_into_raw();\n }\n wasm.verifyFunctionExecution(retptr, execution.__wbg_ptr, verifying_key.__wbg_ptr, program.__wbg_ptr, ptr0, len0, isLikeNone(imports) ? 0 : addHeapObject(imports), isLikeNone(imported_verifying_keys) ? 0 : addHeapObject(imported_verifying_keys), block_height, ptr1);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return r0 !== 0;\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\n/**\n * Set test consensus version heights for testing.\n *\n * @param {string | undefined} heights The block heights at which each consensus version applies. This input should be a simple csv list of block heights and there should be one number for each consensus version. If left undefined, the default test heights will be applied.\n *\n * @example\n * import { getOrInitConsensusVersionTestHeights } from '@provablehq/sdk';\n *\n * Set the consensus version heights.\n * getOrInitConsensusVersionTestHeights(\"0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16\");\n * @param {string | null} [heights]\n * @returns {Array<any>}\n */\nfunction getOrInitConsensusVersionTestHeights(heights) {\n var ptr0 = isLikeNone(heights) ? 0 : passStringToWasm0(heights, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n var len0 = WASM_VECTOR_LEN;\n const ret = wasm.getOrInitConsensusVersionTestHeights(ptr0, len0);\n return takeObject(ret);\n}\n\n/**\n * @param {string} string\n * @returns {Field}\n */\nfunction stringToField(string) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(string, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n const len0 = WASM_VECTOR_LEN;\n wasm.stringToField(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Field.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n}\n\nfunction passArrayJsValueToWasm0(array, malloc) {\n const ptr = malloc(array.length * 4, 4) >>> 0;\n const mem = getDataViewMemory0();\n for (let i = 0; i < array.length; i++) {\n mem.setUint32(ptr + 4 * i, addHeapObject(array[i]), true);\n }\n WASM_VECTOR_LEN = array.length;\n return ptr;\n}\n\nfunction getArrayJsValueFromWasm0(ptr, len) {\n ptr = ptr >>> 0;\n const mem = getDataViewMemory0();\n const result = [];\n for (let i = ptr; i < ptr + 4 * len; i += 4) {\n result.push(takeObject(mem.getUint32(i, true)));\n }\n return result;\n}\nfunction __wasm_bindgen_func_elem_7392(arg0, arg1) {\n wasm.__wasm_bindgen_func_elem_7392(arg0, arg1);\n}\n\nfunction __wasm_bindgen_func_elem_8765(arg0, arg1, arg2) {\n wasm.__wasm_bindgen_func_elem_8765(arg0, arg1, addHeapObject(arg2));\n}\n\nfunction __wasm_bindgen_func_elem_7664(arg0, arg1, arg2, arg3) {\n wasm.__wasm_bindgen_func_elem_7664(arg0, arg1, addHeapObject(arg2), addHeapObject(arg3));\n}\n\nconst __wbindgen_enum_RequestCredentials = [\"omit\", \"same-origin\", \"include\"];\n\nconst __wbindgen_enum_RequestMode = [\"same-origin\", \"no-cors\", \"cors\", \"navigate\"];\n\nconst AddressFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_address_free(ptr >>> 0, 1));\n/**\n * Public address of an Aleo account\n */\nclass Address {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(Address.prototype);\n obj.__wbg_ptr = ptr;\n AddressFinalization.register(obj, obj.__wbg_ptr, obj);\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n AddressFinalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_address_free(ptr, 0);\n }\n /**\n * Get an address object from a group.\n *\n * @param {Group} group The group object.\n *\n * @returns {Address} The address object.\n * @param {Group} group\n * @returns {Address}\n */\n static fromGroup(group) {\n _assertClass(group, Group);\n var ptr0 = group.__destroy_into_raw();\n const ret = wasm.address_fromGroup(ptr0);\n return Address.__wrap(ret);\n }\n /**\n * Get the left endian boolean array representation of the bits of the address.\n * @returns {Array<any>}\n */\n toBitsLe() {\n const ret = wasm.address_toBitsLe(this.__wbg_ptr);\n return takeObject(ret);\n }\n /**\n * Get an address object from an array of fields.\n *\n * @param {Array} fields An array of fields.\n *\n * @returns {Plaintext} The address object.\n * @param {Array<any>} fields\n * @returns {Address}\n */\n static fromFields(fields) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.address_fromFields(retptr, addHeapObject(fields));\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Address.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Create an aleo address object from a string representation of an address.\n * The input is automatically lowercased before parsing.\n *\n * @param {string} address String representation of an address\n * @returns {Address} Address\n * @param {string} address\n * @returns {Address}\n */\n static from_string(address) {\n const ptr0 = passStringToWasm0(address, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n const len0 = WASM_VECTOR_LEN;\n const ret = wasm.address_from_string(ptr0, len0);\n return Address.__wrap(ret);\n }\n /**\n * Get the left endian byte array representation of the address.\n * @returns {Uint8Array}\n */\n toBytesLe() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.address_toBytesLe(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return takeObject(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Cast the address to an I8 with lossy truncation.\n * @returns {I8}\n */\n toI8Lossy() {\n const ret = wasm.address_toI8Lossy(this.__wbg_ptr);\n return I8.__wrap(ret);\n }\n /**\n * Cast the address to a U8 with lossy truncation.\n * @returns {U8}\n */\n toU8Lossy() {\n const ret = wasm.address_toI8Lossy(this.__wbg_ptr);\n return U8.__wrap(ret);\n }\n /**\n * Get an address from a series of bits represented as a boolean array.\n *\n * @param {Array} bits A left endian boolean array representing the bits of the address.\n *\n * @returns {Address} The address object.\n * @param {Array<any>} bits\n * @returns {Address}\n */\n static fromBitsLe(bits) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.address_fromBitsLe(retptr, addHeapObject(bits));\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Address.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Cast the address to an I16 with lossy truncation.\n * @returns {I16}\n */\n toI16Lossy() {\n const ret = wasm.address_toI16Lossy(this.__wbg_ptr);\n return I16.__wrap(ret);\n }\n /**\n * Cast the address to an I32 with lossy truncation.\n * @returns {I32}\n */\n toI32Lossy() {\n const ret = wasm.address_toI32Lossy(this.__wbg_ptr);\n return I32.__wrap(ret);\n }\n /**\n * Cast the address to an I64 with lossy truncation.\n * @returns {I64}\n */\n toI64Lossy() {\n const ret = wasm.address_toI64Lossy(this.__wbg_ptr);\n return I64.__wrap(ret);\n }\n /**\n * Get the plaintext representation of the address.\n * @returns {Plaintext}\n */\n toPlaintext() {\n const ret = wasm.address_toPlaintext(this.__wbg_ptr);\n return Plaintext.__wrap(ret);\n }\n /**\n * Get a string representation of an Aleo address object\n *\n * @returns {string} String representation of the address\n * @returns {string}\n */\n toString() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.address_toString(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);\n }\n }\n /**\n * Cast the address to a U16 with lossy truncation.\n * @returns {U16}\n */\n toU16Lossy() {\n const ret = wasm.address_toI16Lossy(this.__wbg_ptr);\n return U16.__wrap(ret);\n }\n /**\n * Cast the address to a U32 with lossy truncation.\n * @returns {U32}\n */\n toU32Lossy() {\n const ret = wasm.address_toI32Lossy(this.__wbg_ptr);\n return U32.__wrap(ret);\n }\n /**\n * Cast the address to a U64 with lossy truncation.\n * @returns {U64}\n */\n toU64Lossy() {\n const ret = wasm.address_toI64Lossy(this.__wbg_ptr);\n return U64.__wrap(ret);\n }\n /**\n * Get an address from a series of bytes.\n *\n * @param {Uint8Array} bytes A left endian byte array representing the address.\n *\n * @returns {Address} The address object.\n * @param {Uint8Array} bytes\n * @returns {Address}\n */\n static fromBytesLe(bytes) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.address_fromBytesLe(retptr, addHeapObject(bytes));\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Address.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Derive an Aleo address from a view key\n *\n * @param {ViewKey} view_key The view key to derive the address from\n * @returns {Address} Address corresponding to the view key\n * @param {ViewKey} view_key\n * @returns {Address}\n */\n static from_view_key(view_key) {\n _assertClass(view_key, ViewKey);\n const ret = wasm.address_from_view_key(view_key.__wbg_ptr);\n return Address.__wrap(ret);\n }\n /**\n * Cast the address to an I128 with lossy truncation.\n * @returns {I128}\n */\n toI128Lossy() {\n const ret = wasm.address_toI128Lossy(this.__wbg_ptr);\n return I128.__wrap(ret);\n }\n /**\n * Cast the address to a U128 with lossy truncation.\n * @returns {U128}\n */\n toU128Lossy() {\n const ret = wasm.address_toI128Lossy(this.__wbg_ptr);\n return U128.__wrap(ret);\n }\n /**\n * Get the address of a program based on the program ID.\n *\n * @param {string} program_id The program ID string.\n * @returns {Address} The address corresponding to the program ID.\n * @param {string} program_id\n * @returns {Address}\n */\n static fromProgramId(program_id) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(program_id, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n const len0 = WASM_VECTOR_LEN;\n wasm.address_fromProgramId(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Address.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Cast the address to a Scalar with lossy truncation (via x-coordinate).\n * @returns {Scalar}\n */\n toScalarLossy() {\n const ret = wasm.address_toScalarLossy(this.__wbg_ptr);\n return Scalar.__wrap(ret);\n }\n /**\n * Derive an Aleo address from a compute key.\n *\n * @param {ComputeKey} compute_key The compute key to derive the address from\n * @param {ComputeKey} compute_key\n * @returns {Address}\n */\n static from_compute_key(compute_key) {\n _assertClass(compute_key, ComputeKey);\n const ret = wasm.address_from_compute_key(compute_key.__wbg_ptr);\n return Address.__wrap(ret);\n }\n /**\n * Derive an Aleo address from a private key\n *\n * @param {PrivateKey} private_key The private key to derive the address from\n * @returns {Address} Address corresponding to the private key\n * @param {PrivateKey} private_key\n * @returns {Address}\n */\n static from_private_key(private_key) {\n _assertClass(private_key, PrivateKey);\n const ret = wasm.address_from_private_key(private_key.__wbg_ptr);\n return Address.__wrap(ret);\n }\n /**\n * Cast the address to a Boolean with lossy truncation (LSB of x-coordinate).\n * @returns {Boolean}\n */\n toBooleanLossy() {\n const ret = wasm.address_toBooleanLossy(this.__wbg_ptr);\n return Boolean.__wrap(ret);\n }\n /**\n * Verify a signature for a message signed by the address\n *\n * @param {Uint8Array} Byte array representing a message signed by the address\n * @returns {boolean} Boolean representing whether or not the signature is valid\n * @param {Uint8Array} message\n * @param {Signature} signature\n * @returns {boolean}\n */\n verify(message, signature) {\n const ptr0 = passArray8ToWasm0(message, wasm.__wbindgen_export);\n const len0 = WASM_VECTOR_LEN;\n _assertClass(signature, Signature);\n const ret = wasm.address_verify(this.__wbg_ptr, ptr0, len0, signature.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Check if the input is a valid Aleo address.\n * String addresses are automatically lowercased before validation.\n *\n * @param {string | Uint8Array} address - Either a string representation of an address\n * or a Uint8Array of bytes in little-endian format.\n * @returns {boolean} True if the input is a valid address, false otherwise.\n * @param {any} address\n * @returns {boolean}\n */\n static isValid(address) {\n const ret = wasm.address_isValid(addHeapObject(address));\n return ret !== 0;\n }\n /**\n * Cast the address to a Field element (x-coordinate of the underlying group point).\n * @returns {Field}\n */\n toField() {\n const ret = wasm.address_toField(this.__wbg_ptr);\n return Field.__wrap(ret);\n }\n /**\n * Get the group representation of the address object.\n * @returns {Group}\n */\n toGroup() {\n const ret = wasm.address_toGroup(this.__wbg_ptr);\n return Group.__wrap(ret);\n }\n /**\n * Get the field array representation of the address.\n * @returns {Array<any>}\n */\n toFields() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.address_toFields(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return takeObject(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Get a string representation of an Aleo address object\n *\n * @param {Address} Address\n * @returns {string} String representation of the address\n * @returns {string}\n */\n to_string() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.address_toString(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);\n }\n }\n}\nif (Symbol.dispose) Address.prototype[Symbol.dispose] = Address.prototype.free;\n\nconst AuthorizationFinalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_authorization_free(ptr >>> 0, 1));\n/**\n * Authorization object containing the authorization for a transaction.\n */\nclass Authorization {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(Authorization.prototype);\n obj.__wbg_ptr = ptr;\n AuthorizationFinalization.register(obj, obj.__wbg_ptr, obj);\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n AuthorizationFinalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_authorization_free(ptr, 0);\n }\n /**\n * Reconstructs an Authorization object from its string representation.\n *\n * @param {String} authorization The string representation of the Authorization.\n * @param {string} authorization\n * @returns {Authorization}\n */\n static fromString(authorization) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(authorization, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n const len0 = WASM_VECTOR_LEN;\n wasm.authorization_fromString(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Authorization.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Returns the left-endian byte representation of the Authorization.\n * @returns {Uint8Array}\n */\n toBytesLe() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.authorization_toBytesLe(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return takeObject(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Get the transitions in an Authorization.\n *\n * @returns {Array<Transition>} Array of transition objects\n * @returns {Array<any>}\n */\n transitions() {\n const ret = wasm.authorization_transitions(this.__wbg_ptr);\n return takeObject(ret);\n }\n /**\n * Creates an authorization object from a left-endian byte representation of an Authorization.\n *\n * @param {Uint8Array} bytes Left-endian bytes representing the Authorization.\n * @param {Uint8Array} bytes\n * @returns {Authorization}\n */\n static fromBytesLe(bytes) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.authorization_fromBytesLe(retptr, addHeapObject(bytes));\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Authorization.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Get the function name.\n *\n * @returns {string} The function name.\n * @returns {string}\n */\n functionName() {\n let deferred2_0;\n let deferred2_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.authorization_functionName(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n var r3 = getDataViewMemory0().getInt32(retptr + 4 * 3, true);\n var ptr1 = r0;\n var len1 = r1;\n if (r3) {\n ptr1 = 0; len1 = 0;\n throw takeObject(r2);\n }\n deferred2_0 = ptr1;\n deferred2_1 = len1;\n return getStringFromWasm0(ptr1, len1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export4(deferred2_0, deferred2_1, 1);\n }\n }\n /**\n * Returns `true` if the Authorization is for `credits.aleo/fee_public`.\n * @returns {boolean}\n */\n isFeePublic() {\n const ret = wasm.authorization_isFeePublic(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Returns `true` if the Authorization is for `credits.aleo/fee_private`.\n * @returns {boolean}\n */\n isFeePrivate() {\n const ret = wasm.authorization_isFeePrivate(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Returns the execution ID for the Authorization.\n *\n * @returns {Field} The execution ID for the Authorization, call toString() after this result to get the string representation.\n * @returns {Field}\n */\n toExecutionId() {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.authorization_toExecutionId(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Field.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Insert a transition into the Authorization.\n *\n * @param {Transition} transition The transition object to insert into the Authorization.\n * @param {Transition} transition\n */\n insertTransition(transition) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(transition, Transition);\n var ptr0 = transition.__destroy_into_raw();\n wasm.authorization_insertTransition(retptr, this.__wbg_ptr, ptr0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n if (r1) {\n throw takeObject(r0);\n }\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Returns the number of `Request`s in the Authorization.\n * @returns {number}\n */\n len() {\n const ret = wasm.authorization_len(this.__wbg_ptr);\n return ret >>> 0;\n }\n /**\n * Create a new authorization from a request object.\n *\n * @param {ExecutionRequest} request The ExecutionRequest to build the authorization from.\n * @param {ExecutionRequest} request\n * @returns {Authorization}\n */\n static new(request) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(request, ExecutionRequest);\n var ptr0 = request.__destroy_into_raw();\n wasm.authorization_new(retptr, ptr0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Authorization.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Check if an Authorization object is the same as another.\n *\n * @param {Authorization} other The Authorization object to determine equality with.\n * @param {Authorization} other\n * @returns {boolean}\n */\n equals(other) {\n _assertClass(other, Authorization);\n const ret = wasm.authorization_equals(this.__wbg_ptr, other.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Return `true` if the Authorization is empty.\n * @returns {boolean}\n */\n isEmpty() {\n const ret = wasm.authorization_isEmpty(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Returns `true` if the Authorization is for `credits.aleo/split`.\n * @returns {boolean}\n */\n isSplit() {\n const ret = wasm.authorization_isSplit(this.__wbg_ptr);\n return ret !== 0;\n }\n /**\n * Returns a new and independent replica of the Authorization.\n * @returns {Authorization}\n */\n replicate() {\n const ret = wasm.authorization_replicate(this.__wbg_ptr);\n return Authorization.__wrap(ret);\n }\n /**\n * Returns the string representation of the Authorization.\n * @returns {string}\n */\n toString() {\n let deferred1_0;\n let deferred1_1;\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.authorization_toString(retptr, this.__wbg_ptr);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n deferred1_0 = r0;\n deferred1_1 = r1;\n return getStringFromWasm0(r0, r1);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n wasm.__wbindgen_export4(deferred1_0, deferred1_1, 1);\n }\n }\n}\nif (Symbol.dispose) Authorization.prototype[Symbol.dispose] = Authorization.prototype.free;\n\nconst BHP1024Finalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_bhp1024_free(ptr >>> 0, 1));\n\nclass BHP1024 {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(BHP1024.prototype);\n obj.__wbg_ptr = ptr;\n BHP1024Finalization.register(obj, obj.__wbg_ptr, obj);\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n BHP1024Finalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_bhp1024_free(ptr, 0);\n }\n /**\n * Returns a BHP hash with an input hasher of 1024 bits.\n * @param {Array<any>} input\n * @returns {Group}\n */\n hashToGroup(input) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.bhp1024_hashToGroup(retptr, this.__wbg_ptr, addHeapObject(input));\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Group.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Returns a BHP commitment with an input hasher of 1024 bits and randomizer.\n * @param {Array<any>} input\n * @param {Scalar} randomizer\n * @returns {Group}\n */\n commitToGroup(input, randomizer) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(randomizer, Scalar);\n var ptr0 = randomizer.__destroy_into_raw();\n wasm.bhp1024_commitToGroup(retptr, this.__wbg_ptr, addHeapObject(input), ptr0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Group.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Create a BHP hasher with an input size of 1024 bits.\n */\n constructor() {\n const ret = wasm.bhp1024_new();\n this.__wbg_ptr = ret >>> 0;\n BHP1024Finalization.register(this, this.__wbg_ptr, this);\n return this;\n }\n /**\n * Returns the BHP hash with an input hasher of 1024 bits.\n * @param {Array<any>} input\n * @returns {Field}\n */\n hash(input) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.bhp1024_hash(retptr, this.__wbg_ptr, addHeapObject(input));\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Field.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Create a BHP hasher with an input size of 1024 bits with a custom domain separator.\n * @param {string} domain_separator\n * @returns {BHP1024}\n */\n static setup(domain_separator) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n const ptr0 = passStringToWasm0(domain_separator, wasm.__wbindgen_export, wasm.__wbindgen_export2);\n const len0 = WASM_VECTOR_LEN;\n wasm.bhp1024_setup(retptr, ptr0, len0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return BHP1024.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Returns a BHP commitment with an input hasher of 1024 bits and randomizer.\n * @param {Array<any>} input\n * @param {Scalar} randomizer\n * @returns {Field}\n */\n commit(input, randomizer) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n _assertClass(randomizer, Scalar);\n var ptr0 = randomizer.__destroy_into_raw();\n wasm.bhp1024_commit(retptr, this.__wbg_ptr, addHeapObject(input), ptr0);\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Field.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n}\nif (Symbol.dispose) BHP1024.prototype[Symbol.dispose] = BHP1024.prototype.free;\n\nconst BHP256Finalization = (typeof FinalizationRegistry === 'undefined')\n ? { register: () => {}, unregister: () => {} }\n : new FinalizationRegistry(ptr => wasm.__wbg_bhp256_free(ptr >>> 0, 1));\n\nclass BHP256 {\n\n static __wrap(ptr) {\n ptr = ptr >>> 0;\n const obj = Object.create(BHP256.prototype);\n obj.__wbg_ptr = ptr;\n BHP256Finalization.register(obj, obj.__wbg_ptr, obj);\n return obj;\n }\n\n __destroy_into_raw() {\n const ptr = this.__wbg_ptr;\n this.__wbg_ptr = 0;\n BHP256Finalization.unregister(this);\n return ptr;\n }\n\n free() {\n const ptr = this.__destroy_into_raw();\n wasm.__wbg_bhp256_free(ptr, 0);\n }\n /**\n * Returns a BHP hash with an input hasher of 256 bits.\n * @param {Array<any>} input\n * @returns {Group}\n */\n hashToGroup(input) {\n try {\n const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);\n wasm.bhp256_hashToGroup(retptr, this.__wbg_ptr, addHeapObject(input));\n var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);\n var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);\n var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);\n if (r2) {\n throw takeObject(r1);\n }\n return Group.__wrap(r0);\n } finally {\n wasm.__wbindgen_add_to_stack_pointer(16);\n }\n }\n /**\n * Returns a BHP commitment with an input hasher of 256 bits and randomizer.\n * @param {Arra