viem 1.6.4 → 1.6.6
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.
- package/chains/dist/cjs/celo/formatters.js.map +1 -0
- package/chains/dist/cjs/celo/parsers.js.map +1 -0
- package/chains/dist/cjs/celo/serializers.js.map +1 -0
- package/chains/dist/cjs/celo/types.js.map +1 -0
- package/chains/dist/cjs/index.js.map +1 -0
- package/chains/dist/cjs/optimism/fees.js.map +1 -0
- package/chains/dist/cjs/optimism/formatters.js.map +1 -0
- package/chains/dist/cjs/optimism/types.js.map +1 -0
- package/chains/dist/cjs/types.js.map +1 -0
- package/chains/dist/cjs/utils.js.map +1 -0
- package/chains/dist/tsconfig.build.tsbuildinfo +1 -0
- package/chains/node_modules/.bin/tsc +17 -0
- package/chains/node_modules/.bin/tsserver +17 -0
- package/chains/tsconfig.tsbuildinfo +1 -0
- package/dist/cjs/chains/celo/parsers.js +76 -0
- package/dist/cjs/chains/celo/parsers.js.map +1 -0
- package/dist/cjs/chains/celo/serializers.js +2 -1
- package/dist/cjs/chains/celo/serializers.js.map +1 -1
- package/dist/cjs/chains/utils.js +3 -1
- package/dist/cjs/chains/utils.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/utils/rpc.js +5 -7
- package/dist/cjs/utils/rpc.js.map +1 -1
- package/dist/cjs/utils/transaction/parseTransaction.js +8 -3
- package/dist/cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/dist/esm/chains/celo/parsers.js +72 -0
- package/dist/esm/chains/celo/parsers.js.map +1 -0
- package/dist/esm/chains/celo/serializers.js +1 -3
- package/dist/esm/chains/celo/serializers.js.map +1 -1
- package/dist/esm/chains/utils.js +1 -0
- package/dist/esm/chains/utils.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/utils/rpc.js +5 -7
- package/dist/esm/utils/rpc.js.map +1 -1
- package/dist/esm/utils/transaction/parseTransaction.js +6 -3
- package/dist/esm/utils/transaction/parseTransaction.js.map +1 -1
- package/package.json +1 -1
- package/src/chains/celo/parsers.ts +123 -0
- package/src/chains/celo/serializers.ts +13 -34
- package/src/chains/celo/types.ts +32 -0
- package/src/chains/utils.ts +6 -2
- package/src/errors/version.ts +1 -1
- package/src/utils/rpc.ts +5 -8
- package/src/utils/transaction/parseTransaction.ts +7 -9
- package/dist/types/abi.d.ts +0 -6
- package/dist/types/abi.d.ts.map +0 -1
- package/dist/types/accounts/generateMnemonic.d.ts +0 -9
- package/dist/types/accounts/generateMnemonic.d.ts.map +0 -1
- package/dist/types/accounts/generatePrivateKey.d.ts +0 -8
- package/dist/types/accounts/generatePrivateKey.d.ts.map +0 -1
- package/dist/types/accounts/hdKeyToAccount.d.ts +0 -9
- package/dist/types/accounts/hdKeyToAccount.d.ts.map +0 -1
- package/dist/types/accounts/index.d.ts +0 -27
- package/dist/types/accounts/index.d.ts.map +0 -1
- package/dist/types/accounts/mnemonicToAccount.d.ts +0 -8
- package/dist/types/accounts/mnemonicToAccount.d.ts.map +0 -1
- package/dist/types/accounts/privateKeyToAccount.d.ts +0 -9
- package/dist/types/accounts/privateKeyToAccount.d.ts.map +0 -1
- package/dist/types/accounts/toAccount.d.ts +0 -11
- package/dist/types/accounts/toAccount.d.ts.map +0 -1
- package/dist/types/accounts/types.d.ts +0 -52
- package/dist/types/accounts/types.d.ts.map +0 -1
- package/dist/types/accounts/utils/parseAccount.d.ts +0 -4
- package/dist/types/accounts/utils/parseAccount.d.ts.map +0 -1
- package/dist/types/accounts/utils/privateKeyToAddress.d.ts +0 -11
- package/dist/types/accounts/utils/privateKeyToAddress.d.ts.map +0 -1
- package/dist/types/accounts/utils/publicKeyToAddress.d.ts +0 -11
- package/dist/types/accounts/utils/publicKeyToAddress.d.ts.map +0 -1
- package/dist/types/accounts/utils/sign.d.ts +0 -16
- package/dist/types/accounts/utils/sign.d.ts.map +0 -1
- package/dist/types/accounts/utils/signMessage.d.ts +0 -16
- package/dist/types/accounts/utils/signMessage.d.ts.map +0 -1
- package/dist/types/accounts/utils/signTransaction.d.ts +0 -12
- package/dist/types/accounts/utils/signTransaction.d.ts.map +0 -1
- package/dist/types/accounts/utils/signTypedData.d.ts +0 -20
- package/dist/types/accounts/utils/signTypedData.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/czech.d.ts +0 -2
- package/dist/types/accounts/wordlists/czech.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/english.d.ts +0 -2
- package/dist/types/accounts/wordlists/english.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/french.d.ts +0 -2
- package/dist/types/accounts/wordlists/french.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/italian.d.ts +0 -2
- package/dist/types/accounts/wordlists/italian.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/japanese.d.ts +0 -2
- package/dist/types/accounts/wordlists/japanese.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/korean.d.ts +0 -2
- package/dist/types/accounts/wordlists/korean.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/simplifiedChinese.d.ts +0 -2
- package/dist/types/accounts/wordlists/simplifiedChinese.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/spanish.d.ts +0 -2
- package/dist/types/accounts/wordlists/spanish.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/traditionalChinese.d.ts +0 -2
- package/dist/types/accounts/wordlists/traditionalChinese.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsAddress.d.ts +0 -45
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsAvatar.d.ts +0 -41
- package/dist/types/actions/ens/getEnsAvatar.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsName.d.ts +0 -41
- package/dist/types/actions/ens/getEnsName.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsResolver.d.ts +0 -43
- package/dist/types/actions/ens/getEnsResolver.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsText.d.ts +0 -46
- package/dist/types/actions/ens/getEnsText.d.ts.map +0 -1
- package/dist/types/actions/getContract.d.ts +0 -314
- package/dist/types/actions/getContract.d.ts.map +0 -1
- package/dist/types/actions/index.d.ts +0 -80
- package/dist/types/actions/index.d.ts.map +0 -1
- package/dist/types/actions/public/call.d.ts +0 -56
- package/dist/types/actions/public/call.d.ts.map +0 -1
- package/dist/types/actions/public/createBlockFilter.d.ts +0 -28
- package/dist/types/actions/public/createBlockFilter.d.ts.map +0 -1
- package/dist/types/actions/public/createContractEventFilter.d.ts +0 -50
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +0 -1
- package/dist/types/actions/public/createEventFilter.d.ts +0 -76
- package/dist/types/actions/public/createEventFilter.d.ts.map +0 -1
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts +0 -28
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts.map +0 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +0 -39
- package/dist/types/actions/public/estimateContractGas.d.ts.map +0 -1
- package/dist/types/actions/public/estimateGas.d.ts +0 -49
- package/dist/types/actions/public/estimateGas.d.ts.map +0 -1
- package/dist/types/actions/public/getBalance.d.ts +0 -55
- package/dist/types/actions/public/getBalance.d.ts.map +0 -1
- package/dist/types/actions/public/getBlock.d.ts +0 -56
- package/dist/types/actions/public/getBlock.d.ts.map +0 -1
- package/dist/types/actions/public/getBlockNumber.d.ts +0 -57
- package/dist/types/actions/public/getBlockNumber.d.ts.map +0 -1
- package/dist/types/actions/public/getBlockTransactionCount.d.ts +0 -47
- package/dist/types/actions/public/getBlockTransactionCount.d.ts.map +0 -1
- package/dist/types/actions/public/getBytecode.d.ts +0 -41
- package/dist/types/actions/public/getBytecode.d.ts.map +0 -1
- package/dist/types/actions/public/getChainId.d.ts +0 -28
- package/dist/types/actions/public/getChainId.d.ts.map +0 -1
- package/dist/types/actions/public/getFeeHistory.d.ts +0 -53
- package/dist/types/actions/public/getFeeHistory.d.ts.map +0 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +0 -96
- package/dist/types/actions/public/getFilterChanges.d.ts.map +0 -1
- package/dist/types/actions/public/getFilterLogs.d.ts +0 -40
- package/dist/types/actions/public/getFilterLogs.d.ts.map +0 -1
- package/dist/types/actions/public/getGasPrice.d.ts +0 -27
- package/dist/types/actions/public/getGasPrice.d.ts.map +0 -1
- package/dist/types/actions/public/getLogs.d.ts +0 -71
- package/dist/types/actions/public/getLogs.d.ts.map +0 -1
- package/dist/types/actions/public/getStorageAt.d.ts +0 -43
- package/dist/types/actions/public/getStorageAt.d.ts.map +0 -1
- package/dist/types/actions/public/getTransaction.d.ts +0 -65
- package/dist/types/actions/public/getTransaction.d.ts.map +0 -1
- package/dist/types/actions/public/getTransactionConfirmations.d.ts +0 -41
- package/dist/types/actions/public/getTransactionConfirmations.d.ts.map +0 -1
- package/dist/types/actions/public/getTransactionCount.d.ts +0 -44
- package/dist/types/actions/public/getTransactionCount.d.ts.map +0 -1
- package/dist/types/actions/public/getTransactionReceipt.d.ts +0 -36
- package/dist/types/actions/public/getTransactionReceipt.d.ts.map +0 -1
- package/dist/types/actions/public/multicall.d.ts +0 -56
- package/dist/types/actions/public/multicall.d.ts.map +0 -1
- package/dist/types/actions/public/readContract.d.ts +0 -41
- package/dist/types/actions/public/readContract.d.ts.map +0 -1
- package/dist/types/actions/public/simulateContract.d.ts +0 -54
- package/dist/types/actions/public/simulateContract.d.ts.map +0 -1
- package/dist/types/actions/public/uninstallFilter.d.ts +0 -34
- package/dist/types/actions/public/uninstallFilter.d.ts.map +0 -1
- package/dist/types/actions/public/verifyHash.d.ts +0 -24
- package/dist/types/actions/public/verifyHash.d.ts.map +0 -1
- package/dist/types/actions/public/verifyMessage.d.ts +0 -28
- package/dist/types/actions/public/verifyMessage.d.ts.map +0 -1
- package/dist/types/actions/public/verifyTypedData.d.ts +0 -27
- package/dist/types/actions/public/verifyTypedData.d.ts.map +0 -1
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts +0 -72
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +0 -1
- package/dist/types/actions/public/watchBlockNumber.d.ts +0 -59
- package/dist/types/actions/public/watchBlockNumber.d.ts.map +0 -1
- package/dist/types/actions/public/watchBlocks.d.ts +0 -67
- package/dist/types/actions/public/watchBlocks.d.ts.map +0 -1
- package/dist/types/actions/public/watchContractEvent.d.ts +0 -89
- package/dist/types/actions/public/watchContractEvent.d.ts.map +0 -1
- package/dist/types/actions/public/watchEvent.d.ts +0 -104
- package/dist/types/actions/public/watchEvent.d.ts.map +0 -1
- package/dist/types/actions/public/watchPendingTransactions.d.ts +0 -74
- package/dist/types/actions/public/watchPendingTransactions.d.ts.map +0 -1
- package/dist/types/actions/test/dropTransaction.d.ts +0 -33
- package/dist/types/actions/test/dropTransaction.d.ts.map +0 -1
- package/dist/types/actions/test/getAutomine.d.ts +0 -27
- package/dist/types/actions/test/getAutomine.d.ts.map +0 -1
- package/dist/types/actions/test/getTxpoolContent.d.ts +0 -34
- package/dist/types/actions/test/getTxpoolContent.d.ts.map +0 -1
- package/dist/types/actions/test/getTxpoolStatus.d.ts +0 -30
- package/dist/types/actions/test/getTxpoolStatus.d.ts.map +0 -1
- package/dist/types/actions/test/impersonateAccount.d.ts +0 -33
- package/dist/types/actions/test/impersonateAccount.d.ts.map +0 -1
- package/dist/types/actions/test/increaseTime.d.ts +0 -32
- package/dist/types/actions/test/increaseTime.d.ts.map +0 -1
- package/dist/types/actions/test/inspectTxpool.d.ts +0 -31
- package/dist/types/actions/test/inspectTxpool.d.ts.map +0 -1
- package/dist/types/actions/test/mine.d.ts +0 -32
- package/dist/types/actions/test/mine.d.ts.map +0 -1
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts +0 -25
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts.map +0 -1
- package/dist/types/actions/test/reset.d.ts +0 -32
- package/dist/types/actions/test/reset.d.ts.map +0 -1
- package/dist/types/actions/test/revert.d.ts +0 -31
- package/dist/types/actions/test/revert.d.ts.map +0 -1
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +0 -35
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +0 -1
- package/dist/types/actions/test/setAutomine.d.ts +0 -25
- package/dist/types/actions/test/setAutomine.d.ts.map +0 -1
- package/dist/types/actions/test/setBalance.d.ts +0 -36
- package/dist/types/actions/test/setBalance.d.ts.map +0 -1
- package/dist/types/actions/test/setBlockGasLimit.d.ts +0 -30
- package/dist/types/actions/test/setBlockGasLimit.d.ts.map +0 -1
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts +0 -30
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts.map +0 -1
- package/dist/types/actions/test/setCode.d.ts +0 -37
- package/dist/types/actions/test/setCode.d.ts.map +0 -1
- package/dist/types/actions/test/setCoinbase.d.ts +0 -33
- package/dist/types/actions/test/setCoinbase.d.ts.map +0 -1
- package/dist/types/actions/test/setIntervalMining.d.ts +0 -30
- package/dist/types/actions/test/setIntervalMining.d.ts.map +0 -1
- package/dist/types/actions/test/setLoggingEnabled.d.ts +0 -25
- package/dist/types/actions/test/setLoggingEnabled.d.ts.map +0 -1
- package/dist/types/actions/test/setMinGasPrice.d.ts +0 -34
- package/dist/types/actions/test/setMinGasPrice.d.ts.map +0 -1
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts +0 -32
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +0 -1
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts +0 -30
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts.map +0 -1
- package/dist/types/actions/test/setNonce.d.ts +0 -36
- package/dist/types/actions/test/setNonce.d.ts.map +0 -1
- package/dist/types/actions/test/setRpcUrl.d.ts +0 -26
- package/dist/types/actions/test/setRpcUrl.d.ts.map +0 -1
- package/dist/types/actions/test/setStorageAt.d.ts +0 -40
- package/dist/types/actions/test/setStorageAt.d.ts.map +0 -1
- package/dist/types/actions/test/snapshot.d.ts +0 -25
- package/dist/types/actions/test/snapshot.d.ts.map +0 -1
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts +0 -33
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts.map +0 -1
- package/dist/types/actions/wallet/addChain.d.ts +0 -29
- package/dist/types/actions/wallet/addChain.d.ts.map +0 -1
- package/dist/types/actions/wallet/deployContract.d.ts +0 -43
- package/dist/types/actions/wallet/deployContract.d.ts.map +0 -1
- package/dist/types/actions/wallet/getAddresses.d.ts +0 -28
- package/dist/types/actions/wallet/getAddresses.d.ts.map +0 -1
- package/dist/types/actions/wallet/getPermissions.d.ts +0 -28
- package/dist/types/actions/wallet/getPermissions.d.ts.map +0 -1
- package/dist/types/actions/wallet/requestAddresses.d.ts +0 -32
- package/dist/types/actions/wallet/requestAddresses.d.ts.map +0 -1
- package/dist/types/actions/wallet/requestPermissions.d.ts +0 -37
- package/dist/types/actions/wallet/requestPermissions.d.ts.map +0 -1
- package/dist/types/actions/wallet/sendTransaction.d.ts +0 -57
- package/dist/types/actions/wallet/sendTransaction.d.ts.map +0 -1
- package/dist/types/actions/wallet/signMessage.d.ts +0 -58
- package/dist/types/actions/wallet/signMessage.d.ts.map +0 -1
- package/dist/types/actions/wallet/signTypedData.d.ts +0 -114
- package/dist/types/actions/wallet/signTypedData.d.ts.map +0 -1
- package/dist/types/actions/wallet/switchChain.d.ts +0 -30
- package/dist/types/actions/wallet/switchChain.d.ts.map +0 -1
- package/dist/types/actions/wallet/watchAsset.d.ts +0 -37
- package/dist/types/actions/wallet/watchAsset.d.ts.map +0 -1
- package/dist/types/actions/wallet/writeContract.d.ts +0 -68
- package/dist/types/actions/wallet/writeContract.d.ts.map +0 -1
- package/dist/types/chains/celo/formatters.d.ts +0 -195
- package/dist/types/chains/celo/formatters.d.ts.map +0 -1
- package/dist/types/chains/celo/serializers.d.ts +0 -20
- package/dist/types/chains/celo/serializers.d.ts.map +0 -1
- package/dist/types/chains/celo/types.d.ts +0 -60
- package/dist/types/chains/celo/types.d.ts.map +0 -1
- package/dist/types/chains/index.d.ts +0 -5329
- package/dist/types/chains/index.d.ts.map +0 -1
- package/dist/types/chains/optimism/fees.d.ts +0 -4
- package/dist/types/chains/optimism/fees.d.ts.map +0 -1
- package/dist/types/chains/optimism/formatters.d.ts +0 -299
- package/dist/types/chains/optimism/formatters.d.ts.map +0 -1
- package/dist/types/chains/optimism/types.d.ts +0 -53
- package/dist/types/chains/optimism/types.d.ts.map +0 -1
- package/dist/types/chains/utils.d.ts +0 -6
- package/dist/types/chains/utils.d.ts.map +0 -1
- package/dist/types/clients/createClient.d.ts +0 -79
- package/dist/types/clients/createClient.d.ts.map +0 -1
- package/dist/types/clients/createPublicClient.d.ts +0 -29
- package/dist/types/clients/createPublicClient.d.ts.map +0 -1
- package/dist/types/clients/createTestClient.d.ts +0 -43
- package/dist/types/clients/createTestClient.d.ts.map +0 -1
- package/dist/types/clients/createWalletClient.d.ts +0 -49
- package/dist/types/clients/createWalletClient.d.ts.map +0 -1
- package/dist/types/clients/decorators/public.d.ts +0 -1087
- package/dist/types/clients/decorators/public.d.ts.map +0 -1
- package/dist/types/clients/decorators/test.d.ts +0 -599
- package/dist/types/clients/decorators/test.d.ts.map +0 -1
- package/dist/types/clients/decorators/wallet.d.ts +0 -449
- package/dist/types/clients/decorators/wallet.d.ts.map +0 -1
- package/dist/types/clients/transports/createTransport.d.ts +0 -34
- package/dist/types/clients/transports/createTransport.d.ts.map +0 -1
- package/dist/types/clients/transports/custom.d.ts +0 -21
- package/dist/types/clients/transports/custom.d.ts.map +0 -1
- package/dist/types/clients/transports/fallback.d.ts +0 -75
- package/dist/types/clients/transports/fallback.d.ts.map +0 -1
- package/dist/types/clients/transports/http.d.ts +0 -40
- package/dist/types/clients/transports/http.d.ts.map +0 -1
- package/dist/types/clients/transports/webSocket.d.ts +0 -46
- package/dist/types/clients/transports/webSocket.d.ts.map +0 -1
- package/dist/types/constants/abis.d.ts +0 -165
- package/dist/types/constants/abis.d.ts.map +0 -1
- package/dist/types/constants/address.d.ts +0 -2
- package/dist/types/constants/address.d.ts.map +0 -1
- package/dist/types/constants/contract.d.ts +0 -2
- package/dist/types/constants/contract.d.ts.map +0 -1
- package/dist/types/constants/contracts.d.ts +0 -2
- package/dist/types/constants/contracts.d.ts.map +0 -1
- package/dist/types/constants/number.d.ts +0 -97
- package/dist/types/constants/number.d.ts.map +0 -1
- package/dist/types/constants/solidity.d.ts +0 -15
- package/dist/types/constants/solidity.d.ts.map +0 -1
- package/dist/types/constants/unit.d.ts +0 -13
- package/dist/types/constants/unit.d.ts.map +0 -1
- package/dist/types/contract.d.ts +0 -30
- package/dist/types/contract.d.ts.map +0 -1
- package/dist/types/ens.d.ts +0 -9
- package/dist/types/ens.d.ts.map +0 -1
- package/dist/types/errors/abi.d.ts +0 -169
- package/dist/types/errors/abi.d.ts.map +0 -1
- package/dist/types/errors/account.d.ts +0 -8
- package/dist/types/errors/account.d.ts.map +0 -1
- package/dist/types/errors/address.d.ts +0 -8
- package/dist/types/errors/address.d.ts.map +0 -1
- package/dist/types/errors/base.d.ts +0 -24
- package/dist/types/errors/base.d.ts.map +0 -1
- package/dist/types/errors/block.d.ts +0 -10
- package/dist/types/errors/block.d.ts.map +0 -1
- package/dist/types/errors/ccip.d.ts +0 -29
- package/dist/types/errors/ccip.d.ts.map +0 -1
- package/dist/types/errors/chain.d.ts +0 -35
- package/dist/types/errors/chain.d.ts.map +0 -1
- package/dist/types/errors/contract.d.ts +0 -64
- package/dist/types/errors/contract.d.ts.map +0 -1
- package/dist/types/errors/data.d.ts +0 -18
- package/dist/types/errors/data.d.ts.map +0 -1
- package/dist/types/errors/encoding.d.ts +0 -53
- package/dist/types/errors/encoding.d.ts.map +0 -1
- package/dist/types/errors/ens.d.ts +0 -26
- package/dist/types/errors/ens.d.ts.map +0 -1
- package/dist/types/errors/estimateGas.d.ts +0 -14
- package/dist/types/errors/estimateGas.d.ts.map +0 -1
- package/dist/types/errors/log.d.ts +0 -6
- package/dist/types/errors/log.d.ts.map +0 -1
- package/dist/types/errors/node.d.ts +0 -105
- package/dist/types/errors/node.d.ts.map +0 -1
- package/dist/types/errors/request.d.ts +0 -61
- package/dist/types/errors/request.d.ts.map +0 -1
- package/dist/types/errors/rpc.d.ts +0 -221
- package/dist/types/errors/rpc.d.ts.map +0 -1
- package/dist/types/errors/transaction.d.ts +0 -79
- package/dist/types/errors/transaction.d.ts.map +0 -1
- package/dist/types/errors/transport.d.ts +0 -5
- package/dist/types/errors/transport.d.ts.map +0 -1
- package/dist/types/errors/utils.d.ts +0 -5
- package/dist/types/errors/utils.d.ts.map +0 -1
- package/dist/types/errors/version.d.ts +0 -2
- package/dist/types/errors/version.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -211
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/public.d.ts +0 -31
- package/dist/types/public.d.ts.map +0 -1
- package/dist/types/test.d.ts +0 -29
- package/dist/types/test.d.ts.map +0 -1
- package/dist/types/types/account.d.ts +0 -12
- package/dist/types/types/account.d.ts.map +0 -1
- package/dist/types/types/block.d.ts +0 -62
- package/dist/types/types/block.d.ts.map +0 -1
- package/dist/types/types/chain.d.ts +0 -62
- package/dist/types/types/chain.d.ts.map +0 -1
- package/dist/types/types/contract.d.ts +0 -138
- package/dist/types/types/contract.d.ts.map +0 -1
- package/dist/types/types/eip1193.d.ts +0 -1216
- package/dist/types/types/eip1193.d.ts.map +0 -1
- package/dist/types/types/ens.d.ts +0 -5
- package/dist/types/types/ens.d.ts.map +0 -1
- package/dist/types/types/fee.d.ts +0 -29
- package/dist/types/types/fee.d.ts.map +0 -1
- package/dist/types/types/filter.d.ts +0 -40
- package/dist/types/types/filter.d.ts.map +0 -1
- package/dist/types/types/log.d.ts +0 -55
- package/dist/types/types/log.d.ts.map +0 -1
- package/dist/types/types/misc.d.ts +0 -14
- package/dist/types/types/misc.d.ts.map +0 -1
- package/dist/types/types/multicall.d.ts +0 -48
- package/dist/types/types/multicall.d.ts.map +0 -1
- package/dist/types/types/rpc.d.ts +0 -20
- package/dist/types/types/rpc.d.ts.map +0 -1
- package/dist/types/types/transaction.d.ts +0 -147
- package/dist/types/types/transaction.d.ts.map +0 -1
- package/dist/types/types/transport.d.ts +0 -3
- package/dist/types/types/transport.d.ts.map +0 -1
- package/dist/types/types/typedData.d.ts +0 -47
- package/dist/types/types/typedData.d.ts.map +0 -1
- package/dist/types/types/utils.d.ts +0 -188
- package/dist/types/types/utils.d.ts.map +0 -1
- package/dist/types/types/window.d.ts +0 -7
- package/dist/types/types/window.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeAbiParameters.d.ts +0 -5
- package/dist/types/utils/abi/decodeAbiParameters.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeDeployData.d.ts +0 -13
- package/dist/types/utils/abi/decodeDeployData.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeErrorResult.d.ts +0 -16
- package/dist/types/utils/abi/decodeErrorResult.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeEventLog.d.ts +0 -20
- package/dist/types/utils/abi/decodeEventLog.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeFunctionData.d.ts +0 -15
- package/dist/types/utils/abi/decodeFunctionData.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeFunctionResult.d.ts +0 -14
- package/dist/types/utils/abi/decodeFunctionResult.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeAbiParameters.d.ts +0 -9
- package/dist/types/utils/abi/encodeAbiParameters.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeDeployData.d.ts +0 -9
- package/dist/types/utils/abi/encodeDeployData.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeErrorResult.d.ts +0 -11
- package/dist/types/utils/abi/encodeErrorResult.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeEventTopics.d.ts +0 -13
- package/dist/types/utils/abi/encodeEventTopics.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeFunctionData.d.ts +0 -11
- package/dist/types/utils/abi/encodeFunctionData.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeFunctionResult.d.ts +0 -13
- package/dist/types/utils/abi/encodeFunctionResult.d.ts.map +0 -1
- package/dist/types/utils/abi/encodePacked.d.ts +0 -11
- package/dist/types/utils/abi/encodePacked.d.ts.map +0 -1
- package/dist/types/utils/abi/formatAbiItem.d.ts +0 -9
- package/dist/types/utils/abi/formatAbiItem.d.ts.map +0 -1
- package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts +0 -8
- package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts.map +0 -1
- package/dist/types/utils/abi/getAbiItem.d.ts +0 -12
- package/dist/types/utils/abi/getAbiItem.d.ts.map +0 -1
- package/dist/types/utils/accounts.d.ts +0 -3
- package/dist/types/utils/accounts.d.ts.map +0 -1
- package/dist/types/utils/address/getAddress.d.ts +0 -4
- package/dist/types/utils/address/getAddress.d.ts.map +0 -1
- package/dist/types/utils/address/getContractAddress.d.ts +0 -20
- package/dist/types/utils/address/getContractAddress.d.ts.map +0 -1
- package/dist/types/utils/address/isAddress.d.ts +0 -3
- package/dist/types/utils/address/isAddress.d.ts.map +0 -1
- package/dist/types/utils/address/isAddressEqual.d.ts +0 -3
- package/dist/types/utils/address/isAddressEqual.d.ts.map +0 -1
- package/dist/types/utils/buildRequest.d.ts +0 -6
- package/dist/types/utils/buildRequest.d.ts.map +0 -1
- package/dist/types/utils/ccip.d.ts +0 -37
- package/dist/types/utils/ccip.d.ts.map +0 -1
- package/dist/types/utils/chain.d.ts +0 -14
- package/dist/types/utils/chain.d.ts.map +0 -1
- package/dist/types/utils/contract/extractFunctionParts.d.ts +0 -13
- package/dist/types/utils/contract/extractFunctionParts.d.ts.map +0 -1
- package/dist/types/utils/data/concat.d.ts +0 -6
- package/dist/types/utils/data/concat.d.ts.map +0 -1
- package/dist/types/utils/data/isBytes.d.ts +0 -3
- package/dist/types/utils/data/isBytes.d.ts.map +0 -1
- package/dist/types/utils/data/isBytesEqual.d.ts +0 -3
- package/dist/types/utils/data/isBytesEqual.d.ts.map +0 -1
- package/dist/types/utils/data/isHex.d.ts +0 -5
- package/dist/types/utils/data/isHex.d.ts.map +0 -1
- package/dist/types/utils/data/pad.d.ts +0 -11
- package/dist/types/utils/data/pad.d.ts.map +0 -1
- package/dist/types/utils/data/size.d.ts +0 -9
- package/dist/types/utils/data/size.d.ts.map +0 -1
- package/dist/types/utils/data/slice.d.ts +0 -33
- package/dist/types/utils/data/slice.d.ts.map +0 -1
- package/dist/types/utils/data/trim.d.ts +0 -8
- package/dist/types/utils/data/trim.d.ts.map +0 -1
- package/dist/types/utils/encoding/fromBytes.d.ts +0 -109
- package/dist/types/utils/encoding/fromBytes.d.ts.map +0 -1
- package/dist/types/utils/encoding/fromHex.d.ts +0 -138
- package/dist/types/utils/encoding/fromHex.d.ts.map +0 -1
- package/dist/types/utils/encoding/fromRlp.d.ts +0 -6
- package/dist/types/utils/encoding/fromRlp.d.ts.map +0 -1
- package/dist/types/utils/encoding/toBytes.d.ts +0 -125
- package/dist/types/utils/encoding/toBytes.d.ts.map +0 -1
- package/dist/types/utils/encoding/toHex.d.ts +0 -139
- package/dist/types/utils/encoding/toHex.d.ts.map +0 -1
- package/dist/types/utils/encoding/toRlp.d.ts +0 -8
- package/dist/types/utils/encoding/toRlp.d.ts.map +0 -1
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts +0 -9
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts.map +0 -1
- package/dist/types/utils/ens/avatar/utils.d.ts +0 -37
- package/dist/types/utils/ens/avatar/utils.d.ts.map +0 -1
- package/dist/types/utils/ens/encodeLabelhash.d.ts +0 -3
- package/dist/types/utils/ens/encodeLabelhash.d.ts.map +0 -1
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts +0 -3
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts.map +0 -1
- package/dist/types/utils/ens/errors.d.ts +0 -2
- package/dist/types/utils/ens/errors.d.ts.map +0 -1
- package/dist/types/utils/ens/labelhash.d.ts +0 -11
- package/dist/types/utils/ens/labelhash.d.ts.map +0 -1
- package/dist/types/utils/ens/namehash.d.ts +0 -13
- package/dist/types/utils/ens/namehash.d.ts.map +0 -1
- package/dist/types/utils/ens/normalize.d.ts +0 -12
- package/dist/types/utils/ens/normalize.d.ts.map +0 -1
- package/dist/types/utils/ens/packetToBytes.d.ts +0 -3
- package/dist/types/utils/ens/packetToBytes.d.ts.map +0 -1
- package/dist/types/utils/errors/getCallError.d.ts +0 -9
- package/dist/types/utils/errors/getCallError.d.ts.map +0 -1
- package/dist/types/utils/errors/getContractError.d.ts +0 -12
- package/dist/types/utils/errors/getContractError.d.ts.map +0 -1
- package/dist/types/utils/errors/getEstimateGasError.d.ts +0 -11
- package/dist/types/utils/errors/getEstimateGasError.d.ts.map +0 -1
- package/dist/types/utils/errors/getNodeError.d.ts +0 -7
- package/dist/types/utils/errors/getNodeError.d.ts.map +0 -1
- package/dist/types/utils/errors/getTransactionError.d.ts +0 -12
- package/dist/types/utils/errors/getTransactionError.d.ts.map +0 -1
- package/dist/types/utils/filters/createFilterRequestScope.d.ts +0 -22
- package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +0 -1
- package/dist/types/utils/formatters/block.d.ts +0 -28
- package/dist/types/utils/formatters/block.d.ts.map +0 -1
- package/dist/types/utils/formatters/extract.d.ts +0 -8
- package/dist/types/utils/formatters/extract.d.ts.map +0 -1
- package/dist/types/utils/formatters/feeHistory.d.ts +0 -4
- package/dist/types/utils/formatters/feeHistory.d.ts.map +0 -1
- package/dist/types/utils/formatters/formatter.d.ts +0 -10
- package/dist/types/utils/formatters/formatter.d.ts.map +0 -1
- package/dist/types/utils/formatters/log.d.ts +0 -7
- package/dist/types/utils/formatters/log.d.ts.map +0 -1
- package/dist/types/utils/formatters/transaction.d.ts +0 -30
- package/dist/types/utils/formatters/transaction.d.ts.map +0 -1
- package/dist/types/utils/formatters/transactionReceipt.d.ts +0 -14
- package/dist/types/utils/formatters/transactionReceipt.d.ts.map +0 -1
- package/dist/types/utils/formatters/transactionRequest.d.ts +0 -14
- package/dist/types/utils/formatters/transactionRequest.d.ts.map +0 -1
- package/dist/types/utils/hash/getEventSelector.d.ts +0 -4
- package/dist/types/utils/hash/getEventSelector.d.ts.map +0 -1
- package/dist/types/utils/hash/getFunctionSelector.d.ts +0 -3
- package/dist/types/utils/hash/getFunctionSelector.d.ts.map +0 -1
- package/dist/types/utils/hash/hashFunction.d.ts +0 -4
- package/dist/types/utils/hash/hashFunction.d.ts.map +0 -1
- package/dist/types/utils/hash/isHash.d.ts +0 -3
- package/dist/types/utils/hash/isHash.d.ts.map +0 -1
- package/dist/types/utils/hash/keccak256.d.ts +0 -6
- package/dist/types/utils/hash/keccak256.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -82
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/observe.d.ts +0 -17
- package/dist/types/utils/observe.d.ts.map +0 -1
- package/dist/types/utils/poll.d.ts +0 -13
- package/dist/types/utils/poll.d.ts.map +0 -1
- package/dist/types/utils/promise/createBatchScheduler.d.ts +0 -17
- package/dist/types/utils/promise/createBatchScheduler.d.ts.map +0 -1
- package/dist/types/utils/promise/withCache.d.ts +0 -36
- package/dist/types/utils/promise/withCache.d.ts.map +0 -1
- package/dist/types/utils/promise/withRetry.d.ts +0 -12
- package/dist/types/utils/promise/withRetry.d.ts.map +0 -1
- package/dist/types/utils/promise/withTimeout.d.ts +0 -8
- package/dist/types/utils/promise/withTimeout.d.ts.map +0 -1
- package/dist/types/utils/regex.d.ts +0 -4
- package/dist/types/utils/regex.d.ts.map +0 -1
- package/dist/types/utils/rpc.d.ts +0 -72
- package/dist/types/utils/rpc.d.ts.map +0 -1
- package/dist/types/utils/signature/hashMessage.d.ts +0 -6
- package/dist/types/utils/signature/hashMessage.d.ts.map +0 -1
- package/dist/types/utils/signature/hashTypedData.d.ts +0 -11
- package/dist/types/utils/signature/hashTypedData.d.ts.map +0 -1
- package/dist/types/utils/signature/hexToSignature.d.ts +0 -13
- package/dist/types/utils/signature/hexToSignature.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverAddress.d.ts +0 -9
- package/dist/types/utils/signature/recoverAddress.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverMessageAddress.d.ts +0 -9
- package/dist/types/utils/signature/recoverMessageAddress.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverPublicKey.d.ts +0 -8
- package/dist/types/utils/signature/recoverPublicKey.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +0 -13
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +0 -1
- package/dist/types/utils/signature/signatureToHex.d.ts +0 -17
- package/dist/types/utils/signature/signatureToHex.d.ts.map +0 -1
- package/dist/types/utils/signature/verifyMessage.d.ts +0 -25
- package/dist/types/utils/signature/verifyMessage.d.ts.map +0 -1
- package/dist/types/utils/signature/verifyTypedData.d.ts +0 -28
- package/dist/types/utils/signature/verifyTypedData.d.ts.map +0 -1
- package/dist/types/utils/stringify.d.ts +0 -2
- package/dist/types/utils/stringify.d.ts.map +0 -1
- package/dist/types/utils/transaction/assertRequest.d.ts +0 -5
- package/dist/types/utils/transaction/assertRequest.d.ts.map +0 -1
- package/dist/types/utils/transaction/assertTransaction.d.ts +0 -5
- package/dist/types/utils/transaction/assertTransaction.d.ts.map +0 -1
- package/dist/types/utils/transaction/getSerializedTransactionType.d.ts +0 -4
- package/dist/types/utils/transaction/getSerializedTransactionType.d.ts.map +0 -1
- package/dist/types/utils/transaction/getTransactionType.d.ts +0 -4
- package/dist/types/utils/transaction/getTransactionType.d.ts.map +0 -1
- package/dist/types/utils/transaction/parseTransaction.d.ts +0 -5
- package/dist/types/utils/transaction/parseTransaction.d.ts.map +0 -1
- package/dist/types/utils/transaction/prepareRequest.d.ts +0 -20
- package/dist/types/utils/transaction/prepareRequest.d.ts.map +0 -1
- package/dist/types/utils/transaction/serializeAccessList.d.ts +0 -5
- package/dist/types/utils/transaction/serializeAccessList.d.ts.map +0 -1
- package/dist/types/utils/transaction/serializeTransaction.d.ts +0 -7
- package/dist/types/utils/transaction/serializeTransaction.d.ts.map +0 -1
- package/dist/types/utils/typedData.d.ts +0 -6
- package/dist/types/utils/typedData.d.ts.map +0 -1
- package/dist/types/utils/uid.d.ts +0 -2
- package/dist/types/utils/uid.d.ts.map +0 -1
- package/dist/types/utils/unit/formatEther.d.ts +0 -2
- package/dist/types/utils/unit/formatEther.d.ts.map +0 -1
- package/dist/types/utils/unit/formatGwei.d.ts +0 -2
- package/dist/types/utils/unit/formatGwei.d.ts.map +0 -1
- package/dist/types/utils/unit/formatUnits.d.ts +0 -2
- package/dist/types/utils/unit/formatUnits.d.ts.map +0 -1
- package/dist/types/utils/unit/parseEther.d.ts +0 -2
- package/dist/types/utils/unit/parseEther.d.ts.map +0 -1
- package/dist/types/utils/unit/parseGwei.d.ts +0 -2
- package/dist/types/utils/unit/parseGwei.d.ts.map +0 -1
- package/dist/types/utils/unit/parseUnits.d.ts +0 -2
- package/dist/types/utils/unit/parseUnits.d.ts.map +0 -1
- package/dist/types/utils/wait.d.ts +0 -2
- package/dist/types/utils/wait.d.ts.map +0 -1
- package/dist/types/wallet.d.ts +0 -11
- package/dist/types/wallet.d.ts.map +0 -1
- package/dist/types/window.d.ts +0 -2
- package/dist/types/window.d.ts.map +0 -1
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"setStorageAt.d.ts","sourceRoot":"","sources":["../../../../src/actions/test/setStorageAt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAGpD,MAAM,MAAM,sBAAsB,GAAG;IACnC,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAA;IAChB,sEAAsE;IACtE,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,kDAAkD;IAClD,KAAK,EAAE,GAAG,CAAA;CACX,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,YAAY,CAChC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,EACtE,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE,sBAAsB,iBAUlD"}
|
@@ -1,25 +0,0 @@
|
|
1
|
-
import type { TestClient, TestClientMode } from '../../clients/createTestClient.js';
|
2
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
-
import type { Account } from '../../types/account.js';
|
4
|
-
import type { Chain } from '../../types/chain.js';
|
5
|
-
/**
|
6
|
-
* Snapshot the state of the blockchain at the current block.
|
7
|
-
*
|
8
|
-
* - Docs: https://viem.sh/docs/actions/test/snapshot.html
|
9
|
-
*
|
10
|
-
* @param client - Client to use
|
11
|
-
*
|
12
|
-
* @example
|
13
|
-
* import { createTestClient, http } from 'viem'
|
14
|
-
* import { foundry } from 'viem/chains'
|
15
|
-
* import { snapshot } from 'viem/test'
|
16
|
-
*
|
17
|
-
* const client = createTestClient({
|
18
|
-
* mode: 'anvil',
|
19
|
-
* chain: 'foundry',
|
20
|
-
* transport: http(),
|
21
|
-
* })
|
22
|
-
* await snapshot(client)
|
23
|
-
*/
|
24
|
-
export declare function snapshot<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: TestClient<TestClientMode, Transport, TChain, TAccount, false>): Promise<`0x${string}`>;
|
25
|
-
//# sourceMappingURL=snapshot.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"snapshot.d.ts","sourceRoot":"","sources":["../../../../src/actions/test/snapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,MAAM,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,0BAIvE"}
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import type { Address } from 'abitype';
|
2
|
-
import type { TestClient, TestClientMode } from '../../clients/createTestClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { Account } from '../../types/account.js';
|
5
|
-
import type { Chain } from '../../types/chain.js';
|
6
|
-
export type StopImpersonatingAccountParameters = {
|
7
|
-
/** The account to impersonate. */
|
8
|
-
address: Address;
|
9
|
-
};
|
10
|
-
/**
|
11
|
-
* Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount.html).
|
12
|
-
*
|
13
|
-
* - Docs: https://viem.sh/docs/actions/test/stopImpersonatingAccount.html
|
14
|
-
*
|
15
|
-
* @param client - Client to use
|
16
|
-
* @param parameters – {@link StopImpersonatingAccountParameters}
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
* import { createTestClient, http } from 'viem'
|
20
|
-
* import { foundry } from 'viem/chains'
|
21
|
-
* import { stopImpersonatingAccount } from 'viem/test'
|
22
|
-
*
|
23
|
-
* const client = createTestClient({
|
24
|
-
* mode: 'anvil',
|
25
|
-
* chain: 'foundry',
|
26
|
-
* transport: http(),
|
27
|
-
* })
|
28
|
-
* await stopImpersonatingAccount(client, {
|
29
|
-
* address: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
30
|
-
* })
|
31
|
-
*/
|
32
|
-
export declare function stopImpersonatingAccount<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: TestClient<TestClientMode, Transport, TChain, TAccount, false>, { address }: StopImpersonatingAccountParameters): Promise<void>;
|
33
|
-
//# sourceMappingURL=stopImpersonatingAccount.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"stopImpersonatingAccount.d.ts","sourceRoot":"","sources":["../../../../src/actions/test/stopImpersonatingAccount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EACV,UAAU,EACV,cAAc,EACf,MAAM,mCAAmC,CAAA;AAC1C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAA;AACrD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD,MAAM,MAAM,kCAAkC,GAAG;IAC/C,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;CACjB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EAAE,UAAU,CAAC,cAAc,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,CAAC,EACtE,EAAE,OAAO,EAAE,EAAE,kCAAkC,iBAMhD"}
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import type { Account } from '../../accounts/types.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { Chain } from '../../types/chain.js';
|
5
|
-
export type AddChainParameters = {
|
6
|
-
/** The chain to add to the wallet. */
|
7
|
-
chain: Chain;
|
8
|
-
};
|
9
|
-
/**
|
10
|
-
* Adds an EVM chain to the wallet.
|
11
|
-
*
|
12
|
-
* - Docs: https://viem.sh/docs/actions/wallet/addChain.html
|
13
|
-
* - JSON-RPC Methods: [`eth_addEthereumChain`](https://eips.ethereum.org/EIPS/eip-3085)
|
14
|
-
*
|
15
|
-
* @param client - Client to use
|
16
|
-
* @param parameters - {@link AddChainParameters}
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
* import { createWalletClient, custom } from 'viem'
|
20
|
-
* import { optimism } from 'viem/chains'
|
21
|
-
* import { addChain } from 'viem/wallet'
|
22
|
-
*
|
23
|
-
* const client = createWalletClient({
|
24
|
-
* transport: custom(window.ethereum),
|
25
|
-
* })
|
26
|
-
* await addChain(client, { chain: optimism })
|
27
|
-
*/
|
28
|
-
export declare function addChain<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>, { chain }: AddChainParameters): Promise<void>;
|
29
|
-
//# sourceMappingURL=addChain.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"addChain.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/addChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,kBAAkB,GAAG;IAC/B,sCAAsC;IACtC,KAAK,EAAE,KAAK,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,KAAK,EAAE,EAAE,kBAAkB,iBAgB3E"}
|
@@ -1,43 +0,0 @@
|
|
1
|
-
import type { Abi } from 'abitype';
|
2
|
-
import type { Account } from '../../accounts/types.js';
|
3
|
-
import type { Client } from '../../clients/createClient.js';
|
4
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
5
|
-
import type { Chain, GetChain } from '../../types/chain.js';
|
6
|
-
import type { GetConstructorArgs } from '../../types/contract.js';
|
7
|
-
import type { Hex } from '../../types/misc.js';
|
8
|
-
import type { UnionOmit } from '../../types/utils.js';
|
9
|
-
import { type SendTransactionParameters, type SendTransactionReturnType } from './sendTransaction.js';
|
10
|
-
export type DeployContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined, TChainOverride extends Chain | undefined = Chain | undefined> = UnionOmit<SendTransactionParameters<TChain, TAccount, TChainOverride>, 'accessList' | 'chain' | 'to' | 'data'> & {
|
11
|
-
abi: TAbi;
|
12
|
-
bytecode: Hex;
|
13
|
-
} & GetChain<TChain, TChainOverride> & GetConstructorArgs<TAbi>;
|
14
|
-
export type DeployContractReturnType = SendTransactionReturnType;
|
15
|
-
/**
|
16
|
-
* Deploys a contract to the network, given bytecode and constructor arguments.
|
17
|
-
*
|
18
|
-
* - Docs: https://viem.sh/docs/contract/deployContract.html
|
19
|
-
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/deploying-contracts
|
20
|
-
*
|
21
|
-
* @param client - Client to use
|
22
|
-
* @param parameters - {@link DeployContractParameters}
|
23
|
-
* @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link DeployContractReturnType}
|
24
|
-
*
|
25
|
-
* @example
|
26
|
-
* import { createWalletClient, http } from 'viem'
|
27
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
28
|
-
* import { mainnet } from 'viem/chains'
|
29
|
-
* import { deployContract } from 'viem/contract'
|
30
|
-
*
|
31
|
-
* const client = createWalletClient({
|
32
|
-
* account: privateKeyToAccount('0x…'),
|
33
|
-
* chain: mainnet,
|
34
|
-
* transport: http(),
|
35
|
-
* })
|
36
|
-
* const hash = await deployContract(client, {
|
37
|
-
* abi: [],
|
38
|
-
* account: '0x…,
|
39
|
-
* bytecode: '0x608060405260405161083e38038061083e833981016040819052610...',
|
40
|
-
* })
|
41
|
-
*/
|
42
|
-
export declare function deployContract<const TAbi extends Abi | readonly unknown[], TChain extends Chain | undefined, TAccount extends Account | undefined, TChainOverride extends Chain | undefined>(walletClient: Client<Transport, TChain, TAccount>, { abi, args, bytecode, ...request }: DeployContractParameters<TAbi, TChain, TAccount, TChainOverride>): Promise<DeployContractReturnType>;
|
43
|
-
//# sourceMappingURL=deployContract.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"deployContract.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/deployContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAGrD,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAE/B,MAAM,sBAAsB,CAAA;AAE7B,MAAM,MAAM,wBAAwB,CAClC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAC1D,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAC1D,SAAS,CACX,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,EAC3D,YAAY,GAAG,OAAO,GAAG,IAAI,GAAG,MAAM,CACvC,GAAG;IACF,GAAG,EAAE,IAAI,CAAA;IACT,QAAQ,EAAE,GAAG,CAAA;CACd,GAAG,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,GAClC,kBAAkB,CAAC,IAAI,CAAC,CAAA;AAE1B,MAAM,MAAM,wBAAwB,GAAG,yBAAyB,CAAA;AAEhE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAC5B,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,cAAc,SAAS,KAAK,GAAG,SAAS,EAExC,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EACjD,EACE,GAAG,EACH,IAAI,EACJ,QAAQ,EACR,GAAG,OAAO,EACX,EAAE,wBAAwB,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,GAClE,OAAO,CAAC,wBAAwB,CAAC,CAenC"}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import type { Address } from 'abitype';
|
2
|
-
import type { Account } from '../../accounts/types.js';
|
3
|
-
import type { Client } from '../../clients/createClient.js';
|
4
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
5
|
-
import type { Chain } from '../../types/chain.js';
|
6
|
-
export type GetAddressesReturnType = Address[];
|
7
|
-
/**
|
8
|
-
* Returns a list of account addresses owned by the wallet or client.
|
9
|
-
*
|
10
|
-
* - Docs: https://viem.sh/docs/actions/wallet/getAddresses.html
|
11
|
-
* - JSON-RPC Methods: [`eth_accounts`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_accounts)
|
12
|
-
*
|
13
|
-
* @param client - Client to use
|
14
|
-
* @returns List of account addresses owned by the wallet or client. {@link GetAddressesReturnType}
|
15
|
-
*
|
16
|
-
* @example
|
17
|
-
* import { createWalletClient, custom } from 'viem'
|
18
|
-
* import { mainnet } from 'viem/chains'
|
19
|
-
* import { getAddresses } from 'viem/wallet'
|
20
|
-
*
|
21
|
-
* const client = createWalletClient({
|
22
|
-
* chain: mainnet,
|
23
|
-
* transport: custom(window.ethereum),
|
24
|
-
* })
|
25
|
-
* const accounts = await getAddresses(client)
|
26
|
-
*/
|
27
|
-
export declare function getAddresses<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>): Promise<GetAddressesReturnType>;
|
28
|
-
//# sourceMappingURL=getAddresses.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getAddresses.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/getAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,sBAAsB,GAAG,OAAO,EAAE,CAAA;AAE9C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,YAAY,CAChC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAC1C,OAAO,CAAC,sBAAsB,CAAC,CAGjC"}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import type { Account } from '../../accounts/types.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { Chain } from '../../types/chain.js';
|
5
|
-
import type { WalletPermission } from '../../types/eip1193.js';
|
6
|
-
export type GetPermissionsReturnType = WalletPermission[];
|
7
|
-
/**
|
8
|
-
* Gets the wallets current permissions.
|
9
|
-
*
|
10
|
-
* - Docs: https://viem.sh/docs/actions/wallet/getPermissions.html
|
11
|
-
* - JSON-RPC Methods: [`wallet_getPermissions`](https://eips.ethereum.org/EIPS/eip-2255)
|
12
|
-
*
|
13
|
-
* @param client - Client to use
|
14
|
-
* @returns The wallet permissions. {@link GetPermissionsReturnType}
|
15
|
-
*
|
16
|
-
* @example
|
17
|
-
* import { createWalletClient, custom } from 'viem'
|
18
|
-
* import { mainnet } from 'viem/chains'
|
19
|
-
* import { getPermissions } from 'viem/wallet'
|
20
|
-
*
|
21
|
-
* const client = createWalletClient({
|
22
|
-
* chain: mainnet,
|
23
|
-
* transport: custom(window.ethereum),
|
24
|
-
* })
|
25
|
-
* const permissions = await getPermissions(client)
|
26
|
-
*/
|
27
|
-
export declare function getPermissions<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>): Promise<WalletPermission[]>;
|
28
|
-
//# sourceMappingURL=getPermissions.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"getPermissions.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/getPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,MAAM,MAAM,wBAAwB,GAAG,gBAAgB,EAAE,CAAA;AAEzD;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,cAAc,CAClC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAChD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,+BAG5C"}
|
@@ -1,32 +0,0 @@
|
|
1
|
-
import type { Address } from 'abitype';
|
2
|
-
import type { Account } from '../../accounts/types.js';
|
3
|
-
import type { Client } from '../../clients/createClient.js';
|
4
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
5
|
-
import type { Chain } from '../../types/chain.js';
|
6
|
-
export type RequestAddressesReturnType = Address[];
|
7
|
-
/**
|
8
|
-
* Requests a list of accounts managed by a wallet.
|
9
|
-
*
|
10
|
-
* - Docs: https://viem.sh/docs/actions/wallet/requestAddresses.html
|
11
|
-
* - JSON-RPC Methods: [`eth_requestAccounts`](https://eips.ethereum.org/EIPS/eip-1102)
|
12
|
-
*
|
13
|
-
* 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).
|
14
|
-
*
|
15
|
-
* 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.
|
16
|
-
*
|
17
|
-
* @param client - Client to use
|
18
|
-
* @returns List of accounts managed by a wallet {@link RequestAddressesReturnType}
|
19
|
-
*
|
20
|
-
* @example
|
21
|
-
* import { createWalletClient, custom } from 'viem'
|
22
|
-
* import { mainnet } from 'viem/chains'
|
23
|
-
* import { requestAddresses } from 'viem/wallet'
|
24
|
-
*
|
25
|
-
* const client = createWalletClient({
|
26
|
-
* chain: mainnet,
|
27
|
-
* transport: custom(window.ethereum),
|
28
|
-
* })
|
29
|
-
* const accounts = await requestAddresses(client)
|
30
|
-
*/
|
31
|
-
export declare function requestAddresses<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>): Promise<RequestAddressesReturnType>;
|
32
|
-
//# sourceMappingURL=requestAddresses.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"requestAddresses.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/requestAddresses.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,0BAA0B,GAAG,OAAO,EAAE,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAC1C,OAAO,CAAC,0BAA0B,CAAC,CAGrC"}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
import type { Account } from '../../accounts/types.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { Chain } from '../../types/chain.js';
|
5
|
-
import type { WalletPermission } from '../../types/eip1193.js';
|
6
|
-
import type { Prettify } from '../../types/utils.js';
|
7
|
-
export type RequestPermissionsParameters = Prettify<{
|
8
|
-
eth_accounts: Record<string, any>;
|
9
|
-
} & {
|
10
|
-
[key: string]: Record<string, any>;
|
11
|
-
}>;
|
12
|
-
export type RequestPermissionsReturnType = WalletPermission[];
|
13
|
-
/**
|
14
|
-
* Requests permissions for a wallet.
|
15
|
-
*
|
16
|
-
* - Docs: https://viem.sh/docs/actions/wallet/requestPermissions.html
|
17
|
-
* - JSON-RPC Methods: [`wallet_requestPermissions`](https://eips.ethereum.org/EIPS/eip-2255)
|
18
|
-
*
|
19
|
-
* @param client - Client to use
|
20
|
-
* @param parameters - {@link RequestPermissionsParameters}
|
21
|
-
* @returns The wallet permissions. {@link RequestPermissionsReturnType}
|
22
|
-
*
|
23
|
-
* @example
|
24
|
-
* import { createWalletClient, custom } from 'viem'
|
25
|
-
* import { mainnet } from 'viem/chains'
|
26
|
-
* import { requestPermissions } from 'viem/wallet'
|
27
|
-
*
|
28
|
-
* const client = createWalletClient({
|
29
|
-
* chain: mainnet,
|
30
|
-
* transport: custom(window.ethereum),
|
31
|
-
* })
|
32
|
-
* const permissions = await requestPermissions(client, {
|
33
|
-
* eth_accounts: {}
|
34
|
-
* })
|
35
|
-
*/
|
36
|
-
export declare function requestPermissions<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>, permissions: RequestPermissionsParameters): Promise<WalletPermission[]>;
|
37
|
-
//# sourceMappingURL=requestPermissions.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"requestPermissions.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/requestPermissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAC9D,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAEpD,MAAM,MAAM,4BAA4B,GAAG,QAAQ,CACjD;IACE,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAClC,GAAG;IACF,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CACnC,CACF,CAAA;AACD,MAAM,MAAM,4BAA4B,GAAG,gBAAgB,EAAE,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,kBAAkB,CACtC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,WAAW,EAAE,4BAA4B,+BAM1C"}
|
@@ -1,57 +0,0 @@
|
|
1
|
-
import type { Account } from '../../accounts/types.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { GetAccountParameter } from '../../types/account.js';
|
5
|
-
import type { Chain, GetChain } from '../../types/chain.js';
|
6
|
-
import type { Hash } from '../../types/misc.js';
|
7
|
-
import type { UnionOmit } from '../../types/utils.js';
|
8
|
-
import { type FormattedTransactionRequest } from '../../utils/formatters/transactionRequest.js';
|
9
|
-
export type SendTransactionParameters<TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = Account | undefined, TChainOverride extends Chain | undefined = Chain | undefined> = UnionOmit<FormattedTransactionRequest<TChainOverride extends Chain ? TChainOverride : TChain>, 'from'> & GetAccountParameter<TAccount> & GetChain<TChain, TChainOverride>;
|
10
|
-
export type SendTransactionReturnType = Hash;
|
11
|
-
/**
|
12
|
-
* Creates, signs, and sends a new transaction to the network.
|
13
|
-
*
|
14
|
-
* - Docs: https://viem.sh/docs/actions/wallet/sendTransaction.html
|
15
|
-
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions
|
16
|
-
* - JSON-RPC Methods:
|
17
|
-
* - JSON-RPC Accounts: [`eth_sendTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendtransaction)
|
18
|
-
* - Local Accounts: [`eth_sendRawTransaction`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_sendrawtransaction)
|
19
|
-
*
|
20
|
-
* @param client - Client to use
|
21
|
-
* @param parameters - {@link SendTransactionParameters}
|
22
|
-
* @returns The [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash. {@link SendTransactionReturnType}
|
23
|
-
*
|
24
|
-
* @example
|
25
|
-
* import { createWalletClient, custom } from 'viem'
|
26
|
-
* import { mainnet } from 'viem/chains'
|
27
|
-
* import { sendTransaction } from 'viem/wallet'
|
28
|
-
*
|
29
|
-
* const client = createWalletClient({
|
30
|
-
* chain: mainnet,
|
31
|
-
* transport: custom(window.ethereum),
|
32
|
-
* })
|
33
|
-
* const hash = await sendTransaction(client, {
|
34
|
-
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
35
|
-
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
36
|
-
* value: 1000000000000000000n,
|
37
|
-
* })
|
38
|
-
*
|
39
|
-
* @example
|
40
|
-
* // Account Hoisting
|
41
|
-
* import { createWalletClient, http } from 'viem'
|
42
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
43
|
-
* import { mainnet } from 'viem/chains'
|
44
|
-
* import { sendTransaction } from 'viem/wallet'
|
45
|
-
*
|
46
|
-
* const client = createWalletClient({
|
47
|
-
* account: privateKeyToAccount('0x…'),
|
48
|
-
* chain: mainnet,
|
49
|
-
* transport: http(),
|
50
|
-
* })
|
51
|
-
* const hash = await sendTransaction(client, {
|
52
|
-
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
53
|
-
* value: 1000000000000000000n,
|
54
|
-
* })
|
55
|
-
*/
|
56
|
-
export declare function sendTransaction<TChain extends Chain | undefined, TAccount extends Account | undefined, TChainOverride extends Chain | undefined>(client: Client<Transport, TChain, TAccount>, args: SendTransactionParameters<TChain, TAccount, TChainOverride>): Promise<SendTransactionReturnType>;
|
57
|
-
//# sourceMappingURL=sendTransaction.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"sendTransaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/sendTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAG5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAK/C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,8CAA8C,CAAA;AAQrD,MAAM,MAAM,yBAAyB,CACnC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,EAC1D,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAC1D,SAAS,CACX,2BAA2B,CACzB,cAAc,SAAS,KAAK,GAAG,cAAc,GAAG,MAAM,CACvD,EACD,MAAM,CACP,GACC,mBAAmB,CAAC,QAAQ,CAAC,GAC7B,QAAQ,CAAC,MAAM,EAAE,cAAc,CAAC,CAAA;AAElC,MAAM,MAAM,yBAAyB,GAAG,IAAI,CAAA;AAE5C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,wBAAsB,eAAe,CACnC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,cAAc,SAAS,KAAK,GAAG,SAAS,EAExC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,IAAI,EAAE,yBAAyB,CAAC,MAAM,EAAE,QAAQ,EAAE,cAAc,CAAC,GAChE,OAAO,CAAC,yBAAyB,CAAC,CA8FpC"}
|
@@ -1,58 +0,0 @@
|
|
1
|
-
import type { Account } from '../../accounts/types.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { GetAccountParameter } from '../../types/account.js';
|
5
|
-
import type { Chain } from '../../types/chain.js';
|
6
|
-
import type { Hex, SignableMessage } from '../../types/misc.js';
|
7
|
-
export type SignMessageParameters<TAccount extends Account | undefined = Account | undefined> = GetAccountParameter<TAccount> & {
|
8
|
-
message: SignableMessage;
|
9
|
-
};
|
10
|
-
export type SignMessageReturnType = Hex;
|
11
|
-
/**
|
12
|
-
* Calculates an Ethereum-specific signature in [EIP-191 format](https://eips.ethereum.org/EIPS/eip-191): `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`.
|
13
|
-
*
|
14
|
-
* - Docs: https://viem.sh/docs/actions/wallet/signMessage.html
|
15
|
-
* - JSON-RPC Methods:
|
16
|
-
* - JSON-RPC Accounts: [`personal_sign`](https://docs.metamask.io/guide/signing-data.html#personal-sign)
|
17
|
-
* - Local Accounts: Signs locally. No JSON-RPC request.
|
18
|
-
*
|
19
|
-
* With the calculated signature, you can:
|
20
|
-
* - use [`verifyMessage`](https://viem.sh/docs/utilities/verifyMessage.html) to verify the signature,
|
21
|
-
* - use [`recoverMessageAddress`](https://viem.sh/docs/utilities/recoverMessageAddress.html) to recover the signing address from a signature.
|
22
|
-
*
|
23
|
-
* @param client - Client to use
|
24
|
-
* @param parameters - {@link SignMessageParameters}
|
25
|
-
* @returns The signed message. {@link SignMessageReturnType}
|
26
|
-
*
|
27
|
-
* @example
|
28
|
-
* import { createWalletClient, custom } from 'viem'
|
29
|
-
* import { mainnet } from 'viem/chains'
|
30
|
-
* import { signMessage } from 'viem/wallet'
|
31
|
-
*
|
32
|
-
* const client = createWalletClient({
|
33
|
-
* chain: mainnet,
|
34
|
-
* transport: custom(window.ethereum),
|
35
|
-
* })
|
36
|
-
* const signature = await signMessage(client, {
|
37
|
-
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
38
|
-
* message: 'hello world',
|
39
|
-
* })
|
40
|
-
*
|
41
|
-
* @example
|
42
|
-
* // Account Hoisting
|
43
|
-
* import { createWalletClient, custom } from 'viem'
|
44
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
45
|
-
* import { mainnet } from 'viem/chains'
|
46
|
-
* import { signMessage } from 'viem/wallet'
|
47
|
-
*
|
48
|
-
* const client = createWalletClient({
|
49
|
-
* account: privateKeyToAccount('0x…'),
|
50
|
-
* chain: mainnet,
|
51
|
-
* transport: custom(window.ethereum),
|
52
|
-
* })
|
53
|
-
* const signature = await signMessage(client, {
|
54
|
-
* message: 'hello world',
|
55
|
-
* })
|
56
|
-
*/
|
57
|
-
export declare function signMessage<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>, { account: account_, message, }: SignMessageParameters<TAccount>): Promise<SignMessageReturnType>;
|
58
|
-
//# sourceMappingURL=signMessage.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"signMessage.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/signMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAG/D,MAAM,MAAM,qBAAqB,CAC/B,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,IACxD,mBAAmB,CAAC,QAAQ,CAAC,GAAG;IAClC,OAAO,EAAE,eAAe,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,GAAG,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6CG;AACH,wBAAsB,WAAW,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,EACE,OAAO,EAAE,QAAyB,EAClC,OAAO,GACR,EAAE,qBAAqB,CAAC,QAAQ,CAAC,GACjC,OAAO,CAAC,qBAAqB,CAAC,CAkBhC"}
|
@@ -1,114 +0,0 @@
|
|
1
|
-
import type { TypedData } from 'abitype';
|
2
|
-
import type { Account } from '../../accounts/types.js';
|
3
|
-
import type { Client } from '../../clients/createClient.js';
|
4
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
5
|
-
import type { GetAccountParameter } from '../../types/account.js';
|
6
|
-
import type { Chain } from '../../types/chain.js';
|
7
|
-
import type { Hex } from '../../types/misc.js';
|
8
|
-
import type { TypedDataDefinition } from '../../types/typedData.js';
|
9
|
-
export type SignTypedDataParameters<TTypedData extends TypedData | {
|
10
|
-
[key: string]: unknown;
|
11
|
-
} = TypedData, TPrimaryType extends string = string, TAccount extends Account | undefined = undefined> = GetAccountParameter<TAccount> & TypedDataDefinition<TTypedData, TPrimaryType>;
|
12
|
-
export type SignTypedDataReturnType = Hex;
|
13
|
-
/**
|
14
|
-
* 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)))`
|
15
|
-
*
|
16
|
-
* - Docs: https://viem.sh/docs/actions/wallet/signTypedData.html
|
17
|
-
* - JSON-RPC Methods:
|
18
|
-
* - JSON-RPC Accounts: [`eth_signTypedData_v4`](https://docs.metamask.io/guide/signing-data.html#signtypeddata-v4)
|
19
|
-
* - Local Accounts: Signs locally. No JSON-RPC request.
|
20
|
-
*
|
21
|
-
* @param client - Client to use
|
22
|
-
* @param parameters - {@link SignTypedDataParameters}
|
23
|
-
* @returns The signed data. {@link SignTypedDataReturnType}
|
24
|
-
*
|
25
|
-
* @example
|
26
|
-
* import { createWalletClient, custom } from 'viem'
|
27
|
-
* import { mainnet } from 'viem/chains'
|
28
|
-
* import { signTypedData } from 'viem/wallet'
|
29
|
-
*
|
30
|
-
* const client = createWalletClient({
|
31
|
-
* chain: mainnet,
|
32
|
-
* transport: custom(window.ethereum),
|
33
|
-
* })
|
34
|
-
* const signature = await signTypedData(client, {
|
35
|
-
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
36
|
-
* domain: {
|
37
|
-
* name: 'Ether Mail',
|
38
|
-
* version: '1',
|
39
|
-
* chainId: 1,
|
40
|
-
* verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
|
41
|
-
* },
|
42
|
-
* types: {
|
43
|
-
* Person: [
|
44
|
-
* { name: 'name', type: 'string' },
|
45
|
-
* { name: 'wallet', type: 'address' },
|
46
|
-
* ],
|
47
|
-
* Mail: [
|
48
|
-
* { name: 'from', type: 'Person' },
|
49
|
-
* { name: 'to', type: 'Person' },
|
50
|
-
* { name: 'contents', type: 'string' },
|
51
|
-
* ],
|
52
|
-
* },
|
53
|
-
* primaryType: 'Mail',
|
54
|
-
* message: {
|
55
|
-
* from: {
|
56
|
-
* name: 'Cow',
|
57
|
-
* wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
|
58
|
-
* },
|
59
|
-
* to: {
|
60
|
-
* name: 'Bob',
|
61
|
-
* wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
|
62
|
-
* },
|
63
|
-
* contents: 'Hello, Bob!',
|
64
|
-
* },
|
65
|
-
* })
|
66
|
-
*
|
67
|
-
* @example
|
68
|
-
* // Account Hoisting
|
69
|
-
* import { createWalletClient, http } from 'viem'
|
70
|
-
* import { privateKeyToAccount } from 'viem/accounts'
|
71
|
-
* import { mainnet } from 'viem/chains'
|
72
|
-
* import { signTypedData } from 'viem/wallet'
|
73
|
-
*
|
74
|
-
* const client = createWalletClient({
|
75
|
-
* account: privateKeyToAccount('0x…'),
|
76
|
-
* chain: mainnet,
|
77
|
-
* transport: http(),
|
78
|
-
* })
|
79
|
-
* const signature = await signTypedData(client, {
|
80
|
-
* domain: {
|
81
|
-
* name: 'Ether Mail',
|
82
|
-
* version: '1',
|
83
|
-
* chainId: 1,
|
84
|
-
* verifyingContract: '0xCcCCccccCCCCcCCCCCCcCcCccCcCCCcCcccccccC',
|
85
|
-
* },
|
86
|
-
* types: {
|
87
|
-
* Person: [
|
88
|
-
* { name: 'name', type: 'string' },
|
89
|
-
* { name: 'wallet', type: 'address' },
|
90
|
-
* ],
|
91
|
-
* Mail: [
|
92
|
-
* { name: 'from', type: 'Person' },
|
93
|
-
* { name: 'to', type: 'Person' },
|
94
|
-
* { name: 'contents', type: 'string' },
|
95
|
-
* ],
|
96
|
-
* },
|
97
|
-
* primaryType: 'Mail',
|
98
|
-
* message: {
|
99
|
-
* from: {
|
100
|
-
* name: 'Cow',
|
101
|
-
* wallet: '0xCD2a3d9F938E13CD947Ec05AbC7FE734Df8DD826',
|
102
|
-
* },
|
103
|
-
* to: {
|
104
|
-
* name: 'Bob',
|
105
|
-
* wallet: '0xbBbBBBBbbBBBbbbBbbBbbbbBBbBbbbbBbBbbBBbB',
|
106
|
-
* },
|
107
|
-
* contents: 'Hello, Bob!',
|
108
|
-
* },
|
109
|
-
* })
|
110
|
-
*/
|
111
|
-
export declare function signTypedData<const TTypedData extends TypedData | {
|
112
|
-
[key: string]: unknown;
|
113
|
-
}, TPrimaryType extends string, TChain extends Chain | undefined, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>, { account: account_, domain, message, primaryType, types: types_, }: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>): Promise<SignTypedDataReturnType>;
|
114
|
-
//# sourceMappingURL=signTypedData.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"signTypedData.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/signTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAExC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAE5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAKnE,MAAM,MAAM,uBAAuB,CACjC,UAAU,SAAS,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAAG,SAAS,EACrE,YAAY,SAAS,MAAM,GAAG,MAAM,EACpC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,IAC9C,mBAAmB,CAAC,QAAQ,CAAC,GAC/B,mBAAmB,CAAC,UAAU,EAAE,YAAY,CAAC,CAAA;AAE/C,MAAM,MAAM,uBAAuB,GAAG,GAAG,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiGG;AACH,wBAAsB,aAAa,CACjC,KAAK,CAAC,UAAU,SAAS,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,EAC/D,YAAY,SAAS,MAAM,EAC3B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,EACE,OAAO,EAAE,QAAyB,EAClC,MAAM,EACN,OAAO,EACP,WAAW,EACX,KAAK,EAAE,MAAM,GACd,EAAE,uBAAuB,CAAC,UAAU,EAAE,YAAY,EAAE,QAAQ,CAAC,GAC7D,OAAO,CAAC,uBAAuB,CAAC,CAiDlC"}
|
@@ -1,30 +0,0 @@
|
|
1
|
-
import type { Account } from '../../accounts/types.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { Chain } from '../../types/chain.js';
|
5
|
-
export type SwitchChainParameters = {
|
6
|
-
/** ID of Chain to switch to */
|
7
|
-
id: Chain['id'];
|
8
|
-
};
|
9
|
-
/**
|
10
|
-
* Switch the target chain in a wallet.
|
11
|
-
*
|
12
|
-
* - Docs: https://viem.sh/docs/actions/wallet/switchChain.html
|
13
|
-
* - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-3326)
|
14
|
-
*
|
15
|
-
* @param client - Client to use
|
16
|
-
* @param parameters - {@link SwitchChainParameters}
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
* import { createWalletClient, custom } from 'viem'
|
20
|
-
* import { mainnet, optimism } from 'viem/chains'
|
21
|
-
* import { switchChain } from 'viem/wallet'
|
22
|
-
*
|
23
|
-
* const client = createWalletClient({
|
24
|
-
* chain: mainnet,
|
25
|
-
* transport: custom(window.ethereum),
|
26
|
-
* })
|
27
|
-
* await switchChain(client, { id: optimism.id })
|
28
|
-
*/
|
29
|
-
export declare function switchChain<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>, { id }: SwitchChainParameters): Promise<void>;
|
30
|
-
//# sourceMappingURL=switchChain.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"switchChain.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/switchChain.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,qBAAqB,GAAG;IAClC,+BAA+B;IAC/B,EAAE,EAAE,KAAK,CAAC,IAAI,CAAC,CAAA;CAChB,CAAA;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAChD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,qBAAqB,iBAS3E"}
|
@@ -1,37 +0,0 @@
|
|
1
|
-
import type { Account } from '../../accounts/types.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { Chain } from '../../types/chain.js';
|
5
|
-
import type { WatchAssetParams } from '../../types/eip1193.js';
|
6
|
-
export type WatchAssetParameters = WatchAssetParams;
|
7
|
-
export type WatchAssetReturnType = boolean;
|
8
|
-
/**
|
9
|
-
* Adds an EVM chain to the wallet.
|
10
|
-
*
|
11
|
-
* - Docs: https://viem.sh/docs/actions/wallet/watchAsset.html
|
12
|
-
* - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747)
|
13
|
-
*
|
14
|
-
* @param client - Client to use
|
15
|
-
* @param parameters - {@link WatchAssetParameters}
|
16
|
-
* @returns Boolean indicating if the token was successfully added. {@link WatchAssetReturnType}
|
17
|
-
*
|
18
|
-
* @example
|
19
|
-
* import { createWalletClient, custom } from 'viem'
|
20
|
-
* import { mainnet } from 'viem/chains'
|
21
|
-
* import { watchAsset } from 'viem/wallet'
|
22
|
-
*
|
23
|
-
* const client = createWalletClient({
|
24
|
-
* chain: mainnet,
|
25
|
-
* transport: custom(window.ethereum),
|
26
|
-
* })
|
27
|
-
* const success = await watchAsset(client, {
|
28
|
-
* type: 'ERC20',
|
29
|
-
* options: {
|
30
|
-
* address: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
31
|
-
* decimals: 18,
|
32
|
-
* symbol: 'WETH',
|
33
|
-
* },
|
34
|
-
* })
|
35
|
-
*/
|
36
|
-
export declare function watchAsset<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>, params: WatchAssetParameters): Promise<WatchAssetReturnType>;
|
37
|
-
//# sourceMappingURL=watchAsset.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"watchAsset.d.ts","sourceRoot":"","sources":["../../../../src/actions/wallet/watchAsset.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAE9D,MAAM,MAAM,oBAAoB,GAAG,gBAAgB,CAAA;AACnD,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,wBAAsB,UAAU,CAC9B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,MAAM,EAAE,oBAAoB,GAC3B,OAAO,CAAC,oBAAoB,CAAC,CAM/B"}
|