viem 0.0.0-portable-types-20230523145621 → 0.0.0-tmm-sign-typed-data-types.20230619T221425
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/README.md +12 -0
- package/dist/cjs/actions/ens/getEnsAddress.js +34 -23
- package/dist/cjs/actions/ens/getEnsAddress.js.map +1 -1
- package/dist/cjs/actions/getContract.js +22 -16
- package/dist/cjs/actions/getContract.js.map +1 -1
- package/dist/cjs/actions/public/call.js +1 -1
- package/dist/cjs/actions/public/call.js.map +1 -1
- package/dist/cjs/actions/public/createContractEventFilter.js +2 -1
- package/dist/cjs/actions/public/createContractEventFilter.js.map +1 -1
- package/dist/cjs/actions/public/createEventFilter.js +2 -1
- package/dist/cjs/actions/public/createEventFilter.js.map +1 -1
- package/dist/cjs/actions/public/estimateContractGas.js +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/getBlock.js.map +1 -1
- package/dist/cjs/actions/public/getBlockTransactionCount.js +1 -1
- package/dist/cjs/actions/public/getBlockTransactionCount.js.map +1 -1
- package/dist/cjs/actions/public/getChainId.js +3 -1
- package/dist/cjs/actions/public/getChainId.js.map +1 -1
- package/dist/cjs/actions/public/getFilterChanges.js +15 -3
- package/dist/cjs/actions/public/getFilterChanges.js.map +1 -1
- package/dist/cjs/actions/public/getFilterLogs.js +14 -2
- 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 +15 -3
- package/dist/cjs/actions/public/getLogs.js.map +1 -1
- package/dist/cjs/actions/public/getTransactionCount.js.map +1 -1
- package/dist/cjs/actions/public/verifyTypedData.js +6 -1
- package/dist/cjs/actions/public/verifyTypedData.js.map +1 -1
- package/dist/cjs/actions/public/watchContractEvent.js +3 -1
- package/dist/cjs/actions/public/watchContractEvent.js.map +1 -1
- package/dist/cjs/actions/public/watchEvent.js +3 -1
- package/dist/cjs/actions/public/watchEvent.js.map +1 -1
- package/dist/cjs/actions/test/getAutomine.js +4 -0
- package/dist/cjs/actions/test/getAutomine.js.map +1 -1
- package/dist/cjs/actions/test/mine.js +10 -4
- package/dist/cjs/actions/test/mine.js.map +1 -1
- package/dist/cjs/actions/test/sendUnsignedTransaction.js +21 -3
- package/dist/cjs/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/dist/cjs/actions/test/setAutomine.js +11 -4
- package/dist/cjs/actions/test/setAutomine.js.map +1 -1
- package/dist/cjs/actions/test/setBalance.js +10 -4
- package/dist/cjs/actions/test/setBalance.js.map +1 -1
- package/dist/cjs/actions/wallet/sendTransaction.js +1 -1
- package/dist/cjs/actions/wallet/sendTransaction.js.map +1 -1
- package/dist/cjs/actions/wallet/signMessage.js +8 -1
- package/dist/cjs/actions/wallet/signMessage.js.map +1 -1
- package/dist/cjs/chains.js +14 -2
- package/dist/cjs/chains.js.map +1 -1
- package/dist/cjs/clients/createClient.js +1 -1
- package/dist/cjs/clients/createClient.js.map +1 -1
- package/dist/cjs/clients/createPublicClient.js.map +1 -1
- package/dist/cjs/clients/createTestClient.js.map +1 -1
- package/dist/cjs/clients/createWalletClient.js.map +1 -1
- package/dist/cjs/clients/decorators/public.js.map +1 -1
- package/dist/cjs/clients/decorators/test.js.map +1 -1
- package/dist/cjs/clients/transports/createTransport.js.map +1 -1
- package/dist/cjs/clients/transports/custom.js.map +1 -1
- package/dist/cjs/clients/transports/fallback.js.map +1 -1
- package/dist/cjs/clients/transports/http.js +25 -7
- package/dist/cjs/clients/transports/http.js.map +1 -1
- package/dist/cjs/clients/transports/webSocket.js +22 -14
- package/dist/cjs/clients/transports/webSocket.js.map +1 -1
- package/dist/cjs/errors/abi.js +15 -1
- package/dist/cjs/errors/abi.js.map +1 -1
- package/dist/cjs/errors/base.js +4 -11
- package/dist/cjs/errors/base.js.map +1 -1
- package/dist/cjs/errors/request.js.map +1 -1
- package/dist/cjs/errors/rpc.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/errors/version.js.map +1 -1
- package/dist/cjs/index.js +26 -10
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/eip1193.js.map +1 -1
- package/dist/cjs/utils/abi/decodeEventLog.js +33 -19
- package/dist/cjs/utils/abi/decodeEventLog.js.map +1 -1
- package/dist/cjs/utils/abi/encodeEventTopics.js +11 -7
- package/dist/cjs/utils/abi/encodeEventTopics.js.map +1 -1
- package/dist/cjs/utils/abi/getAbiItem.js +2 -0
- package/dist/cjs/utils/abi/getAbiItem.js.map +1 -1
- package/dist/cjs/utils/encoding/toBytes.js.map +1 -1
- package/dist/cjs/utils/encoding/toHex.js.map +1 -1
- package/dist/cjs/utils/ens/encodeLabelhash.js +8 -0
- package/dist/cjs/utils/ens/encodeLabelhash.js.map +1 -0
- package/dist/cjs/utils/ens/encodedLabelToLabelhash.js +18 -0
- package/dist/cjs/utils/ens/encodedLabelToLabelhash.js.map +1 -0
- package/dist/cjs/utils/ens/labelhash.js +2 -1
- package/dist/cjs/utils/ens/labelhash.js.map +1 -1
- package/dist/cjs/utils/ens/namehash.js +5 -1
- package/dist/cjs/utils/ens/namehash.js.map +1 -1
- package/dist/cjs/utils/ens/packetToBytes.js +10 -9
- package/dist/cjs/utils/ens/packetToBytes.js.map +1 -1
- package/dist/cjs/utils/filters/createFilterRequestScope.js.map +1 -1
- package/dist/cjs/utils/formatters/block.js +3 -1
- package/dist/cjs/utils/formatters/block.js.map +1 -1
- package/dist/cjs/utils/formatters/log.js +2 -2
- package/dist/cjs/utils/formatters/transaction.js +3 -1
- package/dist/cjs/utils/formatters/transaction.js.map +1 -1
- package/dist/cjs/utils/formatters/transactionReceipt.js +1 -1
- package/dist/cjs/utils/formatters/transactionReceipt.js.map +1 -1
- package/dist/cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/dist/cjs/utils/hash/getEventSelector.js +5 -1
- package/dist/cjs/utils/hash/getEventSelector.js.map +1 -1
- package/dist/cjs/utils/hash/getFunctionSelector.js +5 -1
- package/dist/cjs/utils/hash/getFunctionSelector.js.map +1 -1
- package/dist/cjs/utils/hash/hashFunction.js +6 -4
- package/dist/cjs/utils/hash/hashFunction.js.map +1 -1
- package/dist/cjs/utils/index.js.map +1 -1
- package/dist/cjs/utils/observe.js.map +1 -1
- package/dist/cjs/utils/promise/createBatchScheduler.js.map +1 -1
- package/dist/cjs/utils/promise/withCache.js +8 -4
- package/dist/cjs/utils/promise/withCache.js.map +1 -1
- package/dist/cjs/utils/rpc.js +12 -17
- package/dist/cjs/utils/rpc.js.map +1 -1
- package/dist/cjs/utils/signature/hashMessage.js +7 -1
- package/dist/cjs/utils/signature/hashMessage.js.map +1 -1
- package/dist/cjs/utils/transaction/getTransactionType.js.map +1 -1
- package/dist/cjs/utils/transaction/serializeTransaction.js.map +1 -1
- package/dist/cjs/utils/typedData.js.map +1 -1
- package/dist/cjs/utils/unit/parseUnits.js +13 -3
- package/dist/cjs/utils/unit/parseUnits.js.map +1 -1
- package/dist/esm/accounts/generateMnemonic.js +7 -0
- package/dist/esm/accounts/generateMnemonic.js.map +1 -1
- package/dist/esm/accounts/generatePrivateKey.js +5 -0
- package/dist/esm/accounts/generatePrivateKey.js.map +1 -1
- package/dist/esm/accounts/hdKeyToAccount.js +5 -0
- package/dist/esm/accounts/hdKeyToAccount.js.map +1 -1
- package/dist/esm/accounts/mnemonicToAccount.js +5 -0
- package/dist/esm/accounts/mnemonicToAccount.js.map +1 -1
- package/dist/esm/accounts/privateKeyToAccount.js +5 -0
- package/dist/esm/accounts/privateKeyToAccount.js.map +1 -1
- package/dist/esm/accounts/toAccount.js +5 -0
- package/dist/esm/accounts/toAccount.js.map +1 -1
- package/dist/esm/accounts/utils/publicKeyToAddress.js +7 -0
- package/dist/esm/accounts/utils/publicKeyToAddress.js.map +1 -1
- package/dist/esm/accounts/utils/sign.js +8 -0
- package/dist/esm/accounts/utils/sign.js.map +1 -1
- package/dist/esm/accounts/utils/signMessage.js +6 -0
- package/dist/esm/accounts/utils/signMessage.js.map +1 -1
- package/dist/esm/accounts/utils/signTypedData.js +6 -0
- package/dist/esm/accounts/utils/signTypedData.js.map +1 -1
- package/dist/esm/actions/ens/getEnsAddress.js +62 -23
- package/dist/esm/actions/ens/getEnsAddress.js.map +1 -1
- package/dist/esm/actions/ens/getEnsAvatar.js +28 -0
- package/dist/esm/actions/ens/getEnsAvatar.js.map +1 -1
- package/dist/esm/actions/ens/getEnsName.js +27 -0
- package/dist/esm/actions/ens/getEnsName.js.map +1 -1
- package/dist/esm/actions/ens/getEnsResolver.js +28 -0
- package/dist/esm/actions/ens/getEnsResolver.js.map +1 -1
- package/dist/esm/actions/ens/getEnsText.js +29 -0
- package/dist/esm/actions/ens/getEnsText.js.map +1 -1
- package/dist/esm/actions/getContract.js +58 -16
- package/dist/esm/actions/getContract.js.map +1 -1
- package/dist/esm/actions/public/call.js +32 -1
- package/dist/esm/actions/public/call.js.map +1 -1
- package/dist/esm/actions/public/createBlockFilter.js +21 -0
- package/dist/esm/actions/public/createBlockFilter.js.map +1 -1
- package/dist/esm/actions/public/createContractEventFilter.js +24 -1
- package/dist/esm/actions/public/createContractEventFilter.js.map +1 -1
- package/dist/esm/actions/public/createEventFilter.js +25 -1
- package/dist/esm/actions/public/createEventFilter.js.map +1 -1
- package/dist/esm/actions/public/createPendingTransactionFilter.js +21 -0
- package/dist/esm/actions/public/createPendingTransactionFilter.js.map +1 -1
- package/dist/esm/actions/public/estimateContractGas.js +28 -1
- package/dist/esm/actions/public/estimateContractGas.js.map +1 -1
- package/dist/esm/actions/public/estimateGas.js +26 -0
- package/dist/esm/actions/public/estimateGas.js.map +1 -1
- package/dist/esm/actions/public/getBalance.js +35 -0
- package/dist/esm/actions/public/getBalance.js.map +1 -1
- package/dist/esm/actions/public/getBlock.js +24 -0
- package/dist/esm/actions/public/getBlock.js.map +1 -1
- package/dist/esm/actions/public/getBlockNumber.js +23 -0
- package/dist/esm/actions/public/getBlockNumber.js.map +1 -1
- package/dist/esm/actions/public/getBlockTransactionCount.js +24 -1
- package/dist/esm/actions/public/getBlockTransactionCount.js.map +1 -1
- package/dist/esm/actions/public/getBytecode.js +23 -0
- package/dist/esm/actions/public/getBytecode.js.map +1 -1
- package/dist/esm/actions/public/getChainId.js +24 -1
- package/dist/esm/actions/public/getChainId.js.map +1 -1
- package/dist/esm/actions/public/getFeeHistory.js +24 -0
- package/dist/esm/actions/public/getFeeHistory.js.map +1 -1
- package/dist/esm/actions/public/getFilterChanges.js +99 -3
- package/dist/esm/actions/public/getFilterChanges.js.map +1 -1
- package/dist/esm/actions/public/getFilterLogs.js +43 -2
- package/dist/esm/actions/public/getFilterLogs.js.map +1 -1
- package/dist/esm/actions/public/getGasPrice.js +20 -0
- package/dist/esm/actions/public/getGasPrice.js.map +1 -1
- package/dist/esm/actions/public/getLogs.js +39 -3
- package/dist/esm/actions/public/getLogs.js.map +1 -1
- package/dist/esm/actions/public/getStorageAt.js +24 -0
- package/dist/esm/actions/public/getStorageAt.js.map +1 -1
- package/dist/esm/actions/public/getTransaction.js +24 -0
- package/dist/esm/actions/public/getTransaction.js.map +1 -1
- package/dist/esm/actions/public/getTransactionConfirmations.js +24 -0
- package/dist/esm/actions/public/getTransactionConfirmations.js.map +1 -1
- package/dist/esm/actions/public/getTransactionCount.js +23 -0
- package/dist/esm/actions/public/getTransactionCount.js.map +1 -1
- package/dist/esm/actions/public/getTransactionReceipt.js +24 -0
- package/dist/esm/actions/public/getTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/public/multicall.js +40 -0
- package/dist/esm/actions/public/multicall.js.map +1 -1
- package/dist/esm/actions/public/readContract.js +31 -0
- package/dist/esm/actions/public/readContract.js.map +1 -1
- package/dist/esm/actions/public/simulateContract.js +31 -0
- package/dist/esm/actions/public/simulateContract.js.map +1 -1
- package/dist/esm/actions/public/uninstallFilter.js +24 -0
- package/dist/esm/actions/public/uninstallFilter.js.map +1 -1
- package/dist/esm/actions/public/verifyHash.js +10 -0
- package/dist/esm/actions/public/verifyHash.js.map +1 -1
- package/dist/esm/actions/public/verifyMessage.js +11 -0
- package/dist/esm/actions/public/verifyMessage.js.map +1 -1
- package/dist/esm/actions/public/verifyTypedData.js +16 -2
- package/dist/esm/actions/public/verifyTypedData.js.map +1 -1
- package/dist/esm/actions/public/waitForTransactionReceipt.js +52 -0
- package/dist/esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/dist/esm/actions/public/watchBlockNumber.js +31 -0
- package/dist/esm/actions/public/watchBlockNumber.js.map +1 -1
- package/dist/esm/actions/public/watchBlocks.js +35 -1
- package/dist/esm/actions/public/watchBlocks.js.map +1 -1
- package/dist/esm/actions/public/watchContractEvent.js +39 -1
- package/dist/esm/actions/public/watchContractEvent.js.map +1 -1
- package/dist/esm/actions/public/watchEvent.js +41 -1
- package/dist/esm/actions/public/watchEvent.js.map +1 -1
- package/dist/esm/actions/public/watchPendingTransactions.js +29 -0
- package/dist/esm/actions/public/watchPendingTransactions.js.map +1 -1
- package/dist/esm/actions/test/dropTransaction.js +22 -0
- package/dist/esm/actions/test/dropTransaction.js.map +1 -1
- package/dist/esm/actions/test/getAutomine.js +24 -0
- package/dist/esm/actions/test/getAutomine.js.map +1 -1
- package/dist/esm/actions/test/getTxpoolContent.js +20 -0
- package/dist/esm/actions/test/getTxpoolContent.js.map +1 -1
- package/dist/esm/actions/test/getTxpoolStatus.js +20 -0
- package/dist/esm/actions/test/getTxpoolStatus.js.map +1 -1
- package/dist/esm/actions/test/impersonateAccount.js +22 -0
- package/dist/esm/actions/test/impersonateAccount.js.map +1 -1
- package/dist/esm/actions/test/increaseTime.js +22 -0
- package/dist/esm/actions/test/increaseTime.js.map +1 -1
- package/dist/esm/actions/test/inspectTxpool.js +20 -0
- package/dist/esm/actions/test/inspectTxpool.js.map +1 -1
- package/dist/esm/actions/test/mine.js +30 -4
- package/dist/esm/actions/test/mine.js.map +1 -1
- package/dist/esm/actions/test/removeBlockTimestampInterval.js +19 -0
- package/dist/esm/actions/test/removeBlockTimestampInterval.js.map +1 -1
- package/dist/esm/actions/test/reset.js +20 -0
- package/dist/esm/actions/test/reset.js.map +1 -1
- package/dist/esm/actions/test/revert.js +20 -0
- package/dist/esm/actions/test/revert.js.map +1 -1
- package/dist/esm/actions/test/sendUnsignedTransaction.js +48 -4
- package/dist/esm/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/dist/esm/actions/test/setAutomine.js +30 -4
- package/dist/esm/actions/test/setAutomine.js.map +1 -1
- package/dist/esm/actions/test/setBalance.js +33 -4
- package/dist/esm/actions/test/setBalance.js.map +1 -1
- package/dist/esm/actions/test/setBlockGasLimit.js +20 -0
- package/dist/esm/actions/test/setBlockGasLimit.js.map +1 -1
- package/dist/esm/actions/test/setBlockTimestampInterval.js +20 -0
- package/dist/esm/actions/test/setBlockTimestampInterval.js.map +1 -1
- package/dist/esm/actions/test/setCode.js +23 -0
- package/dist/esm/actions/test/setCode.js.map +1 -1
- package/dist/esm/actions/test/setCoinbase.js +22 -0
- package/dist/esm/actions/test/setCoinbase.js.map +1 -1
- package/dist/esm/actions/test/setIntervalMining.js +20 -0
- package/dist/esm/actions/test/setIntervalMining.js.map +1 -1
- package/dist/esm/actions/test/setLoggingEnabled.js +19 -0
- package/dist/esm/actions/test/setLoggingEnabled.js.map +1 -1
- package/dist/esm/actions/test/setMinGasPrice.js +24 -0
- package/dist/esm/actions/test/setMinGasPrice.js.map +1 -1
- package/dist/esm/actions/test/setNextBlockBaseFeePerGas.js +22 -0
- package/dist/esm/actions/test/setNextBlockBaseFeePerGas.js.map +1 -1
- package/dist/esm/actions/test/setNextBlockTimestamp.js +20 -0
- package/dist/esm/actions/test/setNextBlockTimestamp.js.map +1 -1
- package/dist/esm/actions/test/setNonce.js +23 -0
- package/dist/esm/actions/test/setNonce.js.map +1 -1
- package/dist/esm/actions/test/setRpcUrl.js +20 -0
- package/dist/esm/actions/test/setRpcUrl.js.map +1 -1
- package/dist/esm/actions/test/setStorageAt.js +24 -0
- package/dist/esm/actions/test/setStorageAt.js.map +1 -1
- package/dist/esm/actions/test/snapshot.js +19 -0
- package/dist/esm/actions/test/snapshot.js.map +1 -1
- package/dist/esm/actions/test/stopImpersonatingAccount.js +22 -0
- package/dist/esm/actions/test/stopImpersonatingAccount.js.map +1 -1
- package/dist/esm/actions/wallet/addChain.js +19 -0
- package/dist/esm/actions/wallet/addChain.js.map +1 -1
- package/dist/esm/actions/wallet/deployContract.js +27 -0
- package/dist/esm/actions/wallet/deployContract.js.map +1 -1
- package/dist/esm/actions/wallet/getAddresses.js +20 -0
- package/dist/esm/actions/wallet/getAddresses.js.map +1 -1
- package/dist/esm/actions/wallet/getPermissions.js +20 -0
- package/dist/esm/actions/wallet/getPermissions.js.map +1 -1
- package/dist/esm/actions/wallet/requestAddresses.js +24 -0
- package/dist/esm/actions/wallet/requestAddresses.js.map +1 -1
- package/dist/esm/actions/wallet/requestPermissions.js +23 -0
- package/dist/esm/actions/wallet/requestPermissions.js.map +1 -1
- package/dist/esm/actions/wallet/sendTransaction.js +48 -1
- package/dist/esm/actions/wallet/sendTransaction.js.map +1 -1
- package/dist/esm/actions/wallet/signMessage.js +55 -2
- package/dist/esm/actions/wallet/signMessage.js.map +1 -1
- package/dist/esm/actions/wallet/signTypedData.js +100 -0
- package/dist/esm/actions/wallet/signTypedData.js.map +1 -1
- package/dist/esm/actions/wallet/switchChain.js +20 -0
- package/dist/esm/actions/wallet/switchChain.js.map +1 -1
- package/dist/esm/actions/wallet/watchAsset.js +28 -0
- package/dist/esm/actions/wallet/watchAsset.js.map +1 -1
- package/dist/esm/actions/wallet/writeContract.js +50 -0
- package/dist/esm/actions/wallet/writeContract.js.map +1 -1
- package/dist/esm/chains.js +99 -87
- package/dist/esm/chains.js.map +1 -1
- package/dist/esm/clients/createClient.js +4 -1
- package/dist/esm/clients/createClient.js.map +1 -1
- package/dist/esm/clients/createPublicClient.js +19 -0
- package/dist/esm/clients/createPublicClient.js.map +1 -1
- package/dist/esm/clients/createTestClient.js +23 -0
- package/dist/esm/clients/createTestClient.js.map +1 -1
- package/dist/esm/clients/createWalletClient.js +36 -0
- 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.map +1 -1
- package/dist/esm/clients/transports/createTransport.js +3 -0
- package/dist/esm/clients/transports/createTransport.js.map +1 -1
- package/dist/esm/clients/transports/custom.js +3 -0
- package/dist/esm/clients/transports/custom.js.map +1 -1
- package/dist/esm/clients/transports/fallback.js +11 -0
- package/dist/esm/clients/transports/fallback.js.map +1 -1
- package/dist/esm/clients/transports/http.js +31 -8
- package/dist/esm/clients/transports/http.js.map +1 -1
- package/dist/esm/clients/transports/webSocket.js +28 -15
- package/dist/esm/clients/transports/webSocket.js.map +1 -1
- package/dist/esm/constants/abis.js +6 -0
- package/dist/esm/constants/abis.js.map +1 -1
- package/dist/esm/constants/solidity.js +1 -0
- package/dist/esm/constants/solidity.js.map +1 -1
- package/dist/esm/contract.js +0 -1
- package/dist/esm/contract.js.map +1 -1
- package/dist/esm/errors/abi.js +15 -1
- package/dist/esm/errors/abi.js.map +1 -1
- package/dist/esm/errors/base.js +4 -11
- package/dist/esm/errors/base.js.map +1 -1
- package/dist/esm/errors/node.js +9 -0
- package/dist/esm/errors/node.js.map +1 -1
- package/dist/esm/errors/request.js.map +1 -1
- package/dist/esm/errors/rpc.js +103 -0
- package/dist/esm/errors/rpc.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/errors/version.js.map +1 -1
- package/dist/esm/index.js +2 -52
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/package.json +1 -1
- package/dist/esm/types/account.js +1 -1
- package/dist/esm/types/account.js.map +1 -1
- package/dist/esm/types/eip1193.js +2 -0
- package/dist/esm/types/eip1193.js.map +1 -1
- package/dist/esm/utils/abi/decodeAbiParameters.js +29 -0
- package/dist/esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/dist/esm/utils/abi/decodeEventLog.js +35 -19
- package/dist/esm/utils/abi/decodeEventLog.js.map +1 -1
- package/dist/esm/utils/abi/encodeAbiParameters.js +10 -1
- package/dist/esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/dist/esm/utils/abi/encodeEventTopics.js +11 -7
- package/dist/esm/utils/abi/encodeEventTopics.js.map +1 -1
- package/dist/esm/utils/abi/getAbiItem.js +9 -0
- package/dist/esm/utils/abi/getAbiItem.js.map +1 -1
- package/dist/esm/utils/accounts.js +3 -0
- package/dist/esm/utils/accounts.js.map +1 -1
- package/dist/esm/utils/buildRequest.js +2 -0
- package/dist/esm/utils/buildRequest.js.map +1 -1
- package/dist/esm/utils/data/size.js +6 -0
- package/dist/esm/utils/data/size.js.map +1 -1
- package/dist/esm/utils/data/slice.js +21 -0
- package/dist/esm/utils/data/slice.js.map +1 -1
- package/dist/esm/utils/encoding/fromBytes.js +79 -0
- package/dist/esm/utils/encoding/fromBytes.js.map +1 -1
- package/dist/esm/utils/encoding/fromHex.js +106 -0
- package/dist/esm/utils/encoding/fromHex.js.map +1 -1
- package/dist/esm/utils/encoding/toBytes.js +102 -1
- package/dist/esm/utils/encoding/toBytes.js.map +1 -1
- package/dist/esm/utils/encoding/toHex.js +108 -2
- package/dist/esm/utils/encoding/toHex.js.map +1 -1
- package/dist/esm/utils/ens/avatar/parseAvatarRecord.js +6 -2
- package/dist/esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/dist/esm/utils/ens/avatar/utils.js +10 -0
- package/dist/esm/utils/ens/avatar/utils.js.map +1 -1
- package/dist/esm/utils/ens/encodeLabelhash.js +4 -0
- package/dist/esm/utils/ens/encodeLabelhash.js.map +1 -0
- package/dist/esm/utils/ens/encodedLabelToLabelhash.js +14 -0
- package/dist/esm/utils/ens/encodedLabelToLabelhash.js.map +1 -0
- package/dist/esm/utils/ens/labelhash.js +11 -1
- package/dist/esm/utils/ens/labelhash.js.map +1 -1
- package/dist/esm/utils/ens/namehash.js +18 -2
- package/dist/esm/utils/ens/namehash.js.map +1 -1
- package/dist/esm/utils/ens/normalize.js +10 -0
- package/dist/esm/utils/ens/normalize.js.map +1 -1
- package/dist/esm/utils/ens/packetToBytes.js +16 -9
- package/dist/esm/utils/ens/packetToBytes.js.map +1 -1
- package/dist/esm/utils/filters/createFilterRequestScope.js +5 -0
- package/dist/esm/utils/filters/createFilterRequestScope.js.map +1 -1
- package/dist/esm/utils/formatters/block.js +4 -1
- package/dist/esm/utils/formatters/block.js.map +1 -1
- package/dist/esm/utils/formatters/extract.js +3 -0
- package/dist/esm/utils/formatters/extract.js.map +1 -1
- package/dist/esm/utils/formatters/format.js +3 -0
- package/dist/esm/utils/formatters/format.js.map +1 -1
- package/dist/esm/utils/formatters/log.js +2 -2
- package/dist/esm/utils/formatters/transaction.js +3 -1
- package/dist/esm/utils/formatters/transaction.js.map +1 -1
- package/dist/esm/utils/formatters/transactionReceipt.js +2 -2
- package/dist/esm/utils/formatters/transactionReceipt.js.map +1 -1
- package/dist/esm/utils/formatters/transactionRequest.js +1 -1
- package/dist/esm/utils/formatters/transactionRequest.js.map +1 -1
- package/dist/esm/utils/hash/getEventSelector.js +6 -2
- package/dist/esm/utils/hash/getEventSelector.js.map +1 -1
- package/dist/esm/utils/hash/getFunctionSelector.js +6 -2
- package/dist/esm/utils/hash/getFunctionSelector.js.map +1 -1
- package/dist/esm/utils/hash/hashFunction.js +4 -3
- package/dist/esm/utils/hash/hashFunction.js.map +1 -1
- package/dist/esm/utils/index.js.map +1 -1
- package/dist/esm/utils/observe.js +7 -2
- package/dist/esm/utils/observe.js.map +1 -1
- package/dist/esm/utils/poll.js +3 -0
- package/dist/esm/utils/poll.js.map +1 -1
- package/dist/esm/utils/promise/createBatchScheduler.js +1 -1
- package/dist/esm/utils/promise/createBatchScheduler.js.map +1 -1
- package/dist/esm/utils/promise/withCache.js +23 -6
- package/dist/esm/utils/promise/withCache.js.map +1 -1
- package/dist/esm/utils/regex.js +4 -0
- package/dist/esm/utils/regex.js.map +1 -1
- package/dist/esm/utils/rpc.js +27 -19
- package/dist/esm/utils/rpc.js.map +1 -1
- package/dist/esm/utils/signature/hashMessage.js +8 -2
- package/dist/esm/utils/signature/hashMessage.js.map +1 -1
- package/dist/esm/utils/signature/hashTypedData.js +3 -0
- package/dist/esm/utils/signature/hashTypedData.js.map +1 -1
- package/dist/esm/utils/signature/recoverPublicKey.js +2 -0
- package/dist/esm/utils/signature/recoverPublicKey.js.map +1 -1
- package/dist/esm/utils/signature/verifyMessage.js +12 -0
- package/dist/esm/utils/signature/verifyMessage.js.map +1 -1
- package/dist/esm/utils/signature/verifyTypedData.js +12 -0
- package/dist/esm/utils/signature/verifyTypedData.js.map +1 -1
- package/dist/esm/utils/transaction/getTransactionType.js.map +1 -1
- package/dist/esm/utils/transaction/prepareRequest.js +5 -1
- package/dist/esm/utils/transaction/prepareRequest.js.map +1 -1
- package/dist/esm/utils/transaction/serializeTransaction.js +4 -2
- package/dist/esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/dist/esm/utils/typedData.js +4 -0
- package/dist/esm/utils/typedData.js.map +1 -1
- package/dist/esm/utils/unit/parseUnits.js +15 -3
- package/dist/esm/utils/unit/parseUnits.js.map +1 -1
- package/dist/types/accounts/types.d.ts +3 -5
- package/dist/types/accounts/types.d.ts.map +1 -1
- package/dist/types/accounts/utils/signMessage.d.ts +2 -2
- package/dist/types/accounts/utils/signMessage.d.ts.map +1 -1
- package/dist/types/accounts/utils/signTypedData.d.ts +3 -6
- package/dist/types/accounts/utils/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -1
- package/dist/types/actions/getContract.d.ts +65 -21
- package/dist/types/actions/getContract.d.ts.map +1 -1
- package/dist/types/actions/public/createContractEventFilter.d.ts +8 -3
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/createEventFilter.d.ts +17 -5
- package/dist/types/actions/public/createEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +4 -2
- package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -1
- package/dist/types/actions/public/getBlockNumber.d.ts +2 -2
- package/dist/types/actions/public/getBlockNumber.d.ts.map +1 -1
- package/dist/types/actions/public/getChainId.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +4 -4
- package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterLogs.d.ts +4 -4
- package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/dist/types/actions/public/getLogs.d.ts +10 -4
- package/dist/types/actions/public/getLogs.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 +3 -4
- package/dist/types/actions/public/verifyTypedData.d.ts.map +1 -1
- package/dist/types/actions/public/watchContractEvent.d.ts +10 -5
- package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/public/watchEvent.d.ts +11 -5
- package/dist/types/actions/public/watchEvent.d.ts.map +1 -1
- package/dist/types/actions/test/getAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/mine.d.ts.map +1 -1
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +8 -2
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
- package/dist/types/actions/test/setAutomine.d.ts.map +1 -1
- package/dist/types/actions/test/setBalance.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 +4 -7
- package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -1
- package/dist/types/chains.d.ts +364 -16
- package/dist/types/chains.d.ts.map +1 -1
- package/dist/types/clients/createClient.d.ts +5 -5
- package/dist/types/clients/createClient.d.ts.map +1 -1
- package/dist/types/clients/createPublicClient.d.ts +3 -3
- package/dist/types/clients/createPublicClient.d.ts.map +1 -1
- package/dist/types/clients/createTestClient.d.ts +2 -2
- package/dist/types/clients/createTestClient.d.ts.map +1 -1
- package/dist/types/clients/createWalletClient.d.ts +2 -2
- package/dist/types/clients/createWalletClient.d.ts.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +8 -8
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/clients/decorators/test.d.ts +1 -1
- package/dist/types/clients/decorators/test.d.ts.map +1 -1
- package/dist/types/clients/decorators/wallet.d.ts +1 -3
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/types/clients/transports/createTransport.d.ts +5 -8
- package/dist/types/clients/transports/createTransport.d.ts.map +1 -1
- package/dist/types/clients/transports/custom.d.ts +2 -2
- package/dist/types/clients/transports/custom.d.ts.map +1 -1
- package/dist/types/clients/transports/http.d.ts +11 -0
- package/dist/types/clients/transports/http.d.ts.map +1 -1
- package/dist/types/clients/transports/webSocket.d.ts.map +1 -1
- package/dist/types/contract.d.ts +1 -1
- package/dist/types/contract.d.ts.map +1 -1
- package/dist/types/errors/abi.d.ts +6 -4
- package/dist/types/errors/abi.d.ts.map +1 -1
- package/dist/types/errors/base.d.ts +0 -1
- package/dist/types/errors/base.d.ts.map +1 -1
- package/dist/types/errors/request.d.ts +16 -8
- package/dist/types/errors/request.d.ts.map +1 -1
- package/dist/types/errors/rpc.d.ts +2 -2
- package/dist/types/errors/rpc.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/errors/version.d.ts.map +1 -1
- package/dist/types/index.d.ts +55 -53
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/account.d.ts +1 -1
- package/dist/types/types/account.d.ts.map +1 -1
- package/dist/types/types/contract.d.ts +11 -6
- package/dist/types/types/contract.d.ts.map +1 -1
- package/dist/types/types/eip1193.d.ts +1042 -827
- package/dist/types/types/eip1193.d.ts.map +1 -1
- package/dist/types/types/filter.d.ts +12 -3
- package/dist/types/types/filter.d.ts.map +1 -1
- package/dist/types/types/log.d.ts +5 -3
- package/dist/types/types/log.d.ts.map +1 -1
- package/dist/types/types/misc.d.ts +4 -0
- package/dist/types/types/misc.d.ts.map +1 -1
- package/dist/types/types/rpc.d.ts +1 -1
- package/dist/types/types/rpc.d.ts.map +1 -1
- package/dist/types/types/transaction.d.ts +14 -5
- package/dist/types/types/transaction.d.ts.map +1 -1
- package/dist/types/types/typedData.d.ts +17 -29
- package/dist/types/types/typedData.d.ts.map +1 -1
- package/dist/types/types/utils.d.ts +11 -0
- package/dist/types/types/utils.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeEventLog.d.ts +6 -5
- package/dist/types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeEventTopics.d.ts.map +1 -1
- package/dist/types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/dist/types/utils/ens/encodeLabelhash.d.ts +3 -0
- package/dist/types/utils/ens/encodeLabelhash.d.ts.map +1 -0
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts +3 -0
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts.map +1 -0
- package/dist/types/utils/ens/labelhash.d.ts.map +1 -1
- package/dist/types/utils/ens/namehash.d.ts.map +1 -1
- package/dist/types/utils/ens/packetToBytes.d.ts.map +1 -1
- package/dist/types/utils/filters/createFilterRequestScope.d.ts +6 -2
- package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +1 -1
- package/dist/types/utils/formatters/block.d.ts.map +1 -1
- package/dist/types/utils/formatters/transaction.d.ts +1 -1
- package/dist/types/utils/formatters/transaction.d.ts.map +1 -1
- package/dist/types/utils/formatters/transactionReceipt.d.ts.map +1 -1
- package/dist/types/utils/hash/getEventSelector.d.ts +2 -1
- package/dist/types/utils/hash/getEventSelector.d.ts.map +1 -1
- package/dist/types/utils/hash/getFunctionSelector.d.ts +2 -1
- package/dist/types/utils/hash/getFunctionSelector.d.ts.map +1 -1
- package/dist/types/utils/hash/hashFunction.d.ts +2 -0
- package/dist/types/utils/hash/hashFunction.d.ts.map +1 -1
- package/dist/types/utils/index.d.ts +1 -1
- package/dist/types/utils/index.d.ts.map +1 -1
- package/dist/types/utils/observe.d.ts.map +1 -1
- package/dist/types/utils/promise/withCache.d.ts.map +1 -1
- package/dist/types/utils/rpc.d.ts +18 -10
- package/dist/types/utils/rpc.d.ts.map +1 -1
- package/dist/types/utils/signature/hashMessage.d.ts +2 -2
- package/dist/types/utils/signature/hashMessage.d.ts.map +1 -1
- package/dist/types/utils/signature/hashTypedData.d.ts +3 -6
- package/dist/types/utils/signature/hashTypedData.d.ts.map +1 -1
- package/dist/types/utils/signature/recoverMessageAddress.d.ts +2 -2
- package/dist/types/utils/signature/recoverMessageAddress.d.ts.map +1 -1
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +3 -6
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +1 -1
- package/dist/types/utils/signature/verifyTypedData.d.ts +3 -6
- package/dist/types/utils/signature/verifyTypedData.d.ts.map +1 -1
- package/dist/types/utils/transaction/getTransactionType.d.ts +2 -2
- package/dist/types/utils/transaction/getTransactionType.d.ts.map +1 -1
- package/dist/types/utils/typedData.d.ts +2 -3
- package/dist/types/utils/typedData.d.ts.map +1 -1
- package/dist/types/utils/unit/parseUnits.d.ts.map +1 -1
- package/package.json +7 -13
- package/src/accounts/types.ts +4 -4
- package/src/accounts/utils/signMessage.ts +2 -2
- package/src/accounts/utils/signTypedData.ts +4 -4
- package/src/actions/ens/getEnsAddress.ts +37 -22
- package/src/actions/getContract.ts +133 -69
- package/src/actions/public/call.ts +1 -1
- package/src/actions/public/createContractEventFilter.ts +21 -4
- package/src/actions/public/createEventFilter.ts +34 -13
- package/src/actions/public/estimateContractGas.ts +10 -4
- package/src/actions/public/estimateGas.ts +1 -1
- package/src/actions/public/getBlock.ts +2 -2
- package/src/actions/public/getBlockTransactionCount.ts +1 -1
- package/src/actions/public/getChainId.ts +3 -1
- package/src/actions/public/getFilterChanges.ts +32 -7
- package/src/actions/public/getFilterLogs.ts +34 -8
- package/src/actions/public/getGasPrice.ts +1 -1
- package/src/actions/public/getLogs.ts +39 -10
- package/src/actions/public/getTransactionCount.ts +1 -1
- package/src/actions/public/verifyMessage.ts +2 -2
- package/src/actions/public/verifyTypedData.ts +18 -6
- package/src/actions/public/watchContractEvent.ts +16 -4
- package/src/actions/public/watchEvent.ts +17 -4
- package/src/actions/test/getAutomine.ts +4 -0
- package/src/actions/test/mine.ts +10 -4
- package/src/actions/test/sendUnsignedTransaction.ts +54 -5
- package/src/actions/test/setAutomine.ts +8 -4
- package/src/actions/test/setBalance.ts +10 -4
- package/src/actions/wallet/sendTransaction.ts +1 -1
- package/src/actions/wallet/signMessage.ts +11 -4
- package/src/actions/wallet/signTypedData.ts +5 -5
- package/src/chains.ts +123 -88
- package/src/clients/createClient.ts +13 -11
- package/src/clients/createPublicClient.ts +3 -4
- package/src/clients/createTestClient.ts +2 -3
- package/src/clients/createWalletClient.ts +2 -3
- package/src/clients/decorators/public.ts +43 -17
- package/src/clients/decorators/test.ts +4 -3
- package/src/clients/decorators/wallet.ts +2 -2
- package/src/clients/transports/createTransport.ts +5 -9
- package/src/clients/transports/custom.ts +1 -2
- package/src/clients/transports/fallback.ts +1 -1
- package/src/clients/transports/http.ts +44 -7
- package/src/clients/transports/webSocket.ts +23 -15
- package/src/contract.ts +3 -3
- package/src/errors/abi.ts +16 -4
- package/src/errors/base.ts +6 -6
- package/src/errors/request.ts +4 -4
- package/src/errors/rpc.ts +3 -2
- package/src/errors/version.ts +1 -1
- package/src/index.ts +263 -249
- package/src/types/account.ts +9 -9
- package/src/types/contract.ts +33 -15
- package/src/types/eip1193.ts +1084 -827
- package/src/types/filter.ts +15 -3
- package/src/types/log.ts +13 -3
- package/src/types/misc.ts +6 -0
- package/src/types/rpc.ts +1 -1
- package/src/types/transaction.ts +24 -6
- package/src/types/typedData.ts +36 -45
- package/src/types/utils.ts +15 -0
- package/src/utils/abi/decodeEventLog.ts +47 -22
- package/src/utils/abi/encodeEventTopics.ts +16 -11
- package/src/utils/abi/getAbiItem.ts +1 -0
- package/src/utils/encoding/toBytes.ts +1 -1
- package/src/utils/encoding/toHex.ts +2 -2
- package/src/utils/ens/encodeLabelhash.ts +5 -0
- package/src/utils/ens/encodedLabelToLabelhash.ts +11 -0
- package/src/utils/ens/labelhash.ts +2 -1
- package/src/utils/ens/namehash.ts +6 -2
- package/src/utils/ens/packetToBytes.ts +12 -8
- package/src/utils/filters/createFilterRequestScope.ts +12 -4
- package/src/utils/formatters/block.ts +3 -1
- package/src/utils/formatters/log.ts +2 -2
- package/src/utils/formatters/transaction.ts +3 -1
- package/src/utils/formatters/transactionReceipt.ts +4 -2
- package/src/utils/formatters/transactionRequest.ts +1 -1
- package/src/utils/hash/getEventSelector.ts +6 -2
- package/src/utils/hash/getFunctionSelector.ts +6 -2
- package/src/utils/hash/hashFunction.ts +6 -2
- package/src/utils/index.ts +6 -0
- package/src/utils/observe.ts +2 -2
- package/src/utils/promise/createBatchScheduler.ts +1 -1
- package/src/utils/promise/withCache.ts +13 -11
- package/src/utils/rpc.ts +53 -53
- package/src/utils/signature/hashMessage.ts +8 -4
- package/src/utils/signature/hashTypedData.ts +4 -4
- package/src/utils/signature/recoverMessageAddress.ts +2 -2
- package/src/utils/signature/recoverTypedDataAddress.ts +4 -4
- package/src/utils/signature/verifyTypedData.ts +4 -4
- package/src/utils/transaction/getTransactionType.ts +10 -9
- package/src/utils/transaction/serializeTransaction.ts +3 -3
- package/src/utils/typedData.ts +3 -3
- package/src/utils/unit/parseUnits.ts +15 -5
- package/dist/cjs/adapters/ethers.js +0 -49
- package/dist/cjs/adapters/ethers.js.map +0 -1
- package/dist/cjs/ethers.js +0 -6
- package/dist/cjs/ethers.js.map +0 -1
- package/dist/esm/adapters/ethers.js +0 -45
- package/dist/esm/adapters/ethers.js.map +0 -1
- package/dist/esm/ethers.js +0 -2
- package/dist/esm/ethers.js.map +0 -1
- package/dist/types/adapters/ethers.d.ts +0 -27
- package/dist/types/adapters/ethers.d.ts.map +0 -1
- package/dist/types/ethers.d.ts +0 -2
- package/dist/types/ethers.d.ts.map +0 -1
- package/ethers/package.json +0 -5
- package/src/adapters/ethers.ts +0 -94
- package/src/ethers.ts +0 -1
@@ -2,7 +2,11 @@ import type { Address } from 'abitype';
|
|
2
2
|
import type { BlockTag } from './block.js';
|
3
3
|
import type { Hash, Hex, LogTopic } from './misc.js';
|
4
4
|
import type { Quantity, RpcBlock as Block, RpcBlockIdentifier as BlockIdentifier, RpcBlockNumber as BlockNumber, RpcFeeHistory as FeeHistory, RpcLog as Log, RpcTransaction as Transaction, RpcTransactionReceipt as TransactionReceipt, RpcTransactionRequest as TransactionRequest, RpcUncle as Uncle } from './rpc.js';
|
5
|
-
|
5
|
+
import type { Prettify } from './utils.js';
|
6
|
+
export type EIP1474Methods = [...PublicRpcSchema, ...WalletRpcSchema];
|
7
|
+
export type EIP1193Provider = EIP1193Events & {
|
8
|
+
request: EIP1193RequestFn<EIP1474Methods>;
|
9
|
+
};
|
6
10
|
export declare class ProviderRpcError extends Error {
|
7
11
|
code: number;
|
8
12
|
details: string;
|
@@ -15,7 +19,7 @@ export type ProviderMessage = {
|
|
15
19
|
type: string;
|
16
20
|
data: unknown;
|
17
21
|
};
|
18
|
-
export type
|
22
|
+
export type EIP1193Events = {
|
19
23
|
on(event: 'connect', listener: (connectInfo: ProviderConnectInfo) => void): void;
|
20
24
|
on(event: 'disconnect', listener: (error: ProviderRpcError) => void): void;
|
21
25
|
on(event: 'chainChanged', listener: (chainId: string) => void): void;
|
@@ -75,133 +79,149 @@ export type WatchAssetParams = {
|
|
75
79
|
image?: string;
|
76
80
|
};
|
77
81
|
};
|
78
|
-
export type
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
82
|
+
export type PublicRpcSchema = [
|
83
|
+
/**
|
84
|
+
* @description Returns the version of the current client
|
85
|
+
*
|
86
|
+
* @example
|
87
|
+
* provider.request({ method: 'web3_clientVersion' })
|
88
|
+
* // => 'MetaMask/v1.0.0'
|
89
|
+
*/
|
90
|
+
{
|
91
|
+
Method: 'web3_clientVersion';
|
92
|
+
Parameters?: never;
|
93
|
+
ReturnType: string;
|
94
|
+
},
|
95
|
+
/**
|
96
|
+
* @description Hashes data using the Keccak-256 algorithm
|
97
|
+
*
|
98
|
+
* @example
|
99
|
+
* provider.request({ method: 'web3_sha3', params: ['0x68656c6c6f20776f726c64'] })
|
100
|
+
* // => '0xc94770007dda54cF92009BFF0dE90c06F603a09f'
|
101
|
+
*/
|
102
|
+
{
|
103
|
+
Method: 'web3_sha3';
|
104
|
+
Parameters: [data: Hash];
|
105
|
+
ReturnType: string;
|
106
|
+
},
|
107
|
+
/**
|
108
|
+
* @description Determines if this client is listening for new network connections
|
109
|
+
*
|
110
|
+
* @example
|
111
|
+
* provider.request({ method: 'net_listening' })
|
112
|
+
* // => true
|
113
|
+
*/
|
114
|
+
{
|
115
|
+
Method: 'net_listening';
|
116
|
+
Parameters?: never;
|
117
|
+
ReturnType: boolean;
|
118
|
+
},
|
119
|
+
/**
|
120
|
+
* @description Returns the number of peers currently connected to this client
|
121
|
+
*
|
122
|
+
* @example
|
123
|
+
* provider.request({ method: 'net_peerCount' })
|
124
|
+
* // => '0x1'
|
125
|
+
*/
|
126
|
+
{
|
127
|
+
Method: 'net_peerCount';
|
128
|
+
Parameters?: never;
|
129
|
+
ReturnType: Quantity;
|
130
|
+
},
|
131
|
+
/**
|
132
|
+
* @description Returns the chain ID associated with the current network
|
133
|
+
*
|
134
|
+
* @example
|
135
|
+
* provider.request({ method: 'net_version' })
|
136
|
+
* // => '1'
|
137
|
+
*/
|
138
|
+
{
|
139
|
+
Method: 'net_version';
|
140
|
+
Parameters?: never;
|
141
|
+
ReturnType: Quantity;
|
142
|
+
},
|
143
|
+
/**
|
144
|
+
* @description Returns the number of the most recent block seen by this client
|
145
|
+
*
|
146
|
+
* @example
|
147
|
+
* provider.request({ method: 'eth_blockNumber' })
|
148
|
+
* // => '0x1b4'
|
149
|
+
*/
|
150
|
+
{
|
151
|
+
Method: 'eth_blockNumber';
|
152
|
+
Parameters?: never;
|
153
|
+
ReturnType: Quantity;
|
154
|
+
},
|
155
|
+
/**
|
156
|
+
* @description Executes a new message call immediately without submitting a transaction to the network
|
157
|
+
*
|
158
|
+
* @example
|
159
|
+
* provider.request({ method: 'eth_call', params: [{ to: '0x...', data: '0x...' }] })
|
160
|
+
* // => '0x...'
|
161
|
+
*/
|
162
|
+
{
|
163
|
+
Method: 'eth_call';
|
164
|
+
Parameters: [transaction: Partial<TransactionRequest>] | [
|
165
|
+
transaction: Partial<TransactionRequest>,
|
166
|
+
block: BlockNumber | BlockTag | BlockIdentifier
|
157
167
|
];
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
168
|
+
ReturnType: Hex;
|
169
|
+
},
|
170
|
+
/**
|
171
|
+
* @description Returns the chain ID associated with the current network
|
172
|
+
* @example
|
173
|
+
* provider.request({ method: 'eth_chainId' })
|
174
|
+
* // => '1'
|
175
|
+
*/
|
176
|
+
{
|
177
|
+
Method: 'eth_chainId';
|
178
|
+
Parameters?: never;
|
179
|
+
ReturnType: Quantity;
|
180
|
+
},
|
181
|
+
/**
|
182
|
+
* @description Returns the client coinbase address.
|
183
|
+
* @example
|
184
|
+
* provider.request({ method: 'eth_coinbase' })
|
185
|
+
* // => '0x...'
|
186
|
+
*/
|
187
|
+
{
|
188
|
+
Method: 'eth_coinbase';
|
189
|
+
Parameters?: never;
|
190
|
+
ReturnType: Address;
|
191
|
+
},
|
192
|
+
/**
|
193
|
+
* @description Estimates the gas necessary to complete a transaction without submitting it to the network
|
194
|
+
*
|
195
|
+
* @example
|
196
|
+
* provider.request({
|
197
|
+
* method: 'eth_estimateGas',
|
198
|
+
* params: [{ from: '0x...', to: '0x...', value: '0x...' }]
|
199
|
+
* })
|
200
|
+
* // => '0x5208'
|
201
|
+
*/
|
202
|
+
{
|
203
|
+
Method: 'eth_estimateGas';
|
204
|
+
Parameters: [transaction: TransactionRequest] | [transaction: TransactionRequest, block: BlockNumber | BlockTag];
|
205
|
+
ReturnType: Quantity;
|
206
|
+
},
|
207
|
+
/**
|
208
|
+
* @description Returns a collection of historical gas information
|
209
|
+
*
|
210
|
+
* @example
|
211
|
+
* provider.request({
|
212
|
+
* method: 'eth_feeHistory',
|
213
|
+
* params: ['4', 'latest', ['25', '75']]
|
214
|
+
* })
|
215
|
+
* // => {
|
216
|
+
* // oldestBlock: '0x1',
|
217
|
+
* // baseFeePerGas: ['0x1', '0x2', '0x3', '0x4'],
|
218
|
+
* // gasUsedRatio: ['0x1', '0x2', '0x3', '0x4'],
|
219
|
+
* // reward: [['0x1', '0x2'], ['0x3', '0x4'], ['0x5', '0x6'], ['0x7', '0x8']]
|
220
|
+
* // }
|
221
|
+
* */
|
222
|
+
{
|
223
|
+
Method: 'eth_feeHistory';
|
224
|
+
Parameters: [
|
205
225
|
/** Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. Less than requested may be returned if not all blocks are available. */
|
206
226
|
blockCount: Quantity,
|
207
227
|
/** Highest number block of the requested range. */
|
@@ -209,137 +229,153 @@ export type PublicRequests = {
|
|
209
229
|
/** A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used. */
|
210
230
|
rewardPercentiles: number[] | undefined
|
211
231
|
];
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
|
243
|
-
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
|
232
|
+
ReturnType: FeeHistory;
|
233
|
+
},
|
234
|
+
/**
|
235
|
+
* @description Returns the current price of gas expressed in wei
|
236
|
+
*
|
237
|
+
* @example
|
238
|
+
* provider.request({ method: 'eth_gasPrice' })
|
239
|
+
* // => '0x09184e72a000'
|
240
|
+
*/
|
241
|
+
{
|
242
|
+
Method: 'eth_gasPrice';
|
243
|
+
Parameters?: never;
|
244
|
+
ReturnType: Quantity;
|
245
|
+
},
|
246
|
+
/**
|
247
|
+
* @description Returns the balance of an address in wei
|
248
|
+
*
|
249
|
+
* @example
|
250
|
+
* provider.request({ method: 'eth_getBalance', params: ['0x...', 'latest'] })
|
251
|
+
* // => '0x12a05...'
|
252
|
+
*/
|
253
|
+
{
|
254
|
+
Method: 'eth_getBalance';
|
255
|
+
Parameters: [
|
256
|
+
address: Address,
|
257
|
+
block: BlockNumber | BlockTag | BlockIdentifier
|
258
|
+
];
|
259
|
+
ReturnType: Quantity;
|
260
|
+
},
|
261
|
+
/**
|
262
|
+
* @description Returns information about a block specified by hash
|
263
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
264
|
+
* @example
|
265
|
+
* provider.request({ method: 'eth_getBlockByHash', params: ['0x...', true] })
|
266
|
+
* // => {
|
267
|
+
* // number: '0x1b4',
|
268
|
+
* // hash: '0x...',
|
269
|
+
* // parentHash: '0x...',
|
270
|
+
* // ...
|
271
|
+
* // }
|
272
|
+
*/
|
273
|
+
{
|
274
|
+
Method: 'eth_getBlockByHash';
|
275
|
+
Parameters: [
|
250
276
|
/** hash of a block */
|
251
277
|
hash: Hash,
|
252
278
|
/** true will pull full transaction objects, false will pull transaction hashes */
|
253
279
|
includeTransactionObjects: boolean
|
254
280
|
];
|
255
|
-
|
256
|
-
|
257
|
-
|
258
|
-
|
259
|
-
|
260
|
-
|
261
|
-
|
262
|
-
|
263
|
-
|
264
|
-
|
265
|
-
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
281
|
+
ReturnType: Block | null;
|
282
|
+
},
|
283
|
+
/**
|
284
|
+
* @description Returns information about a block specified by number
|
285
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
286
|
+
* @example
|
287
|
+
* provider.request({ method: 'eth_getBlockByNumber', params: ['0x1b4', true] })
|
288
|
+
* // => {
|
289
|
+
* // number: '0x1b4',
|
290
|
+
* // hash: '0x...',
|
291
|
+
* // parentHash: '0x...',
|
292
|
+
* // ...
|
293
|
+
* // }
|
294
|
+
*/
|
295
|
+
{
|
296
|
+
Method: 'eth_getBlockByNumber';
|
297
|
+
Parameters: [
|
271
298
|
/** block number, or one of "latest", "safe", "finalized", "earliest" or "pending" */
|
272
299
|
block: BlockNumber | BlockTag,
|
273
300
|
/** true will pull full transaction objects, false will pull transaction hashes */
|
274
301
|
includeTransactionObjects: boolean
|
275
302
|
];
|
276
|
-
|
277
|
-
|
278
|
-
|
279
|
-
|
280
|
-
|
281
|
-
|
282
|
-
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
|
287
|
-
|
288
|
-
|
289
|
-
|
290
|
-
|
291
|
-
|
292
|
-
|
293
|
-
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
|
322
|
-
|
323
|
-
|
324
|
-
|
325
|
-
|
326
|
-
|
327
|
-
|
328
|
-
|
329
|
-
|
330
|
-
|
331
|
-
|
332
|
-
|
333
|
-
|
334
|
-
|
335
|
-
|
336
|
-
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
303
|
+
ReturnType: Block | null;
|
304
|
+
},
|
305
|
+
/**
|
306
|
+
* @description Returns the number of transactions in a block specified by block hash
|
307
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
308
|
+
* @example
|
309
|
+
* provider.request({ method: 'eth_getBlockTransactionCountByHash', params: ['0x...'] })
|
310
|
+
* // => '0x1'
|
311
|
+
*/
|
312
|
+
{
|
313
|
+
Method: 'eth_getBlockTransactionCountByHash';
|
314
|
+
Parameters: [hash: Hash];
|
315
|
+
ReturnType: Quantity;
|
316
|
+
},
|
317
|
+
/**
|
318
|
+
* @description Returns the number of transactions in a block specified by block number
|
319
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
320
|
+
* @example
|
321
|
+
* provider.request({ method: 'eth_getBlockTransactionCountByNumber', params: ['0x1b4'] })
|
322
|
+
* // => '0x1'
|
323
|
+
*/
|
324
|
+
{
|
325
|
+
Method: 'eth_getBlockTransactionCountByNumber';
|
326
|
+
Parameters: [block: BlockNumber | BlockTag];
|
327
|
+
ReturnType: Quantity;
|
328
|
+
},
|
329
|
+
/**
|
330
|
+
* @description Returns the contract code stored at a given address
|
331
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
332
|
+
* @example
|
333
|
+
* provider.request({ method: 'eth_getCode', params: ['0x...', 'latest'] })
|
334
|
+
* // => '0x...'
|
335
|
+
*/
|
336
|
+
{
|
337
|
+
Method: 'eth_getCode';
|
338
|
+
Parameters: [
|
339
|
+
address: Address,
|
340
|
+
block: BlockNumber | BlockTag | BlockIdentifier
|
341
|
+
];
|
342
|
+
ReturnType: Hex;
|
343
|
+
},
|
344
|
+
/**
|
345
|
+
* @description Returns a list of all logs based on filter ID since the last log retrieval
|
346
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
347
|
+
* @example
|
348
|
+
* provider.request({ method: 'eth_getFilterChanges', params: ['0x...'] })
|
349
|
+
* // => [{ ... }, { ... }]
|
350
|
+
*/
|
351
|
+
{
|
352
|
+
Method: 'eth_getFilterChanges';
|
353
|
+
Parameters: [filterId: Quantity];
|
354
|
+
ReturnType: Log[] | Hex[];
|
355
|
+
},
|
356
|
+
/**
|
357
|
+
* @description Returns a list of all logs based on filter ID
|
358
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
359
|
+
* @example
|
360
|
+
* provider.request({ method: 'eth_getFilterLogs', params: ['0x...'] })
|
361
|
+
* // => [{ ... }, { ... }]
|
362
|
+
*/
|
363
|
+
{
|
364
|
+
Method: 'eth_getFilterLogs';
|
365
|
+
Parameters: [filterId: Quantity];
|
366
|
+
ReturnType: Log[];
|
367
|
+
},
|
368
|
+
/**
|
369
|
+
* @description Returns a list of all logs based on a filter object
|
370
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
371
|
+
* @example
|
372
|
+
* provider.request({ method: 'eth_getLogs', params: [{ fromBlock: '0x...', toBlock: '0x...', address: '0x...', topics: ['0x...'] }] })
|
373
|
+
* // => [{ ... }, { ... }]
|
374
|
+
*/
|
375
|
+
{
|
376
|
+
Method: 'eth_getLogs';
|
377
|
+
Parameters: [
|
378
|
+
{
|
343
379
|
address?: Address | Address[];
|
344
380
|
topics?: LogTopic[];
|
345
381
|
} & ({
|
@@ -352,142 +388,157 @@ export type PublicRequests = {
|
|
352
388
|
blockHash?: Hash;
|
353
389
|
})
|
354
390
|
];
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
365
|
-
|
391
|
+
ReturnType: Log[];
|
392
|
+
},
|
393
|
+
/**
|
394
|
+
* @description Returns the value from a storage position at an address
|
395
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
396
|
+
* @example
|
397
|
+
* provider.request({ method: 'eth_getStorageAt', params: ['0x...', '0x...', 'latest'] })
|
398
|
+
* // => '0x...'
|
399
|
+
*/
|
400
|
+
{
|
401
|
+
Method: 'eth_getStorageAt';
|
402
|
+
Parameters: [
|
366
403
|
address: Address,
|
367
404
|
index: Quantity,
|
368
405
|
block: BlockNumber | BlockTag | BlockIdentifier
|
369
406
|
];
|
370
|
-
|
371
|
-
|
372
|
-
|
373
|
-
|
374
|
-
|
375
|
-
|
376
|
-
|
377
|
-
|
378
|
-
|
379
|
-
|
380
|
-
|
381
|
-
|
382
|
-
|
383
|
-
|
384
|
-
|
385
|
-
|
386
|
-
|
387
|
-
|
388
|
-
|
389
|
-
|
390
|
-
|
391
|
-
|
392
|
-
|
393
|
-
|
394
|
-
|
395
|
-
|
396
|
-
|
397
|
-
|
398
|
-
|
399
|
-
|
400
|
-
|
401
|
-
|
402
|
-
|
403
|
-
|
404
|
-
|
405
|
-
|
406
|
-
|
407
|
-
|
408
|
-
|
409
|
-
|
410
|
-
|
411
|
-
|
412
|
-
|
413
|
-
|
414
|
-
|
415
|
-
|
416
|
-
|
417
|
-
|
418
|
-
|
419
|
-
|
420
|
-
|
421
|
-
|
422
|
-
|
423
|
-
|
424
|
-
|
425
|
-
|
426
|
-
|
427
|
-
|
428
|
-
|
429
|
-
|
430
|
-
|
431
|
-
|
432
|
-
|
433
|
-
|
434
|
-
|
435
|
-
|
436
|
-
|
437
|
-
|
438
|
-
|
439
|
-
|
440
|
-
|
441
|
-
|
442
|
-
|
443
|
-
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
|
450
|
-
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
455
|
-
|
456
|
-
|
457
|
-
|
458
|
-
}
|
459
|
-
|
460
|
-
|
461
|
-
|
462
|
-
|
463
|
-
|
464
|
-
|
465
|
-
|
466
|
-
|
467
|
-
|
468
|
-
|
469
|
-
|
470
|
-
|
471
|
-
|
472
|
-
|
473
|
-
|
474
|
-
|
475
|
-
|
476
|
-
|
477
|
-
|
478
|
-
|
479
|
-
|
480
|
-
|
481
|
-
|
482
|
-
|
483
|
-
|
484
|
-
|
485
|
-
|
486
|
-
|
487
|
-
|
488
|
-
|
489
|
-
|
490
|
-
|
407
|
+
ReturnType: Hex;
|
408
|
+
},
|
409
|
+
/**
|
410
|
+
* @description Returns information about a transaction specified by block hash and transaction index
|
411
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
412
|
+
* @example
|
413
|
+
* provider.request({ method: 'eth_getTransactionByBlockHashAndIndex', params: ['0x...', '0x...'] })
|
414
|
+
* // => { ... }
|
415
|
+
*/
|
416
|
+
{
|
417
|
+
Method: 'eth_getTransactionByBlockHashAndIndex';
|
418
|
+
Parameters: [hash: Hash, index: Quantity];
|
419
|
+
ReturnType: Transaction | null;
|
420
|
+
},
|
421
|
+
/**
|
422
|
+
* @description Returns information about a transaction specified by block number and transaction index
|
423
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
424
|
+
* @example
|
425
|
+
* provider.request({ method: 'eth_getTransactionByBlockNumberAndIndex', params: ['0x...', '0x...'] })
|
426
|
+
* // => { ... }
|
427
|
+
*/
|
428
|
+
{
|
429
|
+
Method: 'eth_getTransactionByBlockNumberAndIndex';
|
430
|
+
Parameters: [block: BlockNumber | BlockTag, index: Quantity];
|
431
|
+
ReturnType: Transaction | null;
|
432
|
+
},
|
433
|
+
/**
|
434
|
+
* @description Returns information about a transaction specified by hash
|
435
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
436
|
+
* @example
|
437
|
+
* provider.request({ method: 'eth_getTransactionByHash', params: ['0x...'] })
|
438
|
+
* // => { ... }
|
439
|
+
*/
|
440
|
+
{
|
441
|
+
Method: 'eth_getTransactionByHash';
|
442
|
+
Parameters: [hash: Hash];
|
443
|
+
ReturnType: Transaction | null;
|
444
|
+
},
|
445
|
+
/**
|
446
|
+
* @description Returns the number of transactions sent from an address
|
447
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
448
|
+
* @example
|
449
|
+
* provider.request({ method: 'eth_getTransactionCount', params: ['0x...', 'latest'] })
|
450
|
+
* // => '0x1'
|
451
|
+
*/
|
452
|
+
{
|
453
|
+
Method: 'eth_getTransactionCount';
|
454
|
+
Parameters: [
|
455
|
+
address: Address,
|
456
|
+
block: BlockNumber | BlockTag | BlockIdentifier
|
457
|
+
];
|
458
|
+
ReturnType: Quantity;
|
459
|
+
},
|
460
|
+
/**
|
461
|
+
* @description Returns the receipt of a transaction specified by hash
|
462
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
463
|
+
* @example
|
464
|
+
* provider.request({ method: 'eth_getTransactionReceipt', params: ['0x...'] })
|
465
|
+
* // => { ... }
|
466
|
+
*/
|
467
|
+
{
|
468
|
+
Method: 'eth_getTransactionReceipt';
|
469
|
+
Parameters: [hash: Hash];
|
470
|
+
ReturnType: TransactionReceipt | null;
|
471
|
+
},
|
472
|
+
/**
|
473
|
+
* @description Returns information about an uncle specified by block hash and uncle index position
|
474
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
475
|
+
* @example
|
476
|
+
* provider.request({ method: 'eth_getUncleByBlockHashAndIndex', params: ['0x...', '0x...'] })
|
477
|
+
* // => { ... }
|
478
|
+
*/
|
479
|
+
{
|
480
|
+
Method: 'eth_getUncleByBlockHashAndIndex';
|
481
|
+
Parameters: [hash: Hash, index: Quantity];
|
482
|
+
ReturnType: Uncle | null;
|
483
|
+
},
|
484
|
+
/**
|
485
|
+
* @description Returns information about an uncle specified by block number and uncle index position
|
486
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
487
|
+
* @example
|
488
|
+
* provider.request({ method: 'eth_getUncleByBlockNumberAndIndex', params: ['0x...', '0x...'] })
|
489
|
+
* // => { ... }
|
490
|
+
*/
|
491
|
+
{
|
492
|
+
Method: 'eth_getUncleByBlockNumberAndIndex';
|
493
|
+
Parameters: [block: BlockNumber | BlockTag, index: Quantity];
|
494
|
+
ReturnType: Uncle | null;
|
495
|
+
},
|
496
|
+
/**
|
497
|
+
* @description Returns the number of uncles in a block specified by block hash
|
498
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
499
|
+
* @example
|
500
|
+
* provider.request({ method: 'eth_getUncleCountByBlockHash', params: ['0x...'] })
|
501
|
+
* // => '0x1'
|
502
|
+
*/
|
503
|
+
{
|
504
|
+
Method: 'eth_getUncleCountByBlockHash';
|
505
|
+
Parameters: [hash: Hash];
|
506
|
+
ReturnType: Quantity;
|
507
|
+
},
|
508
|
+
/**
|
509
|
+
* @description Returns the number of uncles in a block specified by block number
|
510
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
511
|
+
* @example
|
512
|
+
* provider.request({ method: 'eth_getUncleCountByBlockNumber', params: ['0x...'] })
|
513
|
+
* // => '0x1'
|
514
|
+
*/
|
515
|
+
{
|
516
|
+
Method: 'eth_getUncleCountByBlockNumber';
|
517
|
+
Parameters: [block: BlockNumber | BlockTag];
|
518
|
+
ReturnType: Quantity;
|
519
|
+
},
|
520
|
+
/**
|
521
|
+
* @description Creates a filter to listen for new blocks that can be used with `eth_getFilterChanges`
|
522
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
523
|
+
* @example
|
524
|
+
* provider.request({ method: 'eth_newBlockFilter' })
|
525
|
+
* // => '0x1'
|
526
|
+
*/
|
527
|
+
{
|
528
|
+
Method: 'eth_newBlockFilter';
|
529
|
+
Parameters?: never;
|
530
|
+
ReturnType: Quantity;
|
531
|
+
},
|
532
|
+
/**
|
533
|
+
* @description Creates a filter to listen for specific state changes that can then be used with `eth_getFilterChanges`
|
534
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
535
|
+
* @example
|
536
|
+
* provider.request({ method: 'eth_newFilter', params: [{ fromBlock: '0x...', toBlock: '0x...', address: '0x...', topics: ['0x...'] }] })
|
537
|
+
* // => '0x1'
|
538
|
+
*/
|
539
|
+
{
|
540
|
+
Method: 'eth_newFilter';
|
541
|
+
Parameters: [
|
491
542
|
filter: {
|
492
543
|
fromBlock?: BlockNumber | BlockTag;
|
493
544
|
toBlock?: BlockNumber | BlockTag;
|
@@ -495,203 +546,221 @@ export type PublicRequests = {
|
|
495
546
|
topics?: LogTopic[];
|
496
547
|
}
|
497
548
|
];
|
498
|
-
|
499
|
-
|
500
|
-
|
501
|
-
|
502
|
-
|
503
|
-
|
504
|
-
|
505
|
-
|
506
|
-
|
507
|
-
|
508
|
-
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
549
|
-
|
550
|
-
|
551
|
-
|
552
|
-
|
553
|
-
|
554
|
-
|
555
|
-
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
|
564
|
-
|
565
|
-
|
566
|
-
|
567
|
-
|
568
|
-
|
569
|
-
|
570
|
-
|
571
|
-
|
572
|
-
|
573
|
-
|
574
|
-
|
575
|
-
|
576
|
-
|
577
|
-
|
578
|
-
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
549
|
+
ReturnType: Quantity;
|
550
|
+
},
|
551
|
+
/**
|
552
|
+
* @description Creates a filter to listen for new pending transactions that can be used with `eth_getFilterChanges`
|
553
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
554
|
+
* @example
|
555
|
+
* provider.request({ method: 'eth_newPendingTransactionFilter' })
|
556
|
+
* // => '0x1'
|
557
|
+
*/
|
558
|
+
{
|
559
|
+
Method: 'eth_newPendingTransactionFilter';
|
560
|
+
Parameters?: never;
|
561
|
+
ReturnType: Quantity;
|
562
|
+
},
|
563
|
+
/**
|
564
|
+
* @description Returns the current Ethereum protocol version
|
565
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
566
|
+
* @example
|
567
|
+
* provider.request({ method: 'eth_protocolVersion' })
|
568
|
+
* // => '54'
|
569
|
+
*/
|
570
|
+
{
|
571
|
+
Method: 'eth_protocolVersion';
|
572
|
+
Parameters?: never;
|
573
|
+
ReturnType: string;
|
574
|
+
},
|
575
|
+
/**
|
576
|
+
* @description Sends and already-signed transaction to the network
|
577
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
578
|
+
* @example
|
579
|
+
* provider.request({ method: 'eth_sendRawTransaction', params: ['0x...'] })
|
580
|
+
* // => '0x...'
|
581
|
+
*/
|
582
|
+
{
|
583
|
+
Method: 'eth_sendRawTransaction';
|
584
|
+
Parameters: [signedTransaction: Hex];
|
585
|
+
ReturnType: Hash;
|
586
|
+
},
|
587
|
+
/**
|
588
|
+
* @description Destroys a filter based on filter ID
|
589
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
590
|
+
* @example
|
591
|
+
* provider.request({ method: 'eth_uninstallFilter', params: ['0x1'] })
|
592
|
+
* // => true
|
593
|
+
*/
|
594
|
+
{
|
595
|
+
Method: 'eth_uninstallFilter';
|
596
|
+
Parameters: [filterId: Quantity];
|
597
|
+
ReturnType: boolean;
|
598
|
+
}
|
599
|
+
];
|
600
|
+
export type TestRpcSchema<TMode extends string> = [
|
601
|
+
/**
|
602
|
+
* @description Add information about compiled contracts
|
603
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_addcompilationresult
|
604
|
+
*/
|
605
|
+
{
|
606
|
+
Method: `${TMode}_addCompilationResult`;
|
607
|
+
Parameters: any[];
|
608
|
+
ReturnType: any;
|
609
|
+
},
|
610
|
+
/**
|
611
|
+
* @description Remove a transaction from the mempool
|
612
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_droptransaction
|
613
|
+
*/
|
614
|
+
{
|
615
|
+
Method: `${TMode}_dropTransaction`;
|
616
|
+
Parameters: [hash: Hash];
|
617
|
+
ReturnType: void;
|
618
|
+
},
|
619
|
+
/**
|
620
|
+
* @description Turn on call traces for transactions that are returned to the user when they execute a transaction (instead of just txhash/receipt).
|
621
|
+
*/
|
622
|
+
{
|
623
|
+
Method: `${TMode}_enableTraces`;
|
624
|
+
Parameters?: never;
|
625
|
+
ReturnType: void;
|
626
|
+
},
|
627
|
+
/**
|
628
|
+
* @description Impersonate an account or contract address.
|
629
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_impersonateaccount
|
630
|
+
*/
|
631
|
+
{
|
632
|
+
Method: `${TMode}_impersonateAccount`;
|
633
|
+
Parameters: [address: Address];
|
634
|
+
ReturnType: void;
|
635
|
+
},
|
636
|
+
/**
|
637
|
+
* @description Returns true if automatic mining is enabled, and false otherwise. See [Mining Modes](https://hardhat.org/hardhat-network/explanation/mining-modes) to learn more.
|
638
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_getautomine
|
639
|
+
*/
|
640
|
+
{
|
641
|
+
Method: `${TMode}_getAutomine`;
|
642
|
+
Parameters?: never;
|
643
|
+
ReturnType: boolean;
|
644
|
+
},
|
645
|
+
/**
|
646
|
+
* @description Advance the block number of the network by a certain number of blocks
|
647
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_mine
|
648
|
+
*/
|
649
|
+
{
|
650
|
+
Method: `${TMode}_mine`;
|
651
|
+
Parameters: [
|
593
652
|
/** Number of blocks to mine. */
|
594
653
|
count: Hex,
|
595
654
|
/** Interval between each block in seconds. */
|
596
655
|
interval: Hex | undefined
|
597
656
|
];
|
598
|
-
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
657
|
+
ReturnType: void;
|
658
|
+
},
|
659
|
+
/**
|
660
|
+
* @description Resets the fork.
|
661
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_reset
|
662
|
+
*/
|
663
|
+
{
|
664
|
+
Method: `${TMode}_reset`;
|
665
|
+
Parameters: any[];
|
666
|
+
ReturnType: void;
|
667
|
+
},
|
668
|
+
/**
|
669
|
+
* @description Modifies the balance of an account.
|
670
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setbalance
|
671
|
+
*/
|
672
|
+
{
|
673
|
+
Method: `${TMode}_setBalance`;
|
674
|
+
Parameters: [
|
614
675
|
/** The address of the target account. */
|
615
676
|
address: Address,
|
616
677
|
/** Amount to send in wei. */
|
617
|
-
|
678
|
+
balance: Quantity
|
618
679
|
];
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
680
|
+
ReturnType: void;
|
681
|
+
},
|
682
|
+
/**
|
683
|
+
* @description Modifies the bytecode stored at an account's address.
|
684
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setcode
|
685
|
+
*/
|
686
|
+
{
|
687
|
+
Method: `${TMode}_setCode`;
|
688
|
+
Parameters: [
|
627
689
|
/** The address of the contract. */
|
628
690
|
address: Address,
|
629
691
|
/** Data bytecode. */
|
630
692
|
data: string
|
631
693
|
];
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
694
|
+
ReturnType: void;
|
695
|
+
},
|
696
|
+
/**
|
697
|
+
* @description Sets the coinbase address to be used in new blocks.
|
698
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setcoinbase
|
699
|
+
*/
|
700
|
+
{
|
701
|
+
Method: `${TMode}_setCoinbase`;
|
702
|
+
Parameters: [
|
640
703
|
/** The address to set as the coinbase address. */
|
641
704
|
address: Address
|
642
705
|
];
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
706
|
+
ReturnType: void;
|
707
|
+
},
|
708
|
+
/**
|
709
|
+
* @description Enable or disable logging on the test node network.
|
710
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setcoinbase
|
711
|
+
*/
|
712
|
+
{
|
713
|
+
Method: `${TMode}_setLoggingEnabled`;
|
714
|
+
Parameters: [enabled: boolean];
|
715
|
+
ReturnType: void;
|
716
|
+
},
|
717
|
+
/**
|
718
|
+
* @description Change the minimum gas price accepted by the network (in wei).
|
719
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setmingasprice
|
720
|
+
*/
|
721
|
+
{
|
722
|
+
Method: `${TMode}_setMinGasPrice`;
|
723
|
+
Parameters: [gasPrice: Quantity];
|
724
|
+
ReturnType: void;
|
725
|
+
},
|
726
|
+
/**
|
727
|
+
* @description Sets the base fee of the next block.
|
728
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setnextblockbasefeepergas
|
729
|
+
*/
|
730
|
+
{
|
731
|
+
Method: `${TMode}_setNextBlockBaseFeePerGas`;
|
732
|
+
Parameters: [baseFeePerGas: Quantity];
|
733
|
+
ReturnType: void;
|
734
|
+
},
|
735
|
+
/**
|
736
|
+
* @description Modifies an account's nonce by overwriting it.
|
737
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setnonce
|
738
|
+
*/
|
739
|
+
{
|
740
|
+
Method: `${TMode}_setNonce`;
|
741
|
+
Parameters: [
|
675
742
|
/** The account address. */
|
676
743
|
address: Address,
|
677
744
|
/** The new nonce. */
|
678
745
|
nonce: Quantity
|
679
746
|
];
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
747
|
+
ReturnType: void;
|
748
|
+
},
|
749
|
+
/**
|
750
|
+
* @description Sets the backend RPC URL.
|
751
|
+
*/
|
752
|
+
{
|
753
|
+
Method: `${TMode}_setRpcUrl`;
|
754
|
+
Parameters: [url: string];
|
755
|
+
ReturnType: void;
|
756
|
+
},
|
757
|
+
/**
|
758
|
+
* @description Writes a single position of an account's storage.
|
759
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_setstorageat
|
760
|
+
*/
|
761
|
+
{
|
762
|
+
Method: `${TMode}_setStorageAt`;
|
763
|
+
Parameters: [
|
695
764
|
/** The account address. */
|
696
765
|
address: Address,
|
697
766
|
/** The storage position index. */
|
@@ -699,304 +768,450 @@ export type TestRequests<Name extends string> = {
|
|
699
768
|
/** The storage value. */
|
700
769
|
value: Quantity
|
701
770
|
];
|
702
|
-
|
703
|
-
|
704
|
-
|
705
|
-
|
706
|
-
|
707
|
-
|
708
|
-
|
709
|
-
|
771
|
+
ReturnType: void;
|
772
|
+
},
|
773
|
+
/**
|
774
|
+
* @description Use this method to stop impersonating an account after having previously used impersonateAccount.
|
775
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#hardhat_stopimpersonatingaccount
|
776
|
+
*/
|
777
|
+
{
|
778
|
+
Method: `${TMode}_stopImpersonatingAccount`;
|
779
|
+
Parameters: [
|
710
780
|
/** The address to stop impersonating. */
|
711
781
|
address: Address
|
712
782
|
];
|
713
|
-
|
714
|
-
|
715
|
-
|
716
|
-
|
717
|
-
|
718
|
-
|
719
|
-
|
720
|
-
|
721
|
-
|
722
|
-
|
723
|
-
|
724
|
-
|
725
|
-
|
726
|
-
|
727
|
-
|
728
|
-
|
729
|
-
|
730
|
-
|
731
|
-
|
732
|
-
|
733
|
-
|
734
|
-
|
735
|
-
|
736
|
-
|
737
|
-
}
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
|
742
|
-
|
743
|
-
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
|
748
|
-
|
749
|
-
|
750
|
-
|
751
|
-
|
752
|
-
|
753
|
-
|
754
|
-
|
755
|
-
|
756
|
-
|
757
|
-
|
758
|
-
|
759
|
-
|
760
|
-
|
761
|
-
|
762
|
-
|
763
|
-
|
764
|
-
|
765
|
-
|
766
|
-
|
767
|
-
|
768
|
-
|
769
|
-
|
770
|
-
|
771
|
-
|
772
|
-
|
773
|
-
|
774
|
-
|
775
|
-
|
776
|
-
|
777
|
-
|
778
|
-
|
779
|
-
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
|
790
|
-
|
791
|
-
|
792
|
-
|
793
|
-
|
794
|
-
|
795
|
-
|
796
|
-
|
797
|
-
|
798
|
-
|
799
|
-
}
|
800
|
-
|
801
|
-
|
802
|
-
|
803
|
-
|
804
|
-
|
805
|
-
|
806
|
-
|
807
|
-
|
808
|
-
|
809
|
-
|
810
|
-
|
811
|
-
|
812
|
-
|
813
|
-
|
814
|
-
|
815
|
-
|
816
|
-
|
817
|
-
|
818
|
-
|
819
|
-
|
820
|
-
|
821
|
-
|
822
|
-
|
823
|
-
|
824
|
-
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
|
835
|
-
|
836
|
-
|
837
|
-
|
838
|
-
|
839
|
-
|
840
|
-
|
841
|
-
|
842
|
-
|
843
|
-
|
844
|
-
|
845
|
-
|
846
|
-
|
783
|
+
ReturnType: void;
|
784
|
+
},
|
785
|
+
/**
|
786
|
+
* @description Jump forward in time by the given amount of time, in seconds.
|
787
|
+
* @link https://github.com/trufflesuite/ganache/blob/ef1858d5d6f27e4baeb75cccd57fb3dc77a45ae8/src/chains/ethereum/ethereum/RPC-METHODS.md#evm_increasetime
|
788
|
+
*/
|
789
|
+
{
|
790
|
+
Method: `${TMode}_increaseTime`;
|
791
|
+
Parameters: [seconds: number];
|
792
|
+
ReturnType: Quantity;
|
793
|
+
},
|
794
|
+
/**
|
795
|
+
* @description Modifies the balance of an account.
|
796
|
+
* @link https://ganache.dev/#evm_setAccountBalance
|
797
|
+
*/
|
798
|
+
{
|
799
|
+
Method: `evm_setAccountBalance`;
|
800
|
+
Parameters: [
|
801
|
+
/** The address of the target account. */
|
802
|
+
address: Address,
|
803
|
+
/** Amount to send in wei. */
|
804
|
+
value: Quantity
|
805
|
+
];
|
806
|
+
ReturnType: void;
|
807
|
+
},
|
808
|
+
/**
|
809
|
+
* @description Enables or disables, based on the single boolean argument, the automatic mining of new blocks with each new transaction submitted to the network.
|
810
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#evm_setautomine
|
811
|
+
*/
|
812
|
+
{
|
813
|
+
Method: `evm_setAutomine`;
|
814
|
+
Parameters: [boolean];
|
815
|
+
ReturnType: void;
|
816
|
+
},
|
817
|
+
/**
|
818
|
+
* @description Sets the block's gas limit.
|
819
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#evm_setblockgaslimit
|
820
|
+
*/
|
821
|
+
{
|
822
|
+
Method: 'evm_setBlockGasLimit';
|
823
|
+
Parameters: [gasLimit: Quantity];
|
824
|
+
ReturnType: void;
|
825
|
+
},
|
826
|
+
/**
|
827
|
+
* @description Jump forward in time by the given amount of time, in seconds.
|
828
|
+
* @link https://github.com/trufflesuite/ganache/blob/ef1858d5d6f27e4baeb75cccd57fb3dc77a45ae8/src/chains/ethereum/ethereum/RPC-METHODS.md#evm_increasetime
|
829
|
+
*/
|
830
|
+
{
|
831
|
+
Method: `evm_increaseTime`;
|
832
|
+
Parameters: [seconds: Quantity];
|
833
|
+
ReturnType: Quantity;
|
834
|
+
},
|
835
|
+
/**
|
836
|
+
* @description Similar to `evm_increaseTime` but sets a block timestamp `interval`.
|
837
|
+
* The timestamp of the next block will be computed as `lastBlock_timestamp` + `interval`
|
838
|
+
*/
|
839
|
+
{
|
840
|
+
Method: `${TMode}_setBlockTimestampInterval`;
|
841
|
+
Parameters: [seconds: number];
|
842
|
+
ReturnType: void;
|
843
|
+
},
|
844
|
+
/**
|
845
|
+
* @description Removes `setBlockTimestampInterval` if it exists
|
846
|
+
*/
|
847
|
+
{
|
848
|
+
Method: `${TMode}_removeBlockTimestampInterval`;
|
849
|
+
Parameters?: never;
|
850
|
+
ReturnType: void;
|
851
|
+
},
|
852
|
+
/**
|
853
|
+
* @description Enables (with a numeric argument greater than 0) or disables (with a numeric argument equal to 0), the automatic mining of blocks at a regular interval of milliseconds, each of which will include all pending transactions.
|
854
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#evm_setintervalmining
|
855
|
+
*/
|
856
|
+
{
|
857
|
+
Method: 'evm_setIntervalMining';
|
858
|
+
Parameters: [number];
|
859
|
+
ReturnType: void;
|
860
|
+
},
|
861
|
+
/**
|
862
|
+
* @description Set the timestamp of the next block.
|
863
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#evm_setnextblocktimestamp
|
864
|
+
*/
|
865
|
+
{
|
866
|
+
Method: 'evm_setNextBlockTimestamp';
|
867
|
+
Parameters: [Quantity];
|
868
|
+
ReturnType: void;
|
869
|
+
},
|
870
|
+
/**
|
871
|
+
* @description Snapshot the state of the blockchain at the current block. Takes no parameters. Returns the id of the snapshot that was created.
|
872
|
+
* @link https://hardhat.org/hardhat-network/docs/reference#evm_snapshot
|
873
|
+
*/
|
874
|
+
{
|
875
|
+
Method: 'evm_snapshot';
|
876
|
+
Parameters?: never;
|
877
|
+
ReturnType: Quantity;
|
878
|
+
},
|
879
|
+
/**
|
880
|
+
* @description Revert the state of the blockchain to a previous snapshot. Takes a single parameter, which is the snapshot id to revert to.
|
881
|
+
*/
|
882
|
+
{
|
883
|
+
Method: 'evm_revert';
|
884
|
+
Parameters?: [id: Quantity];
|
885
|
+
ReturnType: void;
|
886
|
+
},
|
887
|
+
/**
|
888
|
+
* @description Enables the automatic mining of new blocks with each new transaction submitted to the network.
|
889
|
+
* @link https://ganache.dev/#miner_start
|
890
|
+
*/
|
891
|
+
{
|
892
|
+
Method: 'miner_start';
|
893
|
+
Parameters?: never;
|
894
|
+
ReturnType: void;
|
895
|
+
},
|
896
|
+
/**
|
897
|
+
* @description Disables the automatic mining of new blocks with each new transaction submitted to the network.
|
898
|
+
* @link https://ganache.dev/#miner_stop
|
899
|
+
*/
|
900
|
+
{
|
901
|
+
Method: 'miner_stop';
|
902
|
+
Parameters?: never;
|
903
|
+
ReturnType: void;
|
904
|
+
},
|
905
|
+
/**
|
906
|
+
* @link https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-txpool#txpool-content
|
907
|
+
*/
|
908
|
+
{
|
909
|
+
Method: 'txpool_content';
|
910
|
+
Parameters?: never;
|
911
|
+
ReturnType: {
|
912
|
+
pending: Record<Address, Record<string, Transaction>>;
|
913
|
+
queued: Record<Address, Record<string, Transaction>>;
|
914
|
+
};
|
915
|
+
},
|
916
|
+
/**
|
917
|
+
* @link https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-txpool#txpool-inspect
|
918
|
+
*/
|
919
|
+
{
|
920
|
+
Method: 'txpool_inspect';
|
921
|
+
Parameters?: never;
|
922
|
+
ReturnType: {
|
923
|
+
pending: Record<Address, Record<string, string>>;
|
924
|
+
queued: Record<Address, Record<string, string>>;
|
925
|
+
};
|
926
|
+
},
|
927
|
+
/**
|
928
|
+
* @link https://geth.ethereum.org/docs/interacting-with-geth/rpc/ns-txpool#txpool-inspect
|
929
|
+
*/
|
930
|
+
{
|
931
|
+
Method: 'txpool_status';
|
932
|
+
Parameters?: never;
|
933
|
+
ReturnType: {
|
934
|
+
pending: Quantity;
|
935
|
+
queued: Quantity;
|
936
|
+
};
|
937
|
+
},
|
938
|
+
/**
|
939
|
+
* @description Returns whether the client is actively mining new blocks.
|
940
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
941
|
+
* @example
|
942
|
+
* provider.request({ method: 'eth_mining' })
|
943
|
+
* // => true
|
944
|
+
*/
|
945
|
+
{
|
946
|
+
Method: 'eth_mining';
|
947
|
+
Parameters?: never;
|
948
|
+
ReturnType: boolean;
|
949
|
+
},
|
950
|
+
/**
|
951
|
+
* @description Advance the block number of the network by a certain number of blocks.
|
952
|
+
* @link https://ganache.dev/#evm_mine
|
953
|
+
*/
|
954
|
+
{
|
955
|
+
Method: 'evm_mine';
|
956
|
+
Parameters?: [
|
957
|
+
{
|
958
|
+
/** Number of blocks to mine. */
|
959
|
+
blocks: Hex;
|
960
|
+
}
|
961
|
+
];
|
962
|
+
ReturnType: void;
|
963
|
+
},
|
964
|
+
/**
|
965
|
+
* @description Creates, signs, and sends a new transaction to the network regardless of the signature.
|
966
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
967
|
+
* @example
|
968
|
+
* provider.request({ method: 'eth_sendTransaction', params: [{ from: '0x...', to: '0x...', value: '0x...' }] })
|
969
|
+
* // => '0x...'
|
970
|
+
*/
|
971
|
+
{
|
972
|
+
Method: 'eth_sendUnsignedTransaction';
|
973
|
+
Parameters: [transaction: TransactionRequest];
|
974
|
+
ReturnType: Hash;
|
975
|
+
}
|
976
|
+
];
|
977
|
+
export type WalletRpcSchema = [
|
978
|
+
/**
|
979
|
+
* @description Returns a list of addresses owned by this client
|
980
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
981
|
+
* @example
|
982
|
+
* provider.request({ method: 'eth_accounts' })
|
983
|
+
* // => ['0x0fB69...']
|
984
|
+
*/
|
985
|
+
{
|
986
|
+
Method: 'eth_accounts';
|
987
|
+
Parameters?: never;
|
988
|
+
ReturnType: Address[];
|
989
|
+
},
|
990
|
+
/**
|
991
|
+
* @description Returns the current chain ID associated with the wallet.
|
992
|
+
* @example
|
993
|
+
* provider.request({ method: 'eth_chainId' })
|
994
|
+
* // => '1'
|
995
|
+
*/
|
996
|
+
{
|
997
|
+
Method: 'eth_chainId';
|
998
|
+
Parameters?: never;
|
999
|
+
ReturnType: Quantity;
|
1000
|
+
},
|
1001
|
+
/**
|
1002
|
+
* @description Estimates the gas necessary to complete a transaction without submitting it to the network
|
1003
|
+
*
|
1004
|
+
* @example
|
1005
|
+
* provider.request({
|
1006
|
+
* method: 'eth_estimateGas',
|
1007
|
+
* params: [{ from: '0x...', to: '0x...', value: '0x...' }]
|
1008
|
+
* })
|
1009
|
+
* // => '0x5208'
|
1010
|
+
*/
|
1011
|
+
{
|
1012
|
+
Method: 'eth_estimateGas';
|
1013
|
+
Parameters: [transaction: TransactionRequest] | [transaction: TransactionRequest, block: BlockNumber | BlockTag];
|
1014
|
+
ReturnType: Quantity;
|
1015
|
+
},
|
1016
|
+
/**
|
1017
|
+
* @description Requests that the user provides an Ethereum address to be identified by. Typically causes a browser extension popup to appear.
|
1018
|
+
* @link https://eips.ethereum.org/EIPS/eip-1102
|
1019
|
+
* @example
|
1020
|
+
* provider.request({ method: 'eth_requestAccounts' }] })
|
1021
|
+
* // => ['0x...', '0x...']
|
1022
|
+
*/
|
1023
|
+
{
|
1024
|
+
Method: 'eth_requestAccounts';
|
1025
|
+
Parameters?: never;
|
1026
|
+
ReturnType: Address[];
|
1027
|
+
},
|
1028
|
+
/**
|
1029
|
+
* @description Creates, signs, and sends a new transaction to the network
|
1030
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
1031
|
+
* @example
|
1032
|
+
* provider.request({ method: 'eth_sendTransaction', params: [{ from: '0x...', to: '0x...', value: '0x...' }] })
|
1033
|
+
* // => '0x...'
|
1034
|
+
*/
|
1035
|
+
{
|
1036
|
+
Method: 'eth_sendTransaction';
|
1037
|
+
Parameters: [transaction: TransactionRequest];
|
1038
|
+
ReturnType: Hash;
|
1039
|
+
},
|
1040
|
+
/**
|
1041
|
+
* @description Sends and already-signed transaction to the network
|
1042
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
1043
|
+
* @example
|
1044
|
+
* provider.request({ method: 'eth_sendRawTransaction', params: ['0x...'] })
|
1045
|
+
* // => '0x...'
|
1046
|
+
*/
|
1047
|
+
{
|
1048
|
+
Method: 'eth_sendRawTransaction';
|
1049
|
+
Parameters: [signedTransaction: Hex];
|
1050
|
+
ReturnType: Hash;
|
1051
|
+
},
|
1052
|
+
/**
|
1053
|
+
* @description Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
|
1054
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
1055
|
+
* @example
|
1056
|
+
* provider.request({ method: 'eth_sign', params: ['0x...', '0x...'] })
|
1057
|
+
* // => '0x...'
|
1058
|
+
*/
|
1059
|
+
{
|
1060
|
+
Method: 'eth_sign';
|
1061
|
+
Parameters: [
|
847
1062
|
/** Address to use for signing */
|
848
1063
|
address: Address,
|
849
1064
|
/** Data to sign */
|
850
1065
|
data: Hex
|
851
1066
|
];
|
852
|
-
|
853
|
-
|
854
|
-
|
855
|
-
|
856
|
-
|
857
|
-
|
858
|
-
|
859
|
-
|
860
|
-
|
861
|
-
|
862
|
-
|
863
|
-
|
864
|
-
|
865
|
-
|
866
|
-
|
867
|
-
|
868
|
-
|
869
|
-
|
870
|
-
|
871
|
-
|
872
|
-
|
873
|
-
|
1067
|
+
ReturnType: Hex;
|
1068
|
+
},
|
1069
|
+
/**
|
1070
|
+
* @description Signs a transaction that can be submitted to the network at a later time using with `eth_sendRawTransaction`
|
1071
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
1072
|
+
* @example
|
1073
|
+
* provider.request({ method: 'eth_signTransaction', params: [{ from: '0x...', to: '0x...', value: '0x...' }] })
|
1074
|
+
* // => '0x...'
|
1075
|
+
*/
|
1076
|
+
{
|
1077
|
+
Method: 'eth_signTransaction';
|
1078
|
+
Parameters: [request: TransactionRequest];
|
1079
|
+
ReturnType: Hex;
|
1080
|
+
},
|
1081
|
+
/**
|
1082
|
+
* @description Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
|
1083
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
1084
|
+
* @example
|
1085
|
+
* provider.request({ method: 'eth_signTypedData_v4', params: [{ from: '0x...', data: [{ type: 'string', name: 'message', value: 'hello world' }] }] })
|
1086
|
+
* // => '0x...'
|
1087
|
+
*/
|
1088
|
+
{
|
1089
|
+
Method: 'eth_signTypedData_v4';
|
1090
|
+
Parameters: [
|
874
1091
|
/** Address to use for signing */
|
875
1092
|
address: Address,
|
876
1093
|
/** Message to sign containing type information, a domain separator, and data */
|
877
1094
|
message: string
|
878
1095
|
];
|
879
|
-
|
880
|
-
|
881
|
-
|
882
|
-
|
883
|
-
|
884
|
-
|
885
|
-
|
886
|
-
|
887
|
-
|
888
|
-
|
889
|
-
|
890
|
-
|
891
|
-
|
892
|
-
|
893
|
-
|
894
|
-
|
895
|
-
|
896
|
-
|
897
|
-
|
898
|
-
|
899
|
-
|
900
|
-
|
1096
|
+
ReturnType: Hex;
|
1097
|
+
},
|
1098
|
+
/**
|
1099
|
+
* @description Returns information about the status of this client’s network synchronization
|
1100
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
1101
|
+
* @example
|
1102
|
+
* provider.request({ method: 'eth_syncing' })
|
1103
|
+
* // => { startingBlock: '0x...', currentBlock: '0x...', highestBlock: '0x...' }
|
1104
|
+
*/
|
1105
|
+
{
|
1106
|
+
Method: 'eth_syncing';
|
1107
|
+
Parameters?: never;
|
1108
|
+
ReturnType: NetworkSync | false;
|
1109
|
+
},
|
1110
|
+
/**
|
1111
|
+
* @description Calculates an Ethereum-specific signature in the form of `keccak256("\x19Ethereum Signed Message:\n" + len(message) + message))`
|
1112
|
+
* @link https://eips.ethereum.org/EIPS/eip-1474
|
1113
|
+
* @example
|
1114
|
+
* provider.request({ method: 'personal_sign', params: ['0x...', '0x...'] })
|
1115
|
+
* // => '0x...'
|
1116
|
+
*/
|
1117
|
+
{
|
1118
|
+
Method: 'personal_sign';
|
1119
|
+
Parameters: [
|
901
1120
|
/** Data to sign */
|
902
1121
|
data: Hex,
|
903
1122
|
/** Address to use for signing */
|
904
1123
|
address: Address
|
905
1124
|
];
|
906
|
-
|
907
|
-
}
|
908
|
-
|
909
|
-
|
910
|
-
|
911
|
-
|
912
|
-
|
913
|
-
|
914
|
-
|
915
|
-
|
916
|
-
|
917
|
-
|
918
|
-
|
919
|
-
}
|
920
|
-
|
921
|
-
|
922
|
-
|
923
|
-
|
924
|
-
|
925
|
-
|
926
|
-
|
927
|
-
|
928
|
-
|
929
|
-
|
930
|
-
|
931
|
-
|
932
|
-
|
933
|
-
|
934
|
-
|
935
|
-
|
936
|
-
|
937
|
-
|
938
|
-
|
939
|
-
|
940
|
-
|
941
|
-
|
942
|
-
/**
|
943
|
-
* @description Requests the given permissions from the user.
|
944
|
-
* @link https://eips.ethereum.org/EIPS/eip-2255
|
945
|
-
* @example
|
946
|
-
* provider.request({ method: 'wallet_requestPermissions', params: [{ eth_accounts: {} }] })
|
947
|
-
* // => { ... }
|
948
|
-
* */
|
949
|
-
method: 'wallet_requestPermissions';
|
950
|
-
params: [permissions: {
|
1125
|
+
ReturnType: Hex;
|
1126
|
+
},
|
1127
|
+
/**
|
1128
|
+
* @description Add an Ethereum chain to the wallet.
|
1129
|
+
* @link https://eips.ethereum.org/EIPS/eip-3085
|
1130
|
+
* @example
|
1131
|
+
* provider.request({ method: 'wallet_addEthereumChain', params: [{ chainId: 1, rpcUrl: 'https://mainnet.infura.io/v3/...' }] })
|
1132
|
+
* // => { ... }
|
1133
|
+
*/
|
1134
|
+
{
|
1135
|
+
Method: 'wallet_addEthereumChain';
|
1136
|
+
Parameters: [chain: AddEthereumChainParameter];
|
1137
|
+
ReturnType: null;
|
1138
|
+
},
|
1139
|
+
/**
|
1140
|
+
* @description Gets the wallets current permissions.
|
1141
|
+
* @link https://eips.ethereum.org/EIPS/eip-2255
|
1142
|
+
* @example
|
1143
|
+
* provider.request({ method: 'wallet_getPermissions' })
|
1144
|
+
* // => { ... }
|
1145
|
+
*/
|
1146
|
+
{
|
1147
|
+
Method: 'wallet_getPermissions';
|
1148
|
+
Parameters?: never;
|
1149
|
+
ReturnType: WalletPermission[];
|
1150
|
+
},
|
1151
|
+
/**
|
1152
|
+
* @description Requests the given permissions from the user.
|
1153
|
+
* @link https://eips.ethereum.org/EIPS/eip-2255
|
1154
|
+
* @example
|
1155
|
+
* provider.request({ method: 'wallet_requestPermissions', params: [{ eth_accounts: {} }] })
|
1156
|
+
* // => { ... }
|
1157
|
+
*/
|
1158
|
+
{
|
1159
|
+
Method: 'wallet_requestPermissions';
|
1160
|
+
Parameters: [permissions: {
|
951
1161
|
eth_accounts: Record<string, any>;
|
952
1162
|
}];
|
953
|
-
|
954
|
-
|
955
|
-
|
956
|
-
|
957
|
-
|
958
|
-
|
959
|
-
|
960
|
-
|
961
|
-
|
962
|
-
|
963
|
-
|
964
|
-
|
965
|
-
request(args: {
|
966
|
-
/**
|
967
|
-
* @description Add an Ethereum chain to the wallet.
|
968
|
-
* @link https://eips.ethereum.org/EIPS/eip-3085
|
969
|
-
* @example
|
970
|
-
* provider.request({ method: 'wallet_addEthereumChain', params: [{ chainId: 1, rpcUrl: 'https://mainnet.infura.io/v3/...' }] })
|
971
|
-
* // => { ... }
|
972
|
-
*/
|
973
|
-
method: 'wallet_addEthereumChain';
|
974
|
-
params: [chain: AddEthereumChainParameter];
|
975
|
-
}): Promise<null>;
|
976
|
-
request(args: {
|
977
|
-
/**
|
978
|
-
* @description Switch the wallet to the given Ethereum chain.
|
979
|
-
* @link https://eips.ethereum.org/EIPS/eip-3326
|
980
|
-
* @example
|
981
|
-
* provider.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0xf00' }] })
|
982
|
-
* // => { ... }
|
983
|
-
* */
|
984
|
-
method: 'wallet_switchEthereumChain';
|
985
|
-
params: [chain: {
|
1163
|
+
ReturnType: WalletPermission[];
|
1164
|
+
},
|
1165
|
+
/**
|
1166
|
+
* @description Switch the wallet to the given Ethereum chain.
|
1167
|
+
* @link https://eips.ethereum.org/EIPS/eip-3326
|
1168
|
+
* @example
|
1169
|
+
* provider.request({ method: 'wallet_switchEthereumChain', params: [{ chainId: '0xf00' }] })
|
1170
|
+
* // => { ... }
|
1171
|
+
*/
|
1172
|
+
{
|
1173
|
+
Method: 'wallet_switchEthereumChain';
|
1174
|
+
Parameters: [chain: {
|
986
1175
|
chainId: string;
|
987
1176
|
}];
|
988
|
-
|
1177
|
+
ReturnType: null;
|
1178
|
+
},
|
989
1179
|
/**
|
990
1180
|
* @description Requests that the user tracks the token in their wallet. Returns a boolean indicating if the token was successfully added.
|
991
1181
|
* @link https://eips.ethereum.org/EIPS/eip-747
|
992
1182
|
* @example
|
993
1183
|
* provider.request({ method: 'wallet_watchAsset' }] })
|
994
1184
|
* // => true
|
995
|
-
|
996
|
-
|
997
|
-
|
998
|
-
|
999
|
-
|
1185
|
+
*/
|
1186
|
+
{
|
1187
|
+
Method: 'wallet_watchAsset';
|
1188
|
+
Parameters: WatchAssetParams;
|
1189
|
+
ReturnType: boolean;
|
1190
|
+
}
|
1191
|
+
];
|
1192
|
+
export type RpcSchema = readonly {
|
1193
|
+
Method: string;
|
1194
|
+
Parameters?: unknown;
|
1195
|
+
ReturnType: unknown;
|
1196
|
+
}[];
|
1197
|
+
export type RpcSchemaOverride = Omit<RpcSchema[number], 'Method'>;
|
1198
|
+
export type EIP1193Parameters<TRpcSchema extends RpcSchema | undefined = undefined> = TRpcSchema extends RpcSchema ? {
|
1199
|
+
[K in keyof TRpcSchema]: Prettify<{
|
1200
|
+
method: TRpcSchema[K] extends TRpcSchema[number] ? TRpcSchema[K]['Method'] : never;
|
1201
|
+
} & (TRpcSchema[K] extends TRpcSchema[number] ? TRpcSchema[K]['Parameters'] extends undefined ? {
|
1202
|
+
params?: never;
|
1203
|
+
} : {
|
1204
|
+
params: TRpcSchema[K]['Parameters'];
|
1205
|
+
} : never)>;
|
1206
|
+
}[number] : {
|
1207
|
+
method: string;
|
1208
|
+
params?: unknown;
|
1000
1209
|
};
|
1001
|
-
|
1210
|
+
type DerivedRpcSchema<TRpcSchema extends RpcSchema | undefined, TRpcSchemaOverride extends RpcSchemaOverride | undefined> = TRpcSchemaOverride extends RpcSchemaOverride ? [TRpcSchemaOverride & {
|
1211
|
+
Method: string;
|
1212
|
+
}] : TRpcSchema;
|
1213
|
+
export type EIP1193RequestFn<TRpcSchema extends RpcSchema | undefined = undefined> = <TRpcSchemaOverride extends RpcSchemaOverride | undefined = undefined, TParameters extends EIP1193Parameters<DerivedRpcSchema<TRpcSchema, TRpcSchemaOverride>> = EIP1193Parameters<DerivedRpcSchema<TRpcSchema, TRpcSchemaOverride>>, _ReturnType = DerivedRpcSchema<TRpcSchema, TRpcSchemaOverride> extends RpcSchema ? Extract<DerivedRpcSchema<TRpcSchema, TRpcSchemaOverride>[number], {
|
1214
|
+
Method: TParameters['method'];
|
1215
|
+
}>['ReturnType'] : unknown>(args: TParameters) => Promise<_ReturnType>;
|
1216
|
+
export {};
|
1002
1217
|
//# sourceMappingURL=eip1193.d.ts.map
|