viem 0.3.0 → 0.3.2
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/dist/cjs/actions/ens/getEnsAddress.js.map +1 -1
- package/dist/cjs/actions/ens/getEnsAvatar.js.map +1 -1
- package/dist/cjs/actions/ens/getEnsName.js.map +1 -1
- package/dist/cjs/actions/ens/getEnsResolver.js.map +1 -1
- package/dist/cjs/actions/ens/getEnsText.js.map +1 -1
- package/dist/cjs/actions/getContract.js.map +1 -1
- package/dist/cjs/actions/public/estimateContractGas.js.map +1 -1
- package/dist/cjs/actions/public/getBalance.js.map +1 -1
- package/dist/cjs/actions/public/getFilterChanges.js.map +1 -1
- package/dist/cjs/actions/public/getFilterLogs.js.map +1 -1
- package/dist/cjs/actions/public/getLogs.js.map +1 -1
- package/dist/cjs/actions/public/readContract.js.map +1 -1
- package/dist/cjs/actions/public/simulateContract.js.map +1 -1
- package/dist/cjs/actions/public/uninstallFilter.js.map +1 -1
- package/dist/cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/dist/cjs/actions/public/watchContractEvent.js.map +1 -1
- package/dist/cjs/actions/public/watchEvent.js.map +1 -1
- package/dist/cjs/actions/public/watchPendingTransactions.js.map +1 -1
- package/dist/cjs/actions/test/dropTransaction.js.map +1 -1
- package/dist/cjs/actions/test/getAutomine.js.map +1 -1
- package/dist/cjs/actions/test/getTxpoolContent.js.map +1 -1
- package/dist/cjs/actions/test/getTxpoolStatus.js.map +1 -1
- package/dist/cjs/actions/test/impersonateAccount.js.map +1 -1
- package/dist/cjs/actions/test/increaseTime.js.map +1 -1
- package/dist/cjs/actions/test/inspectTxpool.js.map +1 -1
- package/dist/cjs/actions/test/mine.js.map +1 -1
- package/dist/cjs/actions/test/removeBlockTimestampInterval.js.map +1 -1
- package/dist/cjs/actions/test/reset.js.map +1 -1
- package/dist/cjs/actions/test/revert.js.map +1 -1
- package/dist/cjs/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/dist/cjs/actions/test/setAutomine.js.map +1 -1
- package/dist/cjs/actions/test/setBalance.js.map +1 -1
- package/dist/cjs/actions/test/setBlockGasLimit.js.map +1 -1
- package/dist/cjs/actions/test/setBlockTimestampInterval.js.map +1 -1
- package/dist/cjs/actions/test/setCode.js.map +1 -1
- package/dist/cjs/actions/test/setCoinbase.js.map +1 -1
- package/dist/cjs/actions/test/setIntervalMining.js.map +1 -1
- package/dist/cjs/actions/test/setLoggingEnabled.js.map +1 -1
- package/dist/cjs/actions/test/setMinGasPrice.js.map +1 -1
- package/dist/cjs/actions/test/setNextBlockBaseFeePerGas.js.map +1 -1
- package/dist/cjs/actions/test/setNextBlockTimestamp.js.map +1 -1
- package/dist/cjs/actions/test/setNonce.js.map +1 -1
- package/dist/cjs/actions/test/setRpcUrl.js.map +1 -1
- package/dist/cjs/actions/test/setStorageAt.js.map +1 -1
- package/dist/cjs/actions/test/snapshot.js.map +1 -1
- package/dist/cjs/actions/test/stopImpersonatingAccount.js.map +1 -1
- package/dist/cjs/actions/wallet/addChain.js.map +1 -1
- package/dist/cjs/actions/wallet/getAddresses.js.map +1 -1
- package/dist/cjs/actions/wallet/getPermissions.js.map +1 -1
- package/dist/cjs/actions/wallet/requestAddresses.js.map +1 -1
- package/dist/cjs/actions/wallet/requestPermissions.js.map +1 -1
- package/dist/cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/dist/cjs/actions/wallet/signMessage.js.map +1 -1
- package/dist/cjs/actions/wallet/signTypedData.js.map +1 -1
- package/dist/cjs/actions/wallet/switchChain.js.map +1 -1
- package/dist/cjs/actions/wallet/watchAsset.js.map +1 -1
- package/dist/cjs/actions/wallet/writeContract.js.map +1 -1
- package/dist/cjs/clients/createPublicClient.js.map +1 -1
- package/dist/cjs/clients/createTestClient.js.map +1 -1
- package/dist/cjs/clients/createWalletClient.js.map +1 -1
- package/dist/cjs/clients/decorators/test.js.map +1 -1
- package/dist/cjs/clients/decorators/wallet.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/index.js +2 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/abi/getAbiItem.js.map +1 -1
- package/dist/cjs/utils/index.js +2 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/rpc.js +3 -6
- package/dist/cjs/utils/rpc.js.map +1 -1
- package/dist/cjs/utils/signature/index.js +3 -1
- package/dist/cjs/utils/signature/index.js.map +1 -1
- package/dist/cjs/utils/signature/recoverAddress.js +2 -11
- package/dist/cjs/utils/signature/recoverAddress.js.map +1 -1
- package/dist/cjs/utils/signature/recoverPublicKey.js +18 -0
- package/dist/cjs/utils/signature/recoverPublicKey.js.map +1 -0
- package/dist/esm/actions/ens/getEnsAddress.js.map +1 -1
- package/dist/esm/actions/ens/getEnsAvatar.js.map +1 -1
- package/dist/esm/actions/ens/getEnsName.js.map +1 -1
- package/dist/esm/actions/ens/getEnsResolver.js.map +1 -1
- package/dist/esm/actions/ens/getEnsText.js.map +1 -1
- package/dist/esm/actions/getContract.js.map +1 -1
- package/dist/esm/actions/public/estimateContractGas.js.map +1 -1
- package/dist/esm/actions/public/getBalance.js.map +1 -1
- package/dist/esm/actions/public/getFilterChanges.js.map +1 -1
- package/dist/esm/actions/public/getFilterLogs.js.map +1 -1
- package/dist/esm/actions/public/getLogs.js.map +1 -1
- package/dist/esm/actions/public/readContract.js.map +1 -1
- package/dist/esm/actions/public/simulateContract.js.map +1 -1
- package/dist/esm/actions/public/uninstallFilter.js.map +1 -1
- package/dist/esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/public/watchContractEvent.js.map +1 -1
- package/dist/esm/actions/public/watchEvent.js.map +1 -1
- package/dist/esm/actions/public/watchPendingTransactions.js.map +1 -1
- package/dist/esm/actions/test/dropTransaction.js.map +1 -1
- package/dist/esm/actions/test/getAutomine.js.map +1 -1
- package/dist/esm/actions/test/getTxpoolContent.js.map +1 -1
- package/dist/esm/actions/test/getTxpoolStatus.js.map +1 -1
- package/dist/esm/actions/test/impersonateAccount.js.map +1 -1
- package/dist/esm/actions/test/increaseTime.js.map +1 -1
- package/dist/esm/actions/test/inspectTxpool.js.map +1 -1
- package/dist/esm/actions/test/mine.js.map +1 -1
- package/dist/esm/actions/test/removeBlockTimestampInterval.js.map +1 -1
- package/dist/esm/actions/test/reset.js.map +1 -1
- package/dist/esm/actions/test/revert.js.map +1 -1
- package/dist/esm/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/dist/esm/actions/test/setAutomine.js.map +1 -1
- package/dist/esm/actions/test/setBalance.js.map +1 -1
- package/dist/esm/actions/test/setBlockGasLimit.js.map +1 -1
- package/dist/esm/actions/test/setBlockTimestampInterval.js.map +1 -1
- package/dist/esm/actions/test/setCode.js.map +1 -1
- package/dist/esm/actions/test/setCoinbase.js.map +1 -1
- package/dist/esm/actions/test/setIntervalMining.js.map +1 -1
- package/dist/esm/actions/test/setLoggingEnabled.js.map +1 -1
- package/dist/esm/actions/test/setMinGasPrice.js.map +1 -1
- package/dist/esm/actions/test/setNextBlockBaseFeePerGas.js.map +1 -1
- package/dist/esm/actions/test/setNextBlockTimestamp.js.map +1 -1
- package/dist/esm/actions/test/setNonce.js.map +1 -1
- package/dist/esm/actions/test/setRpcUrl.js.map +1 -1
- package/dist/esm/actions/test/setStorageAt.js.map +1 -1
- package/dist/esm/actions/test/snapshot.js.map +1 -1
- package/dist/esm/actions/test/stopImpersonatingAccount.js.map +1 -1
- package/dist/esm/actions/wallet/addChain.js.map +1 -1
- package/dist/esm/actions/wallet/getAddresses.js.map +1 -1
- package/dist/esm/actions/wallet/getPermissions.js.map +1 -1
- package/dist/esm/actions/wallet/requestAddresses.js.map +1 -1
- package/dist/esm/actions/wallet/requestPermissions.js.map +1 -1
- package/dist/esm/actions/wallet/sendTransaction.js.map +1 -1
- package/dist/esm/actions/wallet/signMessage.js.map +1 -1
- package/dist/esm/actions/wallet/signTypedData.js.map +1 -1
- package/dist/esm/actions/wallet/switchChain.js.map +1 -1
- package/dist/esm/actions/wallet/watchAsset.js.map +1 -1
- package/dist/esm/actions/wallet/writeContract.js.map +1 -1
- package/dist/esm/clients/createPublicClient.js.map +1 -1
- package/dist/esm/clients/createTestClient.js.map +1 -1
- package/dist/esm/clients/createWalletClient.js.map +1 -1
- package/dist/esm/clients/decorators/test.js.map +1 -1
- package/dist/esm/clients/decorators/wallet.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/index.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/abi/getAbiItem.js.map +1 -1
- package/dist/esm/utils/index.js +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/rpc.js +1 -1
- package/dist/esm/utils/rpc.js.map +1 -1
- package/dist/esm/utils/signature/index.js +1 -0
- package/dist/esm/utils/signature/index.js.map +1 -1
- package/dist/esm/utils/signature/recoverAddress.js +2 -11
- package/dist/esm/utils/signature/recoverAddress.js.map +1 -1
- package/dist/esm/utils/signature/recoverPublicKey.js +14 -0
- package/dist/esm/utils/signature/recoverPublicKey.js.map +1 -0
- package/dist/types/actions/ens/getEnsAddress.d.ts +0 -1
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsAvatar.d.ts +0 -1
- package/dist/types/actions/ens/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsName.d.ts +0 -1
- package/dist/types/actions/ens/getEnsName.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsResolver.d.ts +0 -1
- package/dist/types/actions/ens/getEnsResolver.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsText.d.ts +0 -1
- package/dist/types/actions/ens/getEnsText.d.ts.map +1 -1
- package/dist/types/actions/getContract.d.ts +104 -2
- package/dist/types/actions/getContract.d.ts.map +1 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +0 -1
- package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -1
- package/dist/types/actions/public/getBalance.d.ts +0 -1
- package/dist/types/actions/public/getBalance.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +0 -1
- package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterLogs.d.ts +0 -1
- package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/dist/types/actions/public/getLogs.d.ts +2 -2
- package/dist/types/actions/public/getLogs.d.ts.map +1 -1
- package/dist/types/actions/public/readContract.d.ts +2 -3
- package/dist/types/actions/public/readContract.d.ts.map +1 -1
- package/dist/types/actions/public/simulateContract.d.ts +1 -2
- package/dist/types/actions/public/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/public/uninstallFilter.d.ts +0 -1
- package/dist/types/actions/public/uninstallFilter.d.ts.map +1 -1
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts +0 -1
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/public/watchContractEvent.d.ts +0 -1
- package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/public/watchEvent.d.ts +0 -1
- package/dist/types/actions/public/watchEvent.d.ts.map +1 -1
- package/dist/types/actions/public/watchPendingTransactions.d.ts +0 -1
- package/dist/types/actions/public/watchPendingTransactions.d.ts.map +1 -1
- package/dist/types/actions/test/dropTransaction.d.ts +22 -0
- package/dist/types/actions/test/dropTransaction.d.ts.map +1 -1
- package/dist/types/actions/test/getAutomine.d.ts +20 -0
- package/dist/types/actions/test/getAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/getTxpoolContent.d.ts +22 -0
- package/dist/types/actions/test/getTxpoolContent.d.ts.map +1 -1
- package/dist/types/actions/test/getTxpoolStatus.d.ts +20 -0
- package/dist/types/actions/test/getTxpoolStatus.d.ts.map +1 -1
- package/dist/types/actions/test/impersonateAccount.d.ts +22 -0
- package/dist/types/actions/test/impersonateAccount.d.ts.map +1 -1
- package/dist/types/actions/test/increaseTime.d.ts +22 -0
- package/dist/types/actions/test/increaseTime.d.ts.map +1 -1
- package/dist/types/actions/test/inspectTxpool.d.ts +20 -0
- package/dist/types/actions/test/inspectTxpool.d.ts.map +1 -1
- package/dist/types/actions/test/mine.d.ts +20 -0
- package/dist/types/actions/test/mine.d.ts.map +1 -1
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts +19 -0
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts.map +1 -1
- package/dist/types/actions/test/reset.d.ts +20 -0
- package/dist/types/actions/test/reset.d.ts.map +1 -1
- package/dist/types/actions/test/revert.d.ts +20 -0
- package/dist/types/actions/test/revert.d.ts.map +1 -1
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +25 -0
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
- package/dist/types/actions/test/setAutomine.d.ts +19 -0
- package/dist/types/actions/test/setAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/setBalance.d.ts +23 -0
- package/dist/types/actions/test/setBalance.d.ts.map +1 -1
- package/dist/types/actions/test/setBlockGasLimit.d.ts +20 -0
- package/dist/types/actions/test/setBlockGasLimit.d.ts.map +1 -1
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts +20 -0
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts.map +1 -1
- package/dist/types/actions/test/setCode.d.ts +23 -0
- package/dist/types/actions/test/setCode.d.ts.map +1 -1
- package/dist/types/actions/test/setCoinbase.d.ts +22 -0
- package/dist/types/actions/test/setCoinbase.d.ts.map +1 -1
- package/dist/types/actions/test/setIntervalMining.d.ts +20 -0
- package/dist/types/actions/test/setIntervalMining.d.ts.map +1 -1
- package/dist/types/actions/test/setLoggingEnabled.d.ts +19 -0
- package/dist/types/actions/test/setLoggingEnabled.d.ts.map +1 -1
- package/dist/types/actions/test/setMinGasPrice.d.ts +24 -0
- package/dist/types/actions/test/setMinGasPrice.d.ts.map +1 -1
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts +22 -0
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +1 -1
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts +20 -0
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts.map +1 -1
- package/dist/types/actions/test/setNonce.d.ts +23 -0
- package/dist/types/actions/test/setNonce.d.ts.map +1 -1
- package/dist/types/actions/test/setRpcUrl.d.ts +20 -0
- package/dist/types/actions/test/setRpcUrl.d.ts.map +1 -1
- package/dist/types/actions/test/setStorageAt.d.ts +24 -0
- package/dist/types/actions/test/setStorageAt.d.ts.map +1 -1
- package/dist/types/actions/test/snapshot.d.ts +19 -0
- package/dist/types/actions/test/snapshot.d.ts.map +1 -1
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts +22 -0
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts.map +1 -1
- package/dist/types/actions/wallet/addChain.d.ts +20 -0
- package/dist/types/actions/wallet/addChain.d.ts.map +1 -1
- package/dist/types/actions/wallet/deployContract.d.ts +1 -1
- package/dist/types/actions/wallet/getAddresses.d.ts +20 -0
- package/dist/types/actions/wallet/getAddresses.d.ts.map +1 -1
- package/dist/types/actions/wallet/getPermissions.d.ts +20 -0
- package/dist/types/actions/wallet/getPermissions.d.ts.map +1 -1
- package/dist/types/actions/wallet/requestAddresses.d.ts +24 -0
- package/dist/types/actions/wallet/requestAddresses.d.ts.map +1 -1
- package/dist/types/actions/wallet/requestPermissions.d.ts +26 -3
- package/dist/types/actions/wallet/requestPermissions.d.ts.map +1 -1
- package/dist/types/actions/wallet/sendTransaction.d.ts +45 -0
- package/dist/types/actions/wallet/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/wallet/signMessage.d.ts +46 -0
- package/dist/types/actions/wallet/signMessage.d.ts.map +1 -1
- package/dist/types/actions/wallet/signTypedData.d.ts +98 -0
- package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/wallet/switchChain.d.ts +21 -0
- package/dist/types/actions/wallet/switchChain.d.ts.map +1 -1
- package/dist/types/actions/wallet/watchAsset.d.ts +28 -0
- package/dist/types/actions/wallet/watchAsset.d.ts.map +1 -1
- package/dist/types/actions/wallet/writeContract.d.ts +50 -0
- package/dist/types/actions/wallet/writeContract.d.ts.map +1 -1
- package/dist/types/clients/createPublicClient.d.ts +17 -1
- package/dist/types/clients/createPublicClient.d.ts.map +1 -1
- package/dist/types/clients/createTestClient.d.ts +20 -0
- package/dist/types/clients/createTestClient.d.ts.map +1 -1
- package/dist/types/clients/createWalletClient.d.ts +34 -1
- package/dist/types/clients/createWalletClient.d.ts.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +37 -37
- package/dist/types/clients/decorators/test.d.ts +536 -0
- package/dist/types/clients/decorators/test.d.ts.map +1 -1
- package/dist/types/clients/decorators/wallet.d.ts +389 -2
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/utils/abi/getAbiItem.d.ts +1 -1
- package/dist/types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +2 -2
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/rpc.d.ts +1 -1
- package/dist/types/utils/rpc.d.ts.map +1 -1
- package/dist/types/utils/signature/index.d.ts +2 -0
- package/dist/types/utils/signature/index.d.ts.map +1 -1
- package/dist/types/utils/signature/recoverAddress.d.ts.map +1 -1
- package/dist/types/utils/signature/recoverPublicKey.d.ts +8 -0
- package/dist/types/utils/signature/recoverPublicKey.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/actions/ens/getEnsAddress.ts +0 -1
- package/src/actions/ens/getEnsAvatar.ts +0 -1
- package/src/actions/ens/getEnsName.ts +0 -1
- package/src/actions/ens/getEnsResolver.ts +0 -1
- package/src/actions/ens/getEnsText.ts +0 -1
- package/src/actions/getContract.ts +104 -2
- package/src/actions/public/estimateContractGas.ts +0 -1
- package/src/actions/public/getBalance.ts +0 -1
- package/src/actions/public/getFilterChanges.ts +0 -1
- package/src/actions/public/getFilterLogs.ts +0 -1
- package/src/actions/public/getLogs.ts +3 -3
- package/src/actions/public/readContract.ts +2 -3
- package/src/actions/public/simulateContract.ts +1 -2
- package/src/actions/public/uninstallFilter.ts +0 -1
- package/src/actions/public/waitForTransactionReceipt.ts +0 -1
- package/src/actions/public/watchContractEvent.ts +0 -1
- package/src/actions/public/watchEvent.ts +0 -1
- package/src/actions/public/watchPendingTransactions.ts +0 -1
- package/src/actions/test/dropTransaction.ts +22 -0
- package/src/actions/test/getAutomine.ts +20 -0
- package/src/actions/test/getTxpoolContent.ts +22 -0
- package/src/actions/test/getTxpoolStatus.ts +20 -0
- package/src/actions/test/impersonateAccount.ts +22 -0
- package/src/actions/test/increaseTime.ts +22 -0
- package/src/actions/test/inspectTxpool.ts +20 -0
- package/src/actions/test/mine.ts +20 -0
- package/src/actions/test/removeBlockTimestampInterval.ts +19 -0
- package/src/actions/test/reset.ts +20 -0
- package/src/actions/test/revert.ts +20 -0
- package/src/actions/test/sendUnsignedTransaction.ts +25 -0
- package/src/actions/test/setAutomine.ts +19 -0
- package/src/actions/test/setBalance.ts +23 -0
- package/src/actions/test/setBlockGasLimit.ts +20 -0
- package/src/actions/test/setBlockTimestampInterval.ts +20 -0
- package/src/actions/test/setCode.ts +23 -0
- package/src/actions/test/setCoinbase.ts +22 -0
- package/src/actions/test/setIntervalMining.ts +20 -0
- package/src/actions/test/setLoggingEnabled.ts +19 -0
- package/src/actions/test/setMinGasPrice.ts +24 -0
- package/src/actions/test/setNextBlockBaseFeePerGas.ts +22 -0
- package/src/actions/test/setNextBlockTimestamp.ts +20 -0
- package/src/actions/test/setNonce.ts +23 -0
- package/src/actions/test/setRpcUrl.ts +20 -0
- package/src/actions/test/setStorageAt.ts +24 -0
- package/src/actions/test/snapshot.ts +19 -0
- package/src/actions/test/stopImpersonatingAccount.ts +22 -0
- package/src/actions/wallet/addChain.ts +20 -0
- package/src/actions/wallet/deployContract.ts +1 -1
- package/src/actions/wallet/getAddresses.ts +20 -0
- package/src/actions/wallet/getPermissions.ts +20 -0
- package/src/actions/wallet/requestAddresses.ts +24 -0
- package/src/actions/wallet/requestPermissions.ts +31 -6
- package/src/actions/wallet/sendTransaction.ts +45 -0
- package/src/actions/wallet/signMessage.ts +46 -0
- package/src/actions/wallet/signTypedData.ts +98 -0
- package/src/actions/wallet/switchChain.ts +24 -1
- package/src/actions/wallet/watchAsset.ts +28 -0
- package/src/actions/wallet/writeContract.ts +50 -0
- package/src/clients/createPublicClient.ts +17 -1
- package/src/clients/createTestClient.ts +20 -0
- package/src/clients/createWalletClient.ts +34 -1
- package/src/clients/decorators/public.ts +37 -37
- package/src/clients/decorators/test.ts +536 -0
- package/src/clients/decorators/wallet.ts +389 -2
- package/src/errors/version.ts +1 -1
- package/src/index.ts +3 -0
- package/src/utils/abi/getAbiItem.ts +9 -8
- package/src/utils/index.ts +3 -0
- package/src/utils/rpc.ts +2 -2
- package/src/utils/signature/index.ts +6 -0
- package/src/utils/signature/recoverAddress.ts +2 -17
- package/src/utils/signature/recoverPublicKey.ts +30 -0
@@ -3,33 +3,569 @@ import type { Chain, Quantity } from '../../types/index.js';
|
|
3
3
|
import type { TestClient, TestClientMode } from '../createTestClient.js';
|
4
4
|
import type { Transport } from '../transports/index.js';
|
5
5
|
export type TestActions = {
|
6
|
+
/**
|
7
|
+
* Removes a transaction from the mempool.
|
8
|
+
*
|
9
|
+
* - Docs: https://viem.sh/docs/actions/test/dropTransaction.html
|
10
|
+
*
|
11
|
+
* @param args - {@link DropTransactionParameters}
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* import { createTestClient, http } from 'viem'
|
15
|
+
* import { foundry } from 'viem/chains'
|
16
|
+
*
|
17
|
+
* const client = createTestClient({
|
18
|
+
* mode: 'anvil',
|
19
|
+
* chain: 'foundry',
|
20
|
+
* transport: http(),
|
21
|
+
* })
|
22
|
+
* await client.dropTransaction({
|
23
|
+
* hash: '0xe58dceb6b20b03965bb678e27d141e151d7d4efc2334c2d6a49b9fac523f7364'
|
24
|
+
* })
|
25
|
+
*/
|
6
26
|
dropTransaction: (args: DropTransactionParameters) => Promise<void>;
|
27
|
+
/**
|
28
|
+
* Returns the automatic mining status of the node.
|
29
|
+
*
|
30
|
+
* - Docs: https://viem.sh/docs/actions/test/getAutomine.html
|
31
|
+
*
|
32
|
+
* @returns Whether or not the node is auto mining. {@link GetAutomineReturnType}
|
33
|
+
*
|
34
|
+
* @example
|
35
|
+
* import { createTestClient, http } from 'viem'
|
36
|
+
* import { foundry } from 'viem/chains'
|
37
|
+
*
|
38
|
+
* const client = createTestClient({
|
39
|
+
* mode: 'anvil',
|
40
|
+
* chain: 'foundry',
|
41
|
+
* transport: http(),
|
42
|
+
* })
|
43
|
+
* const isAutomining = await client.getAutomine()
|
44
|
+
*/
|
7
45
|
getAutomine: () => Promise<GetAutomineReturnType>;
|
46
|
+
/**
|
47
|
+
* Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
|
48
|
+
*
|
49
|
+
* - Docs: https://viem.sh/docs/actions/test/getTxpoolContent.html
|
50
|
+
*
|
51
|
+
* @returns Transaction pool content. {@link GetTxpoolContentReturnType}
|
52
|
+
*
|
53
|
+
* @example
|
54
|
+
* import { createTestClient, http } from 'viem'
|
55
|
+
* import { foundry } from 'viem/chains'
|
56
|
+
*
|
57
|
+
* const client = createTestClient({
|
58
|
+
* mode: 'anvil',
|
59
|
+
* chain: 'foundry',
|
60
|
+
* transport: http(),
|
61
|
+
* })
|
62
|
+
* const content = await client.getTxpoolContent()
|
63
|
+
*/
|
8
64
|
getTxpoolContent: () => Promise<GetTxpoolContentReturnType>;
|
65
|
+
/**
|
66
|
+
* Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
|
67
|
+
*
|
68
|
+
* - Docs: https://viem.sh/docs/actions/test/getTxpoolStatus.html
|
69
|
+
*
|
70
|
+
* @returns Transaction pool status. {@link GetTxpoolStatusReturnType}
|
71
|
+
*
|
72
|
+
* @example
|
73
|
+
* import { createTestClient, http } from 'viem'
|
74
|
+
* import { foundry } from 'viem/chains'
|
75
|
+
*
|
76
|
+
* const client = createTestClient({
|
77
|
+
* mode: 'anvil',
|
78
|
+
* chain: 'foundry',
|
79
|
+
* transport: http(),
|
80
|
+
* })
|
81
|
+
* const status = await client.getTxpoolStatus()
|
82
|
+
*/
|
9
83
|
getTxpoolStatus: () => Promise<GetTxpoolStatusReturnType>;
|
84
|
+
/**
|
85
|
+
* Impersonate an account or contract address. This lets you send transactions from that account even if you don't have access to its private key.
|
86
|
+
*
|
87
|
+
* - Docs: https://viem.sh/docs/actions/test/impersonateAccount.html
|
88
|
+
*
|
89
|
+
* @param args - {@link ImpersonateAccountParameters}
|
90
|
+
*
|
91
|
+
* @example
|
92
|
+
* import { createTestClient, http } from 'viem'
|
93
|
+
* import { foundry } from 'viem/chains'
|
94
|
+
*
|
95
|
+
* const client = createTestClient({
|
96
|
+
* mode: 'anvil',
|
97
|
+
* chain: 'foundry',
|
98
|
+
* transport: http(),
|
99
|
+
* })
|
100
|
+
* await client.impersonateAccount({
|
101
|
+
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
102
|
+
* })
|
103
|
+
*/
|
10
104
|
impersonateAccount: (args: ImpersonateAccountParameters) => Promise<void>;
|
105
|
+
/**
|
106
|
+
* Jump forward in time by the given amount of time, in seconds.
|
107
|
+
*
|
108
|
+
* - Docs: https://viem.sh/docs/actions/test/increaseTime.html
|
109
|
+
*
|
110
|
+
* @param args – {@link IncreaseTimeParameters}
|
111
|
+
*
|
112
|
+
* @example
|
113
|
+
* import { createTestClient, http } from 'viem'
|
114
|
+
* import { foundry } from 'viem/chains'
|
115
|
+
*
|
116
|
+
* const client = createTestClient({
|
117
|
+
* mode: 'anvil',
|
118
|
+
* chain: 'foundry',
|
119
|
+
* transport: http(),
|
120
|
+
* })
|
121
|
+
* await client.increaseTime({
|
122
|
+
* seconds: 420,
|
123
|
+
* })
|
124
|
+
*/
|
11
125
|
increaseTime: (args: IncreaseTimeParameters) => Promise<Quantity>;
|
126
|
+
/**
|
127
|
+
* Returns a summary of all the transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
|
128
|
+
*
|
129
|
+
* - Docs: https://viem.sh/docs/actions/test/inspectTxpool.html
|
130
|
+
*
|
131
|
+
* @returns Transaction pool inspection data. {@link InspectTxpoolReturnType}
|
132
|
+
*
|
133
|
+
* @example
|
134
|
+
* import { createTestClient, http } from 'viem'
|
135
|
+
* import { foundry } from 'viem/chains'
|
136
|
+
*
|
137
|
+
* const client = createTestClient({
|
138
|
+
* mode: 'anvil',
|
139
|
+
* chain: 'foundry',
|
140
|
+
* transport: http(),
|
141
|
+
* })
|
142
|
+
* const data = await client.inspectTxpool()
|
143
|
+
*/
|
12
144
|
inspectTxpool: () => Promise<InspectTxpoolReturnType>;
|
145
|
+
/**
|
146
|
+
* Mine a specified number of blocks.
|
147
|
+
*
|
148
|
+
* - Docs: https://viem.sh/docs/actions/test/mine.html
|
149
|
+
*
|
150
|
+
* @param client - Client to use
|
151
|
+
* @param args – {@link MineParameters}
|
152
|
+
*
|
153
|
+
* @example
|
154
|
+
* import { createTestClient, http } from 'viem'
|
155
|
+
* import { foundry } from 'viem/chains'
|
156
|
+
*
|
157
|
+
* const client = createTestClient({
|
158
|
+
* mode: 'anvil',
|
159
|
+
* chain: 'foundry',
|
160
|
+
* transport: http(),
|
161
|
+
* })
|
162
|
+
* await client.mine({ blocks: 1 })
|
163
|
+
*/
|
13
164
|
mine: (args: MineParameters) => Promise<void>;
|
165
|
+
/**
|
166
|
+
* Removes [`setBlockTimestampInterval`](https://viem.sh/docs/actions/test/setBlockTimestampInterval.html) if it exists.
|
167
|
+
*
|
168
|
+
* - Docs: https://viem.sh/docs/actions/test/removeBlockTimestampInterval.html
|
169
|
+
*
|
170
|
+
* @example
|
171
|
+
* import { createTestClient, http } from 'viem'
|
172
|
+
* import { foundry } from 'viem/chains'
|
173
|
+
* import { removeBlockTimestampInterval } from 'viem/test'
|
174
|
+
*
|
175
|
+
* const client = createTestClient({
|
176
|
+
* mode: 'anvil',
|
177
|
+
* chain: 'foundry',
|
178
|
+
* transport: http(),
|
179
|
+
* })
|
180
|
+
* await client.removeBlockTimestampInterval()
|
181
|
+
*/
|
14
182
|
removeBlockTimestampInterval: () => Promise<void>;
|
183
|
+
/**
|
184
|
+
* Resets fork back to its original state.
|
185
|
+
*
|
186
|
+
* - Docs: https://viem.sh/docs/actions/test/reset.html
|
187
|
+
*
|
188
|
+
* @param args – {@link ResetParameters}
|
189
|
+
*
|
190
|
+
* @example
|
191
|
+
* import { createTestClient, http } from 'viem'
|
192
|
+
* import { foundry } from 'viem/chains'
|
193
|
+
*
|
194
|
+
* const client = createTestClient({
|
195
|
+
* mode: 'anvil',
|
196
|
+
* chain: 'foundry',
|
197
|
+
* transport: http(),
|
198
|
+
* })
|
199
|
+
* await client.reset({ blockNumber: 69420n })
|
200
|
+
*/
|
15
201
|
reset: (args?: ResetParameters) => Promise<void>;
|
202
|
+
/**
|
203
|
+
* Revert the state of the blockchain at the current block.
|
204
|
+
*
|
205
|
+
* - Docs: https://viem.sh/docs/actions/test/revert.html
|
206
|
+
*
|
207
|
+
* @param args – {@link RevertParameters}
|
208
|
+
*
|
209
|
+
* @example
|
210
|
+
* import { createTestClient, http } from 'viem'
|
211
|
+
* import { foundry } from 'viem/chains'
|
212
|
+
*
|
213
|
+
* const client = createTestClient({
|
214
|
+
* mode: 'anvil',
|
215
|
+
* chain: 'foundry',
|
216
|
+
* transport: http(),
|
217
|
+
* })
|
218
|
+
* await client.revert({ id: '0x…' })
|
219
|
+
*/
|
16
220
|
revert: (args: RevertParameters) => Promise<void>;
|
221
|
+
/**
|
222
|
+
* Returns the details of all transactions currently pending for inclusion in the next block(s), as well as the ones that are being scheduled for future execution only.
|
223
|
+
*
|
224
|
+
* - Docs: https://viem.sh/docs/actions/test/getTxpoolContent.html
|
225
|
+
*
|
226
|
+
* @param args – {@link SendUnsignedTransactionParameters}
|
227
|
+
* @returns The transaction hash. {@link SendUnsignedTransactionReturnType}
|
228
|
+
*
|
229
|
+
* @example
|
230
|
+
* import { createTestClient, http } from 'viem'
|
231
|
+
* import { foundry } from 'viem/chains'
|
232
|
+
*
|
233
|
+
* const client = createTestClient({
|
234
|
+
* mode: 'anvil',
|
235
|
+
* chain: 'foundry',
|
236
|
+
* transport: http(),
|
237
|
+
* })
|
238
|
+
* const hash = await client.sendUnsignedTransaction({
|
239
|
+
* from: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
|
240
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
241
|
+
* value: 1000000000000000000n,
|
242
|
+
* })
|
243
|
+
*/
|
17
244
|
sendUnsignedTransaction: (args: SendUnsignedTransactionParameters) => Promise<SendUnsignedTransactionReturnType>;
|
245
|
+
/**
|
246
|
+
* Enables or disables the automatic mining of new blocks with each new transaction submitted to the network.
|
247
|
+
*
|
248
|
+
* - Docs: https://viem.sh/docs/actions/test/setAutomine.html
|
249
|
+
*
|
250
|
+
* @example
|
251
|
+
* import { createTestClient, http } from 'viem'
|
252
|
+
* import { foundry } from 'viem/chains'
|
253
|
+
*
|
254
|
+
* const client = createTestClient({
|
255
|
+
* mode: 'anvil',
|
256
|
+
* chain: 'foundry',
|
257
|
+
* transport: http(),
|
258
|
+
* })
|
259
|
+
* await client.setAutomine()
|
260
|
+
*/
|
18
261
|
setAutomine: (args: boolean) => Promise<void>;
|
262
|
+
/**
|
263
|
+
* Modifies the balance of an account.
|
264
|
+
*
|
265
|
+
* - Docs: https://viem.sh/docs/actions/test/setBalance.html
|
266
|
+
*
|
267
|
+
* @param args – {@link SetBalanceParameters}
|
268
|
+
*
|
269
|
+
* @example
|
270
|
+
* import { createTestClient, http, parseEther } from 'viem'
|
271
|
+
* import { foundry } from 'viem/chains'
|
272
|
+
*
|
273
|
+
* const client = createTestClient({
|
274
|
+
* mode: 'anvil',
|
275
|
+
* chain: 'foundry',
|
276
|
+
* transport: http(),
|
277
|
+
* })
|
278
|
+
* await client.setBalance({
|
279
|
+
* address: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
280
|
+
* value: parseEther('1'),
|
281
|
+
* })
|
282
|
+
*/
|
19
283
|
setBalance: (args: SetBalanceParameters) => Promise<void>;
|
284
|
+
/**
|
285
|
+
* Sets the block's gas limit.
|
286
|
+
*
|
287
|
+
* - Docs: https://viem.sh/docs/actions/test/setBlockGasLimit.html
|
288
|
+
*
|
289
|
+
* @param args – {@link SetBlockGasLimitParameters}
|
290
|
+
*
|
291
|
+
* @example
|
292
|
+
* import { createTestClient, http } from 'viem'
|
293
|
+
* import { foundry } from 'viem/chains'
|
294
|
+
*
|
295
|
+
* const client = createTestClient({
|
296
|
+
* mode: 'anvil',
|
297
|
+
* chain: 'foundry',
|
298
|
+
* transport: http(),
|
299
|
+
* })
|
300
|
+
* await client.setBlockGasLimit({ gasLimit: 420_000n })
|
301
|
+
*/
|
20
302
|
setBlockGasLimit: (args: SetBlockGasLimitParameters) => Promise<void>;
|
303
|
+
/**
|
304
|
+
* Similar to [`increaseTime`](https://viem.sh/docs/actions/test/increaseTime), but sets a block timestamp `interval`. The timestamp of future blocks will be computed as `lastBlock_timestamp` + `interval`.
|
305
|
+
*
|
306
|
+
* - Docs: https://viem.sh/docs/actions/test/setBlockTimestampInterval.html
|
307
|
+
*
|
308
|
+
* @param args – {@link SetBlockTimestampIntervalParameters}
|
309
|
+
*
|
310
|
+
* @example
|
311
|
+
* import { createTestClient, http } from 'viem'
|
312
|
+
* import { foundry } from 'viem/chains'
|
313
|
+
*
|
314
|
+
* const client = createTestClient({
|
315
|
+
* mode: 'anvil',
|
316
|
+
* chain: 'foundry',
|
317
|
+
* transport: http(),
|
318
|
+
* })
|
319
|
+
* await client.setBlockTimestampInterval({ interval: 5 })
|
320
|
+
*/
|
21
321
|
setBlockTimestampInterval: (args: SetBlockTimestampIntervalParameters) => Promise<void>;
|
322
|
+
/**
|
323
|
+
* Modifies the bytecode stored at an account's address.
|
324
|
+
*
|
325
|
+
* - Docs: https://viem.sh/docs/actions/test/setCode.html
|
326
|
+
*
|
327
|
+
* @param args – {@link SetCodeParameters}
|
328
|
+
*
|
329
|
+
* @example
|
330
|
+
* import { createTestClient, http } from 'viem'
|
331
|
+
* import { foundry } from 'viem/chains'
|
332
|
+
*
|
333
|
+
* const client = createTestClient({
|
334
|
+
* mode: 'anvil',
|
335
|
+
* chain: 'foundry',
|
336
|
+
* transport: http(),
|
337
|
+
* })
|
338
|
+
* await client.setCode({
|
339
|
+
* address: '0xe846c6fcf817734ca4527b28ccb4aea2b6663c79',
|
340
|
+
* bytecode: '0x60806040526000600355600019600955600c80546001600160a01b031916737a250d5630b4cf539739df…',
|
341
|
+
* })
|
342
|
+
*/
|
22
343
|
setCode: (args: SetCodeParameters) => Promise<void>;
|
344
|
+
/**
|
345
|
+
* Sets the coinbase address to be used in new blocks.
|
346
|
+
*
|
347
|
+
* - Docs: https://viem.sh/docs/actions/test/setCoinbase.html
|
348
|
+
*
|
349
|
+
* @param args – {@link SetCoinbaseParameters}
|
350
|
+
*
|
351
|
+
* @example
|
352
|
+
* import { createTestClient, http } from 'viem'
|
353
|
+
* import { foundry } from 'viem/chains'
|
354
|
+
*
|
355
|
+
* const client = createTestClient({
|
356
|
+
* mode: 'anvil',
|
357
|
+
* chain: 'foundry',
|
358
|
+
* transport: http(),
|
359
|
+
* })
|
360
|
+
* await client.setCoinbase({
|
361
|
+
* address: '0xe846c6fcf817734ca4527b28ccb4aea2b6663c79',
|
362
|
+
* })
|
363
|
+
*/
|
23
364
|
setCoinbase: (args: SetCoinbaseParameters) => Promise<void>;
|
365
|
+
/**
|
366
|
+
* Sets the automatic mining interval (in seconds) of blocks. Setting the interval to 0 will disable automatic mining.
|
367
|
+
*
|
368
|
+
* - Docs: https://viem.sh/docs/actions/test/setIntervalMining.html
|
369
|
+
*
|
370
|
+
* @param args – {@link SetIntervalMiningParameters}
|
371
|
+
*
|
372
|
+
* @example
|
373
|
+
* import { createTestClient, http } from 'viem'
|
374
|
+
* import { foundry } from 'viem/chains'
|
375
|
+
*
|
376
|
+
* const client = createTestClient({
|
377
|
+
* mode: 'anvil',
|
378
|
+
* chain: 'foundry',
|
379
|
+
* transport: http(),
|
380
|
+
* })
|
381
|
+
* await client.setIntervalMining({ interval: 5 })
|
382
|
+
*/
|
24
383
|
setIntervalMining: (args: SetIntervalMiningParameters) => Promise<void>;
|
384
|
+
/**
|
385
|
+
* Enable or disable logging on the test node network.
|
386
|
+
*
|
387
|
+
* - Docs: https://viem.sh/docs/actions/test/setLoggingEnabled.html
|
388
|
+
*
|
389
|
+
* @param client - Client to use
|
390
|
+
*
|
391
|
+
* @example
|
392
|
+
* import { createTestClient, http } from 'viem'
|
393
|
+
* import { foundry } from 'viem/chains'
|
394
|
+
*
|
395
|
+
* const client = createTestClient({
|
396
|
+
* mode: 'anvil',
|
397
|
+
* chain: 'foundry',
|
398
|
+
* transport: http(),
|
399
|
+
* })
|
400
|
+
* await client.setLoggingEnabled()
|
401
|
+
*/
|
25
402
|
setLoggingEnabled: (args: boolean) => Promise<void>;
|
403
|
+
/**
|
404
|
+
* Change the minimum gas price accepted by the network (in wei).
|
405
|
+
*
|
406
|
+
* - Docs: https://viem.sh/docs/actions/test/setMinGasPrice.html
|
407
|
+
*
|
408
|
+
* Note: `setMinGasPrice` can only be used on clients that do not have EIP-1559 enabled.
|
409
|
+
*
|
410
|
+
* @param args – {@link SetBlockGasLimitParameters}
|
411
|
+
*
|
412
|
+
* @example
|
413
|
+
* import { createTestClient, http, parseGwei } from 'viem'
|
414
|
+
* import { foundry } from 'viem/chains'
|
415
|
+
*
|
416
|
+
* const client = createTestClient({
|
417
|
+
* mode: 'anvil',
|
418
|
+
* chain: 'foundry',
|
419
|
+
* transport: http(),
|
420
|
+
* })
|
421
|
+
* await client.setMinGasPrice({
|
422
|
+
* gasPrice: parseGwei('20'),
|
423
|
+
* })
|
424
|
+
*/
|
26
425
|
setMinGasPrice: (args: SetMinGasPriceParameters) => Promise<void>;
|
426
|
+
/**
|
427
|
+
* Sets the next block's base fee per gas.
|
428
|
+
*
|
429
|
+
* - Docs: https://viem.sh/docs/actions/test/setNextBlockBaseFeePerGas.html
|
430
|
+
*
|
431
|
+
* @param args – {@link SetNextBlockBaseFeePerGasParameters}
|
432
|
+
*
|
433
|
+
* @example
|
434
|
+
* import { createTestClient, http, parseGwei } from 'viem'
|
435
|
+
* import { foundry } from 'viem/chains'
|
436
|
+
*
|
437
|
+
* const client = createTestClient({
|
438
|
+
* mode: 'anvil',
|
439
|
+
* chain: 'foundry',
|
440
|
+
* transport: http(),
|
441
|
+
* })
|
442
|
+
* await client.setNextBlockBaseFeePerGas({
|
443
|
+
* baseFeePerGas: parseGwei('20'),
|
444
|
+
* })
|
445
|
+
*/
|
27
446
|
setNextBlockBaseFeePerGas: (args: SetNextBlockBaseFeePerGasParameters) => Promise<void>;
|
447
|
+
/**
|
448
|
+
* Sets the next block's timestamp.
|
449
|
+
*
|
450
|
+
* - Docs: https://viem.sh/docs/actions/test/setNextBlockTimestamp.html
|
451
|
+
*
|
452
|
+
* @param args – {@link SetNextBlockTimestampParameters}
|
453
|
+
*
|
454
|
+
* @example
|
455
|
+
* import { createTestClient, http } from 'viem'
|
456
|
+
* import { foundry } from 'viem/chains'
|
457
|
+
*
|
458
|
+
* const client = createTestClient({
|
459
|
+
* mode: 'anvil',
|
460
|
+
* chain: 'foundry',
|
461
|
+
* transport: http(),
|
462
|
+
* })
|
463
|
+
* await client.setNextBlockTimestamp({ timestamp: 1671744314n })
|
464
|
+
*/
|
28
465
|
setNextBlockTimestamp: (args: SetNextBlockTimestampParameters) => Promise<void>;
|
466
|
+
/**
|
467
|
+
* Modifies (overrides) the nonce of an account.
|
468
|
+
*
|
469
|
+
* - Docs: https://viem.sh/docs/actions/test/setNonce.html
|
470
|
+
*
|
471
|
+
* @param args – {@link SetNonceParameters}
|
472
|
+
*
|
473
|
+
* @example
|
474
|
+
* import { createTestClient, http } from 'viem'
|
475
|
+
* import { foundry } from 'viem/chains'
|
476
|
+
*
|
477
|
+
* const client = createTestClient({
|
478
|
+
* mode: 'anvil',
|
479
|
+
* chain: 'foundry',
|
480
|
+
* transport: http(),
|
481
|
+
* })
|
482
|
+
* await client.setNonce({
|
483
|
+
* address: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
484
|
+
* nonce: 420,
|
485
|
+
* })
|
486
|
+
*/
|
29
487
|
setNonce: (args: SetNonceParameters) => Promise<void>;
|
488
|
+
/**
|
489
|
+
* Sets the backend RPC URL.
|
490
|
+
*
|
491
|
+
* - Docs: https://viem.sh/docs/actions/test/setRpcUrl.html
|
492
|
+
*
|
493
|
+
* @param jsonRpcUrl – RPC URL
|
494
|
+
*
|
495
|
+
* @example
|
496
|
+
* import { createTestClient, http } from 'viem'
|
497
|
+
* import { foundry } from 'viem/chains'
|
498
|
+
*
|
499
|
+
* const client = createTestClient({
|
500
|
+
* mode: 'anvil',
|
501
|
+
* chain: 'foundry',
|
502
|
+
* transport: http(),
|
503
|
+
* })
|
504
|
+
* await client.setRpcUrl('https://eth-mainnet.g.alchemy.com/v2')
|
505
|
+
*/
|
30
506
|
setRpcUrl: (args: string) => Promise<void>;
|
507
|
+
/**
|
508
|
+
* Writes to a slot of an account's storage.
|
509
|
+
*
|
510
|
+
* - Docs: https://viem.sh/docs/actions/test/setStorageAt.html
|
511
|
+
*
|
512
|
+
* @param args – {@link SetStorageAtParameters}
|
513
|
+
*
|
514
|
+
* @example
|
515
|
+
* import { createTestClient, http } from 'viem'
|
516
|
+
* import { foundry } from 'viem/chains'
|
517
|
+
*
|
518
|
+
* const client = createTestClient({
|
519
|
+
* mode: 'anvil',
|
520
|
+
* chain: 'foundry',
|
521
|
+
* transport: http(),
|
522
|
+
* })
|
523
|
+
* await client.setStorageAt({
|
524
|
+
* address: '0xe846c6fcf817734ca4527b28ccb4aea2b6663c79',
|
525
|
+
* index: 2,
|
526
|
+
* value: '0x0000000000000000000000000000000000000000000000000000000000000069',
|
527
|
+
* })
|
528
|
+
*/
|
31
529
|
setStorageAt: (args: SetStorageAtParameters) => Promise<void>;
|
530
|
+
/**
|
531
|
+
* Snapshot the state of the blockchain at the current block.
|
532
|
+
*
|
533
|
+
* - Docs: https://viem.sh/docs/actions/test/snapshot.html
|
534
|
+
*
|
535
|
+
* @example
|
536
|
+
* import { createTestClient, http } from 'viem'
|
537
|
+
* import { foundry } from 'viem/chains'
|
538
|
+
* import { snapshot } from 'viem/test'
|
539
|
+
*
|
540
|
+
* const client = createTestClient({
|
541
|
+
* mode: 'anvil',
|
542
|
+
* chain: 'foundry',
|
543
|
+
* transport: http(),
|
544
|
+
* })
|
545
|
+
* await client.snapshot()
|
546
|
+
*/
|
32
547
|
snapshot: () => Promise<Quantity>;
|
548
|
+
/**
|
549
|
+
* Stop impersonating an account after having previously used [`impersonateAccount`](https://viem.sh/docs/actions/test/impersonateAccount).
|
550
|
+
*
|
551
|
+
* - Docs: https://viem.sh/docs/actions/test/stopImpersonatingAccount.html
|
552
|
+
*
|
553
|
+
* @param args – {@link StopImpersonatingAccountParameters}
|
554
|
+
*
|
555
|
+
* @example
|
556
|
+
* import { createTestClient, http } from 'viem'
|
557
|
+
* import { foundry } from 'viem/chains'
|
558
|
+
* import { stopImpersonatingAccount } from 'viem/test'
|
559
|
+
*
|
560
|
+
* const client = createTestClient({
|
561
|
+
* mode: 'anvil',
|
562
|
+
* chain: 'foundry',
|
563
|
+
* transport: http(),
|
564
|
+
* })
|
565
|
+
* await client.stopImpersonatingAccount({
|
566
|
+
* address: '0xa5cc3c03994DB5b0d9A5eEdD10CabaB0813678AC',
|
567
|
+
* })
|
568
|
+
*/
|
33
569
|
stopImpersonatingAccount: (args: StopImpersonatingAccountParameters) => Promise<void>;
|
34
570
|
};
|
35
571
|
export declare function testActions<TChain extends Chain | undefined>(client: TestClient<TestClientMode, Transport, TChain>): TestActions;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"test.d.ts","sourceRoot":"","sources":["../../../../src/clients/decorators/test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,EACrB,0BAA0B,EAC1B,yBAAyB,EACzB,4BAA4B,EAC5B,sBAAsB,EACtB,uBAAuB,EACvB,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,iCAAiC,EACjC,iCAAiC,EACjC,oBAAoB,EACpB,0BAA0B,EAC1B,mCAAmC,EACnC,iBAAiB,EACjB,qBAAqB,EACrB,2BAA2B,EAC3B,wBAAwB,EACxB,mCAAmC,EACnC,+BAA+B,EAC/B,kBAAkB,EAClB,sBAAsB,EACtB,kCAAkC,EACnC,MAAM,6BAA6B,CAAA;AA+BpC,OAAO,KAAK,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACxE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAEvD,MAAM,MAAM,WAAW,GAAG;IACxB,eAAe,EAAE,CAAC,IAAI,EAAE,yBAAyB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACnE,WAAW,EAAE,MAAM,OAAO,CAAC,qBAAqB,CAAC,CAAA;IACjD,gBAAgB,EAAE,MAAM,OAAO,CAAC,0BAA0B,CAAC,CAAA;IAC3D,eAAe,EAAE,MAAM,OAAO,CAAC,yBAAyB,CAAC,CAAA;IACzD,kBAAkB,EAAE,CAAC,IAAI,EAAE,4BAA4B,KAAK,OAAO,CAAC,IAAI,CAAC,CAAA;IACzE,YAAY,EAAE,CAAC,IAAI,EAAE,sBAAsB,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAA;IACjE,aAAa,EAAE,MAAM,OAAO,CAAC,uBAAuB,CAAC,CAAA;IACrD,IAAI,EAAE,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