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