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AA,EACA,MAAAC,QAAA,CAAwBJ,SAAAA,CAAA,CAAU,EAClC,IAAoBL,UAAAA,CAAA,EAAYM,EAChC,CAAoBI,aAAArG,CAAA,CAAAsG,SAAAC,CAAA,IAAAlH,EAAA,CAA+C2G,CAAA,IACnE,OAAmBjB,EAAeC,EAAA,CAAW,GAAA3F,CAAA,CAAAsG,UAAAA,CAAA,EAC7C,EACAK,SAAAQ,SAGOP,EAAA,EAA6C,EACpD,IAAYN,UAAAA,CAAA,IAAAtG,EAAA,CAA2B4G,EACvC,OACA,eACA,CAAU,GAAG,GAAAQ,EAAAC,EAAA,EAAkBrH,EAAA,CAAAgH,aAAAV,GAAAgB,GAAA,EAC/B,EARAV,EACA,CACA,ECKgEjB,EAAA,CAChE,GAAA3F,CAAA,CACAuB,QAAAvB,EAAAuB,OAAA,EAAAA,EACA+E,UAAAtG,EAAAsG,SAAA,EAAAA,CACA,GACAiB,EAAAC,QAAAjB,iBAAAA,GAAAP,CAAAA,EAAAuB,OAAA,OACAE,EAAuB,GAAAC,EAAAC,MAAA,EAAM9H,GAe7B,MAbI,GAAA6H,EAAAE,SAAA,EAAS,KACb,IAAAC,EAAAJ,EAAAK,OAAA,EACAjI,GAAAgI,GAEA1B,EAAA4B,aAAA,EAAwCpB,SAAAA,CAAA,GACxCc,EAAAK,OAAA,CAAA5F,KAAAA,GAEArC,IAAAgI,IAEA1B,EAAA6B,iBAAA,EAA4CrB,SAAAA,CAAA,GAC5Cc,EAAAK,OAAA,CAAAjI,EAEA,EAAK,CAAAA,EAAAsG,EAAA,EACM,GAAA8B,EAAAC,EAAA,EAAQ,CACnB,GAAAlC,CAAA,CACA,GAAAY,CAAA,CACAD,SAAAA,EACAY,QAAAA,EACAY,UAAAC,OAAAC,iBAAA,EAEA","sources":["webpack://_N_E/./node_modules/viem/_esm/actions/wallet/signMessage.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/signTypedData.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/addChain.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/deployContract.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/getAddresses.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/getPermissions.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/requestAddresses.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/requestPermissions.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/signTransaction.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/switchChain.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/watchAsset.js","webpack://_N_E/./node_modules/viem/_esm/actions/wallet/writeContract.js","webpack://_N_E/./node_modules/viem/_esm/clients/decorators/wallet.js","webpack://_N_E/./node_modules/@wagmi/core/dist/esm/actions/getWalletClient.js","webpack://_N_E/./node_modules/@wagmi/core/dist/esm/query/getWalletClient.js","webpack://_N_E/./node_modules/wagmi/dist/esm/hooks/useWalletClient.js","webpack://_N_E/<anon>"],"sourcesContent":["import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport { stringToHex, toHex, } from '../../utils/encoding/toHex.js';\n/**\n * Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256(\"\\x19Ethereum Signed Message:\\n\" + len(message) + message))`.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signMessage\n * - JSON-RPC Methods:\n *   - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data#personal-sign)\n *   - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * With the calculated signature, you can:\n * - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage) to verify the signature,\n * - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress) to recover the signing address from a signature.\n *\n * @param client - Client to use\n * @param parameters - {@link SignMessageParameters}\n * @returns The signed message. {@link SignMessageReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n *   account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n *   message: 'hello world',\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, custom } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signMessage } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   account: privateKeyToAccount('0x…'),\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const signature = await signMessage(client, {\n *   message: 'hello world',\n * })\n */\nexport async function signMessage(client, { account: account_ = client.account, message, }) {\n    if (!account_)\n        throw new AccountNotFoundError({\n            docsPath: '/docs/actions/wallet/signMessage',\n        });\n    const account = parseAccount(account_);\n    if (account.type === 'local')\n        return account.signMessage({ message });\n    const message_ = (() => {\n        if (typeof message === 'string')\n            return stringToHex(message);\n        if (message.raw instanceof Uint8Array)\n            return toHex(message.raw);\n        return message.raw;\n    })();\n    return client.request({\n        method: 'personal_sign',\n        params: [message_, account.address],\n    }, { retryCount: 0 });\n}\n//# sourceMappingURL=signMessage.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError, } from '../../errors/account.js';\nimport { isHex } from '../../utils/data/isHex.js';\nimport { stringify } from '../../utils/stringify.js';\nimport { getTypesForEIP712Domain, validateTypedData, } from '../../utils/typedData.js';\n/**\n * Signs typed data and calculates an Ethereum-specific signature in [https://eips.ethereum.org/EIPS/eip-712](https://eips.ethereum.org/EIPS/eip-712): `sign(keccak256(\"\\x19\\x01\" ‖ domainSeparator ‖ hashStruct(message)))`\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signTypedData\n * - JSON-RPC Methods:\n *   - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data#signtypeddata-v4)\n *   - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * @param client - Client to use\n * @param parameters - {@link SignTypedDataParameters}\n * @returns The signed data. {@link SignTypedDataReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const signature = await signTypedData(client, {\n *   account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n *   domain: {\n *     name: 'Ether Mail',\n *     version: '1',\n *     chainId: 1,\n *     verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n *   },\n *   types: {\n *     Person: [\n *       { name: 'name', type: 'string' },\n *       { name: 'wallet', type: 'address' },\n *     ],\n *     Mail: [\n *       { name: 'from', type: 'Person' },\n *       { name: 'to', type: 'Person' },\n *       { name: 'contents', type: 'string' },\n *     ],\n *   },\n *   primaryType: 'Mail',\n *   message: {\n *     from: {\n *       name: 'Cow',\n *       wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n *     },\n *     to: {\n *       name: 'Bob',\n *       wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n *     },\n *     contents: 'Hello, Bob!',\n *   },\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signTypedData } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   account: privateKeyToAccount('0x…'),\n *   chain: mainnet,\n *   transport: http(),\n * })\n * const signature = await signTypedData(client, {\n *   domain: {\n *     name: 'Ether Mail',\n *     version: '1',\n *     chainId: 1,\n *     verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',\n *   },\n *   types: {\n *     Person: [\n *       { name: 'name', type: 'string' },\n *       { name: 'wallet', type: 'address' },\n *     ],\n *     Mail: [\n *       { name: 'from', type: 'Person' },\n *       { name: 'to', type: 'Person' },\n *       { name: 'contents', type: 'string' },\n *     ],\n *   },\n *   primaryType: 'Mail',\n *   message: {\n *     from: {\n *       name: 'Cow',\n *       wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',\n *     },\n *     to: {\n *       name: 'Bob',\n *       wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',\n *     },\n *     contents: 'Hello, Bob!',\n *   },\n * })\n */\nexport async function signTypedData(client, parameters) {\n    const { account: account_ = client.account, domain, message, primaryType, } = parameters;\n    if (!account_)\n        throw new AccountNotFoundError({\n            docsPath: '/docs/actions/wallet/signTypedData',\n        });\n    const account = parseAccount(account_);\n    const types = {\n        EIP712Domain: getTypesForEIP712Domain({ domain }),\n        ...parameters.types,\n    };\n    // Need to do a runtime validation check on addresses, byte ranges, integer ranges, etc\n    // as we can't statically check this with TypeScript.\n    validateTypedData({ domain, message, primaryType, types });\n    if (account.type === 'local')\n        return account.signTypedData({ domain, message, primaryType, types });\n    const typedData = stringify({ domain: domain ?? {}, message, primaryType, types }, (_, value) => (isHex(value) ? value.toLowerCase() : value));\n    return client.request({\n        method: 'eth_signTypedData_v4',\n        params: [account.address, typedData],\n    }, { retryCount: 0 });\n}\n//# sourceMappingURL=signTypedData.js.map","import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Adds an EVM chain to the wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/addChain\n * - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085)\n *\n * @param client - Client to use\n * @param parameters - {@link AddChainParameters}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { optimism } from 'viem/chains'\n * import { addChain } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   transport: custom(window.ethereum),\n * })\n * await addChain(client, { chain: optimism })\n */\nexport async function addChain(client, { chain }) {\n    const { id, name, nativeCurrency, rpcUrls, blockExplorers } = chain;\n    await client.request({\n        method: 'wallet_addEthereumChain',\n        params: [\n            {\n                chainId: numberToHex(id),\n                chainName: name,\n                nativeCurrency,\n                rpcUrls: rpcUrls.default.http,\n                blockExplorerUrls: blockExplorers\n                    ? Object.values(blockExplorers).map(({ url }) => url)\n                    : undefined,\n            },\n        ],\n    }, { retryCount: 0 });\n}\n//# sourceMappingURL=addChain.js.map","import { encodeDeployData } from '../../utils/abi/encodeDeployData.js';\nimport { sendTransaction, } from './sendTransaction.js';\n/**\n * Deploys a contract to the network, given bytecode and constructor arguments.\n *\n * - Docs: https://viem.sh/docs/contract/deployContract\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/deploying-contracts\n *\n * @param client - Client to use\n * @param parameters - {@link DeployContractParameters}\n * @returns The [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash. {@link DeployContractReturnType}\n *\n * @example\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { deployContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n *   account: privateKeyToAccount('0x…'),\n *   chain: mainnet,\n *   transport: http(),\n * })\n * const hash = await deployContract(client, {\n *   abi: [],\n *   account: '0x…,\n *   bytecode: '0x608060405260405161083e38038061083e833981016040819052610...',\n * })\n */\nexport function deployContract(walletClient, parameters) {\n    const { abi, args, bytecode, ...request } = parameters;\n    const calldata = encodeDeployData({ abi, args, bytecode });\n    return sendTransaction(walletClient, {\n        ...request,\n        data: calldata,\n    });\n}\n//# sourceMappingURL=deployContract.js.map","import { checksumAddress, } from '../../utils/address/getAddress.js';\n/**\n * Returns a list of account addresses owned by the wallet or client.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/getAddresses\n * - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts)\n *\n * @param client - Client to use\n * @returns List of account addresses owned by the wallet or client. {@link GetAddressesReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getAddresses } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const accounts = await getAddresses(client)\n */\nexport async function getAddresses(client) {\n    if (client.account?.type === 'local')\n        return [client.account.address];\n    const addresses = await client.request({ method: 'eth_accounts' });\n    return addresses.map((address) => checksumAddress(address));\n}\n//# sourceMappingURL=getAddresses.js.map","/**\n * Gets the wallets current permissions.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/getPermissions\n * - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255)\n *\n * @param client - Client to use\n * @returns The wallet permissions. {@link GetPermissionsReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { getPermissions } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const permissions = await getPermissions(client)\n */\nexport async function getPermissions(client) {\n    const permissions = await client.request({ method: 'wallet_getPermissions' });\n    return permissions;\n}\n//# sourceMappingURL=getPermissions.js.map","import { getAddress } from '../../utils/address/getAddress.js';\n/**\n * Requests a list of accounts managed by a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/requestAddresses\n * - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102)\n *\n * Sends a request to the wallet, asking for permission to access the user's accounts. After the user accepts the request, it will return a list of accounts (addresses).\n *\n * This API can be useful for dapps that need to access the user's accounts in order to execute transactions or interact with smart contracts.\n *\n * @param client - Client to use\n * @returns List of accounts managed by a wallet {@link RequestAddressesReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { requestAddresses } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const accounts = await requestAddresses(client)\n */\nexport async function requestAddresses(client) {\n    const addresses = await client.request({ method: 'eth_requestAccounts' }, { retryCount: 0 });\n    return addresses.map((address) => getAddress(address));\n}\n//# sourceMappingURL=requestAddresses.js.map","/**\n * Requests permissions for a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/requestPermissions\n * - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255)\n *\n * @param client - Client to use\n * @param parameters - {@link RequestPermissionsParameters}\n * @returns The wallet permissions. {@link RequestPermissionsReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { requestPermissions } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const permissions = await requestPermissions(client, {\n *   eth_accounts: {}\n * })\n */\nexport async function requestPermissions(client, permissions) {\n    return client.request({\n        method: 'wallet_requestPermissions',\n        params: [permissions],\n    }, { retryCount: 0 });\n}\n//# sourceMappingURL=requestPermissions.js.map","import { parseAccount, } from '../../accounts/utils/parseAccount.js';\nimport { AccountNotFoundError } from '../../errors/account.js';\nimport {} from '../../types/rpc.js';\nimport { assertCurrentChain, } from '../../utils/chain/assertCurrentChain.js';\nimport { numberToHex } from '../../utils/encoding/toHex.js';\nimport { formatTransactionRequest, } from '../../utils/formatters/transactionRequest.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { assertRequest, } from '../../utils/transaction/assertRequest.js';\nimport { getChainId } from '../public/getChainId.js';\n/**\n * Signs a transaction.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/signTransaction\n * - JSON-RPC Methods:\n *   - JSON-RPC Accounts: [`eth_signTransaction`](https://ethereum.github.io/execution-apis/api-documentation/)\n *   - Local Accounts: Signs locally. No JSON-RPC request.\n *\n * @param args - {@link SignTransactionParameters}\n * @returns The signed serialized tranasction. {@link SignTransactionReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { signTransaction } from 'viem/actions'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const signature = await signTransaction(client, {\n *   account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',\n *   to: '0x0000000000000000000000000000000000000000',\n *   value: 1n,\n * })\n *\n * @example\n * // Account Hoisting\n * import { createWalletClient, http } from 'viem'\n * import { privateKeyToAccount } from 'viem/accounts'\n * import { mainnet } from 'viem/chains'\n * import { signTransaction } from 'viem/actions'\n *\n * const client = createWalletClient({\n *   account: privateKeyToAccount('0x…'),\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const signature = await signTransaction(client, {\n *   to: '0x0000000000000000000000000000000000000000',\n *   value: 1n,\n * })\n */\nexport async function signTransaction(client, parameters) {\n    const { account: account_ = client.account, chain = client.chain, ...transaction } = parameters;\n    if (!account_)\n        throw new AccountNotFoundError({\n            docsPath: '/docs/actions/wallet/signTransaction',\n        });\n    const account = parseAccount(account_);\n    assertRequest({\n        account,\n        ...parameters,\n    });\n    const chainId = await getAction(client, getChainId, 'getChainId')({});\n    if (chain !== null)\n        assertCurrentChain({\n            currentChainId: chainId,\n            chain,\n        });\n    const formatters = chain?.formatters || client.chain?.formatters;\n    const format = formatters?.transactionRequest?.format || formatTransactionRequest;\n    if (account.type === 'local') {\n        return account.signTransaction({\n            ...transaction,\n            chainId,\n        }, { serializer: client.chain?.serializers?.transaction });\n    }\n    return await client.request({\n        method: 'eth_signTransaction',\n        params: [\n            {\n                ...format(transaction),\n                chainId: numberToHex(chainId),\n                from: account.address,\n            },\n        ],\n    }, { retryCount: 0 });\n}\n//# sourceMappingURL=signTransaction.js.map","import { numberToHex, } from '../../utils/encoding/toHex.js';\n/**\n * Switch the target chain in a wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/switchChain\n * - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326)\n *\n * @param client - Client to use\n * @param parameters - {@link SwitchChainParameters}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet, optimism } from 'viem/chains'\n * import { switchChain } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * await switchChain(client, { id: optimism.id })\n */\nexport async function switchChain(client, { id }) {\n    await client.request({\n        method: 'wallet_switchEthereumChain',\n        params: [\n            {\n                chainId: numberToHex(id),\n            },\n        ],\n    }, { retryCount: 0 });\n}\n//# sourceMappingURL=switchChain.js.map","/**\n * Adds an EVM chain to the wallet.\n *\n * - Docs: https://viem.sh/docs/actions/wallet/watchAsset\n * - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747)\n *\n * @param client - Client to use\n * @param parameters - {@link WatchAssetParameters}\n * @returns Boolean indicating if the token was successfully added. {@link WatchAssetReturnType}\n *\n * @example\n * import { createWalletClient, custom } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { watchAsset } from 'viem/wallet'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const success = await watchAsset(client, {\n *   type: 'ERC20',\n *   options: {\n *     address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',\n *     decimals: 18,\n *     symbol: 'WETH',\n *   },\n * })\n */\nexport async function watchAsset(client, params) {\n    const added = await client.request({\n        method: 'wallet_watchAsset',\n        params,\n    }, { retryCount: 0 });\n    return added;\n}\n//# sourceMappingURL=watchAsset.js.map","import { encodeFunctionData, } from '../../utils/abi/encodeFunctionData.js';\nimport { getAction } from '../../utils/getAction.js';\nimport { sendTransaction, } from './sendTransaction.js';\n/**\n * Executes a write function on a contract.\n *\n * - Docs: https://viem.sh/docs/contract/writeContract\n * - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts\n *\n * A \"write\" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state.\n *\n * Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).\n *\n * __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__\n *\n * @param client - Client to use\n * @param parameters - {@link WriteContractParameters}\n * @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}\n *\n * @example\n * import { createWalletClient, custom, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { writeContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: custom(window.ethereum),\n * })\n * const hash = await writeContract(client, {\n *   address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n *   abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),\n *   functionName: 'mint',\n *   args: [69420],\n * })\n *\n * @example\n * // With Validation\n * import { createWalletClient, http, parseAbi } from 'viem'\n * import { mainnet } from 'viem/chains'\n * import { simulateContract, writeContract } from 'viem/contract'\n *\n * const client = createWalletClient({\n *   chain: mainnet,\n *   transport: http(),\n * })\n * const { request } = await simulateContract(client, {\n *   address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',\n *   abi: parseAbi(['function mint(uint32 tokenId) nonpayable']),\n *   functionName: 'mint',\n *   args: [69420],\n * }\n * const hash = await writeContract(client, request)\n */\nexport async function writeContract(client, parameters) {\n    const { abi, address, args, dataSuffix, functionName, ...request } = parameters;\n    const data = encodeFunctionData({\n        abi,\n        args,\n        functionName,\n    });\n    return getAction(client, sendTransaction, 'sendTransaction')({\n        data: `${data}${dataSuffix ? dataSuffix.replace('0x', '') : ''}`,\n        to: address,\n        ...request,\n    });\n}\n//# sourceMappingURL=writeContract.js.map","import { getChainId, } from '../../actions/public/getChainId.js';\nimport { addChain, } from '../../actions/wallet/addChain.js';\nimport { deployContract, } from '../../actions/wallet/deployContract.js';\nimport { getAddresses, } from '../../actions/wallet/getAddresses.js';\nimport { getPermissions, } from '../../actions/wallet/getPermissions.js';\nimport { prepareTransactionRequest, } from '../../actions/wallet/prepareTransactionRequest.js';\nimport { requestAddresses, } from '../../actions/wallet/requestAddresses.js';\nimport { requestPermissions, } from '../../actions/wallet/requestPermissions.js';\nimport { sendRawTransaction, } from '../../actions/wallet/sendRawTransaction.js';\nimport { sendTransaction, } from '../../actions/wallet/sendTransaction.js';\nimport { signMessage, } from '../../actions/wallet/signMessage.js';\nimport { signTransaction, } from '../../actions/wallet/signTransaction.js';\nimport { signTypedData, } from '../../actions/wallet/signTypedData.js';\nimport { switchChain, } from '../../actions/wallet/switchChain.js';\nimport { watchAsset, } from '../../actions/wallet/watchAsset.js';\nimport { writeContract, } from '../../actions/wallet/writeContract.js';\nimport {} from '../../types/contract.js';\nexport function walletActions(client) {\n    return {\n        addChain: (args) => addChain(client, args),\n        deployContract: (args) => deployContract(client, args),\n        getAddresses: () => getAddresses(client),\n        getChainId: () => getChainId(client),\n        getPermissions: () => getPermissions(client),\n        prepareTransactionRequest: (args) => prepareTransactionRequest(client, args),\n        requestAddresses: () => requestAddresses(client),\n        requestPermissions: (args) => requestPermissions(client, args),\n        sendRawTransaction: (args) => sendRawTransaction(client, args),\n        sendTransaction: (args) => sendTransaction(client, args),\n        signMessage: (args) => signMessage(client, args),\n        signTransaction: (args) => signTransaction(client, args),\n        signTypedData: (args) => signTypedData(client, args),\n        switchChain: (args) => switchChain(client, args),\n        watchAsset: (args) => watchAsset(client, args),\n        writeContract: (args) => writeContract(client, args),\n    };\n}\n//# sourceMappingURL=wallet.js.map","import { walletActions } from 'viem';\nimport { getConnectorClient, } from './getConnectorClient.js';\nexport async function getWalletClient(config, parameters = {}) {\n    const client = await getConnectorClient(config, parameters);\n    client.extend(walletActions);\n    // @ts-ignore\n    return client.extend(walletActions);\n}\n//# sourceMappingURL=getWalletClient.js.map","import { getWalletClient, } from '../actions/getWalletClient.js';\nimport { filterQueryOptions } from './utils.js';\nexport function getWalletClientQueryOptions(config, options = {}) {\n    return {\n        gcTime: 0,\n        async queryFn({ queryKey }) {\n            const { connector } = options;\n            const { connectorUid: _, scopeKey: _s, ...parameters } = queryKey[1];\n            return getWalletClient(config, { ...parameters, connector });\n        },\n        queryKey: getWalletClientQueryKey(options),\n    };\n}\nexport function getWalletClientQueryKey(options = {}) {\n    const { connector, ...parameters } = options;\n    return [\n        'walletClient',\n        { ...filterQueryOptions(parameters), connectorUid: connector?.uid },\n    ];\n}\n//# sourceMappingURL=getWalletClient.js.map","'use client';\n// Almost identical implementation to `useConnectorClient` (except for return type)\n// Should update both in tandem\nimport { useQueryClient } from '@tanstack/react-query';\nimport { getWalletClientQueryOptions, } from '@wagmi/core/query';\nimport { useEffect, useRef } from 'react';\nimport { useQuery, } from '../utils/query.js';\nimport { useAccount } from './useAccount.js';\nimport { useChainId } from './useChainId.js';\nimport { useConfig } from './useConfig.js';\n/** https://wagmi.sh/react/api/hooks/useWalletClient */\nexport function useWalletClient(parameters = {}) {\n    const { query = {}, ...rest } = parameters;\n    const config = useConfig(rest);\n    const queryClient = useQueryClient();\n    const { address, connector, status } = useAccount({ config });\n    const chainId = useChainId({ config });\n    const { queryKey, ...options } = getWalletClientQueryOptions(config, {\n        ...parameters,\n        chainId: parameters.chainId ?? chainId,\n        connector: parameters.connector ?? connector,\n    });\n    const enabled = Boolean(status !== 'disconnected' && (query.enabled ?? true));\n    const addressRef = useRef(address);\n    // biome-ignore lint/correctness/useExhaustiveDependencies: `queryKey` not required\n    useEffect(() => {\n        const previousAddress = addressRef.current;\n        if (!address && previousAddress) {\n            // remove when account is disconnected\n            queryClient.removeQueries({ queryKey });\n            addressRef.current = undefined;\n        }\n        else if (address !== previousAddress) {\n            // invalidate when address changes\n            queryClient.invalidateQueries({ queryKey });\n            addressRef.current = address;\n        }\n    }, [address, queryClient]);\n    return useQuery({\n        ...query,\n        ...options,\n        queryKey,\n        enabled,\n        staleTime: Number.POSITIVE_INFINITY,\n    });\n}\n//# sourceMappingURL=useWalletClient.js.map"],"names":["signMessage","client","account","account_","message","_errors_account_js__WEBPACK_IMPORTED_MODULE_0__","o","docsPath","_accounts_utils_parseAccount_js__WEBPACK_IMPORTED_MODULE_1__","T","type","message_","_utils_encoding_toHex_js__WEBPACK_IMPORTED_MODULE_2__","$G","raw","Uint8Array","NC","request","method","params","address","retryCount","signTypedData","parameters","domain","primaryType","types","EIP712Domain","_utils_typedData_js__WEBPACK_IMPORTED_MODULE_2__","cj","iC","typedData","_utils_stringify_js__WEBPACK_IMPORTED_MODULE_3__","P","_","value","_utils_data_isHex_js__WEBPACK_IMPORTED_MODULE_4__","v","toLowerCase","addChain","chain","id","name","nativeCurrency","rpcUrls","blockExplorers","chainId","toHex","eC","chainName","default","http","blockExplorerUrls","Object","values","map","url","undefined","getAddresses","addresses","getAddress","x","getPermissions","permissions","requestAddresses","K","requestPermissions","signTransaction","transaction","errors_account","parseAccount","assertRequest","F","getAction","s","getChainId","L","assertCurrentChain","q","currentChainId","formatters","format","transactionRequest","tG","serializer","serializers","from","switchChain","watchAsset","added","writeContract","abi","args","dataSuffix","functionName","data","encodeFunctionData","R","sendTransaction","replace","to","walletActions","deployContract","walletClient","bytecode","calldata","encodeDeployData","w","prepareTransactionRequest","Z","sendRawTransaction","p","l","getWalletClient","config","getConnectorClient","e","extend","useWalletClient","query","rest","useConfig","queryClient","QueryClientProvider","NL","connector","status","useAccount","m","useChainId","queryKey","options","getWalletClientQueryOptions","gcTime","queryFn","connectorUid","scopeKey","_s","getWalletClientQueryKey","utils","OP","uid","enabled","Boolean","addressRef","react","useRef","useEffect","previousAddress","current","removeQueries","invalidateQueries","utils_query","aM","staleTime","Number","POSITIVE_INFINITY"],"sourceRoot":""}