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
package/src/errors/rpc.ts
CHANGED
@@ -95,10 +95,11 @@ export class ProviderRpcError<
|
|
95
95
|
*/
|
96
96
|
export class ParseRpcError extends RpcError {
|
97
97
|
override name = 'ParseRpcError'
|
98
|
+
static code = -32700 as const
|
98
99
|
|
99
100
|
constructor(cause: Error) {
|
100
101
|
super(cause, {
|
101
|
-
code:
|
102
|
+
code: ParseRpcError.code,
|
102
103
|
shortMessage:
|
103
104
|
'Invalid JSON was received by the server. An error occurred on the server while parsing the JSON text.',
|
104
105
|
})
|
@@ -112,10 +113,11 @@ export class ParseRpcError extends RpcError {
|
|
112
113
|
*/
|
113
114
|
export class InvalidRequestRpcError extends RpcError {
|
114
115
|
override name = 'InvalidRequestRpcError'
|
116
|
+
static code = -32600 as const
|
115
117
|
|
116
118
|
constructor(cause: Error) {
|
117
119
|
super(cause, {
|
118
|
-
code:
|
120
|
+
code: InvalidRequestRpcError.code,
|
119
121
|
shortMessage: 'JSON is not a valid request object.',
|
120
122
|
})
|
121
123
|
}
|
@@ -128,10 +130,11 @@ export class InvalidRequestRpcError extends RpcError {
|
|
128
130
|
*/
|
129
131
|
export class MethodNotFoundRpcError extends RpcError {
|
130
132
|
override name = 'MethodNotFoundRpcError'
|
133
|
+
static code = -32601 as const
|
131
134
|
|
132
135
|
constructor(cause: Error) {
|
133
136
|
super(cause, {
|
134
|
-
code:
|
137
|
+
code: MethodNotFoundRpcError.code,
|
135
138
|
shortMessage: 'The method does not exist / is not available.',
|
136
139
|
})
|
137
140
|
}
|
@@ -144,10 +147,11 @@ export class MethodNotFoundRpcError extends RpcError {
|
|
144
147
|
*/
|
145
148
|
export class InvalidParamsRpcError extends RpcError {
|
146
149
|
override name = 'InvalidParamsRpcError'
|
150
|
+
static code = -32602 as const
|
147
151
|
|
148
152
|
constructor(cause: Error) {
|
149
153
|
super(cause, {
|
150
|
-
code:
|
154
|
+
code: InvalidParamsRpcError.code,
|
151
155
|
shortMessage: [
|
152
156
|
'Invalid parameters were provided to the RPC method.',
|
153
157
|
'Double check you have provided the correct parameters.',
|
@@ -163,10 +167,11 @@ export class InvalidParamsRpcError extends RpcError {
|
|
163
167
|
*/
|
164
168
|
export class InternalRpcError extends RpcError {
|
165
169
|
override name = 'InternalRpcError'
|
170
|
+
static code = -32603 as const
|
166
171
|
|
167
172
|
constructor(cause: Error) {
|
168
173
|
super(cause, {
|
169
|
-
code:
|
174
|
+
code: InternalRpcError.code,
|
170
175
|
shortMessage: 'An internal error was received.',
|
171
176
|
})
|
172
177
|
}
|
@@ -179,10 +184,11 @@ export class InternalRpcError extends RpcError {
|
|
179
184
|
*/
|
180
185
|
export class InvalidInputRpcError extends RpcError {
|
181
186
|
override name = 'InvalidInputRpcError'
|
187
|
+
static code = -32000 as const
|
182
188
|
|
183
189
|
constructor(cause: Error) {
|
184
190
|
super(cause, {
|
185
|
-
code:
|
191
|
+
code: InvalidInputRpcError.code,
|
186
192
|
shortMessage: [
|
187
193
|
'Missing or invalid parameters.',
|
188
194
|
'Double check you have provided the correct parameters.',
|
@@ -198,10 +204,11 @@ export class InvalidInputRpcError extends RpcError {
|
|
198
204
|
*/
|
199
205
|
export class ResourceNotFoundRpcError extends RpcError {
|
200
206
|
override name = 'ResourceNotFoundRpcError'
|
207
|
+
static code = -32001 as const
|
201
208
|
|
202
209
|
constructor(cause: Error) {
|
203
210
|
super(cause, {
|
204
|
-
code:
|
211
|
+
code: ResourceNotFoundRpcError.code,
|
205
212
|
shortMessage: 'Requested resource not found.',
|
206
213
|
})
|
207
214
|
}
|
@@ -214,10 +221,11 @@ export class ResourceNotFoundRpcError extends RpcError {
|
|
214
221
|
*/
|
215
222
|
export class ResourceUnavailableRpcError extends RpcError {
|
216
223
|
override name = 'ResourceUnavailableRpcError'
|
224
|
+
static code = -32002 as const
|
217
225
|
|
218
226
|
constructor(cause: Error) {
|
219
227
|
super(cause, {
|
220
|
-
code:
|
228
|
+
code: ResourceUnavailableRpcError.code,
|
221
229
|
shortMessage: 'Requested resource not available.',
|
222
230
|
})
|
223
231
|
}
|
@@ -230,9 +238,13 @@ export class ResourceUnavailableRpcError extends RpcError {
|
|
230
238
|
*/
|
231
239
|
export class TransactionRejectedRpcError extends RpcError {
|
232
240
|
override name = 'TransactionRejectedRpcError'
|
241
|
+
static code = -32003 as const
|
233
242
|
|
234
243
|
constructor(cause: Error) {
|
235
|
-
super(cause, {
|
244
|
+
super(cause, {
|
245
|
+
code: TransactionRejectedRpcError.code,
|
246
|
+
shortMessage: 'Transaction creation failed.',
|
247
|
+
})
|
236
248
|
}
|
237
249
|
}
|
238
250
|
|
@@ -243,9 +255,13 @@ export class TransactionRejectedRpcError extends RpcError {
|
|
243
255
|
*/
|
244
256
|
export class MethodNotSupportedRpcError extends RpcError {
|
245
257
|
override name = 'MethodNotSupportedRpcError'
|
258
|
+
static code = -32004 as const
|
246
259
|
|
247
260
|
constructor(cause: Error) {
|
248
|
-
super(cause, {
|
261
|
+
super(cause, {
|
262
|
+
code: MethodNotSupportedRpcError.code,
|
263
|
+
shortMessage: 'Method is not implemented.',
|
264
|
+
})
|
249
265
|
}
|
250
266
|
}
|
251
267
|
|
@@ -256,10 +272,11 @@ export class MethodNotSupportedRpcError extends RpcError {
|
|
256
272
|
*/
|
257
273
|
export class LimitExceededRpcError extends RpcError {
|
258
274
|
override name = 'LimitExceededRpcError'
|
275
|
+
static code = -32005 as const
|
259
276
|
|
260
277
|
constructor(cause: Error) {
|
261
278
|
super(cause, {
|
262
|
-
code:
|
279
|
+
code: LimitExceededRpcError.code,
|
263
280
|
shortMessage: 'Request exceeds defined limit.',
|
264
281
|
})
|
265
282
|
}
|
@@ -272,10 +289,11 @@ export class LimitExceededRpcError extends RpcError {
|
|
272
289
|
*/
|
273
290
|
export class JsonRpcVersionUnsupportedError extends RpcError {
|
274
291
|
override name = 'JsonRpcVersionUnsupportedError'
|
292
|
+
static code = -32006 as const
|
275
293
|
|
276
294
|
constructor(cause: Error) {
|
277
295
|
super(cause, {
|
278
|
-
code:
|
296
|
+
code: JsonRpcVersionUnsupportedError.code,
|
279
297
|
shortMessage: 'Version of JSON-RPC protocol is not supported.',
|
280
298
|
})
|
281
299
|
}
|
@@ -288,10 +306,11 @@ export class JsonRpcVersionUnsupportedError extends RpcError {
|
|
288
306
|
*/
|
289
307
|
export class UserRejectedRequestError extends ProviderRpcError {
|
290
308
|
override name = 'UserRejectedRequestError'
|
309
|
+
static code = 4001 as const
|
291
310
|
|
292
311
|
constructor(cause: Error) {
|
293
312
|
super(cause, {
|
294
|
-
code:
|
313
|
+
code: UserRejectedRequestError.code,
|
295
314
|
shortMessage: 'User rejected the request.',
|
296
315
|
})
|
297
316
|
}
|
@@ -304,10 +323,11 @@ export class UserRejectedRequestError extends ProviderRpcError {
|
|
304
323
|
*/
|
305
324
|
export class UnauthorizedProviderError extends ProviderRpcError {
|
306
325
|
override name = 'UnauthorizedProviderError'
|
326
|
+
static code = 4100 as const
|
307
327
|
|
308
328
|
constructor(cause: Error) {
|
309
329
|
super(cause, {
|
310
|
-
code:
|
330
|
+
code: UnauthorizedProviderError.code,
|
311
331
|
shortMessage:
|
312
332
|
'The requested method and/or account has not been authorized by the user.',
|
313
333
|
})
|
@@ -321,10 +341,11 @@ export class UnauthorizedProviderError extends ProviderRpcError {
|
|
321
341
|
*/
|
322
342
|
export class UnsupportedProviderMethodError extends ProviderRpcError {
|
323
343
|
override name = 'UnsupportedProviderMethodError'
|
344
|
+
static code = 4200 as const
|
324
345
|
|
325
346
|
constructor(cause: Error) {
|
326
347
|
super(cause, {
|
327
|
-
code:
|
348
|
+
code: UnsupportedProviderMethodError.code,
|
328
349
|
shortMessage: 'The Provider does not support the requested method.',
|
329
350
|
})
|
330
351
|
}
|
@@ -337,10 +358,11 @@ export class UnsupportedProviderMethodError extends ProviderRpcError {
|
|
337
358
|
*/
|
338
359
|
export class ProviderDisconnectedError extends ProviderRpcError {
|
339
360
|
override name = 'ProviderDisconnectedError'
|
361
|
+
static code = 4900 as const
|
340
362
|
|
341
363
|
constructor(cause: Error) {
|
342
364
|
super(cause, {
|
343
|
-
code:
|
365
|
+
code: ProviderDisconnectedError.code,
|
344
366
|
shortMessage: 'The Provider is disconnected from all chains.',
|
345
367
|
})
|
346
368
|
}
|
@@ -353,10 +375,11 @@ export class ProviderDisconnectedError extends ProviderRpcError {
|
|
353
375
|
*/
|
354
376
|
export class ChainDisconnectedError extends ProviderRpcError {
|
355
377
|
override name = 'ChainDisconnectedError'
|
378
|
+
static code = 4901 as const
|
356
379
|
|
357
380
|
constructor(cause: Error) {
|
358
381
|
super(cause, {
|
359
|
-
code:
|
382
|
+
code: ChainDisconnectedError.code,
|
360
383
|
shortMessage: 'The Provider is not connected to the requested chain.',
|
361
384
|
})
|
362
385
|
}
|
@@ -369,10 +392,11 @@ export class ChainDisconnectedError extends ProviderRpcError {
|
|
369
392
|
*/
|
370
393
|
export class SwitchChainError extends ProviderRpcError {
|
371
394
|
override name = 'SwitchChainError'
|
395
|
+
static code = 4902 as const
|
372
396
|
|
373
397
|
constructor(cause: Error) {
|
374
398
|
super(cause, {
|
375
|
-
code:
|
399
|
+
code: SwitchChainError.code,
|
376
400
|
shortMessage: 'An error occurred when attempting to switch chain.',
|
377
401
|
})
|
378
402
|
}
|
package/src/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '1.
|
1
|
+
export const version = '1.2.0'
|
package/src/index.ts
CHANGED
@@ -34,10 +34,10 @@ export {
|
|
34
34
|
type GetContractParameters,
|
35
35
|
type GetContractReturnType,
|
36
36
|
} from './actions/getContract.js'
|
37
|
-
export type
|
38
|
-
export
|
39
|
-
CallParameters,
|
40
|
-
CallReturnType,
|
37
|
+
export { type AddChainParameters } from './actions/wallet/addChain.js'
|
38
|
+
export {
|
39
|
+
type CallParameters,
|
40
|
+
type CallReturnType,
|
41
41
|
} from './actions/public/call.js'
|
42
42
|
export type { CreateBlockFilterReturnType } from './actions/public/createBlockFilter.js'
|
43
43
|
export type {
|
@@ -223,6 +223,10 @@ export type {
|
|
223
223
|
WatchAssetParameters,
|
224
224
|
WatchAssetReturnType,
|
225
225
|
} from './actions/wallet/watchAsset.js'
|
226
|
+
export type {
|
227
|
+
VerifyHashParameters,
|
228
|
+
VerifyHashReturnType,
|
229
|
+
} from './actions/public/verifyHash.js'
|
226
230
|
export type {
|
227
231
|
WatchContractEventParameters,
|
228
232
|
WatchContractEventReturnType,
|
@@ -261,6 +265,18 @@ export {
|
|
261
265
|
type TestClientConfig,
|
262
266
|
createTestClient,
|
263
267
|
} from './clients/createTestClient.js'
|
268
|
+
export {
|
269
|
+
type PublicActions,
|
270
|
+
publicActions,
|
271
|
+
} from './clients/decorators/public.js'
|
272
|
+
export {
|
273
|
+
type TestActions,
|
274
|
+
testActions,
|
275
|
+
} from './clients/decorators/test.js'
|
276
|
+
export {
|
277
|
+
type WalletActions,
|
278
|
+
walletActions,
|
279
|
+
} from './clients/decorators/wallet.js'
|
264
280
|
export {
|
265
281
|
type Transport,
|
266
282
|
type TransportConfig,
|
package/src/types/account.ts
CHANGED
@@ -2,7 +2,7 @@ import type { Address } from 'abitype'
|
|
2
2
|
|
3
3
|
import type { Account, JsonRpcAccount } from '../accounts/types.js'
|
4
4
|
|
5
|
-
import type { IsUndefined } from './utils.js'
|
5
|
+
import type { IsUndefined, Prettify } from './utils.js'
|
6
6
|
|
7
7
|
export type GetAccountParameter<
|
8
8
|
TAccount extends Account | undefined = Account | undefined,
|
@@ -10,10 +10,14 @@ export type GetAccountParameter<
|
|
10
10
|
? { account: Account | Address }
|
11
11
|
: { account?: Account | Address }
|
12
12
|
|
13
|
-
export type ParseAccount<
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
export type ParseAccount<
|
14
|
+
TAccountOrAddress extends Account | Address | undefined =
|
15
|
+
| Account
|
16
|
+
| Address
|
17
|
+
| undefined,
|
18
|
+
> = TAccountOrAddress extends Address
|
19
|
+
? Prettify<JsonRpcAccount<TAccountOrAddress>>
|
20
|
+
: TAccountOrAddress
|
17
21
|
|
18
22
|
export type {
|
19
23
|
Account,
|
package/src/types/utils.ts
CHANGED
@@ -176,9 +176,9 @@ export type PartialBy<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>
|
|
176
176
|
/**
|
177
177
|
* @description Combines members of an intersection into a readable type.
|
178
178
|
*
|
179
|
-
* @link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg
|
179
|
+
* @see {@link https://twitter.com/mattpocockuk/status/1622730173446557697?s=20&t=NdpAcmEFXY01xkqU3KO0Mg}
|
180
180
|
* @example
|
181
|
-
* Prettify<{ a: string }
|
181
|
+
* Prettify<{ a: string } & { b: string } & { c: number, d: bigint }>
|
182
182
|
* => { a: string, b: string, c: number, d: bigint }
|
183
183
|
*/
|
184
184
|
export type Prettify<T> = {
|
@@ -71,27 +71,65 @@ export function buildRequest<TRequest extends (args: any) => Promise<any>>(
|
|
71
71
|
const err = err_ as unknown as RpcError<
|
72
72
|
RpcErrorCode | ProviderRpcErrorCode
|
73
73
|
>
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
74
|
+
switch (err.code) {
|
75
|
+
// -32700
|
76
|
+
case ParseRpcError.code:
|
77
|
+
throw new ParseRpcError(err)
|
78
|
+
// -32600
|
79
|
+
case InvalidRequestRpcError.code:
|
80
|
+
throw new InvalidRequestRpcError(err)
|
81
|
+
// -32601
|
82
|
+
case MethodNotFoundRpcError.code:
|
83
|
+
throw new MethodNotFoundRpcError(err)
|
84
|
+
// -32602
|
85
|
+
case InvalidParamsRpcError.code:
|
86
|
+
throw new InvalidParamsRpcError(err)
|
87
|
+
// -32603
|
88
|
+
case InternalRpcError.code:
|
89
|
+
throw new InternalRpcError(err)
|
90
|
+
// -32000
|
91
|
+
case InvalidInputRpcError.code:
|
92
|
+
throw new InvalidInputRpcError(err)
|
93
|
+
// -32001
|
94
|
+
case ResourceNotFoundRpcError.code:
|
95
|
+
throw new ResourceNotFoundRpcError(err)
|
96
|
+
// -32002
|
97
|
+
case ResourceUnavailableRpcError.code:
|
98
|
+
throw new ResourceUnavailableRpcError(err)
|
99
|
+
// -32003
|
100
|
+
case TransactionRejectedRpcError.code:
|
101
|
+
throw new TransactionRejectedRpcError(err)
|
102
|
+
// -32004
|
103
|
+
case MethodNotSupportedRpcError.code:
|
104
|
+
throw new MethodNotSupportedRpcError(err)
|
105
|
+
// -32005
|
106
|
+
case LimitExceededRpcError.code:
|
107
|
+
throw new LimitExceededRpcError(err)
|
108
|
+
// -32006
|
109
|
+
case JsonRpcVersionUnsupportedError.code:
|
110
|
+
throw new JsonRpcVersionUnsupportedError(err)
|
111
|
+
// 4001
|
112
|
+
case UserRejectedRequestError.code:
|
113
|
+
throw new UserRejectedRequestError(err)
|
114
|
+
// 4100
|
115
|
+
case UnauthorizedProviderError.code:
|
116
|
+
throw new UnauthorizedProviderError(err)
|
117
|
+
// 4200
|
118
|
+
case UnsupportedProviderMethodError.code:
|
119
|
+
throw new UnsupportedProviderMethodError(err)
|
120
|
+
// 4900
|
121
|
+
case ProviderDisconnectedError.code:
|
122
|
+
throw new ProviderDisconnectedError(err)
|
123
|
+
// 4901
|
124
|
+
case ChainDisconnectedError.code:
|
125
|
+
throw new ChainDisconnectedError(err)
|
126
|
+
// 4902
|
127
|
+
case SwitchChainError.code:
|
128
|
+
throw new SwitchChainError(err)
|
129
|
+
default:
|
130
|
+
if (err_ instanceof BaseError) throw err_
|
131
|
+
throw new UnknownRpcError(err as Error)
|
132
|
+
}
|
95
133
|
}
|
96
134
|
},
|
97
135
|
{
|
package/src/utils/ccip.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { Abi, Address } from 'abitype'
|
2
2
|
|
3
3
|
import { type CallParameters, call } from '../actions/public/call.js'
|
4
|
-
import type { PublicClient } from '../clients/createPublicClient.js'
|
5
4
|
import type { Transport } from '../clients/transports/createTransport.js'
|
6
5
|
import { type BaseError } from '../errors/base.js'
|
7
6
|
import {
|
@@ -14,6 +13,7 @@ import type { Chain } from '../types/chain.js'
|
|
14
13
|
import type { GetErrorArgs } from '../types/contract.js'
|
15
14
|
import type { Hex } from '../types/misc.js'
|
16
15
|
|
16
|
+
import type { Client } from '../clients/createClient.js'
|
17
17
|
import { decodeErrorResult } from './abi/decodeErrorResult.js'
|
18
18
|
import { encodeAbiParameters } from './abi/encodeAbiParameters.js'
|
19
19
|
import { isAddressEqual } from './address/isAddressEqual.js'
|
@@ -49,8 +49,8 @@ export const offchainLookupAbiItem = {
|
|
49
49
|
],
|
50
50
|
} as const satisfies Abi[number]
|
51
51
|
|
52
|
-
export async function offchainLookup<TChain extends Chain | undefined
|
53
|
-
client:
|
52
|
+
export async function offchainLookup<TChain extends Chain | undefined,>(
|
53
|
+
client: Client<Transport, TChain>,
|
54
54
|
{
|
55
55
|
blockNumber,
|
56
56
|
blockTag,
|
@@ -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 { AssetGatewayUrls } from '../../../types/ens.js'
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
} from './utils.js'
|
14
14
|
|
15
15
|
export async function parseAvatarRecord<TChain extends Chain | undefined>(
|
16
|
-
client:
|
16
|
+
client: Client<Transport, TChain>,
|
17
17
|
{
|
18
18
|
gatewayUrls,
|
19
19
|
record,
|
@@ -28,7 +28,7 @@ export async function parseAvatarRecord<TChain extends Chain | undefined>(
|
|
28
28
|
}
|
29
29
|
|
30
30
|
async function parseNftAvatarUri<TChain extends Chain | undefined>(
|
31
|
-
client:
|
31
|
+
client: Client<Transport, TChain>,
|
32
32
|
{
|
33
33
|
gatewayUrls,
|
34
34
|
record,
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
3
|
import { readContract } from '../../../actions/public/readContract.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 {
|
7
7
|
EnsAvatarInvalidMetadataError,
|
@@ -213,7 +213,7 @@ export function parseNftUri(uri: string): ParsedNft {
|
|
213
213
|
}
|
214
214
|
|
215
215
|
export async function getNftTokenUri<TChain extends Chain | undefined>(
|
216
|
-
client:
|
216
|
+
client: Client<Transport, TChain>,
|
217
217
|
{ nft }: { nft: ParsedNft },
|
218
218
|
) {
|
219
219
|
if (nft.namespace === 'erc721') {
|
@@ -1,8 +1,9 @@
|
|
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 { OnResponseFn } from '../../clients/transports/fallback.js'
|
4
4
|
import type { Chain } from '../../types/chain.js'
|
5
|
-
import type {
|
5
|
+
import type { PublicRpcSchema } from '../../types/eip1193.js'
|
6
|
+
import type { EIP1193RequestFn } from '../../types/eip1193.js'
|
6
7
|
import type { Hex } from '../../types/misc.js'
|
7
8
|
import type { Filter } from '../../types/utils.js'
|
8
9
|
|
@@ -28,7 +29,7 @@ type CreateFilterRequestScopeReturnType = (
|
|
28
29
|
* to the successful filter ID.
|
29
30
|
*/
|
30
31
|
export function createFilterRequestScope<TChain extends Chain | undefined>(
|
31
|
-
client:
|
32
|
+
client: Client<Transport, TChain>,
|
32
33
|
{ method }: CreateFilterRequestScopeParameters,
|
33
34
|
): CreateFilterRequestScopeReturnType {
|
34
35
|
const requestMap: Record<Hex, EIP1193RequestFn> = {}
|
@@ -10,8 +10,7 @@ import { getBlock } from '../../actions/public/getBlock.js'
|
|
10
10
|
import { getGasPrice } from '../../actions/public/getGasPrice.js'
|
11
11
|
import { getTransactionCount } from '../../actions/public/getTransactionCount.js'
|
12
12
|
import type { SendTransactionParameters } from '../../actions/wallet/sendTransaction.js'
|
13
|
-
import type {
|
14
|
-
import type { WalletClient } from '../../clients/createWalletClient.js'
|
13
|
+
import type { Client } from '../../clients/createClient.js'
|
15
14
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
16
15
|
import { AccountNotFoundError } from '../../errors/account.js'
|
17
16
|
import { BaseError } from '../../errors/base.js'
|
@@ -49,9 +48,7 @@ export async function prepareRequest<
|
|
49
48
|
TAccount extends Account | undefined,
|
50
49
|
TParameters extends PrepareRequestParameters<TAccount>,
|
51
50
|
>(
|
52
|
-
client:
|
53
|
-
| WalletClient<Transport, TChain, TAccount>
|
54
|
-
| PublicClient<Transport, TChain>,
|
51
|
+
client: Client<Transport, TChain, TAccount>,
|
55
52
|
args: TParameters,
|
56
53
|
): Promise<PrepareRequestReturnType<TAccount, TParameters>> {
|
57
54
|
const {
|