@miden-sdk/miden-sdk 0.15.0-alpha.6 → 0.15.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../js/constants.js","../../js/syncLock.js","../../js/utils.js","../../js/resources/accounts.js","../../js/resources/transactions.js","../../js/resources/notes.js","../../js/resources/tags.js","../../js/resources/settings.js","../../js/resources/compiler.js","../../js/resources/keystore.js","../../js/client.js","../../js/standalone.js","../../js/storageView.js","../../js/index.js"],"sourcesContent":["export const WorkerAction = Object.freeze({\n INIT: \"init\",\n INIT_MOCK: \"initMock\",\n INIT_THREAD_POOL: \"initThreadPool\",\n CALL_METHOD: \"callMethod\",\n EXECUTE_CALLBACK: \"executeCallback\",\n});\n\nexport const CallbackType = Object.freeze({\n GET_KEY: \"getKey\",\n INSERT_KEY: \"insertKey\",\n SIGN: \"sign\",\n});\n\nexport const MethodName = Object.freeze({\n CREATE_CLIENT: \"createClient\",\n APPLY_TRANSACTION: \"applyTransaction\",\n EXECUTE_TRANSACTION: \"executeTransaction\",\n PROVE_TRANSACTION: \"proveTransaction\",\n SUBMIT_NEW_TRANSACTION: \"submitNewTransaction\",\n SUBMIT_NEW_TRANSACTION_MOCK: \"submitNewTransactionMock\",\n SUBMIT_NEW_TRANSACTION_WITH_PROVER: \"submitNewTransactionWithProver\",\n SUBMIT_NEW_TRANSACTION_WITH_PROVER_MOCK: \"submitNewTransactionWithProverMock\",\n SYNC_STATE: \"syncState\",\n SYNC_STATE_MOCK: \"syncStateMock\",\n SYNC_CHAIN: \"syncChain\",\n SYNC_CHAIN_MOCK: \"syncChainMock\",\n SYNC_NOTE_TRANSPORT: \"syncNoteTransport\",\n SYNC_NOTE_TRANSPORT_MOCK: \"syncNoteTransportMock\",\n});\n","/**\n * Sync Lock Module\n *\n * Coordinates concurrent sync calls using the Web Locks API.\n *\n * Behavior:\n * - Same-method coalescing: if a sync of the same method is in progress,\n * subsequent callers share its result promise\n * - Different-method serialization: different methods (e.g. syncState vs\n * syncNoteTransport) wait for each other via the Web Lock, or via an\n * in-process per-dbId promise chain when Web Locks are unavailable\n * - Web Locks also serialize across tabs (Chrome 69+, Safari 15.4+)\n */\n\n/**\n * Check if the Web Locks API is available.\n */\nexport function hasWebLocks() {\n return (\n typeof navigator !== \"undefined\" &&\n navigator.locks !== undefined &&\n typeof navigator.locks.request === \"function\"\n );\n}\n\n// Coalesce map keyed by `${dbId}:${methodId}` -> in-flight promise.\nconst inFlight = new Map();\n\n// Per-dbId promise tail used to serialize cross-method calls when Web Locks\n// are unavailable. Each new task chains onto the current tail so different\n// methods on the same dbId run sequentially within the tab.\nconst fallbackTails = new Map();\n\n/**\n * Build the coalesce-map key for an in-flight sync of `(dbId, methodId)`.\n *\n * @param {string} dbId\n * @param {string} methodId\n * @returns {string}\n */\nfunction coalesceKey(dbId, methodId) {\n return `${dbId}:${methodId}`;\n}\n\n/**\n * Run `fn` while holding the per-db Web Lock. When Web Locks are unavailable,\n * serializes `fn` against any other in-flight call on the same `dbId` via an\n * in-process promise chain — the wasm-bindgen `WebClient` uses a synchronous\n * `RefCell` for interior mutability in the browser, so overlapping\n * cross-method borrows would throw \"recursive use of an object detected\n * which would lead to unsafe aliasing in rust\".\n *\n * @param {string} dbId\n * @param {() => Promise<T>} fn\n * @returns {Promise<T>}\n * @template T\n */\nfunction runUnderLock(dbId, fn) {\n if (!hasWebLocks()) {\n const prev = fallbackTails.get(dbId) ?? Promise.resolve();\n const next = prev.catch(() => {}).then(fn);\n const guarded = next.catch(() => {});\n fallbackTails.set(dbId, guarded);\n guarded.then(() => {\n // Drop the slot only if no successor chained onto this tail.\n if (fallbackTails.get(dbId) === guarded) fallbackTails.delete(dbId);\n });\n return next;\n }\n return navigator.locks.request(\n `miden-sync-${dbId}`,\n { mode: \"exclusive\" },\n fn\n );\n}\n\n/**\n * Run `fn` under the sync lock for (dbId, methodId).\n *\n * Concurrent calls with the same (dbId, methodId) share the same promise\n * (coalescing). Concurrent calls on the same dbId with different methodIds\n * serialize via the Web Lock.\n *\n * @param {string} dbId - Database ID\n * @param {string} methodId - Method identifier (see MethodName constants)\n * @param {() => Promise<T>} fn - Work to run under the lock\n * @returns {Promise<T>}\n */\nexport function withSyncLock(dbId, methodId, fn) {\n const key = coalesceKey(dbId, methodId);\n\n let work = inFlight.get(key);\n if (!work) {\n work = runUnderLock(dbId, fn);\n inFlight.set(key, work);\n // Swallow on the derived promise so a rejection here doesn't surface as\n // an unhandled rejection; the caller still sees the error through `work`.\n work\n .finally(() => {\n if (inFlight.get(key) === work) inFlight.delete(key);\n })\n .catch(() => {});\n }\n\n return work;\n}\n","/**\n * Shared utility functions for the MidenClient resource classes.\n * Each function accepts a `wasm` parameter (the WASM module) for constructing typed objects.\n */\n\n/**\n * Resolves an AccountRef (string | Account | AccountId) to an AccountId.\n *\n * - Strings starting with `0x`/`0X` are parsed as hex via `AccountId.fromHex()`.\n * - Other strings are parsed as bech32 via `AccountId.fromBech32()`.\n * - Objects with an `.id()` method (Account) are resolved by calling `.id()`.\n * - Otherwise, the value is assumed to be an AccountId pass-through.\n *\n * @param {string | Account | AccountId} ref - The account reference to resolve.\n * @param {object} wasm - The WASM module.\n * @returns {AccountId} The resolved AccountId.\n */\nexport function resolveAccountRef(ref, wasm) {\n if (ref == null) {\n throw new Error(\"Account reference cannot be null or undefined\");\n }\n if (typeof ref === \"string\") {\n if (ref.startsWith(\"0x\") || ref.startsWith(\"0X\")) {\n return wasm.AccountId.fromHex(ref);\n }\n return wasm.AccountId.fromBech32(ref);\n }\n if (ref && typeof ref.id === \"function\") {\n return ref.id();\n }\n return ref;\n}\n\n/**\n * Resolves an AccountRef to a WASM Address object.\n *\n * - Strings starting with bech32 prefixes (`m`) are parsed via `Address.fromBech32()`.\n * - Strings starting with `0x`/`0X` are parsed as hex AccountId, then wrapped in Address.\n * - Account objects are resolved via `.id()` then wrapped in Address.\n * - AccountId objects are wrapped in Address directly.\n *\n * @param {string | Account | AccountId} ref - The account reference to resolve.\n * @param {object} wasm - The WASM module.\n * @returns {Address} The resolved Address.\n */\nexport function resolveAddress(ref, wasm) {\n if (ref == null) {\n throw new Error(\"Address reference cannot be null or undefined\");\n }\n if (typeof ref === \"string\") {\n if (ref.startsWith(\"0x\") || ref.startsWith(\"0X\")) {\n const accountId = wasm.AccountId.fromHex(ref);\n return wasm.Address.fromAccountId(accountId, undefined);\n }\n return wasm.Address.fromBech32(ref);\n }\n if (ref && typeof ref.id === \"function\") {\n const accountId = ref.id();\n return wasm.Address.fromAccountId(accountId, undefined);\n }\n return wasm.Address.fromAccountId(ref, undefined);\n}\n\n/**\n * Resolves a NoteVisibility string to a WASM NoteType value.\n *\n * @param {string | undefined} type - \"public\" or \"private\". Defaults to \"public\".\n * @param {object} wasm - The WASM module.\n * @returns {number} The NoteType enum value.\n */\nexport function resolveNoteType(type, wasm) {\n if (type === \"private\") {\n return wasm.NoteType.Private;\n }\n if (type === \"public\" || type == null) {\n return wasm.NoteType.Public;\n }\n throw new Error(\n `Unknown note type: \"${type}\". Expected \"public\" or \"private\".`\n );\n}\n\n/**\n * Resolves a storage mode string to a WASM AccountStorageMode instance.\n *\n * @param {string | undefined} mode - \"private\", \"public\", or \"network\". Defaults to \"private\".\n * @param {object} wasm - The WASM module.\n * @returns {AccountStorageMode} The storage mode instance.\n */\nexport function resolveStorageMode(mode, wasm) {\n switch (mode) {\n case \"public\":\n return wasm.AccountStorageMode.public();\n case \"network\":\n return wasm.AccountStorageMode.network();\n case \"private\":\n case undefined:\n case null:\n return wasm.AccountStorageMode.private();\n default:\n throw new Error(\n `Unknown storage mode: \"${mode}\". Expected \"private\", \"public\", or \"network\".`\n );\n }\n}\n\n/**\n * Resolves an auth scheme string to a WASM AuthScheme enum value.\n *\n * @param {string | undefined} scheme - \"falcon\" or \"ecdsa\". Defaults to \"falcon\".\n * @param {object} wasm - The WASM module.\n * @returns {number} The AuthScheme enum value.\n */\nexport function resolveAuthScheme(scheme, wasm) {\n if (scheme === \"ecdsa\") {\n return wasm.AuthScheme.AuthEcdsaK256Keccak;\n }\n if (scheme === \"falcon\" || scheme == null) {\n return wasm.AuthScheme.AuthRpoFalcon512;\n }\n throw new Error(\n `Unknown auth scheme: \"${scheme}\". Expected \"falcon\" or \"ecdsa\".`\n );\n}\n\n/**\n * Resolves an AccountType value to a boolean `mutable` flag\n * for the underlying WASM `newWallet()` / `importPublicAccountFromSeed()` calls.\n *\n * Accepts the numeric WASM enum values (2 = immutable, 3 = mutable) or the\n * legacy string aliases (\"MutableWallet\", \"ImmutableWallet\"). Defaults to\n * mutable when undefined.\n *\n * @param {number | string | undefined} accountType\n * @returns {boolean} Whether the account code is mutable.\n */\nexport function resolveAccountMutability(accountType) {\n if (\n accountType == null ||\n accountType === \"MutableWallet\" ||\n accountType === 3\n ) {\n return true;\n }\n if (accountType === \"ImmutableWallet\" || accountType === 2) {\n return false;\n }\n throw new Error(\n `Unknown wallet account type: \"${accountType}\". Expected AccountType.MutableWallet (3) or AccountType.ImmutableWallet (2).`\n );\n}\n\n/**\n * Resolves a NoteInput (string | NoteId | InputNoteRecord | Note) to a hex string.\n *\n * - Strings are passed through unchanged.\n * - NoteId WASM objects are converted via `.toString()`.\n * - InputNoteRecord and Note objects (with an `.id()` method) are resolved via `.id().toString()`.\n *\n * @param {string | object} input - The note reference to resolve.\n * @returns {string} The hex note ID string.\n */\nexport function resolveNoteIdHex(input) {\n if (input == null) {\n throw new Error(\"Note ID cannot be null or undefined\");\n }\n if (typeof input === \"string\") {\n return input;\n }\n // NoteId WASM object — has toString() but not id() (unlike InputNoteRecord/Note).\n // Check for constructor.fromHex to distinguish from plain objects (which also inherit toString).\n if (\n typeof input.toString === \"function\" &&\n typeof input.id !== \"function\" &&\n input.constructor?.fromHex !== undefined\n ) {\n return input.toString();\n }\n // InputNoteRecord, Note, or other object with id() returning NoteId\n if (typeof input.id === \"function\") {\n return input.id().toString();\n }\n throw new TypeError(\n `Cannot resolve note ID: expected string, NoteId, InputNoteRecord, or Note, got ${typeof input}`\n );\n}\n\n/**\n * Resolves a TransactionId reference (string | TransactionId) to a hex string.\n *\n * - Strings are passed through unchanged.\n * - TransactionId WASM objects are converted via `.toHex()`.\n *\n * @param {string | object} input - The transaction ID reference to resolve.\n * @returns {string} The hex transaction ID string.\n */\nexport function resolveTransactionIdHex(input) {\n if (input == null) {\n throw new Error(\"Transaction ID cannot be null or undefined\");\n }\n if (typeof input === \"string\") {\n return input;\n }\n // TransactionId WASM object — toHex() returns hex\n if (typeof input.toHex === \"function\") {\n return input.toHex();\n }\n throw new TypeError(\n `Cannot resolve transaction ID: expected string or TransactionId, got ${typeof input}`\n );\n}\n\n/**\n * Hashes a seed value. Strings are hashed via SHA-256 to produce a 32-byte Uint8Array.\n * Uint8Array values are passed through unchanged.\n *\n * @param {string | Uint8Array} seed - The seed to hash.\n * @returns {Promise<Uint8Array>} The hashed seed.\n */\nexport async function hashSeed(seed) {\n if (seed instanceof Uint8Array) {\n return seed;\n }\n if (typeof seed === \"string\") {\n const encoded = new TextEncoder().encode(seed);\n const hash = await crypto.subtle.digest(\"SHA-256\", encoded);\n return new Uint8Array(hash);\n }\n throw new TypeError(\n `Invalid seed type: expected string or Uint8Array, got ${typeof seed}`\n );\n}\n","import {\n resolveAccountRef,\n resolveStorageMode,\n resolveAuthScheme,\n resolveAccountMutability,\n hashSeed,\n} from \"../utils.js\";\n\nexport class AccountsResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n async create(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n const type = opts?.type;\n\n if (\n type === 0 ||\n type === 1 ||\n type === \"FungibleFaucet\" ||\n type === \"NonFungibleFaucet\"\n ) {\n const storageMode = resolveStorageMode(opts.storage ?? \"public\", wasm);\n const authScheme = resolveAuthScheme(opts.auth, wasm);\n return await this.#inner.newFaucet(\n storageMode,\n type === 1 || type === \"NonFungibleFaucet\",\n opts.name ?? opts.symbol,\n opts.symbol,\n opts.decimals,\n BigInt(opts.maxSupply),\n authScheme\n );\n } else if (\n type === \"ImmutableContract\" ||\n type === \"MutableContract\" ||\n opts?.components // Contracts are distinguished from wallets by having components\n ) {\n return await this.#createContract(opts, wasm);\n } else {\n // Default: wallet (mutable or immutable based on type)\n const mutable = resolveAccountMutability(opts?.type);\n const storageMode = resolveStorageMode(opts?.storage ?? \"private\", wasm);\n const authScheme = resolveAuthScheme(opts?.auth, wasm);\n const seed = opts?.seed ? await hashSeed(opts.seed) : undefined;\n return await this.#inner.newWallet(\n storageMode,\n mutable,\n authScheme,\n seed\n );\n }\n }\n\n async #createContract(opts, wasm) {\n if (!opts.seed)\n throw new Error(\"Contract creation requires a 'seed' (Uint8Array)\");\n if (!opts.auth)\n throw new Error(\"Contract creation requires an 'auth' (AuthSecretKey)\");\n\n // The 0.15 protocol has no code-mutability distinction, so the `type`\n // (\"ImmutableContract\" / \"MutableContract\") only steers routing here; the\n // account's on-chain visibility is set entirely by `storageMode`.\n const storageMode = resolveStorageMode(opts.storage ?? \"public\", wasm);\n const authComponent =\n wasm.AccountComponent.createAuthComponentFromSecretKey(opts.auth);\n\n // Schema commitment from `build()` is not a substitute for contract code; require explicit\n // `components` so auth-only contracts are rejected at this layer.\n const components = opts.components ?? [];\n if (components.length === 0) {\n throw new Error(\n \"Contract accounts require at least one non-auth procedure: pass at least one entry in `components`.\"\n );\n }\n\n let builder = new wasm.AccountBuilder(opts.seed)\n .storageMode(storageMode)\n .withAuthComponent(authComponent);\n\n for (const component of components) {\n builder = builder.withComponent(component);\n }\n\n const built = builder.build();\n const account = built.account;\n\n await this.#inner.newAccountWithSecretKey(account, opts.auth);\n return account;\n }\n\n async insert({ account, overwrite = false }) {\n this.#client.assertNotTerminated();\n await this.#inner.newAccount(account, overwrite);\n }\n\n async getOrImport(ref) {\n this.#client.assertNotTerminated();\n return (await this.get(ref)) ?? (await this.import(ref));\n }\n\n async get(ref) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const account = await this.#inner.getAccount(id);\n return account ?? null;\n }\n\n async list() {\n this.#client.assertNotTerminated();\n return await this.#inner.getAccounts();\n }\n\n async getDetails(ref) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const account = await this.#inner.getAccount(id);\n if (!account) {\n throw new Error(`Account not found: ${id.toString()}`);\n }\n const keys = this.#inner.keystore\n ? await this.#inner.keystore.getCommitments(id)\n : await this.#inner.getPublicKeyCommitmentsOfAccount(id);\n return {\n account,\n vault: account.vault(),\n storage: account.storage(),\n code: account.code() ?? null,\n keys,\n };\n }\n\n async getBalance(accountRef, tokenRef) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(accountRef, wasm);\n const faucetId = resolveAccountRef(tokenRef, wasm);\n const reader = await this.#inner.accountReader(accountId);\n return await reader.getBalance(faucetId);\n }\n\n async import(input) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n // Early exit for string, Account, and AccountHeader types before property\n // checks, preventing misrouting if a WASM object ever gains a .file or .seed\n // property. Bare AccountId (no .id() method) falls through to the fallback.\n if (typeof input === \"string\" || typeof input.id === \"function\") {\n const id = resolveAccountRef(input, wasm);\n await this.#inner.importAccountById(id);\n return await this.#inner.getAccount(id);\n }\n\n if (input.file) {\n // Extract accountId before importAccountFile — WASM consumes the\n // AccountFile by value, invalidating the JS wrapper after the call.\n const accountId =\n typeof input.file.accountId === \"function\"\n ? input.file.accountId()\n : null;\n await this.#inner.importAccountFile(input.file);\n if (accountId) {\n return await this.#inner.getAccount(accountId);\n }\n throw new Error(\n \"Could not determine account ID from AccountFile. \" +\n \"Ensure the file contains a valid account.\"\n );\n }\n\n if (input.seed) {\n // Import public account from seed\n const authScheme = resolveAuthScheme(input.auth, wasm);\n const mutable = resolveAccountMutability(input.type);\n return await this.#inner.importPublicAccountFromSeed(\n input.seed,\n mutable,\n authScheme\n );\n }\n\n // Fallback: treat as AccountRef (string, AccountId, Account, AccountHeader)\n const id = resolveAccountRef(input, wasm);\n await this.#inner.importAccountById(id);\n return await this.#inner.getAccount(id);\n }\n\n async export(ref) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n return await this.#inner.exportAccountFile(id);\n }\n\n async addAddress(ref, addr) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const address = wasm.Address.fromBech32(addr);\n await this.#inner.insertAccountAddress(id, address);\n }\n\n async removeAddress(ref, addr) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const address = wasm.Address.fromBech32(addr);\n await this.#inner.removeAccountAddress(id, address);\n }\n}\n","import {\n resolveAccountRef,\n resolveNoteType,\n resolveTransactionIdHex,\n} from \"../utils.js\";\n\nexport class TransactionsResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n async send(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n if (opts.returnNote === true) {\n // returnNote path — build the P2ID note in JS so we can return the Note\n // object to the caller (e.g. for out-of-band delivery to the recipient).\n if (opts.reclaimAfter != null || opts.timelockUntil != null) {\n throw new Error(\n \"reclaimAfter and timelockUntil are not supported when returnNote is true\"\n );\n }\n\n const senderId = resolveAccountRef(opts.account, wasm);\n const receiverId = resolveAccountRef(opts.to, wasm);\n const faucetId = resolveAccountRef(opts.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n\n const note = wasm.Note.createP2IDNote(\n senderId,\n receiverId,\n new wasm.NoteAssets([\n new wasm.FungibleAsset(faucetId, BigInt(opts.amount)),\n ]),\n noteType,\n new wasm.NoteAttachment()\n );\n\n // NoteArray constructor consumes its elements; use push(&note) to keep\n // `note` valid so we can return it to the caller below.\n const ownOutputs = new wasm.NoteArray();\n ownOutputs.push(note);\n const request = new wasm.TransactionRequestBuilder()\n .withOwnOutputNotes(ownOutputs)\n .build();\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n senderId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, note, result };\n }\n\n // Default path — note built in WASM with optional reclaim/timelock\n const { accountId, request } = await this.#buildSendRequest(opts, wasm);\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, note: null, result };\n }\n\n async mint(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildMintRequest(opts, wasm);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async consume(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildConsumeRequest(opts, wasm);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async consumeAll(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n // getConsumableNotes takes AccountId by value (consumed by WASM).\n // Save hex so we can reconstruct for submitNewTransaction.\n const accountId = resolveAccountRef(opts.account, wasm);\n const accountIdHex = accountId.toString();\n const consumable = await this.#inner.getConsumableNotes(accountId);\n\n if (!consumable || consumable.length === 0) {\n return { txId: null, consumed: 0, remaining: 0 };\n }\n\n const total = consumable.length;\n const toConsume =\n opts.maxNotes != null ? consumable.slice(0, opts.maxNotes) : consumable;\n\n if (toConsume.length === 0) {\n return { txId: null, consumed: 0, remaining: total };\n }\n\n const notes = toConsume.map((c) => c.inputNoteRecord().toNote());\n\n const request = await this.#inner.newConsumeTransactionRequest(notes);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n wasm.AccountId.fromHex(accountIdHex),\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return {\n txId,\n consumed: toConsume.length,\n remaining: total - toConsume.length,\n result,\n };\n }\n\n async swap(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildSwapRequest(opts, wasm);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n /** Create a partial-swap (PSWAP) note. See {@link PswapCreateOptions}. */\n async pswapCreate(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildPswapCreateRequest(\n opts,\n wasm\n );\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n /** Consume (fully or partially fill) a PSWAP note. See {@link PswapConsumeOptions}. */\n async pswapConsume(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildPswapConsumeRequest(\n opts,\n wasm\n );\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n /** Cancel a PSWAP note as its creator and reclaim the offered asset. See {@link PswapCancelOptions}. */\n async pswapCancel(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildPswapCancelRequest(\n opts,\n wasm\n );\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async preview(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n let accountId;\n let request;\n\n switch (opts.operation) {\n case \"send\": {\n ({ accountId, request } = await this.#buildSendRequest(opts, wasm));\n break;\n }\n case \"mint\": {\n ({ accountId, request } = await this.#buildMintRequest(opts, wasm));\n break;\n }\n case \"consume\": {\n ({ accountId, request } = await this.#buildConsumeRequest(opts, wasm));\n break;\n }\n case \"swap\": {\n ({ accountId, request } = await this.#buildSwapRequest(opts, wasm));\n break;\n }\n case \"pswapCreate\": {\n ({ accountId, request } = await this.#buildPswapCreateRequest(\n opts,\n wasm\n ));\n break;\n }\n case \"pswapConsume\": {\n ({ accountId, request } = await this.#buildPswapConsumeRequest(\n opts,\n wasm\n ));\n break;\n }\n case \"pswapCancel\": {\n ({ accountId, request } = await this.#buildPswapCancelRequest(\n opts,\n wasm\n ));\n break;\n }\n case \"custom\": {\n accountId = resolveAccountRef(opts.account, wasm);\n request = opts.request;\n break;\n }\n default:\n throw new Error(`Unknown preview operation: ${opts.operation}`);\n }\n\n return await this.#inner.executeForSummary(accountId, request);\n }\n\n async execute(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(opts.account, wasm);\n\n let builder = new wasm.TransactionRequestBuilder().withCustomScript(\n opts.script\n );\n\n if (opts.foreignAccounts?.length) {\n const accounts = opts.foreignAccounts.map((fa) => {\n // Distinguish { id: AccountRef, storage? } wrapper objects from WASM types\n // (Account/AccountHeader expose .id() as a method, wrappers have .id as a property)\n const isWrapper =\n fa !== null &&\n typeof fa === \"object\" &&\n \"id\" in fa &&\n typeof fa.id !== \"function\";\n const id = resolveAccountRef(isWrapper ? fa.id : fa, wasm);\n const storage =\n isWrapper && fa.storage\n ? fa.storage\n : new wasm.AccountStorageRequirements();\n return wasm.ForeignAccount.public(id, storage);\n });\n builder = builder.withForeignAccounts(\n new wasm.ForeignAccountArray(accounts)\n );\n }\n\n const request = builder.build();\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async executeProgram(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(opts.account, wasm);\n\n let foreignAccountsArray = new wasm.ForeignAccountArray();\n if (opts.foreignAccounts?.length) {\n const accounts = opts.foreignAccounts.map((fa) => {\n const isWrapper =\n fa !== null &&\n typeof fa === \"object\" &&\n \"id\" in fa &&\n typeof fa.id !== \"function\";\n const id = resolveAccountRef(isWrapper ? fa.id : fa, wasm);\n const storage =\n isWrapper && fa.storage\n ? fa.storage\n : new wasm.AccountStorageRequirements();\n return wasm.ForeignAccount.public(id, storage);\n });\n foreignAccountsArray = new wasm.ForeignAccountArray(accounts);\n }\n\n return await this.#inner.executeProgram(\n accountId,\n opts.script,\n opts.adviceInputs ?? new wasm.AdviceInputs(),\n foreignAccountsArray\n );\n }\n\n async submit(account, request, opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(account, wasm);\n return await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts?.prover\n );\n }\n\n async list(query) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n let filter;\n if (!query) {\n filter = wasm.TransactionFilter.all();\n } else if (query.status === \"uncommitted\") {\n filter = wasm.TransactionFilter.uncommitted();\n } else if (query.ids) {\n const txIds = query.ids.map((id) =>\n wasm.TransactionId.fromHex(resolveTransactionIdHex(id))\n );\n filter = wasm.TransactionFilter.ids(txIds);\n } else if (query.expiredBefore !== undefined) {\n filter = wasm.TransactionFilter.expiredBefore(query.expiredBefore);\n } else {\n filter = wasm.TransactionFilter.all();\n }\n\n return await this.#inner.getTransactions(filter);\n }\n\n /**\n * Polls for transaction confirmation.\n *\n * @param {string | TransactionId} txId - Transaction ID hex string or TransactionId object.\n * @param {WaitOptions} [opts] - Polling options.\n * @param {number} [opts.timeout=60000] - Wall-clock polling timeout in\n * milliseconds. This is NOT a block height — it controls how long the\n * client waits before giving up. Set to 0 to disable the timeout and poll\n * indefinitely until the transaction is committed or discarded.\n * @param {number} [opts.interval=5000] - Polling interval in ms.\n * @param {function} [opts.onProgress] - Called with the current status on\n * each poll iteration (\"pending\", \"submitted\", or \"committed\").\n */\n async waitFor(txId, opts) {\n this.#client.assertNotTerminated();\n const hex = resolveTransactionIdHex(txId);\n const timeout = opts?.timeout ?? 60_000;\n const interval = opts?.interval ?? 5_000;\n const start = Date.now();\n\n const wasm = await this.#getWasm();\n\n while (true) {\n const elapsed = Date.now() - start;\n if (timeout > 0 && elapsed >= timeout) {\n throw new Error(\n `Transaction confirmation timed out after ${timeout}ms`\n );\n }\n\n try {\n // Chain-only sync is sufficient: confirmation only needs on-chain\n // state, and skipping NTL keeps polling alive when the note\n // transport endpoint is unavailable.\n await this.#inner.syncChain();\n } catch {\n // Sync may fail transiently; continue polling\n }\n\n // Recreate filter each iteration — WASM consumes it by value\n const filter = wasm.TransactionFilter.ids([\n wasm.TransactionId.fromHex(hex),\n ]);\n const txs = await this.#inner.getTransactions(filter);\n\n if (txs && txs.length > 0) {\n const tx = txs[0];\n const status = tx.transactionStatus?.();\n\n if (status) {\n if (status.isCommitted()) {\n opts?.onProgress?.(\"committed\");\n return;\n }\n if (status.isDiscarded()) {\n throw new Error(`Transaction rejected: ${hex}`);\n }\n }\n\n opts?.onProgress?.(\"submitted\");\n } else {\n opts?.onProgress?.(\"pending\");\n }\n\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n }\n\n // ── Shared request builders ──\n\n async #buildSendRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const targetId = resolveAccountRef(opts.to, wasm);\n const faucetId = resolveAccountRef(opts.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const amount = BigInt(opts.amount);\n\n const request = await this.#inner.newSendTransactionRequest(\n accountId,\n targetId,\n faucetId,\n noteType,\n amount,\n opts.reclaimAfter,\n opts.timelockUntil\n );\n return { accountId, request };\n }\n\n async #buildMintRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const targetId = resolveAccountRef(opts.to, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const amount = BigInt(opts.amount);\n\n // WASM signature: newMintTransactionRequest(target, faucet, noteType, amount)\n const request = await this.#inner.newMintTransactionRequest(\n targetId,\n accountId,\n noteType,\n amount\n );\n return { accountId, request };\n }\n\n async #buildConsumeRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const noteInputs = Array.isArray(opts.notes) ? opts.notes : [opts.notes];\n\n const isDirectNote = (input) =>\n input !== null &&\n typeof input === \"object\" &&\n typeof input.id === \"function\" &&\n typeof input.toNote !== \"function\";\n\n const hasDirectNotes = noteInputs.some(isDirectNote);\n\n if (hasDirectNotes) {\n // At least one raw Note object — use NoteAndArgs builder path\n // (the only WASM path that accepts unauthenticated notes not in the store).\n const resolvedNotes = await Promise.all(\n noteInputs.map(async (input) => {\n if (isDirectNote(input)) return input;\n if (input && typeof input.toNote === \"function\")\n return input.toNote();\n return await this.#resolveNoteInput(input);\n })\n );\n\n const noteAndArgsArr = resolvedNotes.map(\n (note) => new wasm.NoteAndArgs(note, null)\n );\n const request = new wasm.TransactionRequestBuilder()\n .withInputNotes(new wasm.NoteAndArgsArray(noteAndArgsArr))\n .build();\n return { accountId, request };\n }\n\n // Standard path: all inputs are IDs or records — look up from store.\n const notes = await Promise.all(\n noteInputs.map((input) => this.#resolveNoteInput(input))\n );\n const request = await this.#inner.newConsumeTransactionRequest(notes);\n return { accountId, request };\n }\n\n async #buildSwapRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const offeredFaucetId = resolveAccountRef(opts.offer.token, wasm);\n const requestedFaucetId = resolveAccountRef(opts.request.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const paybackNoteType = resolveNoteType(\n opts.paybackType ?? opts.type,\n wasm\n );\n\n const request = await this.#inner.newSwapTransactionRequest(\n accountId,\n offeredFaucetId,\n BigInt(opts.offer.amount),\n requestedFaucetId,\n BigInt(opts.request.amount),\n noteType,\n paybackNoteType\n );\n return { accountId, request };\n }\n\n async #buildPswapCreateRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const offeredFaucetId = resolveAccountRef(opts.offer.token, wasm);\n const requestedFaucetId = resolveAccountRef(opts.request.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const paybackNoteType = resolveNoteType(\n opts.paybackType ?? opts.type,\n wasm\n );\n\n const request = await this.#inner.newPswapCreateTransactionRequest(\n accountId,\n offeredFaucetId,\n BigInt(opts.offer.amount),\n requestedFaucetId,\n BigInt(opts.request.amount),\n noteType,\n paybackNoteType\n );\n return { accountId, request };\n }\n\n async #buildPswapConsumeRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const note = await this.#resolveNoteInput(opts.note);\n const noteFillAmount = opts.noteFillAmount ?? 0n;\n\n const request = await this.#inner.newPswapConsumeTransactionRequest(\n note,\n accountId,\n BigInt(opts.fillAmount),\n BigInt(noteFillAmount)\n );\n return { accountId, request };\n }\n\n async #buildPswapCancelRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const note = await this.#resolveNoteInput(opts.note);\n\n const request = await this.#inner.newPswapCancelTransactionRequest(\n note,\n accountId\n );\n return { accountId, request };\n }\n\n async #resolveNoteInput(input) {\n if (typeof input === \"string\") {\n const record = await this.#inner.getInputNote(input);\n if (!record) {\n throw new Error(`Note not found: ${input}`);\n }\n return record.toNote();\n }\n // InputNoteRecord — unwrap to Note\n if (input && typeof input.toNote === \"function\") {\n return input.toNote();\n }\n // NoteId — has toString() but not toNote() or id() (unlike InputNoteRecord/Note).\n // Check for constructor.fromHex to distinguish from plain objects.\n if (\n input &&\n typeof input.toString === \"function\" &&\n typeof input.toNote !== \"function\" &&\n typeof input.id !== \"function\" &&\n input.constructor?.fromHex !== undefined\n ) {\n const hex = input.toString();\n const record = await this.#inner.getInputNote(hex);\n if (!record) {\n throw new Error(`Note not found: ${hex}`);\n }\n return record.toNote();\n }\n // Assume it's already a Note object\n return input;\n }\n\n async #submitOrSubmitWithProver(accountId, request, perCallProver) {\n const result = await this.#inner.executeTransaction(accountId, request);\n const prover = perCallProver ?? this.#client.defaultProver;\n const proven = prover\n ? await this.#inner.proveTransaction(result, prover)\n : await this.#inner.proveTransaction(result);\n const txId = result.id();\n const height = await this.#inner.submitProvenTransaction(proven, result);\n await this.#inner.applyTransaction(result, height);\n return { txId, result };\n }\n}\n","import {\n resolveAccountRef,\n resolveAddress,\n resolveNoteIdHex,\n} from \"../utils.js\";\n\nexport class NotesResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n async list(query) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const filter = buildNoteFilter(query, wasm);\n return await this.#inner.getInputNotes(filter);\n }\n\n async get(noteId) {\n this.#client.assertNotTerminated();\n const result = await this.#inner.getInputNote(resolveNoteIdHex(noteId));\n return result ?? null;\n }\n\n async listSent(query) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const filter = buildNoteFilter(query, wasm);\n return await this.#inner.getOutputNotes(filter);\n }\n\n async listAvailable(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(opts.account, wasm);\n const consumable = await this.#inner.getConsumableNotes(accountId);\n return consumable.map((c) => c.inputNoteRecord());\n }\n\n async import(noteFile) {\n this.#client.assertNotTerminated();\n return await this.#inner.importNoteFile(noteFile);\n }\n\n async export(noteId, opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const format = opts?.format ?? wasm.NoteExportFormat.Full;\n return await this.#inner.exportNoteFile(resolveNoteIdHex(noteId), format);\n }\n\n async fetchPrivate(opts) {\n this.#client.assertNotTerminated();\n if (opts?.mode === \"all\") {\n await this.#inner.fetchAllPrivateNotes();\n } else {\n await this.#inner.fetchPrivateNotes();\n }\n }\n\n async sendPrivate(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n let note;\n const input = opts.note;\n // Check if input is a Note object (has .id() and .assets() but not .toNote())\n if (\n input &&\n typeof input === \"object\" &&\n typeof input.id === \"function\" &&\n typeof input.assets === \"function\" &&\n typeof input.toNote !== \"function\"\n ) {\n note = input;\n } else {\n const noteHex = resolveNoteIdHex(input);\n const noteRecord = await this.#inner.getInputNote(noteHex);\n if (!noteRecord) {\n throw new Error(`Note not found: ${noteHex}`);\n }\n note = noteRecord.toNote();\n }\n\n const address = resolveAddress(opts.to, wasm);\n await this.#inner.sendPrivateNote(note, address);\n }\n}\n\nfunction buildNoteFilter(query, wasm) {\n if (!query) {\n return new wasm.NoteFilter(wasm.NoteFilterTypes.All, undefined);\n }\n\n if (query.ids) {\n const noteIds = query.ids.map((id) =>\n wasm.NoteId.fromHex(resolveNoteIdHex(id))\n );\n return new wasm.NoteFilter(wasm.NoteFilterTypes.List, noteIds);\n }\n\n if (query.status) {\n const statusMap = {\n consumed: wasm.NoteFilterTypes.Consumed,\n committed: wasm.NoteFilterTypes.Committed,\n expected: wasm.NoteFilterTypes.Expected,\n processing: wasm.NoteFilterTypes.Processing,\n unverified: wasm.NoteFilterTypes.Unverified,\n };\n const filterType = statusMap[query.status];\n if (filterType === undefined) {\n throw new Error(`Unknown note status: ${query.status}`);\n }\n return new wasm.NoteFilter(filterType, undefined);\n }\n\n return new wasm.NoteFilter(wasm.NoteFilterTypes.All, undefined);\n}\n","export class TagsResource {\n #inner;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#client = client;\n }\n\n async add(tag) {\n this.#client.assertNotTerminated();\n await this.#inner.addTag(String(tag));\n }\n\n async remove(tag) {\n this.#client.assertNotTerminated();\n await this.#inner.removeTag(String(tag));\n }\n\n async list() {\n this.#client.assertNotTerminated();\n const tags = await this.#inner.listTags();\n return Array.from(tags).map((t) => {\n const n = Number(t);\n if (Number.isNaN(n)) {\n throw new Error(`Invalid tag value: ${t}`);\n }\n return n;\n });\n }\n}\n","export class SettingsResource {\n #inner;\n #client;\n\n constructor(inner, _getWasm, client) {\n this.#inner = inner;\n this.#client = client;\n }\n\n async get(key) {\n this.#client.assertNotTerminated();\n const value = await this.#inner.getSetting(key);\n return value === undefined ? null : value;\n }\n\n async set(key, value) {\n this.#client.assertNotTerminated();\n await this.#inner.setSetting(key, value);\n }\n\n async remove(key) {\n this.#client.assertNotTerminated();\n await this.#inner.removeSetting(key);\n }\n\n async listKeys() {\n this.#client.assertNotTerminated();\n return await this.#inner.listSettingKeys();\n }\n}\n","export class CompilerResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client = null) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n /**\n * Compiles MASM code + slots into an AccountComponent ready for accounts.create().\n *\n * @param {{ code: string, slots: StorageSlot[], supportAllTypes?: boolean }} opts\n * @returns {Promise<AccountComponent>}\n */\n async component({ code, slots = [], supportAllTypes = true }) {\n this.#client?.assertNotTerminated();\n const wasm = await this.#getWasm();\n const builder = await this.#inner.createCodeBuilder();\n const compiled = builder.compileAccountComponentCode(code);\n const component = wasm.AccountComponent.compile(compiled, slots);\n return supportAllTypes ? component.withSupportsAllTypes() : component;\n }\n\n /**\n * Compiles a transaction script, optionally linking named libraries inline.\n *\n * @param {{ code: string, libraries?: Array<{ namespace: string, code: string, linking?: \"dynamic\" | \"static\" }> }} opts\n * @returns {Promise<TransactionScript>}\n */\n async txScript({ code, libraries = [] }) {\n this.#client?.assertNotTerminated();\n // Ensure WASM is initialized (result unused — only #inner needs it)\n await this.#getWasm();\n const builder = await this.#inner.createCodeBuilder();\n linkLibraries(builder, libraries);\n return builder.compileTxScript(code);\n }\n\n /**\n * Compiles a note script, optionally linking named libraries inline.\n *\n * @param {{ code: string, libraries?: Array<{ namespace: string, code: string, linking?: \"dynamic\" | \"static\" }> }} opts\n * @returns {Promise<NoteScript>}\n */\n async noteScript({ code, libraries = [] }) {\n this.#client?.assertNotTerminated();\n await this.#getWasm();\n const builder = await this.#inner.createCodeBuilder();\n linkLibraries(builder, libraries);\n return builder.compileNoteScript(code);\n }\n}\n\n// Builds and links each library entry against `builder`. Inline\n// `{ namespace, code, linking? }` entries are built via `buildLibrary` and\n// linked according to `linking` (defaulting to dynamic, matching tutorial\n// behavior). Pre-built library objects are linked dynamically.\nfunction linkLibraries(builder, libraries) {\n for (const lib of libraries) {\n if (lib && typeof lib.namespace === \"string\") {\n const built = builder.buildLibrary(lib.namespace, lib.code);\n if (lib.linking === \"static\") {\n builder.linkStaticLibrary(built);\n } else {\n builder.linkDynamicLibrary(built);\n }\n } else {\n builder.linkDynamicLibrary(lib);\n }\n }\n}\n","export class KeystoreResource {\n #inner;\n #client;\n\n constructor(inner, client) {\n this.#inner = inner;\n this.#client = client;\n }\n\n async insert(accountId, secretKey) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.insert(accountId, secretKey);\n }\n return await this.#inner.addAccountSecretKeyToWebStore(\n accountId,\n secretKey\n );\n }\n\n async get(pubKeyCommitment) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.get(pubKeyCommitment);\n }\n return await this.#inner.getAccountAuthByPubKeyCommitment(pubKeyCommitment);\n }\n\n async remove(pubKeyCommitment) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.remove(pubKeyCommitment);\n }\n throw new Error(\"remove() is not supported on this platform\");\n }\n\n async getCommitments(accountId) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.getCommitments(accountId);\n }\n return await this.#inner.getPublicKeyCommitmentsOfAccount(accountId);\n }\n\n async getAccountId(pubKeyCommitment) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.getAccountId(pubKeyCommitment);\n }\n const account =\n await this.#inner.getAccountByKeyCommitment(pubKeyCommitment);\n return account ? account.id() : undefined;\n }\n}\n","import { AccountsResource } from \"./resources/accounts.js\";\nimport { TransactionsResource } from \"./resources/transactions.js\";\nimport { NotesResource } from \"./resources/notes.js\";\nimport { TagsResource } from \"./resources/tags.js\";\nimport { SettingsResource } from \"./resources/settings.js\";\nimport { CompilerResource } from \"./resources/compiler.js\";\nimport { KeystoreResource } from \"./resources/keystore.js\";\nimport { hashSeed } from \"./utils.js\";\n\n/**\n * MidenClient wraps the existing proxy-wrapped WebClient with a resource-based API.\n *\n * Resource classes receive the proxy client and call its methods, handling all type\n * conversions (string -> AccountId, number -> BigInt, string -> enum).\n */\nexport class MidenClient {\n // Injected by index.js to resolve circular imports\n static _WasmWebClient = null;\n static _MockWasmWebClient = null;\n static _getWasmOrThrow = null;\n\n #inner;\n #getWasm;\n #terminated = false;\n #defaultProver = null;\n #isMock = false;\n\n constructor(inner, getWasm, defaultProver) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#defaultProver = defaultProver ?? null;\n\n this.accounts = new AccountsResource(inner, getWasm, this);\n this.transactions = new TransactionsResource(inner, getWasm, this);\n this.notes = new NotesResource(inner, getWasm, this);\n this.tags = new TagsResource(inner, getWasm, this);\n this.settings = new SettingsResource(inner, getWasm, this);\n this.compile = new CompilerResource(inner, getWasm, this);\n this.keystore = new KeystoreResource(inner, this);\n }\n\n /**\n * Escape hatch: runs `fn` with exclusive access to the proxied JS\n * WebClient that backs this MidenClient.\n *\n * The proxy forwards missing properties to the underlying wasm-bindgen\n * `WebClient`, so `fn` can reach lower-level methods like\n * `executeTransaction`, `proveTransaction[WithProver]`,\n * `submitProvenTransaction`, `applyTransaction`,\n * `newSendTransactionRequest`, `newConsumeTransactionRequest`, etc.\n *\n * Intended for advanced consumers that need to split the bundled\n * execute → prove → submit → apply pipeline across contexts — for example,\n * a Chrome MV3 extension that runs `executeTransaction` in its service\n * worker, dispatches the prove step to a `chrome.offscreen` document\n * (where wasm-bindgen-rayon can spawn a real thread pool), then runs\n * `submitProvenTransaction` + `applyTransaction` back in the SW.\n *\n * The callback runs inside `_serializeWasmCall`, so the WASM RefCell is\n * held for the duration of `fn`. Concurrent SDK calls (sync, other\n * transactions, etc.) queue on the same chain and run after `fn`\n * settles. Without this serialization, raw inner-client access would\n * race the proxy's chain and trip wasm-bindgen's \"recursive use of an\n * object detected\" panic.\n *\n * Re-entrancy: while `fn` is running, the underlying client's\n * `_withInnerLockDepth` counter is bumped so that `_serializeWasmCall`\n * invocations made BY `fn` (or any proxy-dispatched method it calls)\n * run inline rather than enqueuing on the chain. Without this, every\n * `await inner.X(...)` inside `fn` would enqueue behind the outer\n * `_withInnerWebClient` slot which is itself awaiting `fn` —\n * a classic re-entrant-lock deadlock. The depth counter restores the\n * intent of the docstring above: the lock is held for the duration\n * of `fn`, and inner-client calls \"borrow\" that already-held lock\n * instead of trying to re-acquire it.\n *\n * SAFETY CONTRACT for re-entrancy: callers MUST hold an external\n * mutex preventing concurrent access to this same client instance\n * via other code paths during `fn`. The chain still serializes\n * against external callers — they queue behind the outer slot — but\n * if an external task runs during one of `fn`'s awaits and calls\n * into the SDK, it will see `_withInnerLockDepth > 0` and run\n * inline, racing wasm-bindgen's borrow check. The wallet pattern\n * (own outer mutex around `_withInnerWebClient`) satisfies this.\n *\n * Stability: marked `@internal`. The shape of the proxied client is\n * intentionally not part of the documented public API and may change\n * between SDK versions. If you depend on this method, pin the SDK\n * version and test the lower-level surface carefully on each upgrade.\n * If your use case is common enough to warrant a stable public API,\n * file an issue.\n *\n * @internal\n * @template T\n * @param {(inner: object) => Promise<T>} fn - Async callback receiving\n * the proxied JS WebClient. Must not return references that escape\n * the callback's lifetime (the lock is released on settle).\n * @returns {Promise<T>} The resolved value of `fn`.\n */\n _withInnerWebClient(fn) {\n this.assertNotTerminated();\n if (typeof fn !== \"function\") {\n throw new TypeError(\"_withInnerWebClient: fn must be a function\");\n }\n const inner = this.#inner;\n return inner._serializeWasmCall(async () => {\n inner._withInnerLockDepth = (inner._withInnerLockDepth || 0) + 1;\n try {\n return await fn(inner);\n } finally {\n inner._withInnerLockDepth--;\n }\n });\n }\n\n /**\n * Creates and initializes a new MidenClient.\n *\n * If no `rpcUrl` is provided, defaults to testnet with full configuration\n * (RPC, prover, note transport, autoSync).\n *\n * @param {ClientOptions} [options] - Client configuration options.\n * @returns {Promise<MidenClient>} A fully initialized client.\n */\n static async create(options) {\n if (!options?.rpcUrl) {\n return MidenClient.createTestnet(options);\n }\n\n const getWasm = MidenClient._getWasmOrThrow;\n const WebClientClass = MidenClient._WasmWebClient;\n\n if (!WebClientClass || !getWasm) {\n throw new Error(\n \"MidenClient not initialized. Import from the SDK package entry point.\"\n );\n }\n\n const seed = options?.seed ? await hashSeed(options.seed) : undefined;\n\n const rpcUrl = resolveRpcUrl(options?.rpcUrl);\n const noteTransportUrl = resolveNoteTransportUrl(options?.noteTransportUrl);\n\n // `useWorker: false` opts out of the Web Worker shim that wraps every\n // WASM call. The shim exists to keep the main thread responsive in\n // browser/extension contexts, but it serializes the prover via\n // `TransactionProver.serialize()` — a format that has no encoding for\n // `newCallbackProver(jsFn)` and silently downgrades it to `\"local\"`.\n // Mobile/Tauri/native-prover consumers must pass `useWorker: false`.\n const useWorker = options?.useWorker;\n let inner;\n if (options?.keystore) {\n inner = await WebClientClass.createClientWithExternalKeystore(\n rpcUrl,\n noteTransportUrl,\n seed,\n options?.storeName,\n options.keystore.getKey,\n options.keystore.insertKey,\n options.keystore.sign,\n options?.debugMode,\n useWorker\n );\n } else {\n inner = await WebClientClass.createClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n options?.storeName,\n options?.debugMode,\n useWorker\n );\n }\n\n let defaultProver = null;\n if (options?.proverUrl) {\n const wasm = await getWasm();\n defaultProver = resolveProver(options.proverUrl, wasm);\n }\n\n const client = new MidenClient(inner, getWasm, defaultProver);\n\n if (options?.autoSync) {\n await client.sync();\n }\n\n return client;\n }\n\n /**\n * Creates a client preconfigured for testnet use.\n *\n * Defaults: rpcUrl \"testnet\", proverUrl \"testnet\", noteTransportUrl \"testnet\", autoSync true.\n * All defaults can be overridden via options.\n *\n * @param {ClientOptions} [options] - Options to override defaults.\n * @returns {Promise<MidenClient>} A fully initialized testnet client.\n */\n static async createTestnet(options) {\n return MidenClient.create({\n rpcUrl: \"testnet\",\n proverUrl: \"testnet\",\n noteTransportUrl: \"testnet\",\n autoSync: true,\n ...options,\n });\n }\n\n /**\n * Creates a client preconfigured for devnet use.\n *\n * Defaults: rpcUrl \"devnet\", proverUrl \"devnet\", noteTransportUrl \"devnet\", autoSync true.\n * All defaults can be overridden via options.\n *\n * @param {ClientOptions} [options] - Options to override defaults.\n * @returns {Promise<MidenClient>} A fully initialized devnet client.\n */\n static async createDevnet(options) {\n return MidenClient.create({\n rpcUrl: \"devnet\",\n proverUrl: \"devnet\",\n noteTransportUrl: \"devnet\",\n autoSync: true,\n ...options,\n });\n }\n\n /**\n * Resolves once the WASM module is initialized and safe to use.\n *\n * Idempotent and shared across callers: the underlying loader memoizes the\n * in-flight promise, so concurrent `ready()` calls await the same\n * initialization and post-init callers resolve immediately from a cached\n * module. Safe to call from `MidenProvider`, tutorial helpers, and any\n * other consumer simultaneously.\n *\n * Useful on the `/lazy` entry (e.g. Next.js / Capacitor), where no\n * top-level await runs at import time. On the default (eager) entry this\n * is redundant — importing the module already awaits WASM — but calling it\n * is still harmless.\n *\n * @returns {Promise<void>} Resolves when WASM is initialized.\n */\n static async ready() {\n const getWasm = MidenClient._getWasmOrThrow;\n if (!getWasm) {\n throw new Error(\n \"MidenClient not initialized. Import from the SDK package entry point.\"\n );\n }\n await getWasm();\n }\n\n /**\n * Creates a mock client for testing.\n *\n * @param {MockOptions} [options] - Mock client options.\n * @returns {Promise<MidenClient>} A mock client.\n */\n static async createMock(options) {\n const getWasm = MidenClient._getWasmOrThrow;\n const MockWebClientClass = MidenClient._MockWasmWebClient;\n\n if (!MockWebClientClass || !getWasm) {\n throw new Error(\n \"MidenClient not initialized. Import from the SDK package entry point.\"\n );\n }\n\n const seed = options?.seed ? await hashSeed(options.seed) : undefined;\n\n const inner = await MockWebClientClass.createClient(\n options?.serializedMockChain,\n options?.serializedNoteTransport,\n seed\n );\n\n const client = new MidenClient(inner, getWasm, null);\n client.#isMock = true;\n return client;\n }\n\n /** Returns the client-level default prover (set from ClientOptions.proverUrl). */\n get defaultProver() {\n return this.#defaultProver;\n }\n\n /**\n * Syncs the client: fetches private notes from the Note Transport Layer, then syncs on-chain\n * state with the Miden node. Fails fast on either.\n *\n * @returns {Promise<SyncSummary>} The sync summary.\n */\n async sync() {\n this.assertNotTerminated();\n return await this.#inner.syncState();\n }\n\n /**\n * Syncs on-chain state only (no NTL fetch).\n *\n * @returns {Promise<SyncSummary>}\n */\n async syncChain() {\n this.assertNotTerminated();\n return await this.#inner.syncChain();\n }\n\n /**\n * Fetches private notes from the Note Transport Layer.\n *\n * @returns {Promise<void>}\n */\n async syncNoteTransport() {\n this.assertNotTerminated();\n return await this.#inner.syncNoteTransport();\n }\n\n /**\n * Returns the current sync height.\n *\n * @returns {Promise<number>} The current sync height.\n */\n async getSyncHeight() {\n this.assertNotTerminated();\n return await this.#inner.getSyncHeight();\n }\n\n /**\n * Resolves once every serialized WASM call that was already on the\n * internal `_serializeWasmCall` chain when `waitForIdle()` was called\n * (execute, submit, prove, apply, sync, or account creation) has\n * settled. Use this from callers that need to perform a non-WASM-side\n * action — e.g. clearing an in-memory auth key on wallet lock — after\n * the kernel finishes, so its auth callback doesn't race with the key\n * being cleared.\n *\n * Does NOT wait for calls enqueued after `waitForIdle()` returns —\n * intentional, so a caller can drain and proceed without being blocked\n * indefinitely by concurrent workload.\n *\n * Caveat for `syncState`: `syncStateWithTimeout` awaits the sync lock\n * (`acquireSyncLock`, which uses Web Locks) BEFORE putting its WASM\n * call onto the chain, so a `syncState` that is queued on the sync\n * lock — but has not yet begun its WASM phase — is not visible to\n * `waitForIdle` and will not be awaited. Other methods (`newWallet`,\n * `executeTransaction`, etc.) route through the chain synchronously\n * on call and are always observed.\n *\n * Safe to call at any time; returns immediately if nothing was in\n * flight.\n *\n * @returns {Promise<void>}\n */\n async waitForIdle() {\n this.assertNotTerminated();\n await this.#inner.waitForIdle();\n }\n\n /**\n * Returns the raw JS value that the most recent sign-callback invocation\n * threw, or `null` if the last sign call succeeded (or no call has\n * happened yet).\n *\n * Useful for recovering structured metadata (e.g. a `reason: 'locked'`\n * property) that the kernel-level `auth::request` diagnostic would\n * otherwise erase. Call immediately after catching a failed\n * `transactions.submit` / `transactions.send` / `transactions.consume`.\n *\n * Meaningful only with `useWorker: false`: under the worker shim the\n * sign callback fires against the worker's WASM keystore, while this\n * accessor reads the main-thread instance — which never signed — so it\n * returns `null`. Consumers that need this signal (e.g. external\n * keystores with lock-aware sign callbacks) already require\n * `useWorker: false` for the callback to be reachable at all.\n *\n * @returns {any} The raw thrown value, or `null`.\n */\n lastAuthError() {\n this.assertNotTerminated();\n return this.#inner.lastAuthError();\n }\n\n /**\n * Terminates the underlying Web Worker. After this, all method calls will throw.\n */\n terminate() {\n this.#terminated = true;\n this.#inner.terminate?.();\n }\n\n [Symbol.dispose]() {\n this.terminate();\n }\n\n async [Symbol.asyncDispose]() {\n this.terminate();\n }\n\n /**\n * Returns the identifier of the underlying store (e.g. IndexedDB database name, file path).\n *\n * @returns {string} The store identifier.\n */\n async storeIdentifier() {\n this.assertNotTerminated();\n return await this.#inner.storeIdentifier();\n }\n\n // ── Mock-only methods ──\n\n /** Advances the mock chain by one block. Only available on mock clients. */\n proveBlock() {\n this.assertNotTerminated();\n this.#assertMock(\"proveBlock\");\n return this.#inner.proveBlock();\n }\n\n /** Returns true if this client uses a mock chain. */\n usesMockChain() {\n return this.#isMock;\n }\n\n /** Serializes the mock chain state for snapshot/restore in tests. */\n serializeMockChain() {\n this.assertNotTerminated();\n this.#assertMock(\"serializeMockChain\");\n return this.#inner.serializeMockChain();\n }\n\n /** Serializes the mock note transport node state. */\n serializeMockNoteTransportNode() {\n this.assertNotTerminated();\n this.#assertMock(\"serializeMockNoteTransportNode\");\n return this.#inner.serializeMockNoteTransportNode();\n }\n\n // ── Internal ──\n\n /** @internal Throws if the client has been terminated. */\n assertNotTerminated() {\n if (this.#terminated) {\n throw new Error(\"Client terminated\");\n }\n }\n\n #assertMock(method) {\n if (!this.#isMock) {\n throw new Error(`${method}() is only available on mock clients`);\n }\n }\n}\n\nconst RPC_URLS = {\n testnet: \"https://rpc.testnet.miden.io\",\n devnet: \"https://rpc.devnet.miden.io\",\n localhost: \"http://localhost:57291\",\n local: \"http://localhost:57291\",\n};\n\n/**\n * Resolves an rpcUrl shorthand or raw URL into a concrete endpoint string.\n *\n * @param {string | undefined} rpcUrl - \"testnet\", \"devnet\", \"localhost\", \"local\", or a raw URL.\n * @returns {string | undefined} A fully qualified URL, or undefined to use the SDK default.\n */\nfunction resolveRpcUrl(rpcUrl) {\n if (!rpcUrl) return undefined;\n return RPC_URLS[rpcUrl.trim().toLowerCase()] ?? rpcUrl;\n}\n\nconst PROVER_URLS = {\n devnet: \"https://tx-prover.devnet.miden.io\",\n testnet: \"https://tx-prover.testnet.miden.io\",\n};\n\nconst NOTE_TRANSPORT_URLS = {\n testnet: \"https://transport.miden.io\",\n devnet: \"https://transport.devnet.miden.io\",\n};\n\n/**\n * Resolves a noteTransportUrl shorthand or raw URL into a concrete endpoint string.\n *\n * @param {string | undefined} noteTransportUrl - \"testnet\", \"devnet\", or a raw URL.\n * @returns {string | undefined} A fully qualified URL, or undefined if omitted.\n */\nfunction resolveNoteTransportUrl(noteTransportUrl) {\n if (!noteTransportUrl) return undefined;\n return (\n NOTE_TRANSPORT_URLS[noteTransportUrl.trim().toLowerCase()] ??\n noteTransportUrl\n );\n}\n\n/**\n * Resolves a proverUrl shorthand or raw URL into a TransactionProver.\n *\n * @param {string} proverUrl - \"local\", \"devnet\", \"testnet\", or a raw URL.\n * @param {object} wasm - Loaded WASM module.\n * @returns {object} A TransactionProver instance.\n */\nfunction resolveProver(proverUrl, wasm) {\n const normalized = proverUrl.trim().toLowerCase();\n if (normalized === \"local\") {\n return wasm.TransactionProver.newLocalProver();\n }\n const remoteUrl = PROVER_URLS[normalized] ?? proverUrl;\n return wasm.TransactionProver.newRemoteProver(remoteUrl, undefined);\n}\n","import { resolveAccountRef, resolveNoteType } from \"./utils.js\";\n\n// Module-level WASM reference, set by index.js after initialization\nlet _wasm = null;\nlet _WebClient = null;\n\nexport function _setWasm(wasm) {\n _wasm = wasm;\n}\n\nexport function _setWebClient(WebClientClass) {\n _WebClient = WebClientClass;\n}\n\nfunction getWasm() {\n if (!_wasm) {\n throw new Error(\n \"WASM not initialized. Ensure the SDK is loaded before calling standalone utilities.\"\n );\n }\n return _wasm;\n}\n\n/**\n * Creates a P2ID (Pay-to-ID) note.\n *\n * @param {NoteOptions} opts - Note creation options.\n * @returns {Note} The created note.\n */\nexport function createP2IDNote(opts) {\n const wasm = getWasm();\n const sender = resolveAccountRef(opts.from, wasm);\n const target = resolveAccountRef(opts.to, wasm);\n const noteAssets = buildNoteAssets(opts.assets, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const attachment = opts.attachment\n ? new wasm.NoteAttachment(opts.attachment)\n : new wasm.NoteAttachment([]);\n\n return wasm.Note.createP2IDNote(\n sender,\n target,\n noteAssets,\n noteType,\n attachment\n );\n}\n\n/**\n * Creates a P2IDE (Pay-to-ID with Expiration) note.\n *\n * @param {P2IDEOptions} opts - Note creation options with timelock/reclaim.\n * @returns {Note} The created note.\n */\nexport function createP2IDENote(opts) {\n const wasm = getWasm();\n const sender = resolveAccountRef(opts.from, wasm);\n const target = resolveAccountRef(opts.to, wasm);\n const noteAssets = buildNoteAssets(opts.assets, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const attachment = opts.attachment\n ? new wasm.NoteAttachment(opts.attachment)\n : new wasm.NoteAttachment([]);\n\n return wasm.Note.createP2IDENote(\n sender,\n target,\n noteAssets,\n opts.reclaimAfter,\n opts.timelockUntil,\n noteType,\n attachment\n );\n}\n\n/**\n * Builds a swap tag for note matching.\n *\n * @param {BuildSwapTagOptions} opts - Swap tag options.\n * @returns {NoteTag} The computed swap tag.\n */\nexport function buildSwapTag(opts) {\n const wasm = getWasm();\n if (!_WebClient || typeof _WebClient.buildSwapTag !== \"function\") {\n throw new Error(\n \"WebClient.buildSwapTag is not available. Ensure the SDK is fully loaded.\"\n );\n }\n const noteType = resolveNoteType(opts.type, wasm);\n const offeredFaucetId = resolveAccountRef(opts.offer.token, wasm);\n const requestedFaucetId = resolveAccountRef(opts.request.token, wasm);\n\n return _WebClient.buildSwapTag(\n noteType,\n offeredFaucetId,\n BigInt(opts.offer.amount),\n requestedFaucetId,\n BigInt(opts.request.amount)\n );\n}\n\nfunction buildNoteAssets(assets, wasm) {\n const assetArray = Array.isArray(assets) ? assets : [assets];\n const fungibleAssets = assetArray.map((asset) => {\n const faucetId = resolveAccountRef(asset.token, wasm);\n return new wasm.FungibleAsset(faucetId, BigInt(asset.amount));\n });\n return new wasm.NoteAssets(fungibleAssets);\n}\n","/**\n * StorageView wraps the raw WASM AccountStorage to provide a developer-friendly\n * (and AI-agent-friendly) API.\n *\n * Key behavior: `getItem()` returns a `StorageResult` that works intuitively for\n * both Value and StorageMap slots. The result has `.toBigInt()`, `.toHex()`, and\n * `.toString()` methods that do the right thing automatically. For StorageMap slots,\n * `.entries` provides access to all map entries.\n *\n * Numeric ergonomics: `StorageResult` is usable directly in template strings,\n * JSX, and arithmetic via `toString()` (lossless, BigInt-backed) and `valueOf()`\n * (returns a JS number for values that fit, throws on overflow — never silently\n * corrupts). For exact u64 access use `.toBigInt()`.\n *\n * The raw WASM AccountStorage is still accessible via `.raw` for advanced use cases\n * that need the original behavior (e.g., comparing map commitment roots).\n */\n/** @param {string} hex @param {typeof Word} WordClass @returns {Word | undefined} */\nfunction hexToWord(hex, WordClass) {\n if (!hex || !WordClass) return undefined;\n try {\n return WordClass.fromHex(hex);\n } catch {\n return undefined;\n }\n}\n\nexport class StorageView {\n #storage;\n #WordClass;\n\n /**\n * @param {AccountStorage} wasmStorage\n * @param {typeof Word} WordClass\n */\n constructor(wasmStorage, WordClass) {\n this.#storage = wasmStorage;\n this.#WordClass = WordClass;\n }\n\n /**\n * The raw WASM AccountStorage, for cases where you need the original\n * primitive behavior (e.g., reading map commitment roots via raw.getItem()).\n */\n get raw() {\n return this.#storage;\n }\n\n /**\n * Returns the commitment to the full account storage.\n */\n commitment() {\n return this.#storage.commitment();\n }\n\n /**\n * Returns the names of all storage slots on this account.\n * @returns {string[]}\n */\n getSlotNames() {\n return this.#storage.getSlotNames();\n }\n\n /**\n * Returns a StorageResult for the given slot.\n *\n * The result has convenience methods that work for both Value and StorageMap slots:\n * - `.toBigInt()` — first felt as BigInt (full u64 precision)\n * - `.toHex()` — first felt's Word as hex string\n * - `.toString()` — renders as the BigInt value (works in JSX: {result})\n * - `.isMap` — true if this is a StorageMap slot\n * - `.entries` — all map entries (undefined for Value slots)\n * - `.word` — the underlying Word value\n *\n * The result is also usable directly in arithmetic (`+result`, `result * 2`)\n * via `valueOf()`, which returns a JS number for values that fit and throws\n * `RangeError` for values exceeding `Number.MAX_SAFE_INTEGER` — use `.toBigInt()`\n * for exact access to large u64 values.\n *\n * For explicit key-based map reads, use `getMapItem(slotName, key)`.\n * For the raw commitment hash, use `raw.getItem(slotName)`.\n *\n * @param {string} slotName\n * @returns {StorageResult | undefined}\n */\n getItem(slotName) {\n // Type detection + value retrieval in one pass.\n // We call getMapEntries to detect maps, but defer parsing the entries\n // until .entries is actually accessed (lazy). Only the first entry's\n // Word is parsed eagerly for the convenience methods (toBigInt, etc.).\n const rawEntries = this.#storage.getMapEntries(slotName);\n if (rawEntries !== undefined && rawEntries !== null) {\n // StorageMap — parse only the first entry eagerly\n const firstWord =\n rawEntries.length > 0\n ? hexToWord(rawEntries[0].value, this.#WordClass)\n : undefined;\n return new StorageResult(firstWord, true, rawEntries, this.#WordClass);\n }\n\n // Value slot — use raw getItem\n const word = this.#storage.getItem(slotName);\n if (!word) return undefined;\n return new StorageResult(word, false, undefined, this.#WordClass);\n }\n\n /**\n * Returns the value for a key in a StorageMap slot.\n * Delegates directly to the raw WASM method.\n *\n * @param {string} slotName\n * @param {Word} key\n * @returns {Word | undefined}\n */\n getMapItem(slotName, key) {\n return this.#storage.getMapItem(slotName, key);\n }\n\n /**\n * Get all key-value pairs from a StorageMap slot.\n * Returns undefined if the slot isn't a map, or an empty array if the map is empty.\n */\n getMapEntries(slotName) {\n return this.#storage.getMapEntries(slotName);\n }\n\n /**\n * Returns the commitment root of a storage slot as a Word.\n *\n * For Value slots, this is the stored Word itself.\n * For StorageMap slots, this is the Merkle root hash of the map — useful for:\n * - Verifying state hasn't changed between transactions\n * - Merkle inclusion proofs against the account state\n * - Comparing map state across accounts or sync cycles\n *\n * This is the raw protocol-level value. For reading stored data, use `getItem()`.\n *\n * @param {string} slotName\n * @returns {Word | undefined}\n */\n getCommitment(slotName) {\n return this.#storage.getItem(slotName);\n }\n}\n\n/**\n * Result of reading a storage slot. Works for both Value and StorageMap slots.\n *\n * Provides a unified interface so code like `storage.getItem(name).toBigInt()`\n * works regardless of the underlying slot type.\n *\n * For StorageMap slots, the convenience methods (toHex, toBigInt) operate on\n * the first entry's value. The full map data is available via `.entries`.\n * Note: Miden storage maps are Merkle-based, so \"first\" is determined by key hash\n * order — deterministic for a given map state, but not meaningful as an ordering.\n */\nexport class StorageResult {\n #word;\n #isMap;\n #rawEntries; // Raw JsStorageMapEntry[] from WASM — parsed lazily\n #parsedEntries; // Parsed entries with Word objects — created on first .entries access\n #WordClass;\n\n /**\n * @param {Word | undefined} word — the primary Word value (first entry for maps)\n * @param {boolean} isMap — whether this came from a StorageMap slot\n * @param {Array | undefined} rawEntries — raw WASM entries (parsed lazily on .entries access)\n * @param {typeof Word} WordClass — Word constructor for hex parsing\n */\n constructor(word, isMap, rawEntries, WordClass) {\n this.#word = word;\n this.#isMap = isMap;\n this.#rawEntries = rawEntries;\n this.#WordClass = WordClass;\n }\n\n /** True if this slot is a StorageMap. */\n get isMap() {\n return this.#isMap;\n }\n\n /**\n * All entries from a StorageMap slot (lazily parsed on first access).\n * Each entry has { key: string (hex), value: string (hex), word: Word | undefined }.\n * Returns undefined for Value slots.\n */\n get entries() {\n if (!this.#isMap) return undefined;\n if (this.#parsedEntries) return this.#parsedEntries;\n if (!this.#rawEntries) return [];\n\n // Parse entries lazily — only when the user actually accesses .entries\n this.#parsedEntries = this.#rawEntries.map((e) => ({\n key: e.key,\n value: e.value,\n word: hexToWord(e.value, this.#WordClass),\n }));\n this.#rawEntries = undefined; // Free raw entries\n return this.#parsedEntries;\n }\n\n /**\n * The underlying Word value.\n * For Value slots: the stored Word.\n * For StorageMap slots: the first entry's value as a Word (or undefined if empty).\n */\n get word() {\n return this.#word;\n }\n\n /**\n * Returns all four Felts of the stored Word as an array.\n * Pass-through to Word.toFelts() — ensures code that expects a Word-like\n * object (e.g., `result.toFelts()[0].asInt()`) works on StorageResult.\n * @returns {Felt[]}\n */\n toFelts() {\n if (!this.#word) return [];\n return this.#word.toFelts();\n }\n\n /**\n * The first Felt of the stored Word.\n * Returns the WASM Felt object — use .asInt() to get its BigInt value.\n * @returns {Felt | undefined}\n */\n felt() {\n if (!this.#word) return undefined;\n const felts = this.#word.toFelts();\n return felts?.[0];\n }\n\n /**\n * First felt as a BigInt. Preserves full u64 precision.\n * @returns {bigint}\n */\n toBigInt() {\n if (!this.#word) return 0n;\n return wordToBigInt(this.#word);\n }\n\n /**\n * The Word's hex representation.\n * For Value slots: the stored Word hex.\n * For StorageMap slots: the first entry's value Word hex.\n * @returns {string}\n */\n toHex() {\n if (!this.#word) return \"0x\" + \"0\".repeat(64);\n return this.#word.toHex();\n }\n\n /**\n * Renders as the BigInt value (lossless). Makes `{storageResult}` work in JSX\n * and template literals: `` `value: ${result}` ``.\n * @returns {string}\n */\n toString() {\n return this.toBigInt().toString();\n }\n\n /**\n * JSON serialization — returns the value as a string to avoid\n * precision loss for large u64 felt values.\n */\n toJSON() {\n return this.toBigInt().toString();\n }\n\n /**\n * Allows `+result`, `result * 2`, etc. to work as expected.\n *\n * Returns a JS number for values that fit in `Number.MAX_SAFE_INTEGER`\n * (2^53 - 1). For larger u64 values, throws `RangeError` rather than\n * silently losing precision — use `.toBigInt()` to access the exact value.\n *\n * @returns {number}\n * @throws {RangeError} if the underlying felt exceeds Number.MAX_SAFE_INTEGER\n */\n valueOf() {\n const big = this.toBigInt();\n if (big > BigInt(Number.MAX_SAFE_INTEGER)) {\n throw new RangeError(\n `StorageResult value ${big} exceeds Number.MAX_SAFE_INTEGER ` +\n `(${Number.MAX_SAFE_INTEGER}) — use .toBigInt() to read the exact value.`\n );\n }\n return Number(big);\n }\n}\n\n/**\n * Convert a Word's first felt to a BigInt.\n * Uses BigInt to preserve full u64 precision (felts are u64-backed).\n * Handles the little-endian byte order of felt serialization.\n *\n * @param {Word} word\n * @returns {bigint}\n */\nexport function wordToBigInt(word) {\n try {\n const hex = word.toHex();\n // Word.toHex() returns \"0x\" + 64 hex chars (4 felts × 16 hex chars each).\n // Each felt is serialized as 8 little-endian bytes, so we take the first 16\n // hex chars (first felt) and reverse the byte pairs to get the integer value.\n const feltHex = hex.slice(2, 18);\n const bytes = feltHex.match(/../g);\n if (!bytes) return 0n;\n return BigInt(\"0x\" + bytes.reverse().join(\"\"));\n } catch {\n return 0n;\n }\n}\n\n/**\n * Install the StorageView wrapper on Account.prototype.storage().\n * After this, `account.storage()` returns a StorageView instead of raw AccountStorage.\n *\n * @param {object} wasmModule — the loaded WASM module containing Account, Word, etc.\n */\nexport function installStorageView(wasmModule) {\n const AccountProto = wasmModule.Account?.prototype;\n if (!AccountProto || !AccountProto.storage) return;\n\n const originalStorage = AccountProto.storage;\n const WordClass = wasmModule.Word;\n\n AccountProto.storage = function () {\n const raw = originalStorage.call(this);\n return new StorageView(raw, WordClass);\n };\n}\n","import loadWasm from \"./wasm.js\";\nimport { CallbackType, MethodName, WorkerAction } from \"./constants.js\";\nimport { withSyncLock } from \"./syncLock.js\";\nimport { MidenClient } from \"./client.js\";\nimport { CompilerResource } from \"./resources/compiler.js\";\nimport {\n createP2IDNote,\n createP2IDENote,\n buildSwapTag,\n _setWasm as _setStandaloneWasm,\n _setWebClient as _setStandaloneWebClient,\n} from \"./standalone.js\";\nimport {\n installStorageView,\n StorageView,\n StorageResult,\n wordToBigInt,\n} from \"./storageView.js\";\nexport * from \"../Cargo.toml\";\n\nexport const AccountType = Object.freeze({\n // WASM-compatible numeric values — usable with AccountBuilder directly\n FungibleFaucet: 0,\n NonFungibleFaucet: 1,\n RegularAccountImmutableCode: 2,\n RegularAccountUpdatableCode: 3,\n // SDK-friendly aliases (same numeric values as their WASM equivalents)\n MutableWallet: 3,\n ImmutableWallet: 2,\n ImmutableContract: 2,\n MutableContract: 3,\n});\n\nexport const AuthScheme = Object.freeze({\n Falcon: \"falcon\",\n ECDSA: \"ecdsa\",\n});\n\nexport const NoteVisibility = Object.freeze({\n Public: \"public\",\n Private: \"private\",\n});\n\nexport const StorageMode = Object.freeze({\n Public: \"public\",\n Private: \"private\",\n});\n\nexport const Linking = Object.freeze({\n Dynamic: \"dynamic\",\n Static: \"static\",\n});\n\nexport { MidenClient };\nexport { CompilerResource };\nexport { createP2IDNote, createP2IDENote, buildSwapTag };\nexport { StorageView, StorageResult, wordToBigInt };\n\n// Internal exports — used by integration tests that need direct access to the low-level WebClient proxy.\nexport {\n WebClient as WasmWebClient,\n MockWebClient as MockWasmWebClient,\n MockWebClient,\n withSyncLock,\n};\n\n// Method classification sets — used by scripts/check-method-classification.js to ensure\n// every WASM export is explicitly categorised. Update when adding new WASM methods.\n//\n// Naming note: \"SYNC_METHODS\" is a historical misnomer. This set groups methods\n// that are forwarded transparently to the underlying WASM via the Proxy in\n// `createClientProxy` — meaning they don't need an explicit JS-class wrapper\n// here. It does NOT mean \"the method is synchronous\"; several entries\n// (e.g. newSwapTransactionRequest, newPswapCreateTransactionRequest) are\n// `async fn` in Rust because they take the client's RNG via an async lock.\nconst SYNC_METHODS = new Set([\n \"buildSwapTag\",\n \"createCodeBuilder\",\n \"lastAuthError\",\n \"newConsumeTransactionRequest\",\n \"newMintTransactionRequest\",\n \"newPswapCancelTransactionRequest\",\n \"newPswapConsumeTransactionRequest\",\n \"newPswapCreateTransactionRequest\",\n \"newSendTransactionRequest\",\n \"newSwapTransactionRequest\",\n \"proveBlock\",\n \"serializeMockChain\",\n \"serializeMockNoteTransportNode\",\n \"setDebugMode\",\n \"storeIdentifier\",\n \"usesMockChain\",\n]);\n\nconst WRITE_METHODS = new Set([\n \"addAccountSecretKeyToWebStore\",\n \"addTag\",\n \"executeForSummary\",\n \"executeProgram\",\n \"fetchAllPrivateNotes\",\n \"fetchPrivateNotes\",\n \"forceImportStore\",\n \"importAccountById\",\n \"importAccountFile\",\n \"importNoteFile\",\n \"importPublicAccountFromSeed\",\n \"insertAccountAddress\",\n \"newAccount\",\n \"pruneAccountHistory\",\n \"removeAccountAddress\",\n \"removeTag\",\n \"removeSetting\",\n \"sendPrivateNote\",\n \"setSetting\",\n \"submitProvenTransaction\",\n]);\n\nconst READ_METHODS = new Set([\n \"accountReader\",\n \"exportAccountFile\",\n \"getAccountAuthByPubKeyCommitment\",\n \"getAccountByKeyCommitment\",\n \"exportNoteFile\",\n \"exportStore\",\n \"getAccount\",\n \"getAccountCode\",\n \"getAccountStorage\",\n \"getAccountVault\",\n \"getAccounts\",\n \"getConsumableNotes\",\n \"getInputNote\",\n \"getInputNotes\",\n \"getOutputNote\",\n \"getOutputNotes\",\n \"getPublicKeyCommitmentsOfAccount\",\n \"getSetting\",\n \"getSyncHeight\",\n \"getTransactions\",\n \"listSettingKeys\",\n \"listTags\",\n \"executeProgram\",\n]);\n\nconst MOCK_STORE_NAME = \"mock_client_db\";\n\n// Suppress unused-variable warnings — these sets exist solely for the CI lint check.\nvoid SYNC_METHODS;\nvoid WRITE_METHODS;\nvoid READ_METHODS;\n\nconst buildTypedArraysExport = (exportObject) => {\n return Object.entries(exportObject).reduce(\n (exports, [exportName, _export]) => {\n if (exportName.endsWith(\"Array\")) {\n exports[exportName] = _export;\n }\n return exports;\n },\n {}\n );\n};\n\nconst deserializeError = (errorLike) => {\n if (!errorLike) {\n return new Error(\"Unknown error received from worker\");\n }\n const { name, message, stack, cause, ...rest } = errorLike;\n const reconstructedError = new Error(message ?? \"Unknown worker error\");\n reconstructedError.name = name ?? reconstructedError.name;\n if (stack) {\n reconstructedError.stack = stack;\n }\n if (cause) {\n reconstructedError.cause = deserializeError(cause);\n }\n Object.entries(rest).forEach(([key, value]) => {\n if (value !== undefined) {\n reconstructedError[key] = value;\n }\n });\n return reconstructedError;\n};\n\nexport const MidenArrays = {};\n\nlet wasmModule = null;\nlet wasmLoadPromise = null;\nlet webClientStaticsCopied = false;\n\nconst ensureWasm = async () => {\n if (wasmModule) {\n return wasmModule;\n }\n if (!wasmLoadPromise) {\n wasmLoadPromise = loadWasm().then((module) => {\n wasmModule = module;\n if (module) {\n Object.assign(MidenArrays, buildTypedArraysExport(module));\n if (!webClientStaticsCopied && module.WebClient) {\n copyWebClientStatics(module.WebClient);\n webClientStaticsCopied = true;\n }\n // Set WASM module for standalone utilities\n _setStandaloneWasm(module);\n // Install StorageView: account.storage() now returns a developer-friendly\n // wrapper that makes getItem() work correctly for StorageMap slots.\n installStorageView(module);\n }\n return module;\n });\n }\n return wasmLoadPromise;\n};\n\nexport const getWasmOrThrow = async () => {\n const module = await ensureWasm();\n if (!module) {\n throw new Error(\n \"Miden WASM bindings are unavailable in this environment (SSR is disabled).\"\n );\n }\n return module;\n};\n/**\n * WebClient is a wrapper around the underlying WASM WebClient object.\n *\n * This wrapper serves several purposes:\n *\n * 1. It creates a dedicated web worker to offload computationally heavy tasks\n * (such as creating accounts, executing transactions, submitting transactions, etc.)\n * from the main thread, helping to prevent UI freezes in the browser.\n *\n * 2. It defines methods that mirror the API of the underlying WASM WebClient,\n * with the intention of executing these functions via the web worker. This allows us\n * to maintain the same API and parameters while benefiting from asynchronous, worker-based computation.\n *\n * 3. It employs a Proxy to forward any calls not designated for web worker computation\n * directly to the underlying WASM WebClient instance.\n *\n * Additionally, the wrapper provides a static createClient function. This static method\n * instantiates the WebClient object and ensures that the necessary createClient calls are\n * performed both in the main thread and within the worker thread. This dual initialization\n * correctly passes user parameters (RPC URL and seed) to both the main-thread\n * WASM WebClient and the worker-side instance.\n *\n * Because of this implementation, the only breaking change for end users is in the way the\n * web client is instantiated. Users should now use the WebClient.createClient static call.\n */\n/**\n * Create a Proxy that forwards missing properties to the underlying WASM\n * WebClient.\n */\nfunction createClientProxy(instance) {\n return new Proxy(instance, {\n get(target, prop, receiver) {\n if (prop in target) {\n return Reflect.get(target, prop, receiver);\n }\n if (target.wasmWebClient && prop in target.wasmWebClient) {\n const value = target.wasmWebClient[prop];\n if (typeof value === \"function\") {\n return value.bind(target.wasmWebClient);\n }\n return value;\n }\n return undefined;\n },\n });\n}\n\nclass WebClient {\n /**\n * Controls which worker variant is spawned when a WebClient is constructed.\n *\n * - `\"auto\"` (default): pick `classic` on Safari/WKWebView (where module\n * workers have a very slow cold start), `module` everywhere else.\n * - `\"module\"`: always use the `.mjs` ES-module worker. Required for webpack\n * 5 / Next.js consumers so the asset tracer can see the WASM URL.\n * - `\"classic\"`: always use the `.js` classic-script worker. Required on\n * Safari/WKWebView. Set this if your consumer bundler (or your host app)\n * does not support module workers.\n *\n * Set before the first `WebClient.createClient(...)` call.\n */\n static workerMode = \"auto\";\n\n /**\n * Decide between the module and classic worker variants based on\n * `WebClient.workerMode` and (when `auto`) the current user agent.\n * @returns {boolean} true when the classic script should be used.\n * @private\n */\n static _shouldUseClassicWorker() {\n const mode = WebClient.workerMode;\n if (mode === \"module\") return false;\n if (mode === \"classic\") return true;\n // auto: classic on Safari/WKWebView, module everywhere else.\n const ua =\n typeof navigator !== \"undefined\" && navigator.userAgent\n ? navigator.userAgent\n : \"\";\n // Chromium-based browsers (Chrome, Edge, Brave, Opera, Chromium-based\n // Android WebView) handle module workers fine.\n if (/Chrome\\/|Chromium\\//.test(ua)) return false;\n // Safari (desktop + iOS) and WKWebView-without-Chrome (e.g. Capacitor host)\n // both have AppleWebKit but no Chrome/Chromium in the UA. Prefer classic.\n if (/AppleWebKit/.test(ua)) return true;\n // Firefox, jsdom, node without navigator, etc. — module worker is fine.\n return false;\n }\n\n /**\n * Create a WebClient wrapper.\n *\n * @param {string | undefined} rpcUrl - RPC endpoint URL used by the client.\n * @param {Uint8Array | undefined} seed - Optional seed for account initialization.\n * @param {string | undefined} storeName - Optional name for the store to be used by the client.\n * @param {(pubKey: Uint8Array) => Promise<Uint8Array | null | undefined> | Uint8Array | null | undefined} [getKeyCb]\n * - Callback to retrieve the secret key bytes for a given public key. The `pubKey`\n * parameter is the serialized public key (from `PublicKey.serialize()`). Return the\n * corresponding secret key as a `Uint8Array`, or `null`/`undefined` if not found. The\n * return value may be provided synchronously or via a `Promise`.\n * @param {(pubKey: Uint8Array, AuthSecretKey: Uint8Array) => Promise<void> | void} [insertKeyCb]\n * - Callback to persist a secret key. `pubKey` is the serialized public key, and\n * `authSecretKey` is the serialized secret key (from `AuthSecretKey.serialize()`). May return\n * `void` or a `Promise<void>`.\n * @param {(pubKey: Uint8Array, signingInputs: Uint8Array) => Promise<Uint8Array> | Uint8Array} [signCb]\n * - Callback to produce serialized signature bytes for the provided inputs. `pubKey` is the\n * serialized public key, and `signingInputs` is a `Uint8Array` produced by\n * `SigningInputs.serialize()`. Must return a `Uint8Array` containing the serialized\n * signature, either directly or wrapped in a `Promise`.\n * @param {string | undefined} [logLevel] - Optional log verbosity level\n * (\"error\", \"warn\", \"info\", \"debug\", \"trace\", \"off\", or \"none\").\n * When set, Rust tracing output is routed to the browser console.\n * @param {boolean} [useWorker=true] - When `false`, skip the Web Worker shim\n * and call the wasm-bindgen `WebClient` directly on the current thread.\n * The worker exists to keep the main thread responsive during WASM work\n * in browser/extension contexts, but it serializes the prover argument\n * via `TransactionProver.serialize()` — a format that has no encoding\n * for `newCallbackProver(jsFn)` and silently downgrades it to `\"local\"`.\n * Consumers that hand a `CallbackProver` (e.g. native iOS/Android plug-in\n * provers in Capacitor apps, or any other JS-side prover bridge) need\n * `useWorker: false` so the prover handle reaches the WASM binding intact.\n */\n constructor(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb,\n logLevel,\n useWorker = true\n ) {\n this.rpcUrl = rpcUrl;\n this.noteTransportUrl = noteTransportUrl;\n this.seed = seed;\n this.storeName = storeName;\n this.getKeyCb = getKeyCb;\n this.insertKeyCb = insertKeyCb;\n this.signCb = signCb;\n this.logLevel = logLevel;\n this.useWorker = useWorker !== false;\n\n // Check if Web Workers are available AND the caller didn't opt out via\n // `useWorker: false`. The opt-out is load-bearing for `CallbackProver`\n // consumers — see the constructor doc above.\n if (this.useWorker && typeof Worker !== \"undefined\") {\n console.log(\"WebClient: Web Workers are available.\");\n // Pick between the module and classic worker variants at runtime — see\n // `WebClient.workerMode` below. Both branches keep the\n // `new Worker(new URL(\"...\", import.meta.url), ...)` form fully literal:\n // webpack 5's new-worker detector is PURELY SYNTACTIC and only triggers\n // a proper worker sub-compilation (with asset+chunk tracing into the\n // Cargo glue and the sibling WASM) when it sees that exact pattern\n // spelled inline. Hoisting either URL into a variable downgrades the\n // detection to a plain \"copy file as asset\" — which in turn makes the\n // worker's `await import(\"./Cargo-*.js\")` 404 because webpack never\n // emitted a chunk for it. The bit of duplication here is load-bearing.\n //\n // - module (`.module.js` with `{ type: \"module\" }`): `import.meta.url`\n // inside the Cargo glue is preserved so webpack/Vite can resolve the\n // WASM URL statically. Preferred everywhere EXCEPT Safari/WKWebView.\n // - classic (`.js`, no options): self-contained async IIFE with\n // `import.meta.url` rewritten to `self.location.href`; the only form\n // Safari/WKWebView can cold-start in a reasonable time.\n if (WebClient._shouldUseClassicWorker()) {\n this.worker = new Worker(\n new URL(\"./workers/web-client-methods-worker.js\", import.meta.url)\n );\n } else {\n this.worker = new Worker(\n new URL(\n \"./workers/web-client-methods-worker.module.js\",\n import.meta.url\n ),\n { type: \"module\" }\n );\n }\n\n // Map to track pending worker requests.\n this.pendingRequests = new Map();\n\n // Promises to track when the worker script is loaded and ready.\n this.loaded = new Promise((resolve) => {\n this.loadedResolver = resolve;\n });\n\n // Create a promise that resolves when the worker signals that it is\n // fully initialized, and rejects if initialization fails. Every\n // worker-forwarded method awaits `ready` first, so an init failure must\n // reject it — otherwise those calls would await a promise that never\n // settles and hang forever.\n this.ready = new Promise((resolve, reject) => {\n this.readyResolver = resolve;\n this.readyRejecter = reject;\n });\n // Init can fail before any caller awaits `ready`; this no-op handler\n // suppresses the unhandledrejection event without consuming the\n // rejection for real awaiters.\n this.ready.catch(() => {});\n\n // Listen for messages from the worker.\n this.worker.addEventListener(\"message\", async (event) => {\n const data = event.data;\n\n // Worker script loaded.\n if (data.loaded) {\n this.loadedResolver();\n return;\n }\n\n // Worker ready.\n if (data.ready) {\n this.readyResolver();\n return;\n }\n\n if (data.action === WorkerAction.EXECUTE_CALLBACK) {\n const { callbackType, args, requestId } = data;\n try {\n const callbackMapping = {\n [CallbackType.GET_KEY]: this.getKeyCb,\n [CallbackType.INSERT_KEY]: this.insertKeyCb,\n [CallbackType.SIGN]: this.signCb,\n };\n if (!callbackMapping[callbackType]) {\n throw new Error(`Callback ${callbackType} not available`);\n }\n const callbackFunction = callbackMapping[callbackType];\n let result = callbackFunction.apply(this, args);\n if (result instanceof Promise) {\n result = await result;\n }\n\n this.worker.postMessage({\n callbackResult: result,\n callbackRequestId: requestId,\n });\n } catch (error) {\n this.worker.postMessage({\n callbackError: error.message,\n callbackRequestId: requestId,\n });\n }\n return;\n }\n\n // Handle responses for method calls.\n const { requestId, error, result, methodName } = data;\n if (requestId && this.pendingRequests.has(requestId)) {\n const { resolve, reject } = this.pendingRequests.get(requestId);\n this.pendingRequests.delete(requestId);\n if (error) {\n const workerError =\n error instanceof Error ? error : deserializeError(error);\n console.error(\n `WebClient: Error from worker in ${methodName}:`,\n workerError\n );\n reject(workerError);\n } else {\n resolve(result);\n }\n return;\n }\n\n // An error with no request attached comes from worker initialization\n // (INIT is the only requestId-less action that can fail). Reject\n // `ready` so queued and future method calls fail with the real cause\n // instead of awaiting forever.\n if (error && !requestId) {\n const workerError =\n error instanceof Error ? error : deserializeError(error);\n console.error(\n \"WebClient: worker initialization failed:\",\n workerError\n );\n this.readyRejecter(workerError);\n }\n });\n\n // Once the worker script has loaded, initialize the worker.\n this.loaded.then(() => this.initializeWorker());\n } else {\n console.log(\n this.useWorker\n ? \"WebClient: Web Workers are not available.\"\n : \"WebClient: Web Worker shim disabled by caller (useWorker=false).\"\n );\n // Worker not available or explicitly disabled; set up fallback values.\n this.worker = null;\n this.pendingRequests = null;\n this.loaded = Promise.resolve();\n this.ready = Promise.resolve();\n }\n\n // Lazy initialize the underlying WASM WebClient when first requested.\n this.wasmWebClient = null;\n this.wasmWebClientPromise = null;\n\n // Promise chain to serialize direct WASM calls that require exclusive\n // (&mut self) access. Without this, concurrent calls on the same client\n // would panic with \"recursive use of an object detected\" due to\n // wasm-bindgen's internal RefCell.\n this._wasmCallChain = Promise.resolve();\n // Depth counter for `_withInnerWebClient` re-entrancy. While > 0,\n // `_serializeWasmCall` runs its callback inline instead of queueing\n // it on the chain — see the comment on `_serializeWasmCall` for the\n // safety contract.\n this._withInnerLockDepth = 0;\n }\n\n /**\n * Serialize a WASM call that requires exclusive (&mut self) access.\n * Concurrent calls are queued and executed one at a time.\n *\n * Wraps both the direct (in-thread) path and the worker-dispatched path.\n * On the worker path this is redundant with the worker's own message queue,\n * but harmless (the chain resolves immediately on the main thread once the\n * worker's postMessage returns). On the direct path it is load-bearing —\n * without it, concurrent main-thread callers would panic with\n * \"recursive use of an object detected\" (wasm-bindgen's internal RefCell).\n *\n * Re-entrancy: when invoked from inside a `_withInnerWebClient(fn)`\n * callback — detected via `_withInnerLockDepth > 0` — `fn` runs inline\n * (no chain enqueue). The outer `_withInnerWebClient` invocation\n * already holds the chain via its own wrapping `_serializeWasmCall`,\n * so enqueueing the inner call would deadlock (the inner queues\n * behind the outer; the outer awaits the inner). The inline run is\n * safe because the chain still serializes against external callers\n * — they queue behind the outer call's chain slot, which only resolves\n * after `fn` (including all inline re-entries) settles. Callers of\n * `_withInnerWebClient` MUST hold an external mutex preventing\n * concurrent access via other code paths on this same instance during\n * the callback; without that, an external task running between two\n * awaits inside `fn` would race wasm-bindgen's borrow check.\n *\n * @param {() => Promise<any>} fn - The async function to execute.\n * @returns {Promise<any>} The result of fn.\n */\n _serializeWasmCall(fn) {\n if (this._withInnerLockDepth > 0) {\n return Promise.resolve().then(fn);\n }\n const result = this._wasmCallChain.catch(() => {}).then(fn);\n this._wasmCallChain = result.catch(() => {});\n return result;\n }\n\n /**\n * Returns a promise that resolves once every serialized WASM call that\n * was already on `_wasmCallChain` when `waitForIdle()` was called has\n * settled. Use this from callers that need to perform a non-WASM-side\n * action (e.g. clear an in-memory auth key) AFTER any in-flight\n * execute / submit / sync has completed, so the WASM kernel's auth\n * callback doesn't race with the key being cleared.\n *\n * Does NOT wait for calls enqueued after `waitForIdle()` returns —\n * this is intentional, so a caller can drain and then proceed without\n * being blocked indefinitely by a concurrent workload.\n *\n * Caveat for `syncState`: `syncStateWithTimeout` awaits\n * `acquireSyncLock` (Web Locks) BEFORE wrapping its WASM call in\n * `_serializeWasmCall`, so a sync that is queued on the sync lock but\n * has not yet reached its WASM phase is not on the chain and will not\n * be awaited. Every other serialized method (`executeTransaction`,\n * `newWallet`, `submitNewTransaction`, `proveTransaction`,\n * `applyTransaction`, and the proxy-fallback reads) routes through\n * the chain synchronously on call and is always observed.\n *\n * @returns {Promise<void>}\n */\n async waitForIdle() {\n // Chain on `_wasmCallChain`; by the time this resolves, any in-flight\n // serialized call has settled. Catch so the chain state doesn't leak.\n await this._wasmCallChain.catch(() => {});\n }\n\n // TODO: This will soon conflict with some changes in main.\n // More context here:\n // https://github.com/0xMiden/miden-client/pull/1645?notification_referrer_id=NT_kwHOA1yg7NoAJVJlcG9zaXRvcnk7NjU5MzQzNzAyO0lzc3VlOzM3OTY4OTU1Nzk&notifications_query=is%3Aunread#discussion_r2696075480\n initializeWorker() {\n // Pass `numThreads` to the worker so it can call `wasm.initThreadPool(n)`\n // inside its OWN WASM instance — the SDK worker's instance is separate\n // from the main thread's, and rayon's global pool is per-instance.\n // Default: navigator.hardwareConcurrency (or 1 if unavailable for any\n // reason — e.g. the page isn't crossOriginIsolated, in which case the\n // worker will skip pool init and parallelism falls back to sequential).\n let numThreads = 1;\n try {\n if (\n typeof self !== \"undefined\" &&\n self.crossOriginIsolated &&\n navigator?.hardwareConcurrency\n ) {\n numThreads = navigator.hardwareConcurrency;\n }\n } catch {}\n this.worker.postMessage({\n action: WorkerAction.INIT,\n args: [\n this.rpcUrl,\n this.noteTransportUrl,\n this.seed,\n this.storeName,\n !!this.getKeyCb,\n !!this.insertKeyCb,\n !!this.signCb,\n this.logLevel,\n numThreads,\n ],\n });\n }\n\n async getWasmWebClient() {\n if (this.wasmWebClient) {\n return this.wasmWebClient;\n }\n if (!this.wasmWebClientPromise) {\n this.wasmWebClientPromise = (async () => {\n const wasm = await getWasmOrThrow();\n const client = new wasm.WebClient();\n this.wasmWebClient = client;\n return client;\n })();\n }\n return this.wasmWebClientPromise;\n }\n\n /**\n * Factory method to create and initialize a WebClient instance.\n * This method is async so you can await the asynchronous call to createClient().\n *\n * @param {string} rpcUrl - The RPC URL.\n * @param {string} noteTransportUrl - The note transport URL (optional).\n * @param {string} seed - The seed for the account.\n * @param {string | undefined} network - Optional name for the store. Setting this allows multiple clients to be used in the same browser.\n * @param {string | undefined} logLevel - Optional log verbosity level (\"error\", \"warn\", \"info\", \"debug\", \"trace\", \"off\", or \"none\").\n * @param {boolean} [useWorker=true] - When `false`, bypass the Web Worker shim\n * and run WASM calls on the current thread. Required for `CallbackProver`\n * consumers (the worker path serializes the prover and loses the callback).\n * @returns {Promise<WebClient>} The fully initialized WebClient.\n */\n static async createClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n network,\n logLevel,\n useWorker = true\n ) {\n // Construct the instance (synchronously).\n const instance = new WebClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n network,\n undefined,\n undefined,\n undefined,\n logLevel,\n useWorker\n );\n\n // Set up logging on the main thread before creating the client.\n if (logLevel) {\n const wasm = await getWasmOrThrow();\n wasm.setupLogging(logLevel);\n }\n\n // Wait for the underlying wasmWebClient to be initialized.\n const wasmWebClient = await instance.getWasmWebClient();\n await wasmWebClient.createClient(rpcUrl, noteTransportUrl, seed, network);\n\n // Wait for the worker to be ready\n await instance.ready;\n\n return createClientProxy(instance);\n }\n\n /**\n * Factory method to create and initialize a WebClient instance with a remote keystore.\n * This method is async so you can await the asynchronous call to createClientWithExternalKeystore().\n *\n * @param {string} rpcUrl - The RPC URL.\n * @param {string | undefined} noteTransportUrl - The note transport URL (optional).\n * @param {string | undefined} seed - The seed for the account.\n * @param {string | undefined} storeName - Optional name for the store. Setting this allows multiple clients to be used in the same browser.\n * @param {Function | undefined} getKeyCb - The get key callback.\n * @param {Function | undefined} insertKeyCb - The insert key callback.\n * @param {Function | undefined} signCb - The sign callback.\n * @param {string | undefined} logLevel - Optional log verbosity level (\"error\", \"warn\", \"info\", \"debug\", \"trace\", \"off\", or \"none\").\n * @param {boolean} [useWorker=true] - When `false`, bypass the Web Worker shim\n * and run WASM calls on the current thread. Required for `CallbackProver`\n * consumers (the worker path serializes the prover and loses the callback).\n * @returns {Promise<WebClient>} The fully initialized WebClient.\n */\n static async createClientWithExternalKeystore(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb,\n logLevel,\n useWorker = true\n ) {\n // Construct the instance (synchronously).\n const instance = new WebClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb,\n logLevel,\n useWorker\n );\n\n // Set up logging on the main thread before creating the client.\n if (logLevel) {\n const wasm = await getWasmOrThrow();\n wasm.setupLogging(logLevel);\n }\n\n // Wait for the underlying wasmWebClient to be initialized.\n const wasmWebClient = await instance.getWasmWebClient();\n await wasmWebClient.createClientWithExternalKeystore(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb\n );\n\n await instance.ready;\n return createClientProxy(instance);\n }\n\n /**\n * Call a method via the worker.\n * @param {string} methodName - Name of the method to call.\n * @param {...any} args - Arguments for the method.\n * @returns {Promise<any>}\n */\n async callMethodWithWorker(methodName, ...args) {\n await this.ready;\n // Create a unique request ID.\n const requestId = `${methodName}-${Date.now()}-${Math.random()}`;\n return new Promise((resolve, reject) => {\n // Save the resolve and reject callbacks in the pendingRequests map.\n this.pendingRequests.set(requestId, { resolve, reject });\n // Send the method call request to the worker.\n this.worker.postMessage({\n action: WorkerAction.CALL_METHOD,\n methodName,\n args,\n requestId,\n });\n });\n }\n\n // ----- Explicitly Wrapped Methods (Worker-Forwarded) -----\n\n async newWallet(storageMode, mutable, authSchemeId, seed) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newWallet(\n storageMode,\n mutable,\n authSchemeId,\n seed\n );\n });\n }\n\n async newFaucet(\n storageMode,\n nonFungible,\n tokenName,\n tokenSymbol,\n decimals,\n maxSupply,\n authSchemeId\n ) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newFaucet(\n storageMode,\n nonFungible,\n tokenName,\n tokenSymbol,\n decimals,\n maxSupply,\n authSchemeId\n );\n });\n }\n\n async newAccount(account, overwrite) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newAccount(account, overwrite);\n });\n }\n\n async newAccountWithSecretKey(account, secretKey) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newAccountWithSecretKey(account, secretKey);\n });\n }\n\n async submitNewTransaction(accountId, transactionRequest) {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.submitNewTransaction(\n accountId,\n transactionRequest\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION,\n accountId.toString(),\n serializedTransactionRequest\n );\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\"INDEX.JS: Error in submitNewTransaction:\", error);\n throw error;\n }\n }\n\n async submitNewTransactionWithProver(accountId, transactionRequest, prover) {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.submitNewTransactionWithProver(\n accountId,\n transactionRequest,\n prover\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const proverPayload = prover.serialize();\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION_WITH_PROVER,\n accountId.toString(),\n serializedTransactionRequest,\n proverPayload\n );\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\n \"INDEX.JS: Error in submitNewTransactionWithProver:\",\n error\n );\n throw error;\n }\n }\n\n async executeTransaction(accountId, transactionRequest) {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.executeTransaction(\n accountId,\n transactionRequest\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const serializedResultBytes = await this.callMethodWithWorker(\n MethodName.EXECUTE_TRANSACTION,\n accountId.toString(),\n serializedTransactionRequest\n );\n\n return wasm.TransactionResult.deserialize(\n new Uint8Array(serializedResultBytes)\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in executeTransaction:\", error);\n throw error;\n }\n }\n\n async proveTransaction(transactionResult, prover) {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.proveTransaction(transactionResult, prover);\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionResult = transactionResult.serialize();\n const proverPayload = prover ? prover.serialize() : null;\n\n const serializedProvenBytes = await this.callMethodWithWorker(\n MethodName.PROVE_TRANSACTION,\n serializedTransactionResult,\n proverPayload\n );\n\n return wasm.ProvenTransaction.deserialize(\n new Uint8Array(serializedProvenBytes)\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in proveTransaction:\", error);\n throw error;\n }\n }\n\n async applyTransaction(transactionResult, submissionHeight) {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.applyTransaction(\n transactionResult,\n submissionHeight\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionResult = transactionResult.serialize();\n const serializedUpdateBytes = await this.callMethodWithWorker(\n MethodName.APPLY_TRANSACTION,\n serializedTransactionResult,\n submissionHeight\n );\n\n return wasm.TransactionStoreUpdate.deserialize(\n new Uint8Array(serializedUpdateBytes)\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in applyTransaction:\", error);\n throw error;\n }\n }\n\n /**\n * Syncs the client (NTL followed by chain sync, failing fast on either).\n *\n * This method coordinates concurrent sync calls using the Web Locks API when available,\n * with an in-process mutex fallback for older browsers. If a sync is already in progress,\n * subsequent callers will wait and receive the same result (coalescing behavior).\n *\n * @returns {Promise<SyncSummary>} The sync summary\n */\n async syncState() {\n const dbId = this.storeName || \"default\";\n const methodId = MethodName.SYNC_STATE;\n\n try {\n return await withSyncLock(dbId, methodId, async () => {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.syncStateImpl();\n }\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes =\n await this.callMethodWithWorker(methodId);\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n });\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncState:\", error);\n throw error;\n }\n }\n\n /**\n * Fetches private notes from the Note Transport Layer.\n *\n * @returns {Promise<void>}\n */\n async syncNoteTransport() {\n const dbId = this.storeName || \"default\";\n const methodId = MethodName.SYNC_NOTE_TRANSPORT;\n\n try {\n await withSyncLock(dbId, methodId, async () => {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n await wasmWebClient.syncNoteTransportImpl();\n } else {\n await this.callMethodWithWorker(methodId);\n }\n });\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncNoteTransport:\", error);\n throw error;\n }\n }\n\n /**\n * Syncs on-chain state only (no NTL fetch).\n *\n * @returns {Promise<SyncSummary>}\n */\n async syncChain() {\n const dbId = this.storeName || \"default\";\n const methodId = MethodName.SYNC_CHAIN;\n\n try {\n return await withSyncLock(dbId, methodId, async () => {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.syncChainImpl();\n }\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes =\n await this.callMethodWithWorker(methodId);\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n });\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncChain:\", error);\n throw error;\n }\n }\n\n /**\n * Terminates the underlying Web Worker used by this WebClient instance.\n *\n * Call this method when you're done using a WebClient to free up browser\n * resources. Each WebClient instance uses a dedicated Web Worker for\n * computationally intensive operations. Terminating releases that thread.\n *\n * After calling terminate(), the WebClient should not be used.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n}\n\nclass MockWebClient extends WebClient {\n constructor(seed, logLevel) {\n super(\n null,\n null,\n seed,\n MOCK_STORE_NAME,\n undefined,\n undefined,\n undefined,\n logLevel\n );\n }\n\n initializeWorker() {\n // Pass `numThreads` exactly like the real INIT path: every prove runs\n // inside the worker's own WASM instance, and rayon's pool is\n // per-instance — without this, mock-client proving (including the\n // integration suite) silently runs single-threaded.\n let numThreads = 1;\n try {\n if (\n typeof self !== \"undefined\" &&\n self.crossOriginIsolated &&\n navigator?.hardwareConcurrency\n ) {\n numThreads = navigator.hardwareConcurrency;\n }\n } catch {}\n this.worker.postMessage({\n action: WorkerAction.INIT_MOCK,\n args: [this.seed, this.logLevel, numThreads],\n });\n }\n\n /**\n * Factory method to create a WebClient with a mock chain for testing purposes.\n *\n * @param serializedMockChain - Serialized mock chain data (optional). Will use an empty chain if not provided.\n * @param serializedMockNoteTransportNode - Serialized mock note transport node data (optional). Will use a new instance if not provided.\n * @param seed - The seed for the account (optional).\n * @returns A promise that resolves to a MockWebClient.\n */\n static async createClient(\n serializedMockChain,\n serializedMockNoteTransportNode,\n seed,\n logLevel\n ) {\n // Construct the instance (synchronously).\n const instance = new MockWebClient(seed, logLevel);\n\n // Set up logging on the main thread before creating the client.\n if (logLevel) {\n const wasm = await getWasmOrThrow();\n wasm.setupLogging(logLevel);\n }\n\n // Wait for the underlying wasmWebClient to be initialized.\n const wasmWebClient = await instance.getWasmWebClient();\n await wasmWebClient.createMockClient(\n seed ?? null,\n serializedMockChain ?? null,\n serializedMockNoteTransportNode ?? null\n );\n\n // Wait for the worker to be ready\n await instance.ready;\n\n return createClientProxy(instance);\n }\n\n /**\n * Syncs the mock client state.\n *\n * This method coordinates concurrent sync calls using the Web Locks API when available,\n * with an in-process mutex fallback for older browsers. If a sync is already in progress,\n * subsequent callers will wait and receive the same result (coalescing behavior).\n *\n * @returns {Promise<SyncSummary>} The sync summary\n */\n async syncState() {\n const dbId = this.storeName || \"mock\";\n const methodId = MethodName.SYNC_STATE;\n\n try {\n return await withSyncLock(dbId, methodId, async () => {\n const wasmWebClient = await this.getWasmWebClient();\n\n if (!this.worker) {\n return await wasmWebClient.syncStateImpl();\n }\n\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes = await this.callMethodWithWorker(\n MethodName.SYNC_STATE_MOCK,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n });\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncState:\", error);\n throw error;\n }\n }\n\n /**\n * Syncs only the on-chain mock state (no note transport fetch).\n *\n * In worker mode, the main-thread mock chain + note-transport-node state\n * is serialized and shipped to the worker before the sync, so a prior\n * `proveBlock()` on the main thread is reflected in the worker's WASM\n * client. The no-worker path uses the main-thread WASM client directly.\n *\n * @returns {Promise<SyncSummary>}\n */\n async syncChain() {\n const dbId = this.storeName || \"mock\";\n const methodId = MethodName.SYNC_CHAIN;\n\n try {\n return await withSyncLock(dbId, methodId, async () => {\n const wasmWebClient = await this.getWasmWebClient();\n\n if (!this.worker) {\n return await wasmWebClient.syncChainImpl();\n }\n\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes = await this.callMethodWithWorker(\n MethodName.SYNC_CHAIN_MOCK,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n });\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncChain:\", error);\n throw error;\n }\n }\n\n /**\n * Syncs only the mock note-transport state (no chain fetch).\n *\n * Mirrors {@link MockWebClient#syncChain}: in worker mode, the\n * main-thread mock chain + note-transport-node state is serialized\n * and shipped to the worker first.\n *\n * @returns {Promise<void>}\n */\n async syncNoteTransport() {\n const dbId = this.storeName || \"mock\";\n const methodId = MethodName.SYNC_NOTE_TRANSPORT;\n\n try {\n await withSyncLock(dbId, methodId, async () => {\n const wasmWebClient = await this.getWasmWebClient();\n\n if (!this.worker) {\n await wasmWebClient.syncNoteTransportImpl();\n return;\n }\n\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n await this.callMethodWithWorker(\n MethodName.SYNC_NOTE_TRANSPORT_MOCK,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n });\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncNoteTransport:\", error);\n throw error;\n }\n }\n\n async submitNewTransaction(accountId, transactionRequest) {\n try {\n if (!this.worker) {\n return await super.submitNewTransaction(accountId, transactionRequest);\n }\n\n const wasmWebClient = await this.getWasmWebClient();\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION_MOCK,\n accountId.toString(),\n serializedTransactionRequest,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n\n const newMockChain = new Uint8Array(result.serializedMockChain);\n const newMockNoteTransportNode = result.serializedMockNoteTransportNode\n ? new Uint8Array(result.serializedMockNoteTransportNode)\n : undefined;\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n if (!(this instanceof MockWebClient)) {\n return transactionResult.id();\n }\n\n this.wasmWebClient = new wasm.WebClient();\n this.wasmWebClientPromise = Promise.resolve(this.wasmWebClient);\n await this.wasmWebClient.createMockClient(\n this.seed,\n newMockChain,\n newMockNoteTransportNode\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\"INDEX.JS: Error in submitNewTransaction:\", error);\n throw error;\n }\n }\n\n async submitNewTransactionWithProver(accountId, transactionRequest, prover) {\n try {\n if (!this.worker) {\n return await super.submitNewTransactionWithProver(\n accountId,\n transactionRequest,\n prover\n );\n }\n\n const wasmWebClient = await this.getWasmWebClient();\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const proverPayload = prover.serialize();\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION_WITH_PROVER_MOCK,\n accountId.toString(),\n serializedTransactionRequest,\n proverPayload,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n\n const newMockChain = new Uint8Array(result.serializedMockChain);\n const newMockNoteTransportNode = result.serializedMockNoteTransportNode\n ? new Uint8Array(result.serializedMockNoteTransportNode)\n : undefined;\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n if (!(this instanceof MockWebClient)) {\n return transactionResult.id();\n }\n\n this.wasmWebClient = new wasm.WebClient();\n this.wasmWebClientPromise = Promise.resolve(this.wasmWebClient);\n await this.wasmWebClient.createMockClient(\n this.seed,\n newMockChain,\n newMockNoteTransportNode\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\n \"INDEX.JS: Error in submitNewTransactionWithProver:\",\n error\n );\n throw error;\n }\n }\n}\n\nfunction copyWebClientStatics(WasmWebClient) {\n if (!WasmWebClient) {\n return;\n }\n Object.getOwnPropertyNames(WasmWebClient).forEach((prop) => {\n if (\n typeof WasmWebClient[prop] === \"function\" &&\n prop !== \"constructor\" &&\n prop !== \"prototype\"\n ) {\n WebClient[prop] = WasmWebClient[prop];\n }\n });\n}\n\n// Wire MidenClient dependencies (resolves circular import)\nMidenClient._WasmWebClient = WebClient;\nMidenClient._MockWasmWebClient = MockWebClient;\nMidenClient._getWasmOrThrow = getWasmOrThrow;\n_setStandaloneWebClient(WebClient);\n"],"names":["exports","_setStandaloneWasm","_setStandaloneWebClient"],"mappings":";;;AAAO,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1C,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,SAAS,EAAE,UAAU;AACvB,EAAE,gBAAgB,EAAE,gBAAgB;AACpC,EAAE,WAAW,EAAE,YAAY;AAC3B,EAAE,gBAAgB,EAAE,iBAAiB;AACrC,CAAC,CAAC;;AAEK,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1C,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,UAAU,EAAE,WAAW;AACzB,EAAE,IAAI,EAAE,MAAM;AACd,CAAC,CAAC;;AAEK,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC;AACxC,EAAE,aAAa,EAAE,cAAc;AAC/B,EAAE,iBAAiB,EAAE,kBAAkB;AACvC,EAAE,mBAAmB,EAAE,oBAAoB;AAC3C,EAAE,iBAAiB,EAAE,kBAAkB;AACvC,EAAE,sBAAsB,EAAE,sBAAsB;AAChD,EAAE,2BAA2B,EAAE,0BAA0B;AACzD,EAAE,kCAAkC,EAAE,gCAAgC;AACtE,EAAE,uCAAuC,EAAE,oCAAoC;AAC/E,EAAE,UAAU,EAAE,WAAW;AACzB,EAAE,eAAe,EAAE,eAAe;AAClC,EAAE,UAAU,EAAE,WAAW;AACzB,EAAE,eAAe,EAAE,eAAe;AAClC,EAAE,mBAAmB,EAAE,mBAAmB;AAC1C,EAAE,wBAAwB,EAAE,uBAAuB;AACnD,CAAC,CAAC;;AC7BF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;A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,CAAC,kBAAkB,GAAG,aAAa;AAC9C,WAAW,CAAC,eAAe,GAAG,cAAc;AAC5CC,aAAuB,CAAC,SAAS,CAAC;;;;"}
1
+ {"version":3,"file":"index.js","sources":["../../js/constants.js","../../js/syncLock.js","../../js/utils.js","../../js/resources/accounts.js","../../js/resources/transactions.js","../../js/resources/notes.js","../../js/resources/tags.js","../../js/resources/settings.js","../../js/resources/compiler.js","../../js/resources/keystore.js","../../js/client.js","../../js/standalone.js","../../js/storageView.js","../../js/index.js"],"sourcesContent":["export const WorkerAction = Object.freeze({\n INIT: \"init\",\n INIT_MOCK: \"initMock\",\n INIT_THREAD_POOL: \"initThreadPool\",\n CALL_METHOD: \"callMethod\",\n EXECUTE_CALLBACK: \"executeCallback\",\n});\n\nexport const CallbackType = Object.freeze({\n GET_KEY: \"getKey\",\n INSERT_KEY: \"insertKey\",\n SIGN: \"sign\",\n});\n\nexport const MethodName = Object.freeze({\n CREATE_CLIENT: \"createClient\",\n APPLY_TRANSACTION: \"applyTransaction\",\n EXECUTE_TRANSACTION: \"executeTransaction\",\n PROVE_TRANSACTION: \"proveTransaction\",\n SUBMIT_NEW_TRANSACTION: \"submitNewTransaction\",\n SUBMIT_NEW_TRANSACTION_MOCK: \"submitNewTransactionMock\",\n SUBMIT_NEW_TRANSACTION_WITH_PROVER: \"submitNewTransactionWithProver\",\n SUBMIT_NEW_TRANSACTION_WITH_PROVER_MOCK: \"submitNewTransactionWithProverMock\",\n SYNC_STATE: \"syncState\",\n SYNC_STATE_MOCK: \"syncStateMock\",\n SYNC_CHAIN: \"syncChain\",\n SYNC_CHAIN_MOCK: \"syncChainMock\",\n SYNC_NOTE_TRANSPORT: \"syncNoteTransport\",\n SYNC_NOTE_TRANSPORT_MOCK: \"syncNoteTransportMock\",\n});\n","/**\n * Sync Lock Module\n *\n * Coordinates concurrent sync calls using the Web Locks API.\n *\n * Behavior:\n * - Same-method coalescing: if a sync of the same method is in progress,\n * subsequent callers share its result promise\n * - Different-method serialization: different methods (e.g. syncState vs\n * syncNoteTransport) wait for each other via the Web Lock, or via an\n * in-process per-dbId promise chain when Web Locks are unavailable\n * - Web Locks also serialize across tabs (Chrome 69+, Safari 15.4+)\n */\n\n/**\n * Check if the Web Locks API is available.\n */\nexport function hasWebLocks() {\n return (\n typeof navigator !== \"undefined\" &&\n navigator.locks !== undefined &&\n typeof navigator.locks.request === \"function\"\n );\n}\n\n// Coalesce map keyed by `${dbId}:${methodId}` -> in-flight promise.\nconst inFlight = new Map();\n\n// Per-dbId promise tail used to serialize cross-method calls when Web Locks\n// are unavailable. Each new task chains onto the current tail so different\n// methods on the same dbId run sequentially within the tab.\nconst fallbackTails = new Map();\n\n/**\n * Build the coalesce-map key for an in-flight sync of `(dbId, methodId)`.\n *\n * @param {string} dbId\n * @param {string} methodId\n * @returns {string}\n */\nfunction coalesceKey(dbId, methodId) {\n return `${dbId}:${methodId}`;\n}\n\n/**\n * Run `fn` while holding the per-db Web Lock. When Web Locks are unavailable,\n * serializes `fn` against any other in-flight call on the same `dbId` via an\n * in-process promise chain — the wasm-bindgen `WebClient` uses a synchronous\n * `RefCell` for interior mutability in the browser, so overlapping\n * cross-method borrows would throw \"recursive use of an object detected\n * which would lead to unsafe aliasing in rust\".\n *\n * @param {string} dbId\n * @param {() => Promise<T>} fn\n * @returns {Promise<T>}\n * @template T\n */\nfunction runUnderLock(dbId, fn) {\n if (!hasWebLocks()) {\n const prev = fallbackTails.get(dbId) ?? Promise.resolve();\n const next = prev.catch(() => {}).then(fn);\n const guarded = next.catch(() => {});\n fallbackTails.set(dbId, guarded);\n guarded.then(() => {\n // Drop the slot only if no successor chained onto this tail.\n if (fallbackTails.get(dbId) === guarded) fallbackTails.delete(dbId);\n });\n return next;\n }\n return navigator.locks.request(\n `miden-sync-${dbId}`,\n { mode: \"exclusive\" },\n fn\n );\n}\n\n/**\n * Run `fn` under the sync lock for (dbId, methodId).\n *\n * Concurrent calls with the same (dbId, methodId) share the same promise\n * (coalescing). Concurrent calls on the same dbId with different methodIds\n * serialize via the Web Lock.\n *\n * @param {string} dbId - Database ID\n * @param {string} methodId - Method identifier (see MethodName constants)\n * @param {() => Promise<T>} fn - Work to run under the lock\n * @returns {Promise<T>}\n */\nexport function withSyncLock(dbId, methodId, fn) {\n const key = coalesceKey(dbId, methodId);\n\n let work = inFlight.get(key);\n if (!work) {\n work = runUnderLock(dbId, fn);\n inFlight.set(key, work);\n // Swallow on the derived promise so a rejection here doesn't surface as\n // an unhandled rejection; the caller still sees the error through `work`.\n work\n .finally(() => {\n if (inFlight.get(key) === work) inFlight.delete(key);\n })\n .catch(() => {});\n }\n\n return work;\n}\n","/**\n * Shared utility functions for the MidenClient resource classes.\n * Each function accepts a `wasm` parameter (the WASM module) for constructing typed objects.\n */\n\n/**\n * Resolves an AccountRef (string | Account | AccountId) to an AccountId.\n *\n * - Strings starting with `0x`/`0X` are parsed as hex via `AccountId.fromHex()`.\n * - Other strings are parsed as bech32 via `AccountId.fromBech32()`.\n * - Objects with an `.id()` method (Account) are resolved by calling `.id()`.\n * - Otherwise, the value is assumed to be an AccountId pass-through.\n *\n * @param {string | Account | AccountId} ref - The account reference to resolve.\n * @param {object} wasm - The WASM module.\n * @returns {AccountId} The resolved AccountId.\n */\nexport function resolveAccountRef(ref, wasm) {\n if (ref == null) {\n throw new Error(\"Account reference cannot be null or undefined\");\n }\n if (typeof ref === \"string\") {\n if (ref.startsWith(\"0x\") || ref.startsWith(\"0X\")) {\n return wasm.AccountId.fromHex(ref);\n }\n return wasm.AccountId.fromBech32(ref);\n }\n if (ref && typeof ref.id === \"function\") {\n return ref.id();\n }\n return ref;\n}\n\n/**\n * Resolves an AccountRef to a WASM Address object.\n *\n * - Strings starting with bech32 prefixes (`m`) are parsed via `Address.fromBech32()`.\n * - Strings starting with `0x`/`0X` are parsed as hex AccountId, then wrapped in Address.\n * - Account objects are resolved via `.id()` then wrapped in Address.\n * - AccountId objects are wrapped in Address directly.\n *\n * @param {string | Account | AccountId} ref - The account reference to resolve.\n * @param {object} wasm - The WASM module.\n * @returns {Address} The resolved Address.\n */\nexport function resolveAddress(ref, wasm) {\n if (ref == null) {\n throw new Error(\"Address reference cannot be null or undefined\");\n }\n if (typeof ref === \"string\") {\n if (ref.startsWith(\"0x\") || ref.startsWith(\"0X\")) {\n const accountId = wasm.AccountId.fromHex(ref);\n return wasm.Address.fromAccountId(accountId, undefined);\n }\n return wasm.Address.fromBech32(ref);\n }\n if (ref && typeof ref.id === \"function\") {\n const accountId = ref.id();\n return wasm.Address.fromAccountId(accountId, undefined);\n }\n return wasm.Address.fromAccountId(ref, undefined);\n}\n\n/**\n * Resolves a NoteVisibility string to a WASM NoteType value.\n *\n * @param {string | undefined} type - \"public\" or \"private\". Defaults to \"public\".\n * @param {object} wasm - The WASM module.\n * @returns {number} The NoteType enum value.\n */\nexport function resolveNoteType(type, wasm) {\n if (type === \"private\") {\n return wasm.NoteType.Private;\n }\n if (type === \"public\" || type == null) {\n return wasm.NoteType.Public;\n }\n throw new Error(\n `Unknown note type: \"${type}\". Expected \"public\" or \"private\".`\n );\n}\n\n/**\n * Resolves a storage mode string to a WASM AccountStorageMode instance.\n *\n * @param {string | undefined} mode - \"private\", \"public\", or \"network\". Defaults to \"private\".\n * @param {object} wasm - The WASM module.\n * @returns {AccountStorageMode} The storage mode instance.\n */\nexport function resolveStorageMode(mode, wasm) {\n switch (mode) {\n case \"public\":\n return wasm.AccountStorageMode.public();\n case \"network\":\n return wasm.AccountStorageMode.network();\n case \"private\":\n case undefined:\n case null:\n return wasm.AccountStorageMode.private();\n default:\n throw new Error(\n `Unknown storage mode: \"${mode}\". Expected \"private\", \"public\", or \"network\".`\n );\n }\n}\n\n/**\n * Resolves an auth scheme string to a WASM AuthScheme enum value.\n *\n * @param {string | undefined} scheme - \"falcon\" or \"ecdsa\". Defaults to \"falcon\".\n * @param {object} wasm - The WASM module.\n * @returns {number} The AuthScheme enum value.\n */\nexport function resolveAuthScheme(scheme, wasm) {\n if (scheme === \"ecdsa\") {\n return wasm.AuthScheme.AuthEcdsaK256Keccak;\n }\n if (scheme === \"falcon\" || scheme == null) {\n return wasm.AuthScheme.AuthRpoFalcon512;\n }\n throw new Error(\n `Unknown auth scheme: \"${scheme}\". Expected \"falcon\" or \"ecdsa\".`\n );\n}\n\n/**\n * Resolves an AccountType value to a boolean `mutable` flag\n * for the underlying WASM `newWallet()` / `importPublicAccountFromSeed()` calls.\n *\n * Accepts the numeric WASM enum values (2 = immutable, 3 = mutable) or the\n * legacy string aliases (\"MutableWallet\", \"ImmutableWallet\"). Defaults to\n * mutable when undefined.\n *\n * @param {number | string | undefined} accountType\n * @returns {boolean} Whether the account code is mutable.\n */\nexport function resolveAccountMutability(accountType) {\n if (\n accountType == null ||\n accountType === \"MutableWallet\" ||\n accountType === 3\n ) {\n return true;\n }\n if (accountType === \"ImmutableWallet\" || accountType === 2) {\n return false;\n }\n throw new Error(\n `Unknown wallet account type: \"${accountType}\". Expected AccountType.MutableWallet (3) or AccountType.ImmutableWallet (2).`\n );\n}\n\n/**\n * Resolves a NoteInput (string | NoteId | InputNoteRecord | Note) to a hex string.\n *\n * - Strings are passed through unchanged.\n * - NoteId WASM objects are converted via `.toString()`.\n * - InputNoteRecord and Note objects (with an `.id()` method) are resolved via `.id().toString()`.\n *\n * @param {string | object} input - The note reference to resolve.\n * @returns {string} The hex note ID string.\n */\nexport function resolveNoteIdHex(input) {\n if (input == null) {\n throw new Error(\"Note ID cannot be null or undefined\");\n }\n if (typeof input === \"string\") {\n return input;\n }\n // NoteId WASM object — has toString() but not id() (unlike InputNoteRecord/Note).\n // Check for constructor.fromHex to distinguish from plain objects (which also inherit toString).\n if (\n typeof input.toString === \"function\" &&\n typeof input.id !== \"function\" &&\n input.constructor?.fromHex !== undefined\n ) {\n return input.toString();\n }\n // InputNoteRecord, Note, or other object with id() returning NoteId\n if (typeof input.id === \"function\") {\n return input.id().toString();\n }\n throw new TypeError(\n `Cannot resolve note ID: expected string, NoteId, InputNoteRecord, or Note, got ${typeof input}`\n );\n}\n\n/**\n * Resolves a TransactionId reference (string | TransactionId) to a hex string.\n *\n * - Strings are passed through unchanged.\n * - TransactionId WASM objects are converted via `.toHex()`.\n *\n * @param {string | object} input - The transaction ID reference to resolve.\n * @returns {string} The hex transaction ID string.\n */\nexport function resolveTransactionIdHex(input) {\n if (input == null) {\n throw new Error(\"Transaction ID cannot be null or undefined\");\n }\n if (typeof input === \"string\") {\n return input;\n }\n // TransactionId WASM object — toHex() returns hex\n if (typeof input.toHex === \"function\") {\n return input.toHex();\n }\n throw new TypeError(\n `Cannot resolve transaction ID: expected string or TransactionId, got ${typeof input}`\n );\n}\n\n/**\n * Hashes a seed value. Strings are hashed via SHA-256 to produce a 32-byte Uint8Array.\n * Uint8Array values are passed through unchanged.\n *\n * @param {string | Uint8Array} seed - The seed to hash.\n * @returns {Promise<Uint8Array>} The hashed seed.\n */\nexport async function hashSeed(seed) {\n if (seed instanceof Uint8Array) {\n return seed;\n }\n if (typeof seed === \"string\") {\n const encoded = new TextEncoder().encode(seed);\n const hash = await crypto.subtle.digest(\"SHA-256\", encoded);\n return new Uint8Array(hash);\n }\n throw new TypeError(\n `Invalid seed type: expected string or Uint8Array, got ${typeof seed}`\n );\n}\n","import {\n resolveAccountRef,\n resolveStorageMode,\n resolveAuthScheme,\n resolveAccountMutability,\n hashSeed,\n} from \"../utils.js\";\n\nexport class AccountsResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n async create(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n const type = opts?.type;\n\n if (\n type === 0 ||\n type === 1 ||\n type === \"FungibleFaucet\" ||\n type === \"NonFungibleFaucet\"\n ) {\n const storageMode = resolveStorageMode(opts.storage ?? \"public\", wasm);\n const authScheme = resolveAuthScheme(opts.auth, wasm);\n return await this.#inner.newFaucet(\n storageMode,\n type === 1 || type === \"NonFungibleFaucet\",\n opts.name ?? opts.symbol,\n opts.symbol,\n opts.decimals,\n BigInt(opts.maxSupply),\n authScheme\n );\n } else if (\n type === \"ImmutableContract\" ||\n type === \"MutableContract\" ||\n opts?.components // Contracts are distinguished from wallets by having components\n ) {\n return await this.#createContract(opts, wasm);\n } else {\n // Default: wallet (mutable or immutable based on type)\n const mutable = resolveAccountMutability(opts?.type);\n const storageMode = resolveStorageMode(opts?.storage ?? \"private\", wasm);\n const authScheme = resolveAuthScheme(opts?.auth, wasm);\n const seed = opts?.seed ? await hashSeed(opts.seed) : undefined;\n return await this.#inner.newWallet(\n storageMode,\n mutable,\n authScheme,\n seed\n );\n }\n }\n\n async #createContract(opts, wasm) {\n if (!opts.seed)\n throw new Error(\"Contract creation requires a 'seed' (Uint8Array)\");\n if (!opts.auth)\n throw new Error(\"Contract creation requires an 'auth' (AuthSecretKey)\");\n\n // The 0.15 protocol has no code-mutability distinction, so the `type`\n // (\"ImmutableContract\" / \"MutableContract\") only steers routing here; the\n // account's on-chain visibility is set entirely by `storageMode`.\n const storageMode = resolveStorageMode(opts.storage ?? \"public\", wasm);\n const authComponent =\n wasm.AccountComponent.createAuthComponentFromSecretKey(opts.auth);\n\n // Schema commitment from `build()` is not a substitute for contract code; require explicit\n // `components` so auth-only contracts are rejected at this layer.\n const components = opts.components ?? [];\n if (components.length === 0) {\n throw new Error(\n \"Contract accounts require at least one non-auth procedure: pass at least one entry in `components`.\"\n );\n }\n\n let builder = new wasm.AccountBuilder(opts.seed)\n .storageMode(storageMode)\n .withAuthComponent(authComponent);\n\n for (const component of components) {\n builder = builder.withComponent(component);\n }\n\n const built = builder.build();\n const account = built.account;\n\n await this.#inner.newAccountWithSecretKey(account, opts.auth);\n return account;\n }\n\n async insert({ account, overwrite = false }) {\n this.#client.assertNotTerminated();\n await this.#inner.newAccount(account, overwrite);\n }\n\n async getOrImport(ref) {\n this.#client.assertNotTerminated();\n return (await this.get(ref)) ?? (await this.import(ref));\n }\n\n async get(ref) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const account = await this.#inner.getAccount(id);\n return account ?? null;\n }\n\n async list() {\n this.#client.assertNotTerminated();\n return await this.#inner.getAccounts();\n }\n\n async getDetails(ref) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const account = await this.#inner.getAccount(id);\n if (!account) {\n throw new Error(`Account not found: ${id.toString()}`);\n }\n const keys = this.#inner.keystore\n ? await this.#inner.keystore.getCommitments(id)\n : await this.#inner.getPublicKeyCommitmentsOfAccount(id);\n return {\n account,\n vault: account.vault(),\n storage: account.storage(),\n code: account.code() ?? null,\n keys,\n };\n }\n\n async getBalance(accountRef, tokenRef) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(accountRef, wasm);\n const faucetId = resolveAccountRef(tokenRef, wasm);\n const reader = await this.#inner.accountReader(accountId);\n return await reader.getBalance(faucetId);\n }\n\n async import(input) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n // Early exit for string, Account, and AccountHeader types before property\n // checks, preventing misrouting if a WASM object ever gains a .file or .seed\n // property. Bare AccountId (no .id() method) falls through to the fallback.\n if (typeof input === \"string\" || typeof input.id === \"function\") {\n const id = resolveAccountRef(input, wasm);\n await this.#inner.importAccountById(id);\n return await this.#inner.getAccount(id);\n }\n\n if (input.file) {\n // Extract accountId before importAccountFile — WASM consumes the\n // AccountFile by value, invalidating the JS wrapper after the call.\n const accountId =\n typeof input.file.accountId === \"function\"\n ? input.file.accountId()\n : null;\n await this.#inner.importAccountFile(input.file);\n if (accountId) {\n return await this.#inner.getAccount(accountId);\n }\n throw new Error(\n \"Could not determine account ID from AccountFile. \" +\n \"Ensure the file contains a valid account.\"\n );\n }\n\n if (input.seed) {\n // Import public account from seed\n const authScheme = resolveAuthScheme(input.auth, wasm);\n const mutable = resolveAccountMutability(input.type);\n return await this.#inner.importPublicAccountFromSeed(\n input.seed,\n mutable,\n authScheme\n );\n }\n\n // Fallback: treat as AccountRef (string, AccountId, Account, AccountHeader)\n const id = resolveAccountRef(input, wasm);\n await this.#inner.importAccountById(id);\n return await this.#inner.getAccount(id);\n }\n\n async export(ref) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n return await this.#inner.exportAccountFile(id);\n }\n\n async addAddress(ref, addr) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const address = wasm.Address.fromBech32(addr);\n await this.#inner.insertAccountAddress(id, address);\n }\n\n async removeAddress(ref, addr) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const id = resolveAccountRef(ref, wasm);\n const address = wasm.Address.fromBech32(addr);\n await this.#inner.removeAccountAddress(id, address);\n }\n}\n","import {\n resolveAccountRef,\n resolveNoteType,\n resolveTransactionIdHex,\n} from \"../utils.js\";\n\nexport class TransactionsResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n async send(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n if (opts.returnNote === true) {\n // returnNote path — build the P2ID note in JS so we can return the Note\n // object to the caller (e.g. for out-of-band delivery to the recipient).\n if (opts.reclaimAfter != null || opts.timelockUntil != null) {\n throw new Error(\n \"reclaimAfter and timelockUntil are not supported when returnNote is true\"\n );\n }\n\n const senderId = resolveAccountRef(opts.account, wasm);\n const receiverId = resolveAccountRef(opts.to, wasm);\n const faucetId = resolveAccountRef(opts.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n\n const note = wasm.Note.createP2IDNote(\n senderId,\n receiverId,\n new wasm.NoteAssets([\n new wasm.FungibleAsset(faucetId, BigInt(opts.amount)),\n ]),\n noteType,\n new wasm.NoteAttachment()\n );\n\n // NoteArray constructor consumes its elements; use push(&note) to keep\n // `note` valid so we can return it to the caller below.\n const ownOutputs = new wasm.NoteArray();\n ownOutputs.push(note);\n const request = new wasm.TransactionRequestBuilder()\n .withOwnOutputNotes(ownOutputs)\n .build();\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n senderId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, note, result };\n }\n\n // Default path — note built in WASM with optional reclaim/timelock\n const { accountId, request } = await this.#buildSendRequest(opts, wasm);\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, note: null, result };\n }\n\n async mint(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildMintRequest(opts, wasm);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async consume(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildConsumeRequest(opts, wasm);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async consumeAll(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n // getConsumableNotes takes AccountId by value (consumed by WASM).\n // Save hex so we can reconstruct for submitNewTransaction.\n const accountId = resolveAccountRef(opts.account, wasm);\n const accountIdHex = accountId.toString();\n const consumable = await this.#inner.getConsumableNotes(accountId);\n\n if (!consumable || consumable.length === 0) {\n return { txId: null, consumed: 0, remaining: 0 };\n }\n\n const total = consumable.length;\n const toConsume =\n opts.maxNotes != null ? consumable.slice(0, opts.maxNotes) : consumable;\n\n if (toConsume.length === 0) {\n return { txId: null, consumed: 0, remaining: total };\n }\n\n const notes = toConsume.map((c) => c.inputNoteRecord().toNote());\n\n const request = await this.#inner.newConsumeTransactionRequest(notes);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n wasm.AccountId.fromHex(accountIdHex),\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return {\n txId,\n consumed: toConsume.length,\n remaining: total - toConsume.length,\n result,\n };\n }\n\n async swap(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildSwapRequest(opts, wasm);\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n /** Create a partial-swap (PSWAP) note. See {@link PswapCreateOptions}. */\n async pswapCreate(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildPswapCreateRequest(\n opts,\n wasm\n );\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n /** Consume (fully or partially fill) a PSWAP note. See {@link PswapConsumeOptions}. */\n async pswapConsume(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildPswapConsumeRequest(\n opts,\n wasm\n );\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n /** Cancel a PSWAP note as its creator and reclaim the offered asset. See {@link PswapCancelOptions}. */\n async pswapCancel(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const { accountId, request } = await this.#buildPswapCancelRequest(\n opts,\n wasm\n );\n\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async preview(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n let accountId;\n let request;\n\n switch (opts.operation) {\n case \"send\": {\n ({ accountId, request } = await this.#buildSendRequest(opts, wasm));\n break;\n }\n case \"mint\": {\n ({ accountId, request } = await this.#buildMintRequest(opts, wasm));\n break;\n }\n case \"consume\": {\n ({ accountId, request } = await this.#buildConsumeRequest(opts, wasm));\n break;\n }\n case \"swap\": {\n ({ accountId, request } = await this.#buildSwapRequest(opts, wasm));\n break;\n }\n case \"pswapCreate\": {\n ({ accountId, request } = await this.#buildPswapCreateRequest(\n opts,\n wasm\n ));\n break;\n }\n case \"pswapConsume\": {\n ({ accountId, request } = await this.#buildPswapConsumeRequest(\n opts,\n wasm\n ));\n break;\n }\n case \"pswapCancel\": {\n ({ accountId, request } = await this.#buildPswapCancelRequest(\n opts,\n wasm\n ));\n break;\n }\n case \"custom\": {\n accountId = resolveAccountRef(opts.account, wasm);\n request = opts.request;\n break;\n }\n default:\n throw new Error(`Unknown preview operation: ${opts.operation}`);\n }\n\n return await this.#inner.executeForSummary(accountId, request);\n }\n\n async execute(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(opts.account, wasm);\n\n let builder = new wasm.TransactionRequestBuilder().withCustomScript(\n opts.script\n );\n\n if (opts.foreignAccounts?.length) {\n const accounts = opts.foreignAccounts.map((fa) => {\n // Distinguish { id: AccountRef, storage? } wrapper objects from WASM types\n // (Account/AccountHeader expose .id() as a method, wrappers have .id as a property)\n const isWrapper =\n fa !== null &&\n typeof fa === \"object\" &&\n \"id\" in fa &&\n typeof fa.id !== \"function\";\n const id = resolveAccountRef(isWrapper ? fa.id : fa, wasm);\n const storage =\n isWrapper && fa.storage\n ? fa.storage\n : new wasm.AccountStorageRequirements();\n return wasm.ForeignAccount.public(id, storage);\n });\n builder = builder.withForeignAccounts(\n new wasm.ForeignAccountArray(accounts)\n );\n }\n\n const request = builder.build();\n const { txId, result } = await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts.prover\n );\n\n if (opts.waitForConfirmation) {\n await this.waitFor(txId.toHex(), { timeout: opts.timeout });\n }\n\n return { txId, result };\n }\n\n async executeProgram(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(opts.account, wasm);\n\n let foreignAccountsArray = new wasm.ForeignAccountArray();\n if (opts.foreignAccounts?.length) {\n const accounts = opts.foreignAccounts.map((fa) => {\n const isWrapper =\n fa !== null &&\n typeof fa === \"object\" &&\n \"id\" in fa &&\n typeof fa.id !== \"function\";\n const id = resolveAccountRef(isWrapper ? fa.id : fa, wasm);\n const storage =\n isWrapper && fa.storage\n ? fa.storage\n : new wasm.AccountStorageRequirements();\n return wasm.ForeignAccount.public(id, storage);\n });\n foreignAccountsArray = new wasm.ForeignAccountArray(accounts);\n }\n\n return await this.#inner.executeProgram(\n accountId,\n opts.script,\n opts.adviceInputs ?? new wasm.AdviceInputs(),\n foreignAccountsArray\n );\n }\n\n async submit(account, request, opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(account, wasm);\n return await this.#submitOrSubmitWithProver(\n accountId,\n request,\n opts?.prover\n );\n }\n\n async list(query) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n let filter;\n if (!query) {\n filter = wasm.TransactionFilter.all();\n } else if (query.status === \"uncommitted\") {\n filter = wasm.TransactionFilter.uncommitted();\n } else if (query.ids) {\n const txIds = query.ids.map((id) =>\n wasm.TransactionId.fromHex(resolveTransactionIdHex(id))\n );\n filter = wasm.TransactionFilter.ids(txIds);\n } else if (query.expiredBefore !== undefined) {\n filter = wasm.TransactionFilter.expiredBefore(query.expiredBefore);\n } else {\n filter = wasm.TransactionFilter.all();\n }\n\n return await this.#inner.getTransactions(filter);\n }\n\n /**\n * Polls for transaction confirmation.\n *\n * @param {string | TransactionId} txId - Transaction ID hex string or TransactionId object.\n * @param {WaitOptions} [opts] - Polling options.\n * @param {number} [opts.timeout=60000] - Wall-clock polling timeout in\n * milliseconds. This is NOT a block height — it controls how long the\n * client waits before giving up. Set to 0 to disable the timeout and poll\n * indefinitely until the transaction is committed or discarded.\n * @param {number} [opts.interval=5000] - Polling interval in ms.\n * @param {function} [opts.onProgress] - Called with the current status on\n * each poll iteration (\"pending\", \"submitted\", or \"committed\").\n */\n async waitFor(txId, opts) {\n this.#client.assertNotTerminated();\n const hex = resolveTransactionIdHex(txId);\n const timeout = opts?.timeout ?? 60_000;\n const interval = opts?.interval ?? 5_000;\n const start = Date.now();\n\n const wasm = await this.#getWasm();\n\n while (true) {\n const elapsed = Date.now() - start;\n if (timeout > 0 && elapsed >= timeout) {\n throw new Error(\n `Transaction confirmation timed out after ${timeout}ms`\n );\n }\n\n try {\n // Chain-only sync is sufficient: confirmation only needs on-chain\n // state, and skipping NTL keeps polling alive when the note\n // transport endpoint is unavailable.\n await this.#inner.syncChain();\n } catch {\n // Sync may fail transiently; continue polling\n }\n\n // Recreate filter each iteration — WASM consumes it by value\n const filter = wasm.TransactionFilter.ids([\n wasm.TransactionId.fromHex(hex),\n ]);\n const txs = await this.#inner.getTransactions(filter);\n\n if (txs && txs.length > 0) {\n const tx = txs[0];\n const status = tx.transactionStatus?.();\n\n if (status) {\n if (status.isCommitted()) {\n opts?.onProgress?.(\"committed\");\n return;\n }\n if (status.isDiscarded()) {\n throw new Error(`Transaction rejected: ${hex}`);\n }\n }\n\n opts?.onProgress?.(\"submitted\");\n } else {\n opts?.onProgress?.(\"pending\");\n }\n\n await new Promise((resolve) => setTimeout(resolve, interval));\n }\n }\n\n // ── Shared request builders ──\n\n async #buildSendRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const targetId = resolveAccountRef(opts.to, wasm);\n const faucetId = resolveAccountRef(opts.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const amount = BigInt(opts.amount);\n\n const request = await this.#inner.newSendTransactionRequest(\n accountId,\n targetId,\n faucetId,\n noteType,\n amount,\n opts.reclaimAfter,\n opts.timelockUntil\n );\n return { accountId, request };\n }\n\n async #buildMintRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const targetId = resolveAccountRef(opts.to, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const amount = BigInt(opts.amount);\n\n // WASM signature: newMintTransactionRequest(target, faucet, noteType, amount)\n const request = await this.#inner.newMintTransactionRequest(\n targetId,\n accountId,\n noteType,\n amount\n );\n return { accountId, request };\n }\n\n async #buildConsumeRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const noteInputs = Array.isArray(opts.notes) ? opts.notes : [opts.notes];\n\n const isDirectNote = (input) =>\n input !== null &&\n typeof input === \"object\" &&\n typeof input.id === \"function\" &&\n typeof input.toNote !== \"function\";\n\n const hasDirectNotes = noteInputs.some(isDirectNote);\n\n if (hasDirectNotes) {\n // At least one raw Note object — use NoteAndArgs builder path\n // (the only WASM path that accepts unauthenticated notes not in the store).\n const resolvedNotes = await Promise.all(\n noteInputs.map(async (input) => {\n if (isDirectNote(input)) return input;\n if (input && typeof input.toNote === \"function\")\n return input.toNote();\n return await this.#resolveNoteInput(input);\n })\n );\n\n const noteAndArgsArr = resolvedNotes.map(\n (note) => new wasm.NoteAndArgs(note, null)\n );\n const request = new wasm.TransactionRequestBuilder()\n .withInputNotes(new wasm.NoteAndArgsArray(noteAndArgsArr))\n .build();\n return { accountId, request };\n }\n\n // Standard path: all inputs are IDs or records — look up from store.\n const notes = await Promise.all(\n noteInputs.map((input) => this.#resolveNoteInput(input))\n );\n const request = await this.#inner.newConsumeTransactionRequest(notes);\n return { accountId, request };\n }\n\n async #buildSwapRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const offeredFaucetId = resolveAccountRef(opts.offer.token, wasm);\n const requestedFaucetId = resolveAccountRef(opts.request.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const paybackNoteType = resolveNoteType(\n opts.paybackType ?? opts.type,\n wasm\n );\n\n const request = await this.#inner.newSwapTransactionRequest(\n accountId,\n offeredFaucetId,\n BigInt(opts.offer.amount),\n requestedFaucetId,\n BigInt(opts.request.amount),\n noteType,\n paybackNoteType\n );\n return { accountId, request };\n }\n\n async #buildPswapCreateRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const offeredFaucetId = resolveAccountRef(opts.offer.token, wasm);\n const requestedFaucetId = resolveAccountRef(opts.request.token, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const paybackNoteType = resolveNoteType(\n opts.paybackType ?? opts.type,\n wasm\n );\n\n const request = await this.#inner.newPswapCreateTransactionRequest(\n accountId,\n offeredFaucetId,\n BigInt(opts.offer.amount),\n requestedFaucetId,\n BigInt(opts.request.amount),\n noteType,\n paybackNoteType\n );\n return { accountId, request };\n }\n\n async #buildPswapConsumeRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const note = await this.#resolveNoteInput(opts.note);\n const noteFillAmount = opts.noteFillAmount ?? 0n;\n\n const request = await this.#inner.newPswapConsumeTransactionRequest(\n note,\n accountId,\n BigInt(opts.fillAmount),\n BigInt(noteFillAmount)\n );\n return { accountId, request };\n }\n\n async #buildPswapCancelRequest(opts, wasm) {\n const accountId = resolveAccountRef(opts.account, wasm);\n const note = await this.#resolveNoteInput(opts.note);\n\n const request = await this.#inner.newPswapCancelTransactionRequest(\n note,\n accountId\n );\n return { accountId, request };\n }\n\n async #resolveNoteInput(input) {\n if (typeof input === \"string\") {\n const record = await this.#inner.getInputNote(input);\n if (!record) {\n throw new Error(`Note not found: ${input}`);\n }\n return record.toNote();\n }\n // InputNoteRecord — unwrap to Note\n if (input && typeof input.toNote === \"function\") {\n return input.toNote();\n }\n // NoteId — has toString() but not toNote() or id() (unlike InputNoteRecord/Note).\n // Check for constructor.fromHex to distinguish from plain objects.\n if (\n input &&\n typeof input.toString === \"function\" &&\n typeof input.toNote !== \"function\" &&\n typeof input.id !== \"function\" &&\n input.constructor?.fromHex !== undefined\n ) {\n const hex = input.toString();\n const record = await this.#inner.getInputNote(hex);\n if (!record) {\n throw new Error(`Note not found: ${hex}`);\n }\n return record.toNote();\n }\n // Assume it's already a Note object\n return input;\n }\n\n async #submitOrSubmitWithProver(accountId, request, perCallProver) {\n const result = await this.#inner.executeTransaction(accountId, request);\n const prover = perCallProver ?? this.#client.defaultProver;\n const proven = prover\n ? await this.#inner.proveTransaction(result, prover)\n : await this.#inner.proveTransaction(result);\n const txId = result.id();\n const height = await this.#inner.submitProvenTransaction(proven, result);\n await this.#inner.applyTransaction(result, height);\n return { txId, result };\n }\n}\n","import {\n resolveAccountRef,\n resolveAddress,\n resolveNoteIdHex,\n} from \"../utils.js\";\n\nexport class NotesResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n async list(query) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const filter = buildNoteFilter(query, wasm);\n return await this.#inner.getInputNotes(filter);\n }\n\n async get(noteId) {\n this.#client.assertNotTerminated();\n const result = await this.#inner.getInputNote(resolveNoteIdHex(noteId));\n return result ?? null;\n }\n\n async listSent(query) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const filter = buildNoteFilter(query, wasm);\n return await this.#inner.getOutputNotes(filter);\n }\n\n async listAvailable(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const accountId = resolveAccountRef(opts.account, wasm);\n const consumable = await this.#inner.getConsumableNotes(accountId);\n return consumable.map((c) => c.inputNoteRecord());\n }\n\n async import(noteFile) {\n this.#client.assertNotTerminated();\n return await this.#inner.importNoteFile(noteFile);\n }\n\n async export(noteId, opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n const format = opts?.format ?? wasm.NoteExportFormat.Full;\n return await this.#inner.exportNoteFile(resolveNoteIdHex(noteId), format);\n }\n\n async fetchPrivate(opts) {\n this.#client.assertNotTerminated();\n if (opts?.mode === \"all\") {\n await this.#inner.fetchAllPrivateNotes();\n } else {\n await this.#inner.fetchPrivateNotes();\n }\n }\n\n async sendPrivate(opts) {\n this.#client.assertNotTerminated();\n const wasm = await this.#getWasm();\n\n let note;\n const input = opts.note;\n // Check if input is a Note object (has .id() and .assets() but not .toNote())\n if (\n input &&\n typeof input === \"object\" &&\n typeof input.id === \"function\" &&\n typeof input.assets === \"function\" &&\n typeof input.toNote !== \"function\"\n ) {\n note = input;\n } else {\n const noteHex = resolveNoteIdHex(input);\n const noteRecord = await this.#inner.getInputNote(noteHex);\n if (!noteRecord) {\n throw new Error(`Note not found: ${noteHex}`);\n }\n note = noteRecord.toNote();\n }\n\n const address = resolveAddress(opts.to, wasm);\n await this.#inner.sendPrivateNote(note, address);\n }\n}\n\nfunction buildNoteFilter(query, wasm) {\n if (!query) {\n return new wasm.NoteFilter(wasm.NoteFilterTypes.All, undefined);\n }\n\n if (query.ids) {\n const noteIds = query.ids.map((id) =>\n wasm.NoteId.fromHex(resolveNoteIdHex(id))\n );\n return new wasm.NoteFilter(wasm.NoteFilterTypes.List, noteIds);\n }\n\n if (query.status) {\n const statusMap = {\n consumed: wasm.NoteFilterTypes.Consumed,\n committed: wasm.NoteFilterTypes.Committed,\n expected: wasm.NoteFilterTypes.Expected,\n processing: wasm.NoteFilterTypes.Processing,\n unverified: wasm.NoteFilterTypes.Unverified,\n };\n const filterType = statusMap[query.status];\n if (filterType === undefined) {\n throw new Error(`Unknown note status: ${query.status}`);\n }\n return new wasm.NoteFilter(filterType, undefined);\n }\n\n return new wasm.NoteFilter(wasm.NoteFilterTypes.All, undefined);\n}\n","export class TagsResource {\n #inner;\n #client;\n\n constructor(inner, getWasm, client) {\n this.#inner = inner;\n this.#client = client;\n }\n\n async add(tag) {\n this.#client.assertNotTerminated();\n await this.#inner.addTag(String(tag));\n }\n\n async remove(tag) {\n this.#client.assertNotTerminated();\n await this.#inner.removeTag(String(tag));\n }\n\n async list() {\n this.#client.assertNotTerminated();\n const tags = await this.#inner.listTags();\n return Array.from(tags).map((t) => {\n const n = Number(t);\n if (Number.isNaN(n)) {\n throw new Error(`Invalid tag value: ${t}`);\n }\n return n;\n });\n }\n}\n","export class SettingsResource {\n #inner;\n #client;\n\n constructor(inner, _getWasm, client) {\n this.#inner = inner;\n this.#client = client;\n }\n\n async get(key) {\n this.#client.assertNotTerminated();\n const value = await this.#inner.getSetting(key);\n return value === undefined ? null : value;\n }\n\n async set(key, value) {\n this.#client.assertNotTerminated();\n await this.#inner.setSetting(key, value);\n }\n\n async remove(key) {\n this.#client.assertNotTerminated();\n await this.#inner.removeSetting(key);\n }\n\n async listKeys() {\n this.#client.assertNotTerminated();\n return await this.#inner.listSettingKeys();\n }\n}\n","export class CompilerResource {\n #inner;\n #getWasm;\n #client;\n\n constructor(inner, getWasm, client = null) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#client = client;\n }\n\n /**\n * Compiles MASM code + slots into an AccountComponent ready for accounts.create().\n *\n * @param {{ code: string, slots: StorageSlot[], supportAllTypes?: boolean }} opts\n * @returns {Promise<AccountComponent>}\n */\n async component({ code, slots = [], supportAllTypes = true }) {\n this.#client?.assertNotTerminated();\n const wasm = await this.#getWasm();\n const builder = await this.#inner.createCodeBuilder();\n const compiled = builder.compileAccountComponentCode(code);\n const component = wasm.AccountComponent.compile(compiled, slots);\n return supportAllTypes ? component.withSupportsAllTypes() : component;\n }\n\n /**\n * Compiles a transaction script, optionally linking named libraries inline.\n *\n * @param {{ code: string, libraries?: Array<{ namespace: string, code: string, linking?: \"dynamic\" | \"static\" }> }} opts\n * @returns {Promise<TransactionScript>}\n */\n async txScript({ code, libraries = [] }) {\n this.#client?.assertNotTerminated();\n // Ensure WASM is initialized (result unused — only #inner needs it)\n await this.#getWasm();\n const builder = await this.#inner.createCodeBuilder();\n linkLibraries(builder, libraries);\n return builder.compileTxScript(code);\n }\n\n /**\n * Compiles a note script, optionally linking named libraries inline.\n *\n * @param {{ code: string, libraries?: Array<{ namespace: string, code: string, linking?: \"dynamic\" | \"static\" }> }} opts\n * @returns {Promise<NoteScript>}\n */\n async noteScript({ code, libraries = [] }) {\n this.#client?.assertNotTerminated();\n await this.#getWasm();\n const builder = await this.#inner.createCodeBuilder();\n linkLibraries(builder, libraries);\n return builder.compileNoteScript(code);\n }\n}\n\n// Builds and links each library entry against `builder`. Inline\n// `{ namespace, code, linking? }` entries are built via `buildLibrary` and\n// linked according to `linking` (defaulting to dynamic, matching tutorial\n// behavior). Pre-built library objects are linked dynamically.\nfunction linkLibraries(builder, libraries) {\n for (const lib of libraries) {\n if (lib && typeof lib.namespace === \"string\") {\n const built = builder.buildLibrary(lib.namespace, lib.code);\n if (lib.linking === \"static\") {\n builder.linkStaticLibrary(built);\n } else {\n builder.linkDynamicLibrary(built);\n }\n } else {\n builder.linkDynamicLibrary(lib);\n }\n }\n}\n","export class KeystoreResource {\n #inner;\n #client;\n\n constructor(inner, client) {\n this.#inner = inner;\n this.#client = client;\n }\n\n async insert(accountId, secretKey) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.insert(accountId, secretKey);\n }\n return await this.#inner.addAccountSecretKeyToWebStore(\n accountId,\n secretKey\n );\n }\n\n async get(pubKeyCommitment) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.get(pubKeyCommitment);\n }\n return await this.#inner.getAccountAuthByPubKeyCommitment(pubKeyCommitment);\n }\n\n async remove(pubKeyCommitment) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.remove(pubKeyCommitment);\n }\n throw new Error(\"remove() is not supported on this platform\");\n }\n\n async getCommitments(accountId) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.getCommitments(accountId);\n }\n return await this.#inner.getPublicKeyCommitmentsOfAccount(accountId);\n }\n\n async getAccountId(pubKeyCommitment) {\n this.#client.assertNotTerminated();\n if (this.#inner.keystore) {\n return await this.#inner.keystore.getAccountId(pubKeyCommitment);\n }\n const account =\n await this.#inner.getAccountByKeyCommitment(pubKeyCommitment);\n return account ? account.id() : undefined;\n }\n}\n","import { AccountsResource } from \"./resources/accounts.js\";\nimport { TransactionsResource } from \"./resources/transactions.js\";\nimport { NotesResource } from \"./resources/notes.js\";\nimport { TagsResource } from \"./resources/tags.js\";\nimport { SettingsResource } from \"./resources/settings.js\";\nimport { CompilerResource } from \"./resources/compiler.js\";\nimport { KeystoreResource } from \"./resources/keystore.js\";\nimport { hashSeed } from \"./utils.js\";\n\n/**\n * MidenClient wraps the existing proxy-wrapped WebClient with a resource-based API.\n *\n * Resource classes receive the proxy client and call its methods, handling all type\n * conversions (string -> AccountId, number -> BigInt, string -> enum).\n */\nexport class MidenClient {\n // Injected by index.js to resolve circular imports\n static _WasmWebClient = null;\n static _MockWasmWebClient = null;\n static _getWasmOrThrow = null;\n\n #inner;\n #getWasm;\n #terminated = false;\n #defaultProver = null;\n #isMock = false;\n\n constructor(inner, getWasm, defaultProver) {\n this.#inner = inner;\n this.#getWasm = getWasm;\n this.#defaultProver = defaultProver ?? null;\n\n this.accounts = new AccountsResource(inner, getWasm, this);\n this.transactions = new TransactionsResource(inner, getWasm, this);\n this.notes = new NotesResource(inner, getWasm, this);\n this.tags = new TagsResource(inner, getWasm, this);\n this.settings = new SettingsResource(inner, getWasm, this);\n this.compile = new CompilerResource(inner, getWasm, this);\n this.keystore = new KeystoreResource(inner, this);\n }\n\n /**\n * Escape hatch: runs `fn` with exclusive access to the proxied JS\n * WebClient that backs this MidenClient.\n *\n * The proxy forwards missing properties to the underlying wasm-bindgen\n * `WebClient`, so `fn` can reach lower-level methods like\n * `executeTransaction`, `proveTransaction[WithProver]`,\n * `submitProvenTransaction`, `applyTransaction`,\n * `newSendTransactionRequest`, `newConsumeTransactionRequest`, etc.\n *\n * Intended for advanced consumers that need to split the bundled\n * execute → prove → submit → apply pipeline across contexts — for example,\n * a Chrome MV3 extension that runs `executeTransaction` in its service\n * worker, dispatches the prove step to a `chrome.offscreen` document\n * (where wasm-bindgen-rayon can spawn a real thread pool), then runs\n * `submitProvenTransaction` + `applyTransaction` back in the SW.\n *\n * The callback runs inside `_serializeWasmCall`, so the WASM RefCell is\n * held for the duration of `fn`. Concurrent SDK calls (sync, other\n * transactions, etc.) queue on the same chain and run after `fn`\n * settles. Without this serialization, raw inner-client access would\n * race the proxy's chain and trip wasm-bindgen's \"recursive use of an\n * object detected\" panic.\n *\n * Re-entrancy: while `fn` is running, the underlying client's\n * `_withInnerLockDepth` counter is bumped so that `_serializeWasmCall`\n * invocations made BY `fn` (or any proxy-dispatched method it calls)\n * run inline rather than enqueuing on the chain. Without this, every\n * `await inner.X(...)` inside `fn` would enqueue behind the outer\n * `_withInnerWebClient` slot which is itself awaiting `fn` —\n * a classic re-entrant-lock deadlock. The depth counter restores the\n * intent of the docstring above: the lock is held for the duration\n * of `fn`, and inner-client calls \"borrow\" that already-held lock\n * instead of trying to re-acquire it.\n *\n * SAFETY CONTRACT for re-entrancy: callers MUST hold an external\n * mutex preventing concurrent access to this same client instance\n * via other code paths during `fn`. The chain still serializes\n * against external callers — they queue behind the outer slot — but\n * if an external task runs during one of `fn`'s awaits and calls\n * into the SDK, it will see `_withInnerLockDepth > 0` and run\n * inline, racing wasm-bindgen's borrow check. The wallet pattern\n * (own outer mutex around `_withInnerWebClient`) satisfies this.\n *\n * Stability: marked `@internal`. The shape of the proxied client is\n * intentionally not part of the documented public API and may change\n * between SDK versions. If you depend on this method, pin the SDK\n * version and test the lower-level surface carefully on each upgrade.\n * If your use case is common enough to warrant a stable public API,\n * file an issue.\n *\n * @internal\n * @template T\n * @param {(inner: object) => Promise<T>} fn - Async callback receiving\n * the proxied JS WebClient. Must not return references that escape\n * the callback's lifetime (the lock is released on settle).\n * @returns {Promise<T>} The resolved value of `fn`.\n */\n _withInnerWebClient(fn) {\n this.assertNotTerminated();\n if (typeof fn !== \"function\") {\n throw new TypeError(\"_withInnerWebClient: fn must be a function\");\n }\n const inner = this.#inner;\n return inner._serializeWasmCall(async () => {\n inner._withInnerLockDepth = (inner._withInnerLockDepth || 0) + 1;\n try {\n return await fn(inner);\n } finally {\n inner._withInnerLockDepth--;\n }\n });\n }\n\n /**\n * Creates and initializes a new MidenClient.\n *\n * If no `rpcUrl` is provided, defaults to testnet with full configuration\n * (RPC, prover, note transport, autoSync).\n *\n * @param {ClientOptions} [options] - Client configuration options.\n * @returns {Promise<MidenClient>} A fully initialized client.\n */\n static async create(options) {\n if (!options?.rpcUrl) {\n return MidenClient.createTestnet(options);\n }\n\n const getWasm = MidenClient._getWasmOrThrow;\n const WebClientClass = MidenClient._WasmWebClient;\n\n if (!WebClientClass || !getWasm) {\n throw new Error(\n \"MidenClient not initialized. Import from the SDK package entry point.\"\n );\n }\n\n const seed = options?.seed ? await hashSeed(options.seed) : undefined;\n\n const rpcUrl = resolveRpcUrl(options?.rpcUrl);\n const noteTransportUrl = resolveNoteTransportUrl(options?.noteTransportUrl);\n\n // `useWorker: false` opts out of the Web Worker shim that wraps every\n // WASM call. The shim exists to keep the main thread responsive in\n // browser/extension contexts, but it serializes the prover via\n // `TransactionProver.serialize()` — a format that has no encoding for\n // `newCallbackProver(jsFn)` and silently downgrades it to `\"local\"`.\n // Mobile/Tauri/native-prover consumers must pass `useWorker: false`.\n const useWorker = options?.useWorker;\n let inner;\n if (options?.keystore) {\n inner = await WebClientClass.createClientWithExternalKeystore(\n rpcUrl,\n noteTransportUrl,\n seed,\n options?.storeName,\n options.keystore.getKey,\n options.keystore.insertKey,\n options.keystore.sign,\n options?.debugMode,\n useWorker\n );\n } else {\n inner = await WebClientClass.createClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n options?.storeName,\n options?.debugMode,\n useWorker\n );\n }\n\n let defaultProver = null;\n if (options?.proverUrl) {\n const wasm = await getWasm();\n defaultProver = resolveProver(options.proverUrl, wasm);\n }\n\n const client = new MidenClient(inner, getWasm, defaultProver);\n\n if (options?.autoSync) {\n await client.sync();\n }\n\n return client;\n }\n\n /**\n * Creates a client preconfigured for testnet use.\n *\n * Defaults: rpcUrl \"testnet\", proverUrl \"testnet\", noteTransportUrl \"testnet\", autoSync true.\n * All defaults can be overridden via options.\n *\n * @param {ClientOptions} [options] - Options to override defaults.\n * @returns {Promise<MidenClient>} A fully initialized testnet client.\n */\n static async createTestnet(options) {\n return MidenClient.create({\n rpcUrl: \"testnet\",\n proverUrl: \"testnet\",\n noteTransportUrl: \"testnet\",\n autoSync: true,\n ...options,\n });\n }\n\n /**\n * Creates a client preconfigured for devnet use.\n *\n * Defaults: rpcUrl \"devnet\", proverUrl \"devnet\", noteTransportUrl \"devnet\", autoSync true.\n * All defaults can be overridden via options.\n *\n * @param {ClientOptions} [options] - Options to override defaults.\n * @returns {Promise<MidenClient>} A fully initialized devnet client.\n */\n static async createDevnet(options) {\n return MidenClient.create({\n rpcUrl: \"devnet\",\n proverUrl: \"devnet\",\n noteTransportUrl: \"devnet\",\n autoSync: true,\n ...options,\n });\n }\n\n /**\n * Resolves once the WASM module is initialized and safe to use.\n *\n * Idempotent and shared across callers: the underlying loader memoizes the\n * in-flight promise, so concurrent `ready()` calls await the same\n * initialization and post-init callers resolve immediately from a cached\n * module. Safe to call from `MidenProvider`, tutorial helpers, and any\n * other consumer simultaneously.\n *\n * Useful on the `/lazy` entry (e.g. Next.js / Capacitor), where no\n * top-level await runs at import time. On the default (eager) entry this\n * is redundant — importing the module already awaits WASM — but calling it\n * is still harmless.\n *\n * @returns {Promise<void>} Resolves when WASM is initialized.\n */\n static async ready() {\n const getWasm = MidenClient._getWasmOrThrow;\n if (!getWasm) {\n throw new Error(\n \"MidenClient not initialized. Import from the SDK package entry point.\"\n );\n }\n await getWasm();\n }\n\n /**\n * Creates a mock client for testing.\n *\n * @param {MockOptions} [options] - Mock client options.\n * @returns {Promise<MidenClient>} A mock client.\n */\n static async createMock(options) {\n const getWasm = MidenClient._getWasmOrThrow;\n const MockWebClientClass = MidenClient._MockWasmWebClient;\n\n if (!MockWebClientClass || !getWasm) {\n throw new Error(\n \"MidenClient not initialized. Import from the SDK package entry point.\"\n );\n }\n\n const seed = options?.seed ? await hashSeed(options.seed) : undefined;\n\n const inner = await MockWebClientClass.createClient(\n options?.serializedMockChain,\n options?.serializedNoteTransport,\n seed\n );\n\n const client = new MidenClient(inner, getWasm, null);\n client.#isMock = true;\n return client;\n }\n\n /** Returns the client-level default prover (set from ClientOptions.proverUrl). */\n get defaultProver() {\n return this.#defaultProver;\n }\n\n /**\n * Syncs the client: fetches private notes from the Note Transport Layer, then syncs on-chain\n * state with the Miden node. Fails fast on either.\n *\n * @returns {Promise<SyncSummary>} The sync summary.\n */\n async sync() {\n this.assertNotTerminated();\n return await this.#inner.syncState();\n }\n\n /**\n * Syncs on-chain state only (no NTL fetch).\n *\n * @returns {Promise<SyncSummary>}\n */\n async syncChain() {\n this.assertNotTerminated();\n return await this.#inner.syncChain();\n }\n\n /**\n * Fetches private notes from the Note Transport Layer.\n *\n * @returns {Promise<void>}\n */\n async syncNoteTransport() {\n this.assertNotTerminated();\n return await this.#inner.syncNoteTransport();\n }\n\n /**\n * Returns the current sync height.\n *\n * @returns {Promise<number>} The current sync height.\n */\n async getSyncHeight() {\n this.assertNotTerminated();\n return await this.#inner.getSyncHeight();\n }\n\n /**\n * Resolves once every serialized WASM call that was already on the\n * internal `_serializeWasmCall` chain when `waitForIdle()` was called\n * (execute, submit, prove, apply, sync, or account creation) has\n * settled. Use this from callers that need to perform a non-WASM-side\n * action — e.g. clearing an in-memory auth key on wallet lock — after\n * the kernel finishes, so its auth callback doesn't race with the key\n * being cleared.\n *\n * Does NOT wait for calls enqueued after `waitForIdle()` returns —\n * intentional, so a caller can drain and proceed without being blocked\n * indefinitely by concurrent workload.\n *\n * Caveat for `syncState`: `syncStateWithTimeout` awaits the sync lock\n * (`acquireSyncLock`, which uses Web Locks) BEFORE putting its WASM\n * call onto the chain, so a `syncState` that is queued on the sync\n * lock — but has not yet begun its WASM phase — is not visible to\n * `waitForIdle` and will not be awaited. Other methods (`newWallet`,\n * `executeTransaction`, etc.) route through the chain synchronously\n * on call and are always observed.\n *\n * Safe to call at any time; returns immediately if nothing was in\n * flight.\n *\n * @returns {Promise<void>}\n */\n async waitForIdle() {\n this.assertNotTerminated();\n await this.#inner.waitForIdle();\n }\n\n /**\n * Returns the raw JS value that the most recent sign-callback invocation\n * threw, or `null` if the last sign call succeeded (or no call has\n * happened yet).\n *\n * Useful for recovering structured metadata (e.g. a `reason: 'locked'`\n * property) that the kernel-level `auth::request` diagnostic would\n * otherwise erase. Call immediately after catching a failed\n * `transactions.submit` / `transactions.send` / `transactions.consume`.\n *\n * Meaningful only with `useWorker: false`: under the worker shim the\n * sign callback fires against the worker's WASM keystore, while this\n * accessor reads the main-thread instance — which never signed — so it\n * returns `null`. Consumers that need this signal (e.g. external\n * keystores with lock-aware sign callbacks) already require\n * `useWorker: false` for the callback to be reachable at all.\n *\n * @returns {any} The raw thrown value, or `null`.\n */\n lastAuthError() {\n this.assertNotTerminated();\n return this.#inner.lastAuthError();\n }\n\n /**\n * Terminates the underlying Web Worker. After this, all method calls will throw.\n */\n terminate() {\n this.#terminated = true;\n this.#inner.terminate?.();\n }\n\n [Symbol.dispose]() {\n this.terminate();\n }\n\n async [Symbol.asyncDispose]() {\n this.terminate();\n }\n\n /**\n * Returns the identifier of the underlying store (e.g. IndexedDB database name, file path).\n *\n * @returns {string} The store identifier.\n */\n async storeIdentifier() {\n this.assertNotTerminated();\n return await this.#inner.storeIdentifier();\n }\n\n // ── Mock-only methods ──\n\n /** Advances the mock chain by one block. Only available on mock clients. */\n proveBlock() {\n this.assertNotTerminated();\n this.#assertMock(\"proveBlock\");\n return this.#inner.proveBlock();\n }\n\n /** Returns true if this client uses a mock chain. */\n usesMockChain() {\n return this.#isMock;\n }\n\n /** Serializes the mock chain state for snapshot/restore in tests. */\n serializeMockChain() {\n this.assertNotTerminated();\n this.#assertMock(\"serializeMockChain\");\n return this.#inner.serializeMockChain();\n }\n\n /** Serializes the mock note transport node state. */\n serializeMockNoteTransportNode() {\n this.assertNotTerminated();\n this.#assertMock(\"serializeMockNoteTransportNode\");\n return this.#inner.serializeMockNoteTransportNode();\n }\n\n // ── Internal ──\n\n /** @internal Throws if the client has been terminated. */\n assertNotTerminated() {\n if (this.#terminated) {\n throw new Error(\"Client terminated\");\n }\n }\n\n #assertMock(method) {\n if (!this.#isMock) {\n throw new Error(`${method}() is only available on mock clients`);\n }\n }\n}\n\nconst RPC_URLS = {\n testnet: \"https://rpc.testnet.miden.io\",\n devnet: \"https://rpc.devnet.miden.io\",\n localhost: \"http://localhost:57291\",\n local: \"http://localhost:57291\",\n};\n\n/**\n * Resolves an rpcUrl shorthand or raw URL into a concrete endpoint string.\n *\n * @param {string | undefined} rpcUrl - \"testnet\", \"devnet\", \"localhost\", \"local\", or a raw URL.\n * @returns {string | undefined} A fully qualified URL, or undefined to use the SDK default.\n */\nfunction resolveRpcUrl(rpcUrl) {\n if (!rpcUrl) return undefined;\n return RPC_URLS[rpcUrl.trim().toLowerCase()] ?? rpcUrl;\n}\n\nconst PROVER_URLS = {\n devnet: \"https://tx-prover.devnet.miden.io\",\n testnet: \"https://tx-prover.testnet.miden.io\",\n};\n\nconst NOTE_TRANSPORT_URLS = {\n testnet: \"https://transport.miden.io\",\n devnet: \"https://transport.devnet.miden.io\",\n};\n\n/**\n * Resolves a noteTransportUrl shorthand or raw URL into a concrete endpoint string.\n *\n * @param {string | undefined} noteTransportUrl - \"testnet\", \"devnet\", or a raw URL.\n * @returns {string | undefined} A fully qualified URL, or undefined if omitted.\n */\nfunction resolveNoteTransportUrl(noteTransportUrl) {\n if (!noteTransportUrl) return undefined;\n return (\n NOTE_TRANSPORT_URLS[noteTransportUrl.trim().toLowerCase()] ??\n noteTransportUrl\n );\n}\n\n/**\n * Resolves a proverUrl shorthand or raw URL into a TransactionProver.\n *\n * @param {string} proverUrl - \"local\", \"devnet\", \"testnet\", or a raw URL.\n * @param {object} wasm - Loaded WASM module.\n * @returns {object} A TransactionProver instance.\n */\nfunction resolveProver(proverUrl, wasm) {\n const normalized = proverUrl.trim().toLowerCase();\n if (normalized === \"local\") {\n return wasm.TransactionProver.newLocalProver();\n }\n const remoteUrl = PROVER_URLS[normalized] ?? proverUrl;\n return wasm.TransactionProver.newRemoteProver(remoteUrl, undefined);\n}\n","import { resolveAccountRef, resolveNoteType } from \"./utils.js\";\n\n// Module-level WASM reference, set by index.js after initialization\nlet _wasm = null;\nlet _WebClient = null;\n\nexport function _setWasm(wasm) {\n _wasm = wasm;\n}\n\nexport function _setWebClient(WebClientClass) {\n _WebClient = WebClientClass;\n}\n\nfunction getWasm() {\n if (!_wasm) {\n throw new Error(\n \"WASM not initialized. Ensure the SDK is loaded before calling standalone utilities.\"\n );\n }\n return _wasm;\n}\n\n/**\n * Creates a P2ID (Pay-to-ID) note.\n *\n * @param {NoteOptions} opts - Note creation options.\n * @returns {Note} The created note.\n */\nexport function createP2IDNote(opts) {\n const wasm = getWasm();\n const sender = resolveAccountRef(opts.from, wasm);\n const target = resolveAccountRef(opts.to, wasm);\n const noteAssets = buildNoteAssets(opts.assets, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const attachment = opts.attachment\n ? new wasm.NoteAttachment(opts.attachment)\n : new wasm.NoteAttachment([]);\n\n return wasm.Note.createP2IDNote(\n sender,\n target,\n noteAssets,\n noteType,\n attachment\n );\n}\n\n/**\n * Creates a P2IDE (Pay-to-ID with Expiration) note.\n *\n * @param {P2IDEOptions} opts - Note creation options with timelock/reclaim.\n * @returns {Note} The created note.\n */\nexport function createP2IDENote(opts) {\n const wasm = getWasm();\n const sender = resolveAccountRef(opts.from, wasm);\n const target = resolveAccountRef(opts.to, wasm);\n const noteAssets = buildNoteAssets(opts.assets, wasm);\n const noteType = resolveNoteType(opts.type, wasm);\n const attachment = opts.attachment\n ? new wasm.NoteAttachment(opts.attachment)\n : new wasm.NoteAttachment([]);\n\n return wasm.Note.createP2IDENote(\n sender,\n target,\n noteAssets,\n opts.reclaimAfter,\n opts.timelockUntil,\n noteType,\n attachment\n );\n}\n\n/**\n * Builds a swap tag for note matching.\n *\n * @param {BuildSwapTagOptions} opts - Swap tag options.\n * @returns {NoteTag} The computed swap tag.\n */\nexport function buildSwapTag(opts) {\n const wasm = getWasm();\n if (!_WebClient || typeof _WebClient.buildSwapTag !== \"function\") {\n throw new Error(\n \"WebClient.buildSwapTag is not available. Ensure the SDK is fully loaded.\"\n );\n }\n const noteType = resolveNoteType(opts.type, wasm);\n const offeredFaucetId = resolveAccountRef(opts.offer.token, wasm);\n const requestedFaucetId = resolveAccountRef(opts.request.token, wasm);\n\n return _WebClient.buildSwapTag(\n noteType,\n offeredFaucetId,\n BigInt(opts.offer.amount),\n requestedFaucetId,\n BigInt(opts.request.amount)\n );\n}\n\nfunction buildNoteAssets(assets, wasm) {\n const assetArray = Array.isArray(assets) ? assets : [assets];\n const fungibleAssets = assetArray.map((asset) => {\n const faucetId = resolveAccountRef(asset.token, wasm);\n return new wasm.FungibleAsset(faucetId, BigInt(asset.amount));\n });\n return new wasm.NoteAssets(fungibleAssets);\n}\n","/**\n * StorageView wraps the raw WASM AccountStorage to provide a developer-friendly\n * (and AI-agent-friendly) API.\n *\n * Key behavior: `getItem()` returns a `StorageResult` that works intuitively for\n * both Value and StorageMap slots. The result has `.toBigInt()`, `.toHex()`, and\n * `.toString()` methods that do the right thing automatically. For StorageMap slots,\n * `.entries` provides access to all map entries.\n *\n * Numeric ergonomics: `StorageResult` is usable directly in template strings,\n * JSX, and arithmetic via `toString()` (lossless, BigInt-backed) and `valueOf()`\n * (returns a JS number for values that fit, throws on overflow — never silently\n * corrupts). For exact u64 access use `.toBigInt()`.\n *\n * The raw WASM AccountStorage is still accessible via `.raw` for advanced use cases\n * that need the original behavior (e.g., comparing map commitment roots).\n */\n/** @param {string} hex @param {typeof Word} WordClass @returns {Word | undefined} */\nfunction hexToWord(hex, WordClass) {\n if (!hex || !WordClass) return undefined;\n try {\n return WordClass.fromHex(hex);\n } catch {\n return undefined;\n }\n}\n\nexport class StorageView {\n #storage;\n #WordClass;\n\n /**\n * @param {AccountStorage} wasmStorage\n * @param {typeof Word} WordClass\n */\n constructor(wasmStorage, WordClass) {\n this.#storage = wasmStorage;\n this.#WordClass = WordClass;\n }\n\n /**\n * The raw WASM AccountStorage, for cases where you need the original\n * primitive behavior (e.g., reading map commitment roots via raw.getItem()).\n */\n get raw() {\n return this.#storage;\n }\n\n /**\n * Returns the commitment to the full account storage.\n */\n commitment() {\n return this.#storage.commitment();\n }\n\n /**\n * Returns the names of all storage slots on this account.\n * @returns {string[]}\n */\n getSlotNames() {\n return this.#storage.getSlotNames();\n }\n\n /**\n * Returns a StorageResult for the given slot.\n *\n * The result has convenience methods that work for both Value and StorageMap slots:\n * - `.toBigInt()` — first felt as BigInt (full u64 precision)\n * - `.toHex()` — first felt's Word as hex string\n * - `.toString()` — renders as the BigInt value (works in JSX: {result})\n * - `.isMap` — true if this is a StorageMap slot\n * - `.entries` — all map entries (undefined for Value slots)\n * - `.word` — the underlying Word value\n *\n * The result is also usable directly in arithmetic (`+result`, `result * 2`)\n * via `valueOf()`, which returns a JS number for values that fit and throws\n * `RangeError` for values exceeding `Number.MAX_SAFE_INTEGER` — use `.toBigInt()`\n * for exact access to large u64 values.\n *\n * For explicit key-based map reads, use `getMapItem(slotName, key)`.\n * For the raw commitment hash, use `raw.getItem(slotName)`.\n *\n * @param {string} slotName\n * @returns {StorageResult | undefined}\n */\n getItem(slotName) {\n // Type detection + value retrieval in one pass.\n // We call getMapEntries to detect maps, but defer parsing the entries\n // until .entries is actually accessed (lazy). Only the first entry's\n // Word is parsed eagerly for the convenience methods (toBigInt, etc.).\n const rawEntries = this.#storage.getMapEntries(slotName);\n if (rawEntries !== undefined && rawEntries !== null) {\n // StorageMap — parse only the first entry eagerly\n const firstWord =\n rawEntries.length > 0\n ? hexToWord(rawEntries[0].value, this.#WordClass)\n : undefined;\n return new StorageResult(firstWord, true, rawEntries, this.#WordClass);\n }\n\n // Value slot — use raw getItem\n const word = this.#storage.getItem(slotName);\n if (!word) return undefined;\n return new StorageResult(word, false, undefined, this.#WordClass);\n }\n\n /**\n * Returns the value for a key in a StorageMap slot.\n * Delegates directly to the raw WASM method.\n *\n * @param {string} slotName\n * @param {Word} key\n * @returns {Word | undefined}\n */\n getMapItem(slotName, key) {\n return this.#storage.getMapItem(slotName, key);\n }\n\n /**\n * Get all key-value pairs from a StorageMap slot.\n * Returns undefined if the slot isn't a map, or an empty array if the map is empty.\n */\n getMapEntries(slotName) {\n return this.#storage.getMapEntries(slotName);\n }\n\n /**\n * Returns the commitment root of a storage slot as a Word.\n *\n * For Value slots, this is the stored Word itself.\n * For StorageMap slots, this is the Merkle root hash of the map — useful for:\n * - Verifying state hasn't changed between transactions\n * - Merkle inclusion proofs against the account state\n * - Comparing map state across accounts or sync cycles\n *\n * This is the raw protocol-level value. For reading stored data, use `getItem()`.\n *\n * @param {string} slotName\n * @returns {Word | undefined}\n */\n getCommitment(slotName) {\n return this.#storage.getItem(slotName);\n }\n}\n\n/**\n * Result of reading a storage slot. Works for both Value and StorageMap slots.\n *\n * Provides a unified interface so code like `storage.getItem(name).toBigInt()`\n * works regardless of the underlying slot type.\n *\n * For StorageMap slots, the convenience methods (toHex, toBigInt) operate on\n * the first entry's value. The full map data is available via `.entries`.\n * Note: Miden storage maps are Merkle-based, so \"first\" is determined by key hash\n * order — deterministic for a given map state, but not meaningful as an ordering.\n */\nexport class StorageResult {\n #word;\n #isMap;\n #rawEntries; // Raw JsStorageMapEntry[] from WASM — parsed lazily\n #parsedEntries; // Parsed entries with Word objects — created on first .entries access\n #WordClass;\n\n /**\n * @param {Word | undefined} word — the primary Word value (first entry for maps)\n * @param {boolean} isMap — whether this came from a StorageMap slot\n * @param {Array | undefined} rawEntries — raw WASM entries (parsed lazily on .entries access)\n * @param {typeof Word} WordClass — Word constructor for hex parsing\n */\n constructor(word, isMap, rawEntries, WordClass) {\n this.#word = word;\n this.#isMap = isMap;\n this.#rawEntries = rawEntries;\n this.#WordClass = WordClass;\n }\n\n /** True if this slot is a StorageMap. */\n get isMap() {\n return this.#isMap;\n }\n\n /**\n * All entries from a StorageMap slot (lazily parsed on first access).\n * Each entry has { key: string (hex), value: string (hex), word: Word | undefined }.\n * Returns undefined for Value slots.\n */\n get entries() {\n if (!this.#isMap) return undefined;\n if (this.#parsedEntries) return this.#parsedEntries;\n if (!this.#rawEntries) return [];\n\n // Parse entries lazily — only when the user actually accesses .entries\n this.#parsedEntries = this.#rawEntries.map((e) => ({\n key: e.key,\n value: e.value,\n word: hexToWord(e.value, this.#WordClass),\n }));\n this.#rawEntries = undefined; // Free raw entries\n return this.#parsedEntries;\n }\n\n /**\n * The underlying Word value.\n * For Value slots: the stored Word.\n * For StorageMap slots: the first entry's value as a Word (or undefined if empty).\n */\n get word() {\n return this.#word;\n }\n\n /**\n * Returns all four Felts of the stored Word as an array.\n * Pass-through to Word.toFelts() — ensures code that expects a Word-like\n * object (e.g., `result.toFelts()[0].asInt()`) works on StorageResult.\n * @returns {Felt[]}\n */\n toFelts() {\n if (!this.#word) return [];\n return this.#word.toFelts();\n }\n\n /**\n * The first Felt of the stored Word.\n * Returns the WASM Felt object — use .asInt() to get its BigInt value.\n * @returns {Felt | undefined}\n */\n felt() {\n if (!this.#word) return undefined;\n const felts = this.#word.toFelts();\n return felts?.[0];\n }\n\n /**\n * First felt as a BigInt. Preserves full u64 precision.\n * @returns {bigint}\n */\n toBigInt() {\n if (!this.#word) return 0n;\n return wordToBigInt(this.#word);\n }\n\n /**\n * The Word's hex representation.\n * For Value slots: the stored Word hex.\n * For StorageMap slots: the first entry's value Word hex.\n * @returns {string}\n */\n toHex() {\n if (!this.#word) return \"0x\" + \"0\".repeat(64);\n return this.#word.toHex();\n }\n\n /**\n * Renders as the BigInt value (lossless). Makes `{storageResult}` work in JSX\n * and template literals: `` `value: ${result}` ``.\n * @returns {string}\n */\n toString() {\n return this.toBigInt().toString();\n }\n\n /**\n * JSON serialization — returns the value as a string to avoid\n * precision loss for large u64 felt values.\n */\n toJSON() {\n return this.toBigInt().toString();\n }\n\n /**\n * Allows `+result`, `result * 2`, etc. to work as expected.\n *\n * Returns a JS number for values that fit in `Number.MAX_SAFE_INTEGER`\n * (2^53 - 1). For larger u64 values, throws `RangeError` rather than\n * silently losing precision — use `.toBigInt()` to access the exact value.\n *\n * @returns {number}\n * @throws {RangeError} if the underlying felt exceeds Number.MAX_SAFE_INTEGER\n */\n valueOf() {\n const big = this.toBigInt();\n if (big > BigInt(Number.MAX_SAFE_INTEGER)) {\n throw new RangeError(\n `StorageResult value ${big} exceeds Number.MAX_SAFE_INTEGER ` +\n `(${Number.MAX_SAFE_INTEGER}) — use .toBigInt() to read the exact value.`\n );\n }\n return Number(big);\n }\n}\n\n/**\n * Convert a Word's first felt to a BigInt.\n * Uses BigInt to preserve full u64 precision (felts are u64-backed).\n * Handles the little-endian byte order of felt serialization.\n *\n * @param {Word} word\n * @returns {bigint}\n */\nexport function wordToBigInt(word) {\n try {\n const hex = word.toHex();\n // Word.toHex() returns \"0x\" + 64 hex chars (4 felts × 16 hex chars each).\n // Each felt is serialized as 8 little-endian bytes, so we take the first 16\n // hex chars (first felt) and reverse the byte pairs to get the integer value.\n const feltHex = hex.slice(2, 18);\n const bytes = feltHex.match(/../g);\n if (!bytes) return 0n;\n return BigInt(\"0x\" + bytes.reverse().join(\"\"));\n } catch {\n return 0n;\n }\n}\n\n/**\n * Install the StorageView wrapper on Account.prototype.storage().\n * After this, `account.storage()` returns a StorageView instead of raw AccountStorage.\n *\n * @param {object} wasmModule — the loaded WASM module containing Account, Word, etc.\n */\nexport function installStorageView(wasmModule) {\n const AccountProto = wasmModule.Account?.prototype;\n if (!AccountProto || !AccountProto.storage) return;\n\n const originalStorage = AccountProto.storage;\n const WordClass = wasmModule.Word;\n\n AccountProto.storage = function () {\n const raw = originalStorage.call(this);\n return new StorageView(raw, WordClass);\n };\n}\n","import loadWasm from \"./wasm.js\";\nimport { CallbackType, MethodName, WorkerAction } from \"./constants.js\";\nimport { withSyncLock } from \"./syncLock.js\";\nimport { MidenClient } from \"./client.js\";\nimport { CompilerResource } from \"./resources/compiler.js\";\nimport {\n createP2IDNote,\n createP2IDENote,\n buildSwapTag,\n _setWasm as _setStandaloneWasm,\n _setWebClient as _setStandaloneWebClient,\n} from \"./standalone.js\";\nimport {\n installStorageView,\n StorageView,\n StorageResult,\n wordToBigInt,\n} from \"./storageView.js\";\nexport * from \"../Cargo.toml\";\n\nexport const AccountType = Object.freeze({\n // WASM-compatible numeric values — usable with AccountBuilder directly\n FungibleFaucet: 0,\n NonFungibleFaucet: 1,\n RegularAccountImmutableCode: 2,\n RegularAccountUpdatableCode: 3,\n // SDK-friendly aliases (same numeric values as their WASM equivalents)\n MutableWallet: 3,\n ImmutableWallet: 2,\n ImmutableContract: 2,\n MutableContract: 3,\n});\n\nexport const AuthScheme = Object.freeze({\n Falcon: \"falcon\",\n ECDSA: \"ecdsa\",\n});\n\nexport const NoteVisibility = Object.freeze({\n Public: \"public\",\n Private: \"private\",\n});\n\nexport const StorageMode = Object.freeze({\n Public: \"public\",\n Private: \"private\",\n});\n\nexport const Linking = Object.freeze({\n Dynamic: \"dynamic\",\n Static: \"static\",\n});\n\nexport { MidenClient };\nexport { CompilerResource };\nexport { createP2IDNote, createP2IDENote, buildSwapTag };\nexport { StorageView, StorageResult, wordToBigInt };\n\n// Internal exports — used by integration tests that need direct access to the low-level WebClient proxy.\nexport {\n WebClient as WasmWebClient,\n MockWebClient as MockWasmWebClient,\n MockWebClient,\n withSyncLock,\n};\n\n// Method classification sets — used by scripts/check-method-classification.js to ensure\n// every WASM export is explicitly categorised. Update when adding new WASM methods.\n//\n// Naming note: \"SYNC_METHODS\" is a historical misnomer. This set groups methods\n// that are forwarded transparently to the underlying WASM via the Proxy in\n// `createClientProxy` — meaning they don't need an explicit JS-class wrapper\n// here. It does NOT mean \"the method is synchronous\"; several entries\n// (e.g. newSwapTransactionRequest, newPswapCreateTransactionRequest) are\n// `async fn` in Rust because they take the client's RNG via an async lock.\nconst SYNC_METHODS = new Set([\n \"buildSwapTag\",\n \"createCodeBuilder\",\n \"lastAuthError\",\n \"newConsumeTransactionRequest\",\n \"newMintTransactionRequest\",\n \"newPswapCancelTransactionRequest\",\n \"newPswapConsumeTransactionRequest\",\n \"newPswapCreateTransactionRequest\",\n \"newSendTransactionRequest\",\n \"newSwapTransactionRequest\",\n \"proveBlock\",\n \"serializeMockChain\",\n \"serializeMockNoteTransportNode\",\n \"setDebugMode\",\n \"storeIdentifier\",\n \"usesMockChain\",\n]);\n\nconst WRITE_METHODS = new Set([\n \"addAccountSecretKeyToWebStore\",\n \"addTag\",\n \"executeForSummary\",\n \"executeProgram\",\n \"fetchAllPrivateNotes\",\n \"fetchPrivateNotes\",\n \"forceImportStore\",\n \"importAccountById\",\n \"importAccountFile\",\n \"importNoteFile\",\n \"importPublicAccountFromSeed\",\n \"insertAccountAddress\",\n \"newAccount\",\n \"pruneAccountHistory\",\n \"removeAccountAddress\",\n \"removeTag\",\n \"removeSetting\",\n \"sendPrivateNote\",\n \"setSetting\",\n \"submitProvenTransaction\",\n]);\n\nconst READ_METHODS = new Set([\n \"accountReader\",\n \"exportAccountFile\",\n \"getAccountAuthByPubKeyCommitment\",\n \"getAccountByKeyCommitment\",\n \"exportNoteFile\",\n \"exportStore\",\n \"getAccount\",\n \"getAccountCode\",\n \"getAccountStorage\",\n \"getAccountVault\",\n \"getAccounts\",\n \"getConsumableNotes\",\n \"getInputNote\",\n \"getInputNotes\",\n \"getOutputNote\",\n \"getOutputNotes\",\n \"getPublicKeyCommitmentsOfAccount\",\n \"getSetting\",\n \"getSyncHeight\",\n \"getTransactions\",\n \"listSettingKeys\",\n \"listTags\",\n \"executeProgram\",\n]);\n\nconst MOCK_STORE_NAME = \"mock_client_db\";\n\n// SYNC_METHODS is consumed by `createClientProxy`; WRITE_METHODS and\n// READ_METHODS exist solely for the CI lint check\n// (scripts/check-method-classification.js); suppress unused-variable\n// warnings for those two.\nvoid WRITE_METHODS;\nvoid READ_METHODS;\n\nconst buildTypedArraysExport = (exportObject) => {\n return Object.entries(exportObject).reduce(\n (exports, [exportName, _export]) => {\n if (exportName.endsWith(\"Array\")) {\n exports[exportName] = _export;\n }\n return exports;\n },\n {}\n );\n};\n\nconst deserializeError = (errorLike) => {\n if (!errorLike) {\n return new Error(\"Unknown error received from worker\");\n }\n const { name, message, stack, cause, ...rest } = errorLike;\n const reconstructedError = new Error(message ?? \"Unknown worker error\");\n reconstructedError.name = name ?? reconstructedError.name;\n if (stack) {\n reconstructedError.stack = stack;\n }\n if (cause) {\n reconstructedError.cause = deserializeError(cause);\n }\n Object.entries(rest).forEach(([key, value]) => {\n if (value !== undefined) {\n reconstructedError[key] = value;\n }\n });\n return reconstructedError;\n};\n\nexport const MidenArrays = {};\n\nlet wasmModule = null;\nlet wasmLoadPromise = null;\nlet webClientStaticsCopied = false;\n\nconst ensureWasm = async () => {\n if (wasmModule) {\n return wasmModule;\n }\n if (!wasmLoadPromise) {\n wasmLoadPromise = loadWasm().then((module) => {\n wasmModule = module;\n if (module) {\n Object.assign(MidenArrays, buildTypedArraysExport(module));\n if (!webClientStaticsCopied && module.WebClient) {\n copyWebClientStatics(module.WebClient);\n webClientStaticsCopied = true;\n }\n // Set WASM module for standalone utilities\n _setStandaloneWasm(module);\n // Install StorageView: account.storage() now returns a developer-friendly\n // wrapper that makes getItem() work correctly for StorageMap slots.\n installStorageView(module);\n }\n return module;\n });\n }\n return wasmLoadPromise;\n};\n\nexport const getWasmOrThrow = async () => {\n const module = await ensureWasm();\n if (!module) {\n throw new Error(\n \"Miden WASM bindings are unavailable in this environment (SSR is disabled).\"\n );\n }\n return module;\n};\n/**\n * WebClient is a wrapper around the underlying WASM WebClient object.\n *\n * This wrapper serves several purposes:\n *\n * 1. It creates a dedicated web worker to offload computationally heavy tasks\n * (such as creating accounts, executing transactions, submitting transactions, etc.)\n * from the main thread, helping to prevent UI freezes in the browser.\n *\n * 2. It defines methods that mirror the API of the underlying WASM WebClient,\n * with the intention of executing these functions via the web worker. This allows us\n * to maintain the same API and parameters while benefiting from asynchronous, worker-based computation.\n *\n * 3. It employs a Proxy to forward any calls not designated for web worker computation\n * directly to the underlying WASM WebClient instance.\n *\n * Additionally, the wrapper provides a static createClient function. This static method\n * instantiates the WebClient object and ensures that the necessary createClient calls are\n * performed both in the main thread and within the worker thread. This dual initialization\n * correctly passes user parameters (RPC URL and seed) to both the main-thread\n * WASM WebClient and the worker-side instance.\n *\n * Because of this implementation, the only breaking change for end users is in the way the\n * web client is instantiated. Users should now use the WebClient.createClient static call.\n */\n/**\n * Create a Proxy that forwards missing properties to the underlying WASM\n * WebClient.\n */\nfunction createClientProxy(instance) {\n return new Proxy(instance, {\n get(target, prop, receiver) {\n if (prop in target) {\n return Reflect.get(target, prop, receiver);\n }\n if (target.wasmWebClient && prop in target.wasmWebClient) {\n const value = target.wasmWebClient[prop];\n if (typeof value === \"function\") {\n // SYNC_METHODS are safe to bind raw (synchronous in JS, or\n // documented exceptions). Everything else holds the WASM\n // client's internal RefCell across its awaits, so it MUST join\n // `_serializeWasmCall` — an unserialized fallback overlapping\n // any in-flight call panics with \"RefCell already borrowed\"\n // and poisons the instance for every later call.\n if (typeof prop === \"string\" && SYNC_METHODS.has(prop)) {\n return value.bind(target.wasmWebClient);\n }\n return (...args) =>\n target._serializeWasmCall(() =>\n value.apply(target.wasmWebClient, args)\n );\n }\n return value;\n }\n return undefined;\n },\n });\n}\n\nclass WebClient {\n /**\n * Controls which worker variant is spawned when a WebClient is constructed.\n *\n * - `\"auto\"` (default): pick `classic` on Safari/WKWebView (where module\n * workers have a very slow cold start), `module` everywhere else.\n * - `\"module\"`: always use the `.mjs` ES-module worker. Required for webpack\n * 5 / Next.js consumers so the asset tracer can see the WASM URL.\n * - `\"classic\"`: always use the `.js` classic-script worker. Required on\n * Safari/WKWebView. Set this if your consumer bundler (or your host app)\n * does not support module workers.\n *\n * Set before the first `WebClient.createClient(...)` call.\n */\n static workerMode = \"auto\";\n\n /**\n * Decide between the module and classic worker variants based on\n * `WebClient.workerMode` and (when `auto`) the current user agent.\n * @returns {boolean} true when the classic script should be used.\n * @private\n */\n static _shouldUseClassicWorker() {\n const mode = WebClient.workerMode;\n if (mode === \"module\") return false;\n if (mode === \"classic\") return true;\n // auto: classic on Safari/WKWebView, module everywhere else.\n const ua =\n typeof navigator !== \"undefined\" && navigator.userAgent\n ? navigator.userAgent\n : \"\";\n // Chromium-based browsers (Chrome, Edge, Brave, Opera, Chromium-based\n // Android WebView) handle module workers fine.\n if (/Chrome\\/|Chromium\\//.test(ua)) return false;\n // Safari (desktop + iOS) and WKWebView-without-Chrome (e.g. Capacitor host)\n // both have AppleWebKit but no Chrome/Chromium in the UA. Prefer classic.\n if (/AppleWebKit/.test(ua)) return true;\n // Firefox, jsdom, node without navigator, etc. — module worker is fine.\n return false;\n }\n\n /**\n * Create a WebClient wrapper.\n *\n * @param {string | undefined} rpcUrl - RPC endpoint URL used by the client.\n * @param {Uint8Array | undefined} seed - Optional seed for account initialization.\n * @param {string | undefined} storeName - Optional name for the store to be used by the client.\n * @param {(pubKey: Uint8Array) => Promise<Uint8Array | null | undefined> | Uint8Array | null | undefined} [getKeyCb]\n * - Callback to retrieve the secret key bytes for a given public key. The `pubKey`\n * parameter is the serialized public key (from `PublicKey.serialize()`). Return the\n * corresponding secret key as a `Uint8Array`, or `null`/`undefined` if not found. The\n * return value may be provided synchronously or via a `Promise`.\n * @param {(pubKey: Uint8Array, AuthSecretKey: Uint8Array) => Promise<void> | void} [insertKeyCb]\n * - Callback to persist a secret key. `pubKey` is the serialized public key, and\n * `authSecretKey` is the serialized secret key (from `AuthSecretKey.serialize()`). May return\n * `void` or a `Promise<void>`.\n * @param {(pubKey: Uint8Array, signingInputs: Uint8Array) => Promise<Uint8Array> | Uint8Array} [signCb]\n * - Callback to produce serialized signature bytes for the provided inputs. `pubKey` is the\n * serialized public key, and `signingInputs` is a `Uint8Array` produced by\n * `SigningInputs.serialize()`. Must return a `Uint8Array` containing the serialized\n * signature, either directly or wrapped in a `Promise`.\n * @param {string | undefined} [logLevel] - Optional log verbosity level\n * (\"error\", \"warn\", \"info\", \"debug\", \"trace\", \"off\", or \"none\").\n * When set, Rust tracing output is routed to the browser console.\n * @param {boolean} [useWorker=true] - When `false`, skip the Web Worker shim\n * and call the wasm-bindgen `WebClient` directly on the current thread.\n * The worker exists to keep the main thread responsive during WASM work\n * in browser/extension contexts, but it serializes the prover argument\n * via `TransactionProver.serialize()` — a format that has no encoding\n * for `newCallbackProver(jsFn)` and silently downgrades it to `\"local\"`.\n * Consumers that hand a `CallbackProver` (e.g. native iOS/Android plug-in\n * provers in Capacitor apps, or any other JS-side prover bridge) need\n * `useWorker: false` so the prover handle reaches the WASM binding intact.\n */\n constructor(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb,\n logLevel,\n useWorker = true\n ) {\n this.rpcUrl = rpcUrl;\n this.noteTransportUrl = noteTransportUrl;\n this.seed = seed;\n this.storeName = storeName;\n this.getKeyCb = getKeyCb;\n this.insertKeyCb = insertKeyCb;\n this.signCb = signCb;\n this.logLevel = logLevel;\n this.useWorker = useWorker !== false;\n\n // Check if Web Workers are available AND the caller didn't opt out via\n // `useWorker: false`. The opt-out is load-bearing for `CallbackProver`\n // consumers — see the constructor doc above.\n if (this.useWorker && typeof Worker !== \"undefined\") {\n console.log(\"WebClient: Web Workers are available.\");\n // Pick between the module and classic worker variants at runtime — see\n // `WebClient.workerMode` below. Both branches keep the\n // `new Worker(new URL(\"...\", import.meta.url), ...)` form fully literal:\n // webpack 5's new-worker detector is PURELY SYNTACTIC and only triggers\n // a proper worker sub-compilation (with asset+chunk tracing into the\n // Cargo glue and the sibling WASM) when it sees that exact pattern\n // spelled inline. Hoisting either URL into a variable downgrades the\n // detection to a plain \"copy file as asset\" — which in turn makes the\n // worker's `await import(\"./Cargo-*.js\")` 404 because webpack never\n // emitted a chunk for it. The bit of duplication here is load-bearing.\n //\n // - module (`.module.js` with `{ type: \"module\" }`): `import.meta.url`\n // inside the Cargo glue is preserved so webpack/Vite can resolve the\n // WASM URL statically. Preferred everywhere EXCEPT Safari/WKWebView.\n // - classic (`.js`, no options): self-contained async IIFE with\n // `import.meta.url` rewritten to `self.location.href`; the only form\n // Safari/WKWebView can cold-start in a reasonable time.\n if (WebClient._shouldUseClassicWorker()) {\n this.worker = new Worker(\n new URL(\"./workers/web-client-methods-worker.js\", import.meta.url)\n );\n } else {\n this.worker = new Worker(\n new URL(\n \"./workers/web-client-methods-worker.module.js\",\n import.meta.url\n ),\n { type: \"module\" }\n );\n }\n\n // Map to track pending worker requests.\n this.pendingRequests = new Map();\n\n // Promises to track when the worker script is loaded and ready.\n this.loaded = new Promise((resolve) => {\n this.loadedResolver = resolve;\n });\n\n // Create a promise that resolves when the worker signals that it is\n // fully initialized, and rejects if initialization fails. Every\n // worker-forwarded method awaits `ready` first, so an init failure must\n // reject it — otherwise those calls would await a promise that never\n // settles and hang forever.\n this.ready = new Promise((resolve, reject) => {\n this.readyResolver = resolve;\n this.readyRejecter = reject;\n });\n // Init can fail before any caller awaits `ready`; this no-op handler\n // suppresses the unhandledrejection event without consuming the\n // rejection for real awaiters.\n this.ready.catch(() => {});\n\n // Listen for messages from the worker.\n this.worker.addEventListener(\"message\", async (event) => {\n const data = event.data;\n\n // Worker script loaded.\n if (data.loaded) {\n this.loadedResolver();\n return;\n }\n\n // Worker ready.\n if (data.ready) {\n this.readyResolver();\n return;\n }\n\n if (data.action === WorkerAction.EXECUTE_CALLBACK) {\n const { callbackType, args, requestId } = data;\n try {\n const callbackMapping = {\n [CallbackType.GET_KEY]: this.getKeyCb,\n [CallbackType.INSERT_KEY]: this.insertKeyCb,\n [CallbackType.SIGN]: this.signCb,\n };\n if (!callbackMapping[callbackType]) {\n throw new Error(`Callback ${callbackType} not available`);\n }\n const callbackFunction = callbackMapping[callbackType];\n let result = callbackFunction.apply(this, args);\n if (result instanceof Promise) {\n result = await result;\n }\n\n this.worker.postMessage({\n callbackResult: result,\n callbackRequestId: requestId,\n });\n } catch (error) {\n this.worker.postMessage({\n callbackError: error.message,\n callbackRequestId: requestId,\n });\n }\n return;\n }\n\n // Handle responses for method calls.\n const { requestId, error, result, methodName } = data;\n if (requestId && this.pendingRequests.has(requestId)) {\n const { resolve, reject } = this.pendingRequests.get(requestId);\n this.pendingRequests.delete(requestId);\n if (error) {\n const workerError =\n error instanceof Error ? error : deserializeError(error);\n console.error(\n `WebClient: Error from worker in ${methodName}:`,\n workerError\n );\n reject(workerError);\n } else {\n resolve(result);\n }\n return;\n }\n\n // An error with no request attached comes from worker initialization\n // (INIT is the only requestId-less action that can fail). Reject\n // `ready` so queued and future method calls fail with the real cause\n // instead of awaiting forever.\n if (error && !requestId) {\n const workerError =\n error instanceof Error ? error : deserializeError(error);\n console.error(\n \"WebClient: worker initialization failed:\",\n workerError\n );\n this.readyRejecter(workerError);\n }\n });\n\n // Once the worker script has loaded, initialize the worker.\n this.loaded.then(() => this.initializeWorker());\n } else {\n console.log(\n this.useWorker\n ? \"WebClient: Web Workers are not available.\"\n : \"WebClient: Web Worker shim disabled by caller (useWorker=false).\"\n );\n // Worker not available or explicitly disabled; set up fallback values.\n this.worker = null;\n this.pendingRequests = null;\n this.loaded = Promise.resolve();\n this.ready = Promise.resolve();\n }\n\n // Lazy initialize the underlying WASM WebClient when first requested.\n this.wasmWebClient = null;\n this.wasmWebClientPromise = null;\n\n // Promise chain to serialize direct WASM calls that require exclusive\n // (&mut self) access. Without this, concurrent calls on the same client\n // would panic with \"recursive use of an object detected\" due to\n // wasm-bindgen's internal RefCell.\n this._wasmCallChain = Promise.resolve();\n // Depth counter for `_withInnerWebClient` re-entrancy. While > 0,\n // `_serializeWasmCall` runs its callback inline instead of queueing\n // it on the chain — see the comment on `_serializeWasmCall` for the\n // safety contract.\n this._withInnerLockDepth = 0;\n }\n\n /**\n * Serialize a WASM call that requires exclusive (&mut self) access.\n * Concurrent calls are queued and executed one at a time.\n *\n * Wraps both the direct (in-thread) path and the worker-dispatched path.\n * On the worker path this is redundant with the worker's own message queue,\n * but harmless (the chain resolves immediately on the main thread once the\n * worker's postMessage returns). On the direct path it is load-bearing —\n * without it, concurrent main-thread callers would panic with\n * \"recursive use of an object detected\" (wasm-bindgen's internal RefCell).\n *\n * Re-entrancy: when invoked from inside a `_withInnerWebClient(fn)`\n * callback — detected via `_withInnerLockDepth > 0` — `fn` runs inline\n * (no chain enqueue). The outer `_withInnerWebClient` invocation\n * already holds the chain via its own wrapping `_serializeWasmCall`,\n * so enqueueing the inner call would deadlock (the inner queues\n * behind the outer; the outer awaits the inner). The inline run is\n * safe because the chain still serializes against external callers\n * — they queue behind the outer call's chain slot, which only resolves\n * after `fn` (including all inline re-entries) settles. Callers of\n * `_withInnerWebClient` MUST hold an external mutex preventing\n * concurrent access via other code paths on this same instance during\n * the callback; without that, an external task running between two\n * awaits inside `fn` would race wasm-bindgen's borrow check.\n *\n * @param {() => Promise<any>} fn - The async function to execute.\n * @returns {Promise<any>} The result of fn.\n */\n _serializeWasmCall(fn) {\n if (this._withInnerLockDepth > 0) {\n return Promise.resolve().then(fn);\n }\n const result = this._wasmCallChain.catch(() => {}).then(fn);\n this._wasmCallChain = result.catch(() => {});\n return result;\n }\n\n /**\n * Returns a promise that resolves once every serialized WASM call that\n * was already on `_wasmCallChain` when `waitForIdle()` was called has\n * settled. Use this from callers that need to perform a non-WASM-side\n * action (e.g. clear an in-memory auth key) AFTER any in-flight\n * execute / submit / sync has completed, so the WASM kernel's auth\n * callback doesn't race with the key being cleared.\n *\n * Does NOT wait for calls enqueued after `waitForIdle()` returns —\n * this is intentional, so a caller can drain and then proceed without\n * being blocked indefinitely by a concurrent workload.\n *\n * Caveat for `syncState`: `syncStateWithTimeout` awaits\n * `acquireSyncLock` (Web Locks) BEFORE wrapping its WASM call in\n * `_serializeWasmCall`, so a sync that is queued on the sync lock but\n * has not yet reached its WASM phase is not on the chain and will not\n * be awaited. Every other serialized method (`executeTransaction`,\n * `newWallet`, `submitNewTransaction`, `proveTransaction`,\n * `applyTransaction`, and the proxy-fallback reads) routes through\n * the chain synchronously on call and is always observed.\n *\n * @returns {Promise<void>}\n */\n async waitForIdle() {\n // Chain on `_wasmCallChain`; by the time this resolves, any in-flight\n // serialized call has settled. Catch so the chain state doesn't leak.\n await this._wasmCallChain.catch(() => {});\n }\n\n // TODO: This will soon conflict with some changes in main.\n // More context here:\n // https://github.com/0xMiden/miden-client/pull/1645?notification_referrer_id=NT_kwHOA1yg7NoAJVJlcG9zaXRvcnk7NjU5MzQzNzAyO0lzc3VlOzM3OTY4OTU1Nzk&notifications_query=is%3Aunread#discussion_r2696075480\n initializeWorker() {\n // Pass `numThreads` to the worker so it can call `wasm.initThreadPool(n)`\n // inside its OWN WASM instance — the SDK worker's instance is separate\n // from the main thread's, and rayon's global pool is per-instance.\n // Default: navigator.hardwareConcurrency (or 1 if unavailable for any\n // reason — e.g. the page isn't crossOriginIsolated, in which case the\n // worker will skip pool init and parallelism falls back to sequential).\n let numThreads = 1;\n try {\n if (\n typeof self !== \"undefined\" &&\n self.crossOriginIsolated &&\n navigator?.hardwareConcurrency\n ) {\n numThreads = navigator.hardwareConcurrency;\n }\n } catch {}\n this.worker.postMessage({\n action: WorkerAction.INIT,\n args: [\n this.rpcUrl,\n this.noteTransportUrl,\n this.seed,\n this.storeName,\n !!this.getKeyCb,\n !!this.insertKeyCb,\n !!this.signCb,\n this.logLevel,\n numThreads,\n ],\n });\n }\n\n async getWasmWebClient() {\n if (this.wasmWebClient) {\n return this.wasmWebClient;\n }\n if (!this.wasmWebClientPromise) {\n this.wasmWebClientPromise = (async () => {\n const wasm = await getWasmOrThrow();\n const client = new wasm.WebClient();\n this.wasmWebClient = client;\n return client;\n })();\n }\n return this.wasmWebClientPromise;\n }\n\n /**\n * Factory method to create and initialize a WebClient instance.\n * This method is async so you can await the asynchronous call to createClient().\n *\n * @param {string} rpcUrl - The RPC URL.\n * @param {string} noteTransportUrl - The note transport URL (optional).\n * @param {string} seed - The seed for the account.\n * @param {string | undefined} network - Optional name for the store. Setting this allows multiple clients to be used in the same browser.\n * @param {string | undefined} logLevel - Optional log verbosity level (\"error\", \"warn\", \"info\", \"debug\", \"trace\", \"off\", or \"none\").\n * @param {boolean} [useWorker=true] - When `false`, bypass the Web Worker shim\n * and run WASM calls on the current thread. Required for `CallbackProver`\n * consumers (the worker path serializes the prover and loses the callback).\n * @returns {Promise<WebClient>} The fully initialized WebClient.\n */\n static async createClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n network,\n logLevel,\n useWorker = true\n ) {\n // Construct the instance (synchronously).\n const instance = new WebClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n network,\n undefined,\n undefined,\n undefined,\n logLevel,\n useWorker\n );\n\n // Set up logging on the main thread before creating the client.\n if (logLevel) {\n const wasm = await getWasmOrThrow();\n wasm.setupLogging(logLevel);\n }\n\n // Wait for the underlying wasmWebClient to be initialized.\n const wasmWebClient = await instance.getWasmWebClient();\n await wasmWebClient.createClient(rpcUrl, noteTransportUrl, seed, network);\n\n // Wait for the worker to be ready\n await instance.ready;\n\n return createClientProxy(instance);\n }\n\n /**\n * Factory method to create and initialize a WebClient instance with a remote keystore.\n * This method is async so you can await the asynchronous call to createClientWithExternalKeystore().\n *\n * @param {string} rpcUrl - The RPC URL.\n * @param {string | undefined} noteTransportUrl - The note transport URL (optional).\n * @param {string | undefined} seed - The seed for the account.\n * @param {string | undefined} storeName - Optional name for the store. Setting this allows multiple clients to be used in the same browser.\n * @param {Function | undefined} getKeyCb - The get key callback.\n * @param {Function | undefined} insertKeyCb - The insert key callback.\n * @param {Function | undefined} signCb - The sign callback.\n * @param {string | undefined} logLevel - Optional log verbosity level (\"error\", \"warn\", \"info\", \"debug\", \"trace\", \"off\", or \"none\").\n * @param {boolean} [useWorker=true] - When `false`, bypass the Web Worker shim\n * and run WASM calls on the current thread. Required for `CallbackProver`\n * consumers (the worker path serializes the prover and loses the callback).\n * @returns {Promise<WebClient>} The fully initialized WebClient.\n */\n static async createClientWithExternalKeystore(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb,\n logLevel,\n useWorker = true\n ) {\n // Construct the instance (synchronously).\n const instance = new WebClient(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb,\n logLevel,\n useWorker\n );\n\n // Set up logging on the main thread before creating the client.\n if (logLevel) {\n const wasm = await getWasmOrThrow();\n wasm.setupLogging(logLevel);\n }\n\n // Wait for the underlying wasmWebClient to be initialized.\n const wasmWebClient = await instance.getWasmWebClient();\n await wasmWebClient.createClientWithExternalKeystore(\n rpcUrl,\n noteTransportUrl,\n seed,\n storeName,\n getKeyCb,\n insertKeyCb,\n signCb\n );\n\n await instance.ready;\n return createClientProxy(instance);\n }\n\n /**\n * Call a method via the worker.\n * @param {string} methodName - Name of the method to call.\n * @param {...any} args - Arguments for the method.\n * @returns {Promise<any>}\n */\n async callMethodWithWorker(methodName, ...args) {\n await this.ready;\n // Create a unique request ID.\n const requestId = `${methodName}-${Date.now()}-${Math.random()}`;\n return new Promise((resolve, reject) => {\n // Save the resolve and reject callbacks in the pendingRequests map.\n this.pendingRequests.set(requestId, { resolve, reject });\n // Send the method call request to the worker.\n this.worker.postMessage({\n action: WorkerAction.CALL_METHOD,\n methodName,\n args,\n requestId,\n });\n });\n }\n\n // ----- Explicitly Wrapped Methods (Worker-Forwarded) -----\n\n async newWallet(storageMode, mutable, authSchemeId, seed) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newWallet(\n storageMode,\n mutable,\n authSchemeId,\n seed\n );\n });\n }\n\n async newFaucet(\n storageMode,\n nonFungible,\n tokenName,\n tokenSymbol,\n decimals,\n maxSupply,\n authSchemeId\n ) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newFaucet(\n storageMode,\n nonFungible,\n tokenName,\n tokenSymbol,\n decimals,\n maxSupply,\n authSchemeId\n );\n });\n }\n\n async newAccount(account, overwrite) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newAccount(account, overwrite);\n });\n }\n\n async newAccountWithSecretKey(account, secretKey) {\n return this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.newAccountWithSecretKey(account, secretKey);\n });\n }\n\n async submitNewTransaction(accountId, transactionRequest) {\n return this._serializeWasmCall(async () => {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.submitNewTransaction(\n accountId,\n transactionRequest\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION,\n accountId.toString(),\n serializedTransactionRequest\n );\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\"INDEX.JS: Error in submitNewTransaction:\", error);\n throw error;\n }\n });\n }\n\n async submitNewTransactionWithProver(accountId, transactionRequest, prover) {\n return this._serializeWasmCall(async () => {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.submitNewTransactionWithProver(\n accountId,\n transactionRequest,\n prover\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const proverPayload = prover.serialize();\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION_WITH_PROVER,\n accountId.toString(),\n serializedTransactionRequest,\n proverPayload\n );\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\n \"INDEX.JS: Error in submitNewTransactionWithProver:\",\n error\n );\n throw error;\n }\n });\n }\n\n async executeTransaction(accountId, transactionRequest) {\n return this._serializeWasmCall(async () => {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.executeTransaction(\n accountId,\n transactionRequest\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const serializedResultBytes = await this.callMethodWithWorker(\n MethodName.EXECUTE_TRANSACTION,\n accountId.toString(),\n serializedTransactionRequest\n );\n\n return wasm.TransactionResult.deserialize(\n new Uint8Array(serializedResultBytes)\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in executeTransaction:\", error);\n throw error;\n }\n });\n }\n\n async proveTransaction(transactionResult, prover) {\n return this._serializeWasmCall(async () => {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.proveTransaction(\n transactionResult,\n prover\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionResult = transactionResult.serialize();\n const proverPayload = prover ? prover.serialize() : null;\n\n const serializedProvenBytes = await this.callMethodWithWorker(\n MethodName.PROVE_TRANSACTION,\n serializedTransactionResult,\n proverPayload\n );\n\n return wasm.ProvenTransaction.deserialize(\n new Uint8Array(serializedProvenBytes)\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in proveTransaction:\", error);\n throw error;\n }\n });\n }\n\n async applyTransaction(transactionResult, submissionHeight) {\n return this._serializeWasmCall(async () => {\n try {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.applyTransaction(\n transactionResult,\n submissionHeight\n );\n }\n\n const wasm = await getWasmOrThrow();\n const serializedTransactionResult = transactionResult.serialize();\n const serializedUpdateBytes = await this.callMethodWithWorker(\n MethodName.APPLY_TRANSACTION,\n serializedTransactionResult,\n submissionHeight\n );\n\n return wasm.TransactionStoreUpdate.deserialize(\n new Uint8Array(serializedUpdateBytes)\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in applyTransaction:\", error);\n throw error;\n }\n });\n }\n\n /**\n * Syncs the client (NTL followed by chain sync, failing fast on either).\n *\n * This method coordinates concurrent sync calls using the Web Locks API when available,\n * with an in-process mutex fallback for older browsers. If a sync is already in progress,\n * subsequent callers will wait and receive the same result (coalescing behavior).\n *\n * @returns {Promise<SyncSummary>} The sync summary\n */\n async syncState() {\n const dbId = this.storeName || \"default\";\n const methodId = MethodName.SYNC_STATE;\n\n try {\n // The sync lock coalesces concurrent sync callers; the inner\n // `_serializeWasmCall` keeps the WASM phase from racing any other\n // serialized method on this instance. Lock order is always\n // sync lock → chain, so the two can't deadlock.\n return await withSyncLock(dbId, methodId, async () =>\n this._serializeWasmCall(async () => {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.syncStateImpl();\n }\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes =\n await this.callMethodWithWorker(methodId);\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n })\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncState:\", error);\n throw error;\n }\n }\n\n /**\n * Fetches private notes from the Note Transport Layer.\n *\n * @returns {Promise<void>}\n */\n async syncNoteTransport() {\n const dbId = this.storeName || \"default\";\n const methodId = MethodName.SYNC_NOTE_TRANSPORT;\n\n try {\n await withSyncLock(dbId, methodId, async () =>\n this._serializeWasmCall(async () => {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n await wasmWebClient.syncNoteTransportImpl();\n } else {\n await this.callMethodWithWorker(methodId);\n }\n })\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncNoteTransport:\", error);\n throw error;\n }\n }\n\n /**\n * Syncs on-chain state only (no NTL fetch).\n *\n * @returns {Promise<SyncSummary>}\n */\n async syncChain() {\n const dbId = this.storeName || \"default\";\n const methodId = MethodName.SYNC_CHAIN;\n\n try {\n return await withSyncLock(dbId, methodId, async () =>\n this._serializeWasmCall(async () => {\n if (!this.worker) {\n const wasmWebClient = await this.getWasmWebClient();\n return await wasmWebClient.syncChainImpl();\n }\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes =\n await this.callMethodWithWorker(methodId);\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n })\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncChain:\", error);\n throw error;\n }\n }\n\n /**\n * Terminates the underlying Web Worker used by this WebClient instance.\n *\n * Call this method when you're done using a WebClient to free up browser\n * resources. Each WebClient instance uses a dedicated Web Worker for\n * computationally intensive operations. Terminating releases that thread.\n *\n * After calling terminate(), the WebClient should not be used.\n */\n terminate() {\n if (this.worker) {\n this.worker.terminate();\n }\n }\n}\n\nclass MockWebClient extends WebClient {\n constructor(seed, logLevel) {\n super(\n null,\n null,\n seed,\n MOCK_STORE_NAME,\n undefined,\n undefined,\n undefined,\n logLevel\n );\n }\n\n initializeWorker() {\n // Pass `numThreads` exactly like the real INIT path: every prove runs\n // inside the worker's own WASM instance, and rayon's pool is\n // per-instance — without this, mock-client proving (including the\n // integration suite) silently runs single-threaded.\n let numThreads = 1;\n try {\n if (\n typeof self !== \"undefined\" &&\n self.crossOriginIsolated &&\n navigator?.hardwareConcurrency\n ) {\n numThreads = navigator.hardwareConcurrency;\n }\n } catch {}\n this.worker.postMessage({\n action: WorkerAction.INIT_MOCK,\n args: [this.seed, this.logLevel, numThreads],\n });\n }\n\n /**\n * Factory method to create a WebClient with a mock chain for testing purposes.\n *\n * @param serializedMockChain - Serialized mock chain data (optional). Will use an empty chain if not provided.\n * @param serializedMockNoteTransportNode - Serialized mock note transport node data (optional). Will use a new instance if not provided.\n * @param seed - The seed for the account (optional).\n * @returns A promise that resolves to a MockWebClient.\n */\n static async createClient(\n serializedMockChain,\n serializedMockNoteTransportNode,\n seed,\n logLevel\n ) {\n // Construct the instance (synchronously).\n const instance = new MockWebClient(seed, logLevel);\n\n // Set up logging on the main thread before creating the client.\n if (logLevel) {\n const wasm = await getWasmOrThrow();\n wasm.setupLogging(logLevel);\n }\n\n // Wait for the underlying wasmWebClient to be initialized.\n const wasmWebClient = await instance.getWasmWebClient();\n await wasmWebClient.createMockClient(\n seed ?? null,\n serializedMockChain ?? null,\n serializedMockNoteTransportNode ?? null\n );\n\n // Wait for the worker to be ready\n await instance.ready;\n\n return createClientProxy(instance);\n }\n\n /**\n * Syncs the mock client state.\n *\n * This method coordinates concurrent sync calls using the Web Locks API when available,\n * with an in-process mutex fallback for older browsers. If a sync is already in progress,\n * subsequent callers will wait and receive the same result (coalescing behavior).\n *\n * @returns {Promise<SyncSummary>} The sync summary\n */\n async syncState() {\n const dbId = this.storeName || \"mock\";\n const methodId = MethodName.SYNC_STATE;\n\n try {\n return await withSyncLock(dbId, methodId, async () =>\n this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n\n if (!this.worker) {\n return await wasmWebClient.syncStateImpl();\n }\n\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes = await this.callMethodWithWorker(\n MethodName.SYNC_STATE_MOCK,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n })\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncState:\", error);\n throw error;\n }\n }\n\n /**\n * Syncs only the on-chain mock state (no note transport fetch).\n *\n * In worker mode, the main-thread mock chain + note-transport-node state\n * is serialized and shipped to the worker before the sync, so a prior\n * `proveBlock()` on the main thread is reflected in the worker's WASM\n * client. The no-worker path uses the main-thread WASM client directly.\n *\n * @returns {Promise<SyncSummary>}\n */\n async syncChain() {\n const dbId = this.storeName || \"mock\";\n const methodId = MethodName.SYNC_CHAIN;\n\n try {\n return await withSyncLock(dbId, methodId, async () =>\n this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n\n if (!this.worker) {\n return await wasmWebClient.syncChainImpl();\n }\n\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const wasm = await getWasmOrThrow();\n const serializedSyncSummaryBytes = await this.callMethodWithWorker(\n MethodName.SYNC_CHAIN_MOCK,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n return wasm.SyncSummary.deserialize(\n new Uint8Array(serializedSyncSummaryBytes)\n );\n })\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncChain:\", error);\n throw error;\n }\n }\n\n /**\n * Syncs only the mock note-transport state (no chain fetch).\n *\n * Mirrors {@link MockWebClient#syncChain}: in worker mode, the\n * main-thread mock chain + note-transport-node state is serialized\n * and shipped to the worker first.\n *\n * @returns {Promise<void>}\n */\n async syncNoteTransport() {\n const dbId = this.storeName || \"mock\";\n const methodId = MethodName.SYNC_NOTE_TRANSPORT;\n\n try {\n await withSyncLock(dbId, methodId, async () =>\n this._serializeWasmCall(async () => {\n const wasmWebClient = await this.getWasmWebClient();\n\n if (!this.worker) {\n await wasmWebClient.syncNoteTransportImpl();\n return;\n }\n\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n await this.callMethodWithWorker(\n MethodName.SYNC_NOTE_TRANSPORT_MOCK,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n })\n );\n } catch (error) {\n console.error(\"INDEX.JS: Error in syncNoteTransport:\", error);\n throw error;\n }\n }\n\n async submitNewTransaction(accountId, transactionRequest) {\n try {\n if (!this.worker) {\n return await super.submitNewTransaction(accountId, transactionRequest);\n }\n\n const wasmWebClient = await this.getWasmWebClient();\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION_MOCK,\n accountId.toString(),\n serializedTransactionRequest,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n\n const newMockChain = new Uint8Array(result.serializedMockChain);\n const newMockNoteTransportNode = result.serializedMockNoteTransportNode\n ? new Uint8Array(result.serializedMockNoteTransportNode)\n : undefined;\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n if (!(this instanceof MockWebClient)) {\n return transactionResult.id();\n }\n\n this.wasmWebClient = new wasm.WebClient();\n this.wasmWebClientPromise = Promise.resolve(this.wasmWebClient);\n await this.wasmWebClient.createMockClient(\n this.seed,\n newMockChain,\n newMockNoteTransportNode\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\"INDEX.JS: Error in submitNewTransaction:\", error);\n throw error;\n }\n }\n\n async submitNewTransactionWithProver(accountId, transactionRequest, prover) {\n try {\n if (!this.worker) {\n return await super.submitNewTransactionWithProver(\n accountId,\n transactionRequest,\n prover\n );\n }\n\n const wasmWebClient = await this.getWasmWebClient();\n const wasm = await getWasmOrThrow();\n const serializedTransactionRequest = transactionRequest.serialize();\n const proverPayload = prover.serialize();\n const serializedMockChain = (await wasmWebClient.serializeMockChain())\n .buffer;\n const serializedMockNoteTransportNode = (\n await wasmWebClient.serializeMockNoteTransportNode()\n ).buffer;\n\n const result = await this.callMethodWithWorker(\n MethodName.SUBMIT_NEW_TRANSACTION_WITH_PROVER_MOCK,\n accountId.toString(),\n serializedTransactionRequest,\n proverPayload,\n serializedMockChain,\n serializedMockNoteTransportNode\n );\n\n const newMockChain = new Uint8Array(result.serializedMockChain);\n const newMockNoteTransportNode = result.serializedMockNoteTransportNode\n ? new Uint8Array(result.serializedMockNoteTransportNode)\n : undefined;\n\n const transactionResult = wasm.TransactionResult.deserialize(\n new Uint8Array(result.serializedTransactionResult)\n );\n\n if (!(this instanceof MockWebClient)) {\n return transactionResult.id();\n }\n\n this.wasmWebClient = new wasm.WebClient();\n this.wasmWebClientPromise = Promise.resolve(this.wasmWebClient);\n await this.wasmWebClient.createMockClient(\n this.seed,\n newMockChain,\n newMockNoteTransportNode\n );\n\n return transactionResult.id();\n } catch (error) {\n console.error(\n \"INDEX.JS: Error in submitNewTransactionWithProver:\",\n error\n );\n throw error;\n }\n }\n}\n\nfunction copyWebClientStatics(WasmWebClient) {\n if (!WasmWebClient) {\n return;\n }\n Object.getOwnPropertyNames(WasmWebClient).forEach((prop) => {\n if (\n typeof WasmWebClient[prop] === \"function\" &&\n prop !== \"constructor\" &&\n prop !== \"prototype\"\n ) {\n WebClient[prop] = WasmWebClient[prop];\n }\n });\n}\n\n// Wire MidenClient dependencies (resolves circular import)\nMidenClient._WasmWebClient = WebClient;\nMidenClient._MockWasmWebClient = MockWebClient;\nMidenClient._getWasmOrThrow = getWasmOrThrow;\n_setStandaloneWebClient(WebClient);\n"],"names":["exports","_setStandaloneWasm","_setStandaloneWebClient"],"mappings":";;;AAAO,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1C,EAAE,IAAI,EAAE,MAAM;AACd,EAAE,SAAS,EAAE,UAAU;AACvB,EAAE,gBAAgB,EAAE,gBAAgB;AACpC,EAAE,WAAW,EAAE,YAAY;AAC3B,EAAE,gBAAgB,EAAE,iBAAiB;AACrC,CAAC,CAAC;;AAEK,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,CAAC;AAC1C,EAAE,OAAO,EAAE,QAAQ;AACnB,EAAE,UAAU,EAA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