viem 1.1.7 → 1.2.0
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/actions/package.json +5 -0
- 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/index.js +155 -0
- package/dist/cjs/actions/index.js.map +1 -0
- package/dist/cjs/actions/public/call.js.map +1 -1
- package/dist/cjs/actions/public/createBlockFilter.js.map +1 -1
- package/dist/cjs/actions/public/createContractEventFilter.js.map +1 -1
- package/dist/cjs/actions/public/createEventFilter.js.map +1 -1
- package/dist/cjs/actions/public/createPendingTransactionFilter.js.map +1 -1
- package/dist/cjs/actions/public/estimateContractGas.js.map +1 -1
- package/dist/cjs/actions/public/estimateGas.js.map +1 -1
- package/dist/cjs/actions/public/getBalance.js.map +1 -1
- package/dist/cjs/actions/public/getBlock.js.map +1 -1
- package/dist/cjs/actions/public/getBlockNumber.js.map +1 -1
- package/dist/cjs/actions/public/getBlockTransactionCount.js.map +1 -1
- package/dist/cjs/actions/public/getBytecode.js.map +1 -1
- package/dist/cjs/actions/public/getChainId.js.map +1 -1
- package/dist/cjs/actions/public/getFeeHistory.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/getGasPrice.js.map +1 -1
- package/dist/cjs/actions/public/getLogs.js.map +1 -1
- package/dist/cjs/actions/public/getStorageAt.js.map +1 -1
- package/dist/cjs/actions/public/getTransaction.js.map +1 -1
- package/dist/cjs/actions/public/getTransactionConfirmations.js.map +1 -1
- package/dist/cjs/actions/public/getTransactionCount.js.map +1 -1
- package/dist/cjs/actions/public/getTransactionReceipt.js.map +1 -1
- package/dist/cjs/actions/public/multicall.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/verifyHash.js.map +1 -1
- package/dist/cjs/actions/public/verifyMessage.js.map +1 -1
- package/dist/cjs/actions/public/verifyTypedData.js +2 -2
- package/dist/cjs/actions/public/verifyTypedData.js.map +1 -1
- package/dist/cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/dist/cjs/actions/public/watchBlockNumber.js.map +1 -1
- package/dist/cjs/actions/public/watchBlocks.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/deployContract.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/createClient.js +18 -3
- package/dist/cjs/clients/createClient.js.map +1 -1
- package/dist/cjs/clients/createPublicClient.js +8 -14
- package/dist/cjs/clients/createPublicClient.js.map +1 -1
- package/dist/cjs/clients/createTestClient.js +12 -16
- package/dist/cjs/clients/createTestClient.js.map +1 -1
- package/dist/cjs/clients/createWalletClient.js +9 -16
- package/dist/cjs/clients/createWalletClient.js.map +1 -1
- package/dist/cjs/clients/decorators/public.js.map +1 -1
- package/dist/cjs/clients/decorators/test.js +35 -30
- package/dist/cjs/clients/decorators/test.js.map +1 -1
- package/dist/cjs/clients/decorators/wallet.js.map +1 -1
- package/dist/cjs/errors/rpc.js +132 -18
- package/dist/cjs/errors/rpc.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/index.js +11 -5
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/buildRequest.js +42 -41
- package/dist/cjs/utils/buildRequest.js.map +1 -1
- package/dist/cjs/utils/ccip.js.map +1 -1
- package/dist/cjs/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/dist/cjs/utils/ens/avatar/utils.js.map +1 -1
- package/dist/cjs/utils/filters/createFilterRequestScope.js.map +1 -1
- package/dist/cjs/utils/transaction/prepareRequest.js.map +1 -1
- 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/index.js +76 -0
- package/dist/esm/actions/index.js.map +1 -0
- package/dist/esm/actions/public/call.js.map +1 -1
- package/dist/esm/actions/public/createBlockFilter.js.map +1 -1
- package/dist/esm/actions/public/createContractEventFilter.js.map +1 -1
- package/dist/esm/actions/public/createEventFilter.js.map +1 -1
- package/dist/esm/actions/public/createPendingTransactionFilter.js.map +1 -1
- package/dist/esm/actions/public/estimateContractGas.js.map +1 -1
- package/dist/esm/actions/public/estimateGas.js.map +1 -1
- package/dist/esm/actions/public/getBalance.js.map +1 -1
- package/dist/esm/actions/public/getBlock.js.map +1 -1
- package/dist/esm/actions/public/getBlockNumber.js.map +1 -1
- package/dist/esm/actions/public/getBlockTransactionCount.js.map +1 -1
- package/dist/esm/actions/public/getBytecode.js.map +1 -1
- package/dist/esm/actions/public/getChainId.js.map +1 -1
- package/dist/esm/actions/public/getFeeHistory.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/getGasPrice.js.map +1 -1
- package/dist/esm/actions/public/getLogs.js.map +1 -1
- package/dist/esm/actions/public/getStorageAt.js.map +1 -1
- package/dist/esm/actions/public/getTransaction.js.map +1 -1
- package/dist/esm/actions/public/getTransactionConfirmations.js.map +1 -1
- package/dist/esm/actions/public/getTransactionCount.js.map +1 -1
- package/dist/esm/actions/public/getTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/public/multicall.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/verifyHash.js.map +1 -1
- package/dist/esm/actions/public/verifyMessage.js.map +1 -1
- package/dist/esm/actions/public/verifyTypedData.js +1 -1
- package/dist/esm/actions/public/verifyTypedData.js.map +1 -1
- package/dist/esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/public/watchBlockNumber.js.map +1 -1
- package/dist/esm/actions/public/watchBlocks.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/deployContract.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/createClient.js +18 -3
- package/dist/esm/clients/createClient.js.map +1 -1
- package/dist/esm/clients/createPublicClient.js +8 -14
- package/dist/esm/clients/createPublicClient.js.map +1 -1
- package/dist/esm/clients/createTestClient.js +12 -16
- package/dist/esm/clients/createTestClient.js.map +1 -1
- package/dist/esm/clients/createWalletClient.js +9 -16
- package/dist/esm/clients/createWalletClient.js.map +1 -1
- package/dist/esm/clients/decorators/public.js.map +1 -1
- package/dist/esm/clients/decorators/test.js +35 -30
- package/dist/esm/clients/decorators/test.js.map +1 -1
- package/dist/esm/clients/decorators/wallet.js.map +1 -1
- package/dist/esm/errors/rpc.js +168 -36
- package/dist/esm/errors/rpc.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/index.js +5 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/buildRequest.js +60 -41
- package/dist/esm/utils/buildRequest.js.map +1 -1
- package/dist/esm/utils/ccip.js.map +1 -1
- package/dist/esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/dist/esm/utils/ens/avatar/utils.js.map +1 -1
- package/dist/esm/utils/filters/createFilterRequestScope.js.map +1 -1
- package/dist/esm/utils/transaction/prepareRequest.js.map +1 -1
- package/dist/types/actions/ens/getEnsAddress.d.ts +2 -2
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsAvatar.d.ts +2 -2
- package/dist/types/actions/ens/getEnsAvatar.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsName.d.ts +2 -2
- package/dist/types/actions/ens/getEnsName.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsResolver.d.ts +2 -2
- package/dist/types/actions/ens/getEnsResolver.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsText.d.ts +2 -2
- package/dist/types/actions/ens/getEnsText.d.ts.map +1 -1
- package/dist/types/actions/index.d.ts +76 -0
- package/dist/types/actions/index.d.ts.map +1 -0
- package/dist/types/actions/public/call.d.ts +2 -2
- package/dist/types/actions/public/call.d.ts.map +1 -1
- package/dist/types/actions/public/createBlockFilter.d.ts +2 -2
- package/dist/types/actions/public/createBlockFilter.d.ts.map +1 -1
- package/dist/types/actions/public/createContractEventFilter.d.ts +2 -2
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/createEventFilter.d.ts +2 -2
- package/dist/types/actions/public/createEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts +2 -2
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts.map +1 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +2 -3
- package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -1
- package/dist/types/actions/public/estimateGas.d.ts +2 -3
- package/dist/types/actions/public/estimateGas.d.ts.map +1 -1
- package/dist/types/actions/public/getBalance.d.ts +2 -2
- package/dist/types/actions/public/getBalance.d.ts.map +1 -1
- package/dist/types/actions/public/getBlock.d.ts +2 -3
- package/dist/types/actions/public/getBlock.d.ts.map +1 -1
- package/dist/types/actions/public/getBlockNumber.d.ts +4 -4
- package/dist/types/actions/public/getBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/public/getBlockTransactionCount.d.ts +2 -2
- package/dist/types/actions/public/getBlockTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/public/getBytecode.d.ts +2 -2
- package/dist/types/actions/public/getBytecode.d.ts.map +1 -1
- package/dist/types/actions/public/getChainId.d.ts +2 -3
- package/dist/types/actions/public/getChainId.d.ts.map +1 -1
- package/dist/types/actions/public/getFeeHistory.d.ts +2 -2
- package/dist/types/actions/public/getFeeHistory.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +2 -2
- package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterLogs.d.ts +2 -2
- package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/dist/types/actions/public/getGasPrice.d.ts +2 -3
- package/dist/types/actions/public/getGasPrice.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/getStorageAt.d.ts +2 -2
- package/dist/types/actions/public/getStorageAt.d.ts.map +1 -1
- package/dist/types/actions/public/getTransaction.d.ts +2 -2
- package/dist/types/actions/public/getTransaction.d.ts.map +1 -1
- package/dist/types/actions/public/getTransactionConfirmations.d.ts +2 -2
- package/dist/types/actions/public/getTransactionConfirmations.d.ts.map +1 -1
- package/dist/types/actions/public/getTransactionCount.d.ts +2 -3
- package/dist/types/actions/public/getTransactionCount.d.ts.map +1 -1
- package/dist/types/actions/public/getTransactionReceipt.d.ts +2 -2
- package/dist/types/actions/public/getTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/public/multicall.d.ts +2 -2
- package/dist/types/actions/public/multicall.d.ts.map +1 -1
- package/dist/types/actions/public/readContract.d.ts +2 -2
- package/dist/types/actions/public/readContract.d.ts.map +1 -1
- package/dist/types/actions/public/simulateContract.d.ts +2 -2
- package/dist/types/actions/public/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/public/uninstallFilter.d.ts +2 -2
- package/dist/types/actions/public/uninstallFilter.d.ts.map +1 -1
- package/dist/types/actions/public/verifyHash.d.ts +2 -2
- package/dist/types/actions/public/verifyHash.d.ts.map +1 -1
- package/dist/types/actions/public/verifyMessage.d.ts +2 -2
- package/dist/types/actions/public/verifyMessage.d.ts.map +1 -1
- package/dist/types/actions/public/verifyTypedData.d.ts +2 -2
- package/dist/types/actions/public/verifyTypedData.d.ts.map +1 -1
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts +2 -2
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/actions/public/watchBlockNumber.d.ts +2 -2
- package/dist/types/actions/public/watchBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/public/watchBlocks.d.ts +2 -2
- package/dist/types/actions/public/watchBlocks.d.ts.map +1 -1
- package/dist/types/actions/public/watchContractEvent.d.ts +2 -2
- package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/public/watchEvent.d.ts +2 -2
- package/dist/types/actions/public/watchEvent.d.ts.map +1 -1
- package/dist/types/actions/public/watchPendingTransactions.d.ts +2 -2
- package/dist/types/actions/public/watchPendingTransactions.d.ts.map +1 -1
- package/dist/types/actions/test/dropTransaction.d.ts +2 -1
- package/dist/types/actions/test/dropTransaction.d.ts.map +1 -1
- package/dist/types/actions/test/getAutomine.d.ts +2 -1
- package/dist/types/actions/test/getAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/getTxpoolContent.d.ts +2 -1
- package/dist/types/actions/test/getTxpoolContent.d.ts.map +1 -1
- package/dist/types/actions/test/getTxpoolStatus.d.ts +2 -1
- package/dist/types/actions/test/getTxpoolStatus.d.ts.map +1 -1
- package/dist/types/actions/test/impersonateAccount.d.ts +2 -1
- package/dist/types/actions/test/impersonateAccount.d.ts.map +1 -1
- package/dist/types/actions/test/increaseTime.d.ts +2 -1
- package/dist/types/actions/test/increaseTime.d.ts.map +1 -1
- package/dist/types/actions/test/inspectTxpool.d.ts +2 -1
- package/dist/types/actions/test/inspectTxpool.d.ts.map +1 -1
- package/dist/types/actions/test/mine.d.ts +2 -1
- package/dist/types/actions/test/mine.d.ts.map +1 -1
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts +2 -1
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts.map +1 -1
- package/dist/types/actions/test/reset.d.ts +2 -1
- package/dist/types/actions/test/reset.d.ts.map +1 -1
- package/dist/types/actions/test/revert.d.ts +2 -1
- package/dist/types/actions/test/revert.d.ts.map +1 -1
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +2 -1
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
- package/dist/types/actions/test/setAutomine.d.ts +2 -1
- package/dist/types/actions/test/setAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/setBalance.d.ts +2 -1
- package/dist/types/actions/test/setBalance.d.ts.map +1 -1
- package/dist/types/actions/test/setBlockGasLimit.d.ts +2 -1
- package/dist/types/actions/test/setBlockGasLimit.d.ts.map +1 -1
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts +2 -1
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts.map +1 -1
- package/dist/types/actions/test/setCode.d.ts +2 -1
- package/dist/types/actions/test/setCode.d.ts.map +1 -1
- package/dist/types/actions/test/setCoinbase.d.ts +2 -1
- package/dist/types/actions/test/setCoinbase.d.ts.map +1 -1
- package/dist/types/actions/test/setIntervalMining.d.ts +2 -1
- package/dist/types/actions/test/setIntervalMining.d.ts.map +1 -1
- package/dist/types/actions/test/setLoggingEnabled.d.ts +2 -1
- package/dist/types/actions/test/setLoggingEnabled.d.ts.map +1 -1
- package/dist/types/actions/test/setMinGasPrice.d.ts +2 -1
- package/dist/types/actions/test/setMinGasPrice.d.ts.map +1 -1
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts +2 -1
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +1 -1
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts +2 -1
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts.map +1 -1
- package/dist/types/actions/test/setNonce.d.ts +2 -1
- package/dist/types/actions/test/setNonce.d.ts.map +1 -1
- package/dist/types/actions/test/setRpcUrl.d.ts +2 -1
- package/dist/types/actions/test/setRpcUrl.d.ts.map +1 -1
- package/dist/types/actions/test/setStorageAt.d.ts +2 -1
- package/dist/types/actions/test/setStorageAt.d.ts.map +1 -1
- package/dist/types/actions/test/snapshot.d.ts +2 -1
- package/dist/types/actions/test/snapshot.d.ts.map +1 -1
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts +2 -1
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts.map +1 -1
- package/dist/types/actions/wallet/addChain.d.ts +2 -2
- package/dist/types/actions/wallet/addChain.d.ts.map +1 -1
- package/dist/types/actions/wallet/deployContract.d.ts +2 -2
- package/dist/types/actions/wallet/deployContract.d.ts.map +1 -1
- package/dist/types/actions/wallet/getAddresses.d.ts +2 -2
- package/dist/types/actions/wallet/getAddresses.d.ts.map +1 -1
- package/dist/types/actions/wallet/getPermissions.d.ts +2 -2
- package/dist/types/actions/wallet/getPermissions.d.ts.map +1 -1
- package/dist/types/actions/wallet/requestAddresses.d.ts +2 -2
- package/dist/types/actions/wallet/requestAddresses.d.ts.map +1 -1
- package/dist/types/actions/wallet/requestPermissions.d.ts +2 -2
- package/dist/types/actions/wallet/requestPermissions.d.ts.map +1 -1
- package/dist/types/actions/wallet/sendTransaction.d.ts +2 -2
- package/dist/types/actions/wallet/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/wallet/signMessage.d.ts +2 -2
- package/dist/types/actions/wallet/signMessage.d.ts.map +1 -1
- package/dist/types/actions/wallet/signTypedData.d.ts +2 -2
- package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/wallet/switchChain.d.ts +2 -2
- package/dist/types/actions/wallet/switchChain.d.ts.map +1 -1
- package/dist/types/actions/wallet/watchAsset.d.ts +2 -2
- package/dist/types/actions/wallet/watchAsset.d.ts.map +1 -1
- package/dist/types/actions/wallet/writeContract.d.ts +2 -2
- package/dist/types/actions/wallet/writeContract.d.ts.map +1 -1
- package/dist/types/clients/createClient.d.ts +35 -3
- package/dist/types/clients/createClient.d.ts.map +1 -1
- package/dist/types/clients/createPublicClient.d.ts +3 -15
- package/dist/types/clients/createPublicClient.d.ts.map +1 -1
- package/dist/types/clients/createTestClient.d.ts +6 -3
- package/dist/types/clients/createTestClient.d.ts.map +1 -1
- package/dist/types/clients/createWalletClient.d.ts +5 -10
- package/dist/types/clients/createWalletClient.d.ts.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +524 -5
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/clients/decorators/test.d.ts +6 -2
- package/dist/types/clients/decorators/test.d.ts.map +1 -1
- package/dist/types/clients/decorators/wallet.d.ts +520 -2
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/types/errors/rpc.d.ts +18 -0
- package/dist/types/errors/rpc.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/index.d.ts +6 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/account.d.ts +2 -2
- package/dist/types/types/account.d.ts.map +1 -1
- package/dist/types/types/utils.d.ts +2 -2
- package/dist/types/utils/buildRequest.d.ts.map +1 -1
- package/dist/types/utils/ccip.d.ts +2 -2
- package/dist/types/utils/ccip.d.ts.map +1 -1
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts +2 -2
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -1
- package/dist/types/utils/ens/avatar/utils.d.ts +2 -2
- package/dist/types/utils/ens/avatar/utils.d.ts.map +1 -1
- package/dist/types/utils/filters/createFilterRequestScope.d.ts +4 -3
- package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +1 -1
- package/dist/types/utils/formatters/transaction.d.ts +1 -1
- package/dist/types/utils/transaction/prepareRequest.d.ts +2 -3
- package/dist/types/utils/transaction/prepareRequest.d.ts.map +1 -1
- package/package.json +11 -2
- package/src/actions/ens/getEnsAddress.ts +2 -2
- package/src/actions/ens/getEnsAvatar.ts +2 -2
- package/src/actions/ens/getEnsName.ts +2 -2
- package/src/actions/ens/getEnsResolver.ts +2 -2
- package/src/actions/ens/getEnsText.ts +2 -2
- package/src/actions/index.ts +324 -0
- package/src/actions/public/call.ts +4 -4
- package/src/actions/public/createBlockFilter.ts +2 -2
- package/src/actions/public/createContractEventFilter.ts +2 -2
- package/src/actions/public/createEventFilter.ts +2 -2
- package/src/actions/public/createPendingTransactionFilter.ts +2 -2
- package/src/actions/public/estimateContractGas.ts +2 -6
- package/src/actions/public/estimateGas.ts +4 -7
- package/src/actions/public/getBalance.ts +2 -2
- package/src/actions/public/getBlock.ts +4 -7
- package/src/actions/public/getBlockNumber.ts +2 -2
- package/src/actions/public/getBlockTransactionCount.ts +2 -2
- package/src/actions/public/getBytecode.ts +2 -2
- package/src/actions/public/getChainId.ts +3 -8
- package/src/actions/public/getFeeHistory.ts +2 -2
- package/src/actions/public/getFilterChanges.ts +2 -2
- package/src/actions/public/getFilterLogs.ts +2 -2
- package/src/actions/public/getGasPrice.ts +3 -8
- package/src/actions/public/getLogs.ts +2 -2
- package/src/actions/public/getStorageAt.ts +2 -2
- package/src/actions/public/getTransaction.ts +2 -2
- package/src/actions/public/getTransactionConfirmations.ts +2 -2
- package/src/actions/public/getTransactionCount.ts +3 -6
- package/src/actions/public/getTransactionReceipt.ts +2 -2
- package/src/actions/public/multicall.ts +2 -2
- package/src/actions/public/readContract.ts +2 -2
- package/src/actions/public/simulateContract.ts +2 -2
- package/src/actions/public/uninstallFilter.ts +2 -2
- package/src/actions/public/verifyHash.ts +2 -2
- package/src/actions/public/verifyMessage.ts +2 -2
- package/src/actions/public/verifyTypedData.ts +3 -3
- package/src/actions/public/waitForTransactionReceipt.ts +2 -2
- package/src/actions/public/watchBlockNumber.ts +2 -2
- package/src/actions/public/watchBlocks.ts +2 -2
- package/src/actions/public/watchContractEvent.ts +2 -2
- package/src/actions/public/watchEvent.ts +2 -2
- package/src/actions/public/watchPendingTransactions.ts +2 -2
- package/src/actions/test/dropTransaction.ts +6 -2
- package/src/actions/test/getAutomine.ts +6 -2
- package/src/actions/test/getTxpoolContent.ts +6 -2
- package/src/actions/test/getTxpoolStatus.ts +6 -2
- package/src/actions/test/impersonateAccount.ts +6 -2
- package/src/actions/test/increaseTime.ts +6 -2
- package/src/actions/test/inspectTxpool.ts +6 -2
- package/src/actions/test/mine.ts +6 -2
- package/src/actions/test/removeBlockTimestampInterval.ts +3 -1
- package/src/actions/test/reset.ts +6 -2
- package/src/actions/test/revert.ts +6 -2
- package/src/actions/test/sendUnsignedTransaction.ts +3 -1
- package/src/actions/test/setAutomine.ts +6 -2
- package/src/actions/test/setBalance.ts +6 -2
- package/src/actions/test/setBlockGasLimit.ts +6 -2
- package/src/actions/test/setBlockTimestampInterval.ts +3 -1
- package/src/actions/test/setCode.ts +6 -2
- package/src/actions/test/setCoinbase.ts +6 -2
- package/src/actions/test/setIntervalMining.ts +6 -2
- package/src/actions/test/setLoggingEnabled.ts +6 -2
- package/src/actions/test/setMinGasPrice.ts +6 -2
- package/src/actions/test/setNextBlockBaseFeePerGas.ts +3 -1
- package/src/actions/test/setNextBlockTimestamp.ts +6 -2
- package/src/actions/test/setNonce.ts +6 -2
- package/src/actions/test/setRpcUrl.ts +6 -2
- package/src/actions/test/setStorageAt.ts +6 -2
- package/src/actions/test/snapshot.ts +5 -3
- package/src/actions/test/stopImpersonatingAccount.ts +3 -1
- package/src/actions/wallet/addChain.ts +2 -5
- package/src/actions/wallet/deployContract.ts +2 -2
- package/src/actions/wallet/getAddresses.ts +2 -2
- package/src/actions/wallet/getPermissions.ts +2 -2
- package/src/actions/wallet/requestAddresses.ts +2 -2
- package/src/actions/wallet/requestPermissions.ts +2 -2
- package/src/actions/wallet/sendTransaction.ts +2 -2
- package/src/actions/wallet/signMessage.ts +2 -2
- package/src/actions/wallet/signTypedData.ts +2 -2
- package/src/actions/wallet/switchChain.ts +2 -5
- package/src/actions/wallet/watchAsset.ts +2 -2
- package/src/actions/wallet/writeContract.ts +2 -2
- package/src/clients/createClient.ts +83 -6
- package/src/clients/createPublicClient.ts +18 -38
- package/src/clients/createTestClient.ts +34 -23
- package/src/clients/createWalletClient.ts +22 -41
- package/src/clients/decorators/public.ts +10 -12
- package/src/clients/decorators/test.ts +56 -36
- package/src/clients/decorators/wallet.ts +3 -9
- package/src/errors/rpc.ts +42 -18
- package/src/errors/version.ts +1 -1
- package/src/index.ts +20 -4
- package/src/types/account.ts +9 -5
- package/src/types/utils.ts +2 -2
- package/src/utils/buildRequest.ts +59 -21
- package/src/utils/ccip.ts +3 -3
- package/src/utils/ens/avatar/parseAvatarRecord.ts +3 -3
- package/src/utils/ens/avatar/utils.ts +2 -2
- package/src/utils/filters/createFilterRequestScope.ts +4 -3
- package/src/utils/transaction/prepareRequest.ts +2 -5
@@ -1,6 +1,5 @@
|
|
1
1
|
import type { Account } from '../../accounts/types.js'
|
2
|
-
import type {
|
3
|
-
import type { WalletClient } from '../../clients/createWalletClient.js'
|
2
|
+
import type { Client } from '../../clients/createClient.js'
|
4
3
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
4
|
import type { Chain } from '../../types/chain.js'
|
6
5
|
|
@@ -29,12 +28,8 @@ export type GetGasPriceReturnType = bigint
|
|
29
28
|
export async function getGasPrice<
|
30
29
|
TChain extends Chain | undefined,
|
31
30
|
TAccount extends Account | undefined,
|
32
|
-
>(
|
33
|
-
client
|
34
|
-
| PublicClient<Transport, TChain>
|
35
|
-
| WalletClient<Transport, TChain, TAccount>,
|
36
|
-
): Promise<GetGasPriceReturnType> {
|
37
|
-
const gasPrice = await (client as PublicClient).request({
|
31
|
+
>(client: Client<Transport, TChain, TAccount>): Promise<GetGasPriceReturnType> {
|
32
|
+
const gasPrice = await client.request({
|
38
33
|
method: 'eth_gasPrice',
|
39
34
|
})
|
40
35
|
return BigInt(gasPrice)
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { AbiEvent, Address, Narrow } from 'abitype'
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
5
|
import {
|
6
6
|
DecodeLogDataMismatch,
|
@@ -95,7 +95,7 @@ export async function getLogs<
|
|
95
95
|
TAbiEvent extends AbiEvent | undefined,
|
96
96
|
TStrict extends boolean | undefined = undefined,
|
97
97
|
>(
|
98
|
-
client:
|
98
|
+
client: Client<Transport, TChain>,
|
99
99
|
{
|
100
100
|
address,
|
101
101
|
blockHash,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
5
|
import type { BlockTag } from '../../types/block.js'
|
6
6
|
import type { Chain } from '../../types/chain.js'
|
@@ -48,7 +48,7 @@ export type GetStorageAtReturnType = Hex | undefined
|
|
48
48
|
* })
|
49
49
|
*/
|
50
50
|
export async function getStorageAt<TChain extends Chain | undefined>(
|
51
|
-
client:
|
51
|
+
client: Client<Transport, TChain>,
|
52
52
|
{ address, blockNumber, blockTag = 'latest', slot }: GetStorageAtParameters,
|
53
53
|
): Promise<GetStorageAtReturnType> {
|
54
54
|
const blockNumberHex =
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import { TransactionNotFoundError } from '../../errors/transaction.js'
|
4
4
|
import type { BlockTag } from '../../types/block.js'
|
@@ -76,7 +76,7 @@ export type GetTransactionReturnType<TChain extends Chain | undefined = Chain> =
|
|
76
76
|
* })
|
77
77
|
*/
|
78
78
|
export async function getTransaction<TChain extends Chain | undefined>(
|
79
|
-
client:
|
79
|
+
client: Client<Transport, TChain>,
|
80
80
|
{
|
81
81
|
blockHash,
|
82
82
|
blockNumber,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import type { Chain } from '../../types/chain.js'
|
4
4
|
import type { Hash } from '../../types/misc.js'
|
@@ -50,7 +50,7 @@ export type GetTransactionConfirmationsReturnType = bigint
|
|
50
50
|
export async function getTransactionConfirmations<
|
51
51
|
TChain extends Chain | undefined,
|
52
52
|
>(
|
53
|
-
client:
|
53
|
+
client: Client<Transport, TChain>,
|
54
54
|
{ hash, transactionReceipt }: GetTransactionConfirmationsParameters<TChain>,
|
55
55
|
): Promise<GetTransactionConfirmationsReturnType> {
|
56
56
|
const [blockNumber, transaction] = await Promise.all([
|
@@ -1,8 +1,7 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Account } from '../../accounts/types.js'
|
4
|
-
import type {
|
5
|
-
import type { WalletClient } from '../../clients/createWalletClient.js'
|
4
|
+
import type { Client } from '../../clients/createClient.js'
|
6
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
7
6
|
import type { BlockTag } from '../../types/block.js'
|
8
7
|
import type { Chain } from '../../types/chain.js'
|
@@ -53,12 +52,10 @@ export async function getTransactionCount<
|
|
53
52
|
TChain extends Chain | undefined,
|
54
53
|
TAccount extends Account | undefined,
|
55
54
|
>(
|
56
|
-
client:
|
57
|
-
| PublicClient<Transport, TChain>
|
58
|
-
| WalletClient<Transport, TChain, TAccount>,
|
55
|
+
client: Client<Transport, TChain, TAccount>,
|
59
56
|
{ address, blockTag = 'latest', blockNumber }: GetTransactionCountParameters,
|
60
57
|
): Promise<GetTransactionCountReturnType> {
|
61
|
-
const count = await
|
58
|
+
const count = await client.request({
|
62
59
|
method: 'eth_getTransactionCount',
|
63
60
|
params: [address, blockNumber ? numberToHex(blockNumber) : blockTag],
|
64
61
|
})
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import { TransactionReceiptNotFoundError } from '../../errors/transaction.js'
|
4
4
|
import type { Chain } from '../../types/chain.js'
|
@@ -42,7 +42,7 @@ export type GetTransactionReceiptReturnType<
|
|
42
42
|
* })
|
43
43
|
*/
|
44
44
|
export async function getTransactionReceipt<TChain extends Chain | undefined>(
|
45
|
-
client:
|
45
|
+
client: Client<Transport, TChain>,
|
46
46
|
{ hash }: GetTransactionReceiptParameters,
|
47
47
|
) {
|
48
48
|
const receipt = await client.request({
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Address, Narrow } from 'abitype'
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
5
|
import { multicall3Abi } from '../../constants/abis.js'
|
6
6
|
import { AbiDecodingZeroDataError } from '../../errors/abi.js'
|
@@ -84,7 +84,7 @@ export async function multicall<
|
|
84
84
|
TContracts extends ContractFunctionConfig[],
|
85
85
|
TAllowFailure extends boolean = true,
|
86
86
|
>(
|
87
|
-
client:
|
87
|
+
client: Client<Transport, TChain>,
|
88
88
|
args: MulticallParameters<TContracts, TAllowFailure>,
|
89
89
|
): Promise<MulticallReturnType<TContracts, TAllowFailure>> {
|
90
90
|
const {
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Abi } from 'abitype'
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
5
|
import type { BaseError } from '../../errors/base.js'
|
6
6
|
import type { Chain } from '../../types/chain.js'
|
@@ -67,7 +67,7 @@ export async function readContract<
|
|
67
67
|
TAbi extends Abi | readonly unknown[],
|
68
68
|
TFunctionName extends string,
|
69
69
|
>(
|
70
|
-
client:
|
70
|
+
client: Client<Transport, TChain>,
|
71
71
|
{
|
72
72
|
abi,
|
73
73
|
address,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { Abi } from 'abitype'
|
2
2
|
|
3
3
|
import { parseAccount } from '../../accounts/utils/parseAccount.js'
|
4
|
-
import type {
|
4
|
+
import type { Client } from '../../clients/createClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
6
|
import type { BaseError } from '../../errors/base.js'
|
7
7
|
import type { Chain } from '../../types/chain.js'
|
@@ -105,7 +105,7 @@ export async function simulateContract<
|
|
105
105
|
TFunctionName extends string,
|
106
106
|
TChainOverride extends Chain | undefined,
|
107
107
|
>(
|
108
|
-
client:
|
108
|
+
client: Client<Transport, TChain>,
|
109
109
|
{
|
110
110
|
abi,
|
111
111
|
address,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import type { Chain } from '../../types/chain.js'
|
4
4
|
import type { Filter } from '../../types/filter.js'
|
@@ -36,7 +36,7 @@ export async function uninstallFilter<
|
|
36
36
|
TTransport extends Transport,
|
37
37
|
TChain extends Chain | undefined,
|
38
38
|
>(
|
39
|
-
_client:
|
39
|
+
_client: Client<TTransport, TChain>,
|
40
40
|
{ filter }: UninstallFilterParameters,
|
41
41
|
): Promise<UninstallFilterReturnType> {
|
42
42
|
return filter.request({
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Chain } from '../../chains/index.js'
|
4
|
-
import type {
|
4
|
+
import type { Client } from '../../clients/createClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
6
|
import { universalSignatureValidatorAbi } from '../../constants/abis.js'
|
7
7
|
import { universalSignatureValidatorByteCode } from '../../constants/contracts.js'
|
@@ -33,7 +33,7 @@ export type VerifyHashReturnType = boolean
|
|
33
33
|
* @returns Whether or not the signature is valid. {@link VerifyHashReturnType}
|
34
34
|
*/
|
35
35
|
export async function verifyHash<TChain extends Chain | undefined,>(
|
36
|
-
client:
|
36
|
+
client: Client<Transport, TChain>,
|
37
37
|
{ address, hash, signature, ...callRequest }: VerifyHashParameters,
|
38
38
|
): Promise<VerifyHashReturnType> {
|
39
39
|
const signatureHex = isHex(signature) ? signature : toHex(signature)
|
@@ -1,5 +1,5 @@
|
|
1
1
|
import type { Chain } from '../../chains/index.js'
|
2
|
-
import type {
|
2
|
+
import type { Client } from '../../clients/createClient.js'
|
3
3
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
4
4
|
import type { ByteArray, Hex, SignableMessage } from '../../types/misc.js'
|
5
5
|
import { hashMessage } from '../../utils/index.js'
|
@@ -29,7 +29,7 @@ export type VerifyMessageReturnType = boolean
|
|
29
29
|
* @returns Whether or not the signature is valid. {@link VerifyMessageReturnType}
|
30
30
|
*/
|
31
31
|
export async function verifyMessage<TChain extends Chain | undefined,>(
|
32
|
-
client:
|
32
|
+
client: Client<Transport, TChain>,
|
33
33
|
{ address, message, signature, ...callRequest }: VerifyMessageParameters,
|
34
34
|
): Promise<VerifyMessageReturnType> {
|
35
35
|
const hash = hashMessage(message)
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Chain } from '../../chains/index.js'
|
2
|
-
import type {
|
2
|
+
import type { Client } from '../../clients/createClient.js'
|
3
3
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
4
4
|
import type { ByteArray, Hex } from '../../types/misc.js'
|
5
5
|
import type { TypedDataDefinition } from '../../types/typedData.js'
|
6
|
-
import { hashTypedData } from '../../utils/
|
6
|
+
import { hashTypedData } from '../../utils/signature/hashTypedData.js'
|
7
7
|
import { type VerifyHashParameters, verifyHash } from './verifyHash.js'
|
8
8
|
import type { Address, TypedData } from 'abitype'
|
9
9
|
|
@@ -30,7 +30,7 @@ export type VerifyTypedDataReturnType = boolean
|
|
30
30
|
* @returns Whether or not the signature is valid. {@link VerifyTypedDataReturnType}
|
31
31
|
*/
|
32
32
|
export async function verifyTypedData<TChain extends Chain | undefined,>(
|
33
|
-
client:
|
33
|
+
client: Client<Transport, TChain>,
|
34
34
|
{
|
35
35
|
address,
|
36
36
|
signature,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import {
|
4
4
|
TransactionNotFoundError,
|
@@ -99,7 +99,7 @@ export type WaitForTransactionReceiptParameters<
|
|
99
99
|
export async function waitForTransactionReceipt<
|
100
100
|
TChain extends Chain | undefined,
|
101
101
|
>(
|
102
|
-
client:
|
102
|
+
client: Client<Transport, TChain>,
|
103
103
|
{
|
104
104
|
confirmations = 1,
|
105
105
|
hash,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import type { Chain } from '../../types/chain.js'
|
4
4
|
import type { GetTransportConfig } from '../../types/transport.js'
|
@@ -77,7 +77,7 @@ export function watchBlockNumber<
|
|
77
77
|
TChain extends Chain | undefined,
|
78
78
|
TTransport extends Transport,
|
79
79
|
>(
|
80
|
-
client:
|
80
|
+
client: Client<TTransport, TChain>,
|
81
81
|
{
|
82
82
|
emitOnBegin = false,
|
83
83
|
emitMissed = false,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import type { BlockTag } from '../../types/block.js'
|
4
4
|
import type { Chain } from '../../types/chain.js'
|
@@ -84,7 +84,7 @@ export function watchBlocks<
|
|
84
84
|
TTransport extends Transport,
|
85
85
|
TChain extends Chain | undefined,
|
86
86
|
>(
|
87
|
-
client:
|
87
|
+
client: Client<TTransport, TChain>,
|
88
88
|
{
|
89
89
|
blockTag = 'latest',
|
90
90
|
emitMissed = false,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { Abi, Address, ExtractAbiEvent, Narrow } from 'abitype'
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
5
|
import type { Chain } from '../../types/chain.js'
|
6
6
|
import type { GetEventArgs, InferEventName } from '../../types/contract.js'
|
@@ -101,7 +101,7 @@ export function watchContractEvent<
|
|
101
101
|
TEventName extends string,
|
102
102
|
TStrict extends boolean | undefined = undefined,
|
103
103
|
>(
|
104
|
-
client:
|
104
|
+
client: Client<Transport, TChain>,
|
105
105
|
{
|
106
106
|
abi,
|
107
107
|
address,
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import type { AbiEvent, Address } from 'abitype'
|
2
2
|
|
3
|
-
import type {
|
3
|
+
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
5
5
|
import type { Chain } from '../../types/chain.js'
|
6
6
|
import type {
|
@@ -108,7 +108,7 @@ export function watchEvent<
|
|
108
108
|
TEventName extends string | undefined,
|
109
109
|
TStrict extends boolean | undefined = undefined,
|
110
110
|
>(
|
111
|
-
client:
|
111
|
+
client: Client<Transport, TChain>,
|
112
112
|
{
|
113
113
|
address,
|
114
114
|
args,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Client } from '../../clients/createClient.js'
|
2
2
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
3
3
|
import type { Chain } from '../../types/chain.js'
|
4
4
|
import type { Filter } from '../../types/filter.js'
|
@@ -92,7 +92,7 @@ export function watchPendingTransactions<
|
|
92
92
|
TTransport extends Transport,
|
93
93
|
TChain extends Chain | undefined,
|
94
94
|
>(
|
95
|
-
client:
|
95
|
+
client: Client<TTransport, TChain>,
|
96
96
|
{
|
97
97
|
batch = true,
|
98
98
|
onError,
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
import type { Hash } from '../../types/misc.js'
|
8
9
|
|
@@ -33,8 +34,11 @@ export type DropTransactionParameters = {
|
|
33
34
|
* hash: '0xe58dceb6b20b03965bb678e27d141e151d7d4efc2334c2d6a49b9fac523f7364'
|
34
35
|
* })
|
35
36
|
*/
|
36
|
-
export async function dropTransaction<
|
37
|
-
|
37
|
+
export async function dropTransaction<
|
38
|
+
TChain extends Chain | undefined,
|
39
|
+
TAccount extends Account | undefined,
|
40
|
+
>(
|
41
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
38
42
|
{ hash }: DropTransactionParameters,
|
39
43
|
) {
|
40
44
|
await client.request({
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
|
8
9
|
export type GetAutomineReturnType = boolean
|
@@ -27,8 +28,11 @@ export type GetAutomineReturnType = boolean
|
|
27
28
|
* })
|
28
29
|
* const isAutomining = await getAutomine(client)
|
29
30
|
*/
|
30
|
-
export async function getAutomine<
|
31
|
-
|
31
|
+
export async function getAutomine<
|
32
|
+
TChain extends Chain | undefined,
|
33
|
+
TAccount extends Account | undefined,
|
34
|
+
>(
|
35
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
32
36
|
): Promise<GetAutomineReturnType> {
|
33
37
|
if (client.mode === 'ganache')
|
34
38
|
return await client.request({
|
@@ -5,6 +5,7 @@ import type {
|
|
5
5
|
TestClientMode,
|
6
6
|
} from '../../clients/createTestClient.js'
|
7
7
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
8
|
+
import type { Account } from '../../types/account.js'
|
8
9
|
import type { Chain } from '../../types/chain.js'
|
9
10
|
import type { RpcTransaction } from '../../types/rpc.js'
|
10
11
|
|
@@ -35,8 +36,11 @@ export type GetTxpoolContentReturnType = {
|
|
35
36
|
* })
|
36
37
|
* const content = await getTxpoolContent(client)
|
37
38
|
*/
|
38
|
-
export async function getTxpoolContent<
|
39
|
-
|
39
|
+
export async function getTxpoolContent<
|
40
|
+
TChain extends Chain | undefined,
|
41
|
+
TAccount extends Account | undefined,
|
42
|
+
>(
|
43
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
40
44
|
): Promise<GetTxpoolContentReturnType> {
|
41
45
|
return await client.request({
|
42
46
|
method: 'txpool_content',
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
import { hexToNumber } from '../../utils/encoding/fromHex.js'
|
8
9
|
|
@@ -31,8 +32,11 @@ export type GetTxpoolStatusReturnType = {
|
|
31
32
|
* })
|
32
33
|
* const status = await getTxpoolStatus(client)
|
33
34
|
*/
|
34
|
-
export async function getTxpoolStatus<
|
35
|
-
|
35
|
+
export async function getTxpoolStatus<
|
36
|
+
TChain extends Chain | undefined,
|
37
|
+
TAccount extends Account | undefined,
|
38
|
+
>(
|
39
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
36
40
|
): Promise<GetTxpoolStatusReturnType> {
|
37
41
|
const { pending, queued } = await client.request({
|
38
42
|
method: 'txpool_status',
|
@@ -5,6 +5,7 @@ import type {
|
|
5
5
|
TestClientMode,
|
6
6
|
} from '../../clients/createTestClient.js'
|
7
7
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
8
|
+
import type { Account } from '../../types/account.js'
|
8
9
|
import type { Chain } from '../../types/chain.js'
|
9
10
|
|
10
11
|
export type ImpersonateAccountParameters = {
|
@@ -34,8 +35,11 @@ export type ImpersonateAccountParameters = {
|
|
34
35
|
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
35
36
|
* })
|
36
37
|
*/
|
37
|
-
export async function impersonateAccount<
|
38
|
-
|
38
|
+
export async function impersonateAccount<
|
39
|
+
TChain extends Chain | undefined,
|
40
|
+
TAccount extends Account | undefined,
|
41
|
+
>(
|
42
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
39
43
|
{ address }: ImpersonateAccountParameters,
|
40
44
|
) {
|
41
45
|
await client.request({
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
import { numberToHex } from '../../utils/encoding/toHex.js'
|
8
9
|
|
@@ -33,8 +34,11 @@ export type IncreaseTimeParameters = {
|
|
33
34
|
* seconds: 420,
|
34
35
|
* })
|
35
36
|
*/
|
36
|
-
export async function increaseTime<
|
37
|
-
|
37
|
+
export async function increaseTime<
|
38
|
+
TChain extends Chain | undefined,
|
39
|
+
TAccount extends Account | undefined,
|
40
|
+
>(
|
41
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
38
42
|
{ seconds }: IncreaseTimeParameters,
|
39
43
|
) {
|
40
44
|
return await client.request({
|
@@ -5,6 +5,7 @@ import type {
|
|
5
5
|
TestClientMode,
|
6
6
|
} from '../../clients/createTestClient.js'
|
7
7
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
8
|
+
import type { Account } from '../../types/account.js'
|
8
9
|
import type { Chain } from '../../types/chain.js'
|
9
10
|
|
10
11
|
export type InspectTxpoolReturnType = {
|
@@ -32,8 +33,11 @@ export type InspectTxpoolReturnType = {
|
|
32
33
|
* })
|
33
34
|
* const data = await inspectTxpool(client)
|
34
35
|
*/
|
35
|
-
export async function inspectTxpool<
|
36
|
-
|
36
|
+
export async function inspectTxpool<
|
37
|
+
TChain extends Chain | undefined,
|
38
|
+
TAccount extends Account | undefined,
|
39
|
+
>(
|
40
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
37
41
|
): Promise<InspectTxpoolReturnType> {
|
38
42
|
return await client.request({
|
39
43
|
method: 'txpool_inspect',
|
package/src/actions/test/mine.ts
CHANGED
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
import { numberToHex } from '../../utils/encoding/toHex.js'
|
8
9
|
|
@@ -33,8 +34,11 @@ export type MineParameters = {
|
|
33
34
|
* })
|
34
35
|
* await mine(client, { blocks: 1 })
|
35
36
|
*/
|
36
|
-
export async function mine<
|
37
|
-
|
37
|
+
export async function mine<
|
38
|
+
TChain extends Chain | undefined,
|
39
|
+
TAccount extends Account | undefined,
|
40
|
+
>(
|
41
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
38
42
|
{ blocks, interval }: MineParameters,
|
39
43
|
) {
|
40
44
|
if (client.mode === 'ganache')
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
|
8
9
|
/**
|
@@ -26,7 +27,8 @@ import type { Chain } from '../../types/chain.js'
|
|
26
27
|
*/
|
27
28
|
export async function removeBlockTimestampInterval<
|
28
29
|
TChain extends Chain | undefined,
|
29
|
-
|
30
|
+
TAccount extends Account | undefined,
|
31
|
+
>(client: TestClient<TestClientMode, Transport, TChain, TAccount, false>) {
|
30
32
|
await client.request({
|
31
33
|
method: `${client.mode}_removeBlockTimestampInterval`,
|
32
34
|
})
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
|
8
9
|
export type ResetParameters = {
|
@@ -32,8 +33,11 @@ export type ResetParameters = {
|
|
32
33
|
* })
|
33
34
|
* await reset(client, { blockNumber: 69420n })
|
34
35
|
*/
|
35
|
-
export async function reset<
|
36
|
-
|
36
|
+
export async function reset<
|
37
|
+
TChain extends Chain | undefined,
|
38
|
+
TAccount extends Account | undefined,
|
39
|
+
>(
|
40
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
37
41
|
{ blockNumber, jsonRpcUrl }: ResetParameters = {},
|
38
42
|
) {
|
39
43
|
await client.request({
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
import type { Quantity } from '../../types/rpc.js'
|
8
9
|
|
@@ -31,8 +32,11 @@ export type RevertParameters = {
|
|
31
32
|
* })
|
32
33
|
* await revert(client, { id: '0x…' })
|
33
34
|
*/
|
34
|
-
export async function revert<
|
35
|
-
|
35
|
+
export async function revert<
|
36
|
+
TChain extends Chain | undefined,
|
37
|
+
TAccount extends Account | undefined,
|
38
|
+
>(
|
39
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
36
40
|
{ id }: RevertParameters,
|
37
41
|
) {
|
38
42
|
await client.request({
|
@@ -3,6 +3,7 @@ import type {
|
|
3
3
|
TestClientMode,
|
4
4
|
} from '../../clients/createTestClient.js'
|
5
5
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
6
|
+
import type { Account } from '../../types/account.js'
|
6
7
|
import type { Chain } from '../../types/chain.js'
|
7
8
|
import type { Hash } from '../../types/misc.js'
|
8
9
|
import type { TransactionRequest } from '../../types/transaction.js'
|
@@ -45,8 +46,9 @@ export type SendUnsignedTransactionReturnType = Hash
|
|
45
46
|
*/
|
46
47
|
export async function sendUnsignedTransaction<
|
47
48
|
TChain extends Chain | undefined,
|
49
|
+
TAccount extends Account | undefined,
|
48
50
|
>(
|
49
|
-
client: TestClient<TestClientMode, Transport, TChain>,
|
51
|
+
client: TestClient<TestClientMode, Transport, TChain, TAccount, false>,
|
50
52
|
args: SendUnsignedTransactionParameters<TChain>,
|
51
53
|
): Promise<SendUnsignedTransactionReturnType> {
|
52
54
|
const {
|