viem 0.3.5 → 0.3.6
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/errors/version.js +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/types/abi.d.ts +3 -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 +21 -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 +45 -0
- package/dist/types/accounts/types.d.ts.map +1 -0
- package/dist/types/accounts/utils/index.d.ts +10 -0
- package/dist/types/accounts/utils/index.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/publicKeyToAddress.d.ts +10 -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 +9 -0
- package/dist/types/accounts/utils/signTransaction.d.ts.map +1 -0
- package/dist/types/accounts/utils/signTypedData.d.ts +19 -0
- package/dist/types/accounts/utils/signTypedData.d.ts.map +1 -0
- package/dist/types/accounts/utils/signatureToHex.d.ts +3 -0
- package/dist/types/accounts/utils/signatureToHex.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 +40 -0
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsAvatar.d.ts +38 -0
- package/dist/types/actions/ens/getEnsAvatar.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsName.d.ts +38 -0
- package/dist/types/actions/ens/getEnsName.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsResolver.d.ts +40 -0
- package/dist/types/actions/ens/getEnsResolver.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsText.d.ts +43 -0
- package/dist/types/actions/ens/getEnsText.d.ts.map +1 -0
- package/dist/types/actions/ens/index.d.ts +6 -0
- package/dist/types/actions/ens/index.d.ts.map +1 -0
- package/dist/types/actions/getContract.d.ts +261 -0
- package/dist/types/actions/getContract.d.ts.map +1 -0
- package/dist/types/actions/index.d.ts +11 -0
- package/dist/types/actions/index.d.ts.map +1 -0
- package/dist/types/actions/public/call.d.ts +49 -0
- package/dist/types/actions/public/call.d.ts.map +1 -0
- package/dist/types/actions/public/createBlockFilter.d.ts +26 -0
- package/dist/types/actions/public/createBlockFilter.d.ts.map +1 -0
- package/dist/types/actions/public/createContractEventFilter.d.ts +41 -0
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -0
- package/dist/types/actions/public/createEventFilter.d.ts +46 -0
- package/dist/types/actions/public/createEventFilter.d.ts.map +1 -0
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts +26 -0
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts.map +1 -0
- package/dist/types/actions/public/estimateContractGas.d.ts +35 -0
- package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -0
- package/dist/types/actions/public/estimateGas.d.ts +45 -0
- package/dist/types/actions/public/estimateGas.d.ts.map +1 -0
- package/dist/types/actions/public/getBalance.d.ts +52 -0
- package/dist/types/actions/public/getBalance.d.ts.map +1 -0
- package/dist/types/actions/public/getBlock.d.ts +52 -0
- package/dist/types/actions/public/getBlock.d.ts.map +1 -0
- package/dist/types/actions/public/getBlockNumber.d.ts +54 -0
- package/dist/types/actions/public/getBlockNumber.d.ts.map +1 -0
- package/dist/types/actions/public/getBlockTransactionCount.d.ts +44 -0
- package/dist/types/actions/public/getBlockTransactionCount.d.ts.map +1 -0
- package/dist/types/actions/public/getBytecode.d.ts +37 -0
- package/dist/types/actions/public/getBytecode.d.ts.map +1 -0
- package/dist/types/actions/public/getChainId.d.ts +26 -0
- package/dist/types/actions/public/getChainId.d.ts.map +1 -0
- package/dist/types/actions/public/getFeeHistory.d.ts +50 -0
- package/dist/types/actions/public/getFeeHistory.d.ts.map +1 -0
- package/dist/types/actions/public/getFilterChanges.d.ts +91 -0
- package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -0
- package/dist/types/actions/public/getFilterLogs.d.ts +36 -0
- package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -0
- package/dist/types/actions/public/getGasPrice.d.ts +25 -0
- package/dist/types/actions/public/getGasPrice.d.ts.map +1 -0
- package/dist/types/actions/public/getLogs.d.ts +49 -0
- package/dist/types/actions/public/getLogs.d.ts.map +1 -0
- package/dist/types/actions/public/getStorageAt.d.ts +39 -0
- package/dist/types/actions/public/getStorageAt.d.ts.map +1 -0
- package/dist/types/actions/public/getTransaction.d.ts +62 -0
- package/dist/types/actions/public/getTransaction.d.ts.map +1 -0
- package/dist/types/actions/public/getTransactionConfirmations.d.ts +39 -0
- package/dist/types/actions/public/getTransactionConfirmations.d.ts.map +1 -0
- package/dist/types/actions/public/getTransactionCount.d.ts +40 -0
- package/dist/types/actions/public/getTransactionCount.d.ts.map +1 -0
- package/dist/types/actions/public/getTransactionReceipt.d.ts +34 -0
- package/dist/types/actions/public/getTransactionReceipt.d.ts.map +1 -0
- package/dist/types/actions/public/index.d.ts +67 -0
- package/dist/types/actions/public/index.d.ts.map +1 -0
- package/dist/types/actions/public/multicall.d.ts +52 -0
- package/dist/types/actions/public/multicall.d.ts.map +1 -0
- package/dist/types/actions/public/readContract.d.ts +39 -0
- package/dist/types/actions/public/readContract.d.ts.map +1 -0
- package/dist/types/actions/public/simulateContract.d.ts +47 -0
- package/dist/types/actions/public/simulateContract.d.ts.map +1 -0
- package/dist/types/actions/public/uninstallFilter.d.ts +32 -0
- package/dist/types/actions/public/uninstallFilter.d.ts.map +1 -0
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts +69 -0
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +1 -0
- package/dist/types/actions/public/watchBlockNumber.d.ts +57 -0
- package/dist/types/actions/public/watchBlockNumber.d.ts.map +1 -0
- package/dist/types/actions/public/watchBlocks.d.ts +64 -0
- package/dist/types/actions/public/watchBlocks.d.ts.map +1 -0
- package/dist/types/actions/public/watchContractEvent.d.ts +55 -0
- package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -0
- package/dist/types/actions/public/watchEvent.d.ts +61 -0
- package/dist/types/actions/public/watchEvent.d.ts.map +1 -0
- package/dist/types/actions/public/watchPendingTransactions.d.ts +71 -0
- package/dist/types/actions/public/watchPendingTransactions.d.ts.map +1 -0
- package/dist/types/actions/test/dropTransaction.d.ts +30 -0
- package/dist/types/actions/test/dropTransaction.d.ts.map +1 -0
- package/dist/types/actions/test/getAutomine.d.ts +25 -0
- package/dist/types/actions/test/getAutomine.d.ts.map +1 -0
- package/dist/types/actions/test/getTxpoolContent.d.ts +31 -0
- package/dist/types/actions/test/getTxpoolContent.d.ts.map +1 -0
- package/dist/types/actions/test/getTxpoolStatus.d.ts +28 -0
- package/dist/types/actions/test/getTxpoolStatus.d.ts.map +1 -0
- package/dist/types/actions/test/impersonateAccount.d.ts +30 -0
- package/dist/types/actions/test/impersonateAccount.d.ts.map +1 -0
- package/dist/types/actions/test/increaseTime.d.ts +30 -0
- package/dist/types/actions/test/increaseTime.d.ts.map +1 -0
- package/dist/types/actions/test/index.d.ts +52 -0
- package/dist/types/actions/test/index.d.ts.map +1 -0
- package/dist/types/actions/test/inspectTxpool.d.ts +28 -0
- package/dist/types/actions/test/inspectTxpool.d.ts.map +1 -0
- package/dist/types/actions/test/mine.d.ts +30 -0
- package/dist/types/actions/test/mine.d.ts.map +1 -0
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts +23 -0
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts.map +1 -0
- package/dist/types/actions/test/reset.d.ts +30 -0
- package/dist/types/actions/test/reset.d.ts.map +1 -0
- package/dist/types/actions/test/revert.d.ts +28 -0
- package/dist/types/actions/test/revert.d.ts.map +1 -0
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +31 -0
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -0
- package/dist/types/actions/test/setAutomine.d.ts +23 -0
- package/dist/types/actions/test/setAutomine.d.ts.map +1 -0
- package/dist/types/actions/test/setBalance.d.ts +33 -0
- package/dist/types/actions/test/setBalance.d.ts.map +1 -0
- package/dist/types/actions/test/setBlockGasLimit.d.ts +28 -0
- package/dist/types/actions/test/setBlockGasLimit.d.ts.map +1 -0
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts +28 -0
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts.map +1 -0
- package/dist/types/actions/test/setCode.d.ts +33 -0
- package/dist/types/actions/test/setCode.d.ts.map +1 -0
- package/dist/types/actions/test/setCoinbase.d.ts +30 -0
- package/dist/types/actions/test/setCoinbase.d.ts.map +1 -0
- package/dist/types/actions/test/setIntervalMining.d.ts +28 -0
- package/dist/types/actions/test/setIntervalMining.d.ts.map +1 -0
- package/dist/types/actions/test/setLoggingEnabled.d.ts +23 -0
- package/dist/types/actions/test/setLoggingEnabled.d.ts.map +1 -0
- package/dist/types/actions/test/setMinGasPrice.d.ts +32 -0
- package/dist/types/actions/test/setMinGasPrice.d.ts.map +1 -0
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts +30 -0
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +1 -0
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts +28 -0
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts.map +1 -0
- package/dist/types/actions/test/setNonce.d.ts +33 -0
- package/dist/types/actions/test/setNonce.d.ts.map +1 -0
- package/dist/types/actions/test/setRpcUrl.d.ts +24 -0
- package/dist/types/actions/test/setRpcUrl.d.ts.map +1 -0
- package/dist/types/actions/test/setStorageAt.d.ts +36 -0
- package/dist/types/actions/test/setStorageAt.d.ts.map +1 -0
- package/dist/types/actions/test/snapshot.d.ts +23 -0
- package/dist/types/actions/test/snapshot.d.ts.map +1 -0
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts +30 -0
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts.map +1 -0
- package/dist/types/actions/wallet/addChain.d.ts +27 -0
- package/dist/types/actions/wallet/addChain.d.ts.map +1 -0
- package/dist/types/actions/wallet/deployContract.d.ts +38 -0
- package/dist/types/actions/wallet/deployContract.d.ts.map +1 -0
- package/dist/types/actions/wallet/getAddresses.d.ts +26 -0
- package/dist/types/actions/wallet/getAddresses.d.ts.map +1 -0
- package/dist/types/actions/wallet/getPermissions.d.ts +26 -0
- package/dist/types/actions/wallet/getPermissions.d.ts.map +1 -0
- package/dist/types/actions/wallet/index.d.ts +27 -0
- package/dist/types/actions/wallet/index.d.ts.map +1 -0
- package/dist/types/actions/wallet/requestAddresses.d.ts +30 -0
- package/dist/types/actions/wallet/requestAddresses.d.ts.map +1 -0
- package/dist/types/actions/wallet/requestPermissions.d.ts +34 -0
- package/dist/types/actions/wallet/requestPermissions.d.ts.map +1 -0
- package/dist/types/actions/wallet/sendTransaction.d.ts +53 -0
- package/dist/types/actions/wallet/sendTransaction.d.ts.map +1 -0
- package/dist/types/actions/wallet/signMessage.d.ts +54 -0
- package/dist/types/actions/wallet/signMessage.d.ts.map +1 -0
- package/dist/types/actions/wallet/signTypedData.d.ts +109 -0
- package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -0
- package/dist/types/actions/wallet/switchChain.d.ts +28 -0
- package/dist/types/actions/wallet/switchChain.d.ts.map +1 -0
- package/dist/types/actions/wallet/watchAsset.d.ts +35 -0
- package/dist/types/actions/wallet/watchAsset.d.ts.map +1 -0
- package/dist/types/actions/wallet/writeContract.d.ts +58 -0
- package/dist/types/actions/wallet/writeContract.d.ts.map +1 -0
- package/dist/types/adapters/ethers.d.ts +27 -0
- package/dist/types/adapters/ethers.d.ts.map +1 -0
- package/dist/types/chains.d.ts +2487 -0
- package/dist/types/chains.d.ts.map +1 -0
- package/dist/types/clients/createClient.d.ts +43 -0
- package/dist/types/clients/createClient.d.ts.map +1 -0
- package/dist/types/clients/createPublicClient.d.ts +40 -0
- package/dist/types/clients/createPublicClient.d.ts.map +1 -0
- package/dist/types/clients/createTestClient.d.ts +38 -0
- package/dist/types/clients/createTestClient.d.ts.map +1 -0
- package/dist/types/clients/createWalletClient.d.ts +51 -0
- package/dist/types/clients/createWalletClient.d.ts.map +1 -0
- package/dist/types/clients/decorators/index.d.ts +7 -0
- package/dist/types/clients/decorators/index.d.ts.map +1 -0
- package/dist/types/clients/decorators/public.d.ts +1043 -0
- package/dist/types/clients/decorators/public.d.ts.map +1 -0
- package/dist/types/clients/decorators/test.d.ts +572 -0
- package/dist/types/clients/decorators/test.d.ts.map +1 -0
- package/dist/types/clients/decorators/wallet.d.ts +436 -0
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -0
- package/dist/types/clients/index.d.ts +11 -0
- package/dist/types/clients/index.d.ts.map +1 -0
- package/dist/types/clients/transports/createTransport.d.ts +37 -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 +29 -0
- package/dist/types/clients/transports/http.d.ts.map +1 -0
- package/dist/types/clients/transports/index.d.ts +11 -0
- package/dist/types/clients/transports/index.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 +79 -0
- package/dist/types/constants/abis.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/index.d.ts +5 -0
- package/dist/types/constants/index.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 +7 -0
- package/dist/types/contract.d.ts.map +1 -0
- package/dist/types/ens.d.ts +5 -0
- package/dist/types/ens.d.ts.map +1 -0
- package/dist/types/errors/abi.d.ts +165 -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 +22 -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/chain.d.ts +35 -0
- package/dist/types/errors/chain.d.ts.map +1 -0
- package/dist/types/errors/contract.d.ts +58 -0
- package/dist/types/errors/contract.d.ts.map +1 -0
- package/dist/types/errors/data.d.ts +10 -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 +13 -0
- package/dist/types/errors/estimateGas.d.ts.map +1 -0
- package/dist/types/errors/index.d.ts +18 -0
- package/dist/types/errors/index.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 +53 -0
- package/dist/types/errors/request.d.ts.map +1 -0
- package/dist/types/errors/rpc.d.ts +199 -0
- package/dist/types/errors/rpc.d.ts.map +1 -0
- package/dist/types/errors/transaction.d.ts +75 -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/ethers.d.ts +2 -0
- package/dist/types/ethers.d.ts.map +1 -0
- package/dist/types/index.d.ts +12 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/public.d.ts +3 -0
- package/dist/types/public.d.ts.map +1 -0
- package/dist/types/test.d.ts +3 -0
- package/dist/types/test.d.ts.map +1 -0
- package/dist/types/types/account.d.ts +11 -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 +17 -0
- package/dist/types/types/chain.d.ts.map +1 -0
- package/dist/types/types/contract.d.ts +159 -0
- package/dist/types/types/contract.d.ts.map +1 -0
- package/dist/types/types/eip1193.d.ts +1002 -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 +28 -0
- package/dist/types/types/fee.d.ts.map +1 -0
- package/dist/types/types/filter.d.ts +27 -0
- package/dist/types/types/filter.d.ts.map +1 -0
- package/dist/types/types/formatter.d.ts +13 -0
- package/dist/types/types/formatter.d.ts.map +1 -0
- package/dist/types/types/index.d.ts +19 -0
- package/dist/types/types/index.d.ts.map +1 -0
- package/dist/types/types/log.d.ts +42 -0
- package/dist/types/types/log.d.ts.map +1 -0
- package/dist/types/types/misc.d.ts +10 -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 +19 -0
- package/dist/types/types/rpc.d.ts.map +1 -0
- package/dist/types/types/transaction.d.ts +132 -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 +156 -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 +13 -0
- package/dist/types/utils/abi/decodeErrorResult.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeEventLog.d.ts +13 -0
- package/dist/types/utils/abi/decodeEventLog.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeFunctionData.d.ts +14 -0
- package/dist/types/utils/abi/decodeFunctionData.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeFunctionResult.d.ts +10 -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 +8 -0
- package/dist/types/utils/abi/encodeDeployData.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeErrorResult.d.ts +8 -0
- package/dist/types/utils/abi/encodeErrorResult.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeEventTopics.d.ts +9 -0
- package/dist/types/utils/abi/encodeEventTopics.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeFunctionData.d.ts +8 -0
- package/dist/types/utils/abi/encodeFunctionData.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeFunctionResult.d.ts +9 -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/abi/index.d.ts +30 -0
- package/dist/types/utils/abi/index.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 +19 -0
- package/dist/types/utils/address/getContractAddress.d.ts.map +1 -0
- package/dist/types/utils/address/index.d.ts +6 -0
- package/dist/types/utils/address/index.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/chain.d.ts +8 -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/contract/index.d.ts +2 -0
- package/dist/types/utils/contract/index.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/index.d.ts +8 -0
- package/dist/types/utils/data/index.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/isHex.d.ts +3 -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 +27 -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 +110 -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/index.d.ts +8 -0
- package/dist/types/utils/encoding/index.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/index.d.ts +2 -0
- package/dist/types/utils/ens/avatar/index.d.ts.map +1 -0
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts +7 -0
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -0
- package/dist/types/utils/ens/avatar/utils.d.ts +34 -0
- package/dist/types/utils/ens/avatar/utils.d.ts.map +1 -0
- package/dist/types/utils/ens/index.d.ts +5 -0
- package/dist/types/utils/ens/index.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 +13 -0
- package/dist/types/utils/errors/getContractError.d.ts.map +1 -0
- package/dist/types/utils/errors/getEstimateGasError.d.ts +10 -0
- package/dist/types/utils/errors/getEstimateGasError.d.ts.map +1 -0
- package/dist/types/utils/errors/getNodeError.d.ts +6 -0
- package/dist/types/utils/errors/getNodeError.d.ts.map +1 -0
- package/dist/types/utils/errors/getTransactionError.d.ts +10 -0
- package/dist/types/utils/errors/getTransactionError.d.ts.map +1 -0
- package/dist/types/utils/errors/index.d.ts +6 -0
- package/dist/types/utils/errors/index.d.ts.map +1 -0
- package/dist/types/utils/filters/createFilterRequestScope.d.ts +16 -0
- package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +1 -0
- package/dist/types/utils/formatters/block.d.ts +14 -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 +3 -0
- package/dist/types/utils/formatters/feeHistory.d.ts.map +1 -0
- package/dist/types/utils/formatters/format.d.ts +36 -0
- package/dist/types/utils/formatters/format.d.ts.map +1 -0
- package/dist/types/utils/formatters/index.d.ts +13 -0
- package/dist/types/utils/formatters/index.d.ts.map +1 -0
- package/dist/types/utils/formatters/log.d.ts +16 -0
- package/dist/types/utils/formatters/log.d.ts.map +1 -0
- package/dist/types/utils/formatters/transaction.d.ts +19 -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 +3 -0
- package/dist/types/utils/hash/getEventSelector.d.ts.map +1 -0
- package/dist/types/utils/hash/getFunctionSelector.d.ts +2 -0
- package/dist/types/utils/hash/getFunctionSelector.d.ts.map +1 -0
- package/dist/types/utils/hash/hashFunction.d.ts +2 -0
- package/dist/types/utils/hash/hashFunction.d.ts.map +1 -0
- package/dist/types/utils/hash/index.d.ts +5 -0
- package/dist/types/utils/hash/index.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 +26 -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 +15 -0
- package/dist/types/utils/promise/createBatchScheduler.d.ts.map +1 -0
- package/dist/types/utils/promise/index.d.ts +5 -0
- package/dist/types/utils/promise/index.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 +64 -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 +10 -0
- package/dist/types/utils/signature/hashTypedData.d.ts.map +1 -0
- package/dist/types/utils/signature/index.d.ts +16 -0
- package/dist/types/utils/signature/index.d.ts.map +1 -0
- package/dist/types/utils/signature/recoverAddress.d.ts +8 -0
- package/dist/types/utils/signature/recoverAddress.d.ts.map +1 -0
- package/dist/types/utils/signature/recoverMessageAddress.d.ts +8 -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 +12 -0
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +1 -0
- package/dist/types/utils/signature/verifyMessage.d.ts +10 -0
- package/dist/types/utils/signature/verifyMessage.d.ts.map +1 -0
- package/dist/types/utils/signature/verifyTypedData.d.ts +13 -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 +4 -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/index.d.ts +10 -0
- package/dist/types/utils/transaction/index.d.ts.map +1 -0
- package/dist/types/utils/transaction/parseTransaction.d.ts +5 -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/serializeTransaction.d.ts +5 -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/index.d.ts +7 -0
- package/dist/types/utils/unit/index.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 +3 -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/errors/version.ts +1 -1
@@ -0,0 +1,35 @@
|
|
1
|
+
import type { Abi } from 'abitype';
|
2
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
3
|
+
import type { Chain, ContractFunctionConfig, GetValue } from '../../types/index.js';
|
4
|
+
import type { EstimateGasParameters } from './estimateGas.js';
|
5
|
+
export type EstimateContractGasParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain | undefined> = ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & Omit<EstimateGasParameters<TChain>, 'data' | 'to' | 'value'> & GetValue<TAbi, TFunctionName, EstimateGasParameters<TChain>['value']>;
|
6
|
+
export type EstimateContractGasReturnType = bigint;
|
7
|
+
/**
|
8
|
+
* Estimates the gas required to successfully execute a contract write function call.
|
9
|
+
*
|
10
|
+
* - Docs: https://viem.sh/docs/contract/estimateContractGas.html
|
11
|
+
*
|
12
|
+
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
|
13
|
+
*
|
14
|
+
* @param client - Client to use
|
15
|
+
* @param parameters - {@link EstimateContractGasParameters}
|
16
|
+
* @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}
|
17
|
+
*
|
18
|
+
* @example
|
19
|
+
* import { createPublicClient, http, parseAbi } from 'viem'
|
20
|
+
* import { mainnet } from 'viem/chains'
|
21
|
+
* import { estimateContractGas } from 'viem/contract'
|
22
|
+
*
|
23
|
+
* const client = createPublicClient({
|
24
|
+
* chain: mainnet,
|
25
|
+
* transport: http(),
|
26
|
+
* })
|
27
|
+
* const gas = await estimateContractGas(client, {
|
28
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
29
|
+
* abi: parseAbi(['function mint() public']),
|
30
|
+
* functionName: 'mint',
|
31
|
+
* account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
|
32
|
+
* })
|
33
|
+
*/
|
34
|
+
export declare function estimateContractGas<TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { abi, address, args, functionName, ...request }: EstimateContractGasParameters<TAbi, TFunctionName, TChain>): Promise<EstimateContractGasReturnType>;
|
35
|
+
//# sourceMappingURL=estimateContractGas.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"estimateContractGas.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/estimateContractGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAErE,OAAO,KAAK,EACV,KAAK,EACL,sBAAsB,EACtB,QAAQ,EACT,MAAM,sBAAsB,CAAA;AAQ7B,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAA;AAE7D,MAAM,MAAM,6BAA6B,CACvC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,MAAM,EACrC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD,sBAAsB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,GAAG,YAAY,CAAC,GACvE,IAAI,CAAC,qBAAqB,CAAC,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,GAC5D,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,qBAAqB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;AAEvE,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EACrC,aAAa,SAAS,MAAM,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EACE,GAAG,EACH,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,GAAG,OAAO,EACX,EAAE,6BAA6B,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,CAAC,GAC5D,OAAO,CAAC,6BAA6B,CAAC,CAwBxC"}
|
@@ -0,0 +1,45 @@
|
|
1
|
+
import type { PublicClient, WalletClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Account, BlockTag, Chain, Formatter, MergeIntersectionProperties, TransactionRequest } from '../../types/index.js';
|
3
|
+
import type { GetAccountParameter } from '../../types/account.js';
|
4
|
+
import type { Formatted, TransactionRequestFormatter } from '../../utils/index.js';
|
5
|
+
export type FormattedEstimateGas<TFormatter extends Formatter | undefined = Formatter> = MergeIntersectionProperties<Omit<Formatted<TFormatter, TransactionRequest, true>, 'from'>, TransactionRequest>;
|
6
|
+
export type EstimateGasParameters<TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = undefined> = FormattedEstimateGas<TransactionRequestFormatter<TChain>> & GetAccountParameter<TAccount> & ({
|
7
|
+
/** The balance of the account at a block number. */
|
8
|
+
blockNumber?: bigint;
|
9
|
+
blockTag?: never;
|
10
|
+
} | {
|
11
|
+
blockNumber?: never;
|
12
|
+
/**
|
13
|
+
* The balance of the account at a block tag.
|
14
|
+
* @default 'latest'
|
15
|
+
*/
|
16
|
+
blockTag?: BlockTag;
|
17
|
+
});
|
18
|
+
export type EstimateGasReturnType = bigint;
|
19
|
+
/**
|
20
|
+
* Estimates the gas necessary to complete a transaction without submitting it to the network.
|
21
|
+
*
|
22
|
+
* - Docs: https://viem.sh/docs/actions/public/estimateGas.html
|
23
|
+
* - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
|
24
|
+
*
|
25
|
+
* @param client - Client to use
|
26
|
+
* @param parameters - {@link EstimateGasParameters}
|
27
|
+
* @returns The gas estimate (in wei). {@link EstimateGasReturnType}
|
28
|
+
*
|
29
|
+
* @example
|
30
|
+
* import { createPublicClient, http, parseEther } from 'viem'
|
31
|
+
* import { mainnet } from 'viem/chains'
|
32
|
+
* import { estimateGas } from 'viem/public'
|
33
|
+
*
|
34
|
+
* const client = createPublicClient({
|
35
|
+
* chain: mainnet,
|
36
|
+
* transport: http(),
|
37
|
+
* })
|
38
|
+
* const gasEstimate = await estimateGas(client, {
|
39
|
+
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
40
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
41
|
+
* value: parseEther('1'),
|
42
|
+
* })
|
43
|
+
*/
|
44
|
+
export declare function estimateGas<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: PublicClient<Transport, TChain> | WalletClient<Transport, TChain, TAccount>, args: EstimateGasParameters<TChain, TAccount>): Promise<EstimateGasReturnType>;
|
45
|
+
//# sourceMappingURL=estimateGas.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"estimateGas.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/estimateGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACV,MAAM,wBAAwB,CAAA;AAG/B,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,KAAK,EACL,SAAS,EACT,2BAA2B,EAC3B,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AAWjE,OAAO,KAAK,EACV,SAAS,EACT,2BAA2B,EAC5B,MAAM,sBAAsB,CAAA;AAE7B,MAAM,MAAM,oBAAoB,CAC9B,UAAU,SAAS,SAAS,GAAG,SAAS,GAAG,SAAS,IAClD,2BAA2B,CAC7B,IAAI,CAAC,SAAS,CAAC,UAAU,EAAE,kBAAkB,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,EAC7D,kBAAkB,CACnB,CAAA;AAED,MAAM,MAAM,qBAAqB,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,IAC9C,oBAAoB,CAAC,2BAA2B,CAAC,MAAM,CAAC,CAAC,GAC3D,mBAAmB,CAAC,QAAQ,CAAC,GAC7B,CACI;IACE,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CACJ,CAAA;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,MAAM,EACF,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/B,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC7C,IAAI,EAAE,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,GAC5C,OAAO,CAAC,qBAAqB,CAAC,CA4DhC"}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Address, BlockTag, Chain } from '../../types/index.js';
|
3
|
+
export type GetBalanceParameters = {
|
4
|
+
/** The address of the account. */
|
5
|
+
address: Address;
|
6
|
+
} & ({
|
7
|
+
/** The balance of the account at a block number. */
|
8
|
+
blockNumber?: bigint;
|
9
|
+
blockTag?: never;
|
10
|
+
} | {
|
11
|
+
blockNumber?: never;
|
12
|
+
/** The balance of the account at a block tag. */
|
13
|
+
blockTag?: BlockTag;
|
14
|
+
});
|
15
|
+
export type GetBalanceReturnType = bigint;
|
16
|
+
/**
|
17
|
+
* Returns the balance of an address in wei.
|
18
|
+
*
|
19
|
+
* - Docs: https://viem.sh/docs/actions/public/getBalance.html
|
20
|
+
* - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)
|
21
|
+
*
|
22
|
+
* You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html).
|
23
|
+
*
|
24
|
+
* ```ts
|
25
|
+
* const balance = await getBalance(client, {
|
26
|
+
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
27
|
+
* blockTag: 'safe'
|
28
|
+
* })
|
29
|
+
* const balanceAsEther = formatEther(balance)
|
30
|
+
* // "6.942"
|
31
|
+
* ```
|
32
|
+
*
|
33
|
+
* @param client - Client to use
|
34
|
+
* @param parameters - {@link GetBalanceParameters}
|
35
|
+
* @returns The balance of the address in wei. {@link GetBalanceReturnType}
|
36
|
+
*
|
37
|
+
* @example
|
38
|
+
* import { createPublicClient, http } from 'viem'
|
39
|
+
* import { mainnet } from 'viem/chains'
|
40
|
+
* import { getBalance } from 'viem/public'
|
41
|
+
*
|
42
|
+
* const client = createPublicClient({
|
43
|
+
* chain: mainnet,
|
44
|
+
* transport: http(),
|
45
|
+
* })
|
46
|
+
* const balance = await getBalance(client, {
|
47
|
+
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
48
|
+
* })
|
49
|
+
* // 10000000000000000000000n (wei)
|
50
|
+
*/
|
51
|
+
export declare function getBalance<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { address, blockNumber, blockTag }: GetBalanceParameters): Promise<GetBalanceReturnType>;
|
52
|
+
//# sourceMappingURL=getBalance.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBalance.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,CACA;IACE,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CACJ,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,UAAU,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAC/D,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAmB,EAAE,EAAE,oBAAoB,GAClE,OAAO,CAAC,oBAAoB,CAAC,CAQ/B"}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import type { PublicClient, WalletClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Account, BlockTag, Chain, Hash } from '../../types/index.js';
|
3
|
+
import type { BlockFormatter, FormattedBlock } from '../../utils/index.js';
|
4
|
+
export type GetBlockParameters = {
|
5
|
+
/** Whether or not to include transaction data in the response. */
|
6
|
+
includeTransactions?: boolean;
|
7
|
+
} & ({
|
8
|
+
/** Hash of the block. */
|
9
|
+
blockHash?: Hash;
|
10
|
+
blockNumber?: never;
|
11
|
+
blockTag?: never;
|
12
|
+
} | {
|
13
|
+
blockHash?: never;
|
14
|
+
/** The block number. */
|
15
|
+
blockNumber?: bigint;
|
16
|
+
blockTag?: never;
|
17
|
+
} | {
|
18
|
+
blockHash?: never;
|
19
|
+
blockNumber?: never;
|
20
|
+
/**
|
21
|
+
* The block tag.
|
22
|
+
* @default 'latest'
|
23
|
+
*/
|
24
|
+
blockTag?: BlockTag;
|
25
|
+
});
|
26
|
+
export type GetBlockReturnType<TChain extends Chain | undefined = Chain | undefined> = FormattedBlock<BlockFormatter<TChain>>;
|
27
|
+
/**
|
28
|
+
* Returns information about a block at a block number, hash, or tag.
|
29
|
+
*
|
30
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlock.html
|
31
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
|
32
|
+
* - JSON-RPC Methods:
|
33
|
+
* - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.
|
34
|
+
* - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.
|
35
|
+
*
|
36
|
+
* @param client - Client to use
|
37
|
+
* @param parameters - {@link GetBlockParameters}
|
38
|
+
* @returns Information about the block. {@link GetBlockReturnType}
|
39
|
+
*
|
40
|
+
* @example
|
41
|
+
* import { createPublicClient, http } from 'viem'
|
42
|
+
* import { mainnet } from 'viem/chains'
|
43
|
+
* import { getBlock } from 'viem/public'
|
44
|
+
*
|
45
|
+
* const client = createPublicClient({
|
46
|
+
* chain: mainnet,
|
47
|
+
* transport: http(),
|
48
|
+
* })
|
49
|
+
* const block = await getBlock(client)
|
50
|
+
*/
|
51
|
+
export declare function getBlock<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: PublicClient<Transport, TChain> | WalletClient<Transport, TChain, TAccount>, { blockHash, blockNumber, blockTag, includeTransactions, }?: GetBlockParameters): Promise<GetBlockReturnType<TChain>>;
|
52
|
+
//# sourceMappingURL=getBlock.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBlock.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,YAAY,EACZ,SAAS,EACV,MAAM,wBAAwB,CAAA;AAE/B,OAAO,KAAK,EACV,OAAO,EACP,QAAQ,EACR,KAAK,EACL,IAAI,EAEL,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAG1E,MAAM,MAAM,kBAAkB,GAAG;IAC/B,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,OAAO,CAAA;CAC9B,GAAG,CACA;IACE,yBAAyB;IACzB,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CACJ,CAAA;AAED,MAAM,MAAM,kBAAkB,CAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD,cAAc,CAAC,cAAc,CAAC,MAAM,CAAC,CAAC,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EACF,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/B,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC7C,EACE,SAAS,EACT,WAAW,EACX,QAAmB,EACnB,mBAA2B,GAC5B,GAAE,kBAAuB,GACzB,OAAO,CAAC,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAsBrC"}
|
@@ -0,0 +1,54 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Chain } from '../../types/index.js';
|
3
|
+
export type GetBlockNumberParameters = {
|
4
|
+
/** The maximum age (in ms) of the cached value. */
|
5
|
+
maxAge?: number;
|
6
|
+
};
|
7
|
+
export type GetBlockNumberReturnType = bigint;
|
8
|
+
export declare function getBlockNumberCache(id: string): {
|
9
|
+
clear: () => void;
|
10
|
+
promise: {
|
11
|
+
clear: () => boolean;
|
12
|
+
get: () => Promise<unknown> | undefined;
|
13
|
+
set: (data: Promise<unknown>) => Map<string, Promise<unknown>>;
|
14
|
+
};
|
15
|
+
response: {
|
16
|
+
clear: () => boolean;
|
17
|
+
get: () => {
|
18
|
+
created: Date;
|
19
|
+
data: unknown;
|
20
|
+
} | undefined;
|
21
|
+
set: (data: {
|
22
|
+
created: Date;
|
23
|
+
data: unknown;
|
24
|
+
}) => Map<string, {
|
25
|
+
created: Date;
|
26
|
+
data: unknown;
|
27
|
+
}>;
|
28
|
+
};
|
29
|
+
};
|
30
|
+
/**
|
31
|
+
* Returns the number of the most recent block seen.
|
32
|
+
*
|
33
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html
|
34
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
|
35
|
+
* - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)
|
36
|
+
*
|
37
|
+
* @param client - Client to use
|
38
|
+
* @param parameters - {@link GetBlockNumberParameters}
|
39
|
+
* @returns The number of the block. {@link GetBlockNumberReturnType}
|
40
|
+
*
|
41
|
+
* @example
|
42
|
+
* import { createPublicClient, http } from 'viem'
|
43
|
+
* import { mainnet } from 'viem/chains'
|
44
|
+
* import { getBlockNumber } from 'viem/public'
|
45
|
+
*
|
46
|
+
* const client = createPublicClient({
|
47
|
+
* chain: mainnet,
|
48
|
+
* transport: http(),
|
49
|
+
* })
|
50
|
+
* const blockNumber = await getBlockNumber(client)
|
51
|
+
* // 69420n
|
52
|
+
*/
|
53
|
+
export declare function getBlockNumber<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { maxAge }?: GetBlockNumberParameters): Promise<GetBlockNumberReturnType>;
|
54
|
+
//# sourceMappingURL=getBlockNumber.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBlockNumber.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBlockNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAA;AAI7C,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;EAE7C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,cAAc,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EACnE,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EAAE,MAA+B,EAAE,GAAE,wBAA6B,GACjE,OAAO,CAAC,wBAAwB,CAAC,CASnC"}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { BlockTag, Chain, Hash } from '../../types/index.js';
|
3
|
+
export type GetBlockTransactionCountParameters = {
|
4
|
+
/** Hash of the block. */
|
5
|
+
blockHash?: Hash;
|
6
|
+
blockNumber?: never;
|
7
|
+
blockTag?: never;
|
8
|
+
} | {
|
9
|
+
blockHash?: never;
|
10
|
+
/** The block number. */
|
11
|
+
blockNumber?: bigint;
|
12
|
+
blockTag?: never;
|
13
|
+
} | {
|
14
|
+
blockHash?: never;
|
15
|
+
blockNumber?: never;
|
16
|
+
/** The block tag. Defaults to 'latest'. */
|
17
|
+
blockTag?: BlockTag;
|
18
|
+
};
|
19
|
+
export type GetBlockTransactionCountReturnType = number;
|
20
|
+
/**
|
21
|
+
* Returns the number of Transactions at a block number, hash, or tag.
|
22
|
+
*
|
23
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html
|
24
|
+
* - JSON-RPC Methods:
|
25
|
+
* - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.
|
26
|
+
* - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.
|
27
|
+
*
|
28
|
+
* @param client - Client to use
|
29
|
+
* @param parameters - {@link GetBlockTransactionCountParameters}
|
30
|
+
* @returns The block transaction count. {@link GetBlockTransactionCountReturnType}
|
31
|
+
*
|
32
|
+
* @example
|
33
|
+
* import { createPublicClient, http } from 'viem'
|
34
|
+
* import { mainnet } from 'viem/chains'
|
35
|
+
* import { getBlockTransactionCount } from 'viem/public'
|
36
|
+
*
|
37
|
+
* const client = createPublicClient({
|
38
|
+
* chain: mainnet,
|
39
|
+
* transport: http(),
|
40
|
+
* })
|
41
|
+
* const count = await getBlockTransactionCount(client)
|
42
|
+
*/
|
43
|
+
export declare function getBlockTransactionCount<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { blockHash, blockNumber, blockTag, }?: GetBlockTransactionCountParameters): Promise<GetBlockTransactionCountReturnType>;
|
44
|
+
//# sourceMappingURL=getBlockTransactionCount.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBlockTransactionCount.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBlockTransactionCount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,IAAI,EAAY,MAAM,sBAAsB,CAAA;AAG3E,MAAM,MAAM,kCAAkC,GAC1C;IACE,yBAAyB;IACzB,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CAAA;AAEL,MAAM,MAAM,kCAAkC,GAAG,MAAM,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EACE,SAAS,EACT,WAAW,EACX,QAAmB,GACpB,GAAE,kCAAuC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CAkB7C"}
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Address, BlockTag, Chain, Hex } from '../../types/index.js';
|
3
|
+
export type GetBytecodeParameters = {
|
4
|
+
address: Address;
|
5
|
+
} & ({
|
6
|
+
blockNumber?: never;
|
7
|
+
blockTag?: BlockTag;
|
8
|
+
} | {
|
9
|
+
blockNumber?: bigint;
|
10
|
+
blockTag?: never;
|
11
|
+
});
|
12
|
+
export type GetBytecodeReturnType = Hex | undefined;
|
13
|
+
/**
|
14
|
+
* Retrieves the bytecode at an address.
|
15
|
+
*
|
16
|
+
* - Docs: https://viem.sh/docs/contract/getBytecode.html
|
17
|
+
* - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)
|
18
|
+
*
|
19
|
+
* @param client - Client to use
|
20
|
+
* @param parameters - {@link GetBytecodeParameters}
|
21
|
+
* @returns The contract's bytecode. {@link GetBytecodeReturnType}
|
22
|
+
*
|
23
|
+
* @example
|
24
|
+
* import { createPublicClient, http } from 'viem'
|
25
|
+
* import { mainnet } from 'viem/chains'
|
26
|
+
* import { getBytecode } from 'viem/contract'
|
27
|
+
*
|
28
|
+
* const client = createPublicClient({
|
29
|
+
* chain: mainnet,
|
30
|
+
* transport: http(),
|
31
|
+
* })
|
32
|
+
* const code = await getBytecode(client, {
|
33
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
34
|
+
* })
|
35
|
+
*/
|
36
|
+
export declare function getBytecode<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { address, blockNumber, blockTag }: GetBytecodeParameters): Promise<GetBytecodeReturnType>;
|
37
|
+
//# sourceMappingURL=getBytecode.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBytecode.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBytecode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAGzE,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,CACA;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,GACD;IACE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CACJ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,GAAG,GAAG,SAAS,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,WAAW,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChE,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAmB,EAAE,EAAE,qBAAqB,GACnE,OAAO,CAAC,qBAAqB,CAAC,CAShC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
import type { PublicClient, Transport, WalletClient } from '../../clients/index.js';
|
2
|
+
import type { Account, Chain } from '../../types/index.js';
|
3
|
+
export type GetChainIdReturnType = number;
|
4
|
+
/**
|
5
|
+
* Returns the chain ID associated with the current network.
|
6
|
+
*
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getChainId.html
|
8
|
+
* - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)
|
9
|
+
*
|
10
|
+
* @param client - Client to use
|
11
|
+
* @returns The current chain ID. {@link GetChainIdReturnType}
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* import { createPublicClient, http } from 'viem'
|
15
|
+
* import { mainnet } from 'viem/chains'
|
16
|
+
* import { getChainId } from 'viem/public'
|
17
|
+
*
|
18
|
+
* const client = createPublicClient({
|
19
|
+
* chain: mainnet,
|
20
|
+
* transport: http(),
|
21
|
+
* })
|
22
|
+
* const chainId = await getChainId(client)
|
23
|
+
* // 1
|
24
|
+
*/
|
25
|
+
export declare function getChainId<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: PublicClient<Transport, TChain> | WalletClient<Transport, TChain, TAccount>): Promise<GetChainIdReturnType>;
|
26
|
+
//# sourceMappingURL=getChainId.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getChainId.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getChainId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAG1D,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,UAAU,CAC9B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EACF,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/B,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAC5C,OAAO,CAAC,oBAAoB,CAAC,CAG/B"}
|
@@ -0,0 +1,50 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { BlockTag, Chain, FeeHistory } from '../../types/index.js';
|
3
|
+
export type GetFeeHistoryParameters = {
|
4
|
+
/**
|
5
|
+
* 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.
|
6
|
+
*/
|
7
|
+
blockCount: number;
|
8
|
+
/**
|
9
|
+
* 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.
|
10
|
+
*/
|
11
|
+
rewardPercentiles: number[];
|
12
|
+
} & ({
|
13
|
+
blockNumber?: never;
|
14
|
+
/**
|
15
|
+
* Highest number block of the requested range.
|
16
|
+
* @default 'latest'
|
17
|
+
*/
|
18
|
+
blockTag?: BlockTag;
|
19
|
+
} | {
|
20
|
+
/** Highest number block of the requested range. */
|
21
|
+
blockNumber?: bigint;
|
22
|
+
blockTag?: never;
|
23
|
+
});
|
24
|
+
export type GetFeeHistoryReturnType = FeeHistory;
|
25
|
+
/**
|
26
|
+
* Returns a collection of historical gas information.
|
27
|
+
*
|
28
|
+
* - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html
|
29
|
+
* - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)
|
30
|
+
*
|
31
|
+
* @param client - Client to use
|
32
|
+
* @param parameters - {@link GetFeeHistoryParameters}
|
33
|
+
* @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}
|
34
|
+
*
|
35
|
+
* @example
|
36
|
+
* import { createPublicClient, http } from 'viem'
|
37
|
+
* import { mainnet } from 'viem/chains'
|
38
|
+
* import { getFeeHistory } from 'viem/public'
|
39
|
+
*
|
40
|
+
* const client = createPublicClient({
|
41
|
+
* chain: mainnet,
|
42
|
+
* transport: http(),
|
43
|
+
* })
|
44
|
+
* const feeHistory = await getFeeHistory(client, {
|
45
|
+
* blockCount: 4,
|
46
|
+
* rewardPercentiles: [25, 75],
|
47
|
+
* })
|
48
|
+
*/
|
49
|
+
export declare function getFeeHistory<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { blockCount, blockNumber, blockTag, rewardPercentiles, }: GetFeeHistoryParameters): Promise<GetFeeHistoryReturnType>;
|
50
|
+
//# sourceMappingURL=getFeeHistory.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getFeeHistory.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getFeeHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAKvE,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAC5B,GAAG,CACA;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,GACD;IACE,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CACJ,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAA;AAEhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,aAAa,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAClE,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EACE,UAAU,EACV,WAAW,EACX,QAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAWlC"}
|
@@ -0,0 +1,91 @@
|
|
1
|
+
import type { Abi, AbiEvent } from 'abitype';
|
2
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
3
|
+
import type { Chain, Filter, FilterType, Hash, Log, MaybeAbiEventName } from '../../types/index.js';
|
4
|
+
export type GetFilterChangesParameters<TFilterType extends FilterType = FilterType, TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
|
5
|
+
filter: Filter<TFilterType, TAbi, TEventName, any>;
|
6
|
+
};
|
7
|
+
export type GetFilterChangesReturnType<TFilterType extends FilterType = FilterType, TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = TFilterType extends 'event' ? Log<bigint, number, TAbiEvent, TAbi, TEventName>[] : Hash[];
|
8
|
+
/**
|
9
|
+
* Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.
|
10
|
+
*
|
11
|
+
* - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html
|
12
|
+
* - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
|
13
|
+
*
|
14
|
+
* A Filter can be created from the following actions:
|
15
|
+
*
|
16
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
|
17
|
+
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
|
18
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
|
19
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
|
20
|
+
*
|
21
|
+
* Depending on the type of filter, the return value will be different:
|
22
|
+
*
|
23
|
+
* - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.
|
24
|
+
* - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.
|
25
|
+
* - If the filter was created with `createBlockFilter`, it returns a list of block hashes.
|
26
|
+
*
|
27
|
+
* @param client - Client to use
|
28
|
+
* @param parameters - {@link GetFilterChangesParameters}
|
29
|
+
* @returns Logs or hashes. {@link GetFilterChangesReturnType}
|
30
|
+
*
|
31
|
+
* @example
|
32
|
+
* // Blocks
|
33
|
+
* import { createPublicClient, http } from 'viem'
|
34
|
+
* import { mainnet } from 'viem/chains'
|
35
|
+
* import { createBlockFilter, getFilterChanges } from 'viem/public'
|
36
|
+
*
|
37
|
+
* const client = createPublicClient({
|
38
|
+
* chain: mainnet,
|
39
|
+
* transport: http(),
|
40
|
+
* })
|
41
|
+
* const filter = await createBlockFilter(client)
|
42
|
+
* const hashes = await getFilterChanges(client, { filter })
|
43
|
+
*
|
44
|
+
* @example
|
45
|
+
* // Contract Events
|
46
|
+
* import { createPublicClient, http, parseAbi } from 'viem'
|
47
|
+
* import { mainnet } from 'viem/chains'
|
48
|
+
* import { createContractEventFilter, getFilterChanges } from 'viem/public'
|
49
|
+
*
|
50
|
+
* const client = createPublicClient({
|
51
|
+
* chain: mainnet,
|
52
|
+
* transport: http(),
|
53
|
+
* })
|
54
|
+
* const filter = await createContractEventFilter(client, {
|
55
|
+
* address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
56
|
+
* abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
|
57
|
+
* eventName: 'Transfer',
|
58
|
+
* })
|
59
|
+
* const logs = await getFilterChanges(client, { filter })
|
60
|
+
*
|
61
|
+
* @example
|
62
|
+
* // Raw Events
|
63
|
+
* import { createPublicClient, http, parseAbiItem } from 'viem'
|
64
|
+
* import { mainnet } from 'viem/chains'
|
65
|
+
* import { createEventFilter, getFilterChanges } from 'viem/public'
|
66
|
+
*
|
67
|
+
* const client = createPublicClient({
|
68
|
+
* chain: mainnet,
|
69
|
+
* transport: http(),
|
70
|
+
* })
|
71
|
+
* const filter = await createEventFilter(client, {
|
72
|
+
* address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
73
|
+
* event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
|
74
|
+
* })
|
75
|
+
* const logs = await getFilterChanges(client, { filter })
|
76
|
+
*
|
77
|
+
* @example
|
78
|
+
* // Transactions
|
79
|
+
* import { createPublicClient, http } from 'viem'
|
80
|
+
* import { mainnet } from 'viem/chains'
|
81
|
+
* import { createPendingTransactionFilter, getFilterChanges } from 'viem/public'
|
82
|
+
*
|
83
|
+
* const client = createPublicClient({
|
84
|
+
* chain: mainnet,
|
85
|
+
* transport: http(),
|
86
|
+
* })
|
87
|
+
* const filter = await createPendingTransactionFilter(client)
|
88
|
+
* const hashes = await getFilterChanges(client, { filter })
|
89
|
+
*/
|
90
|
+
export declare function getFilterChanges<TTransport extends Transport, TChain extends Chain | undefined, TFilterType extends FilterType, TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(_client: PublicClient<TTransport, TChain>, { filter, }: GetFilterChangesParameters<TFilterType, TAbiEvent, TAbi, TEventName>): Promise<GetFilterChangesReturnType<TFilterType, TAbiEvent, TAbi, TEventName>>;
|
91
|
+
//# sourceMappingURL=getFilterChanges.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getFilterChanges.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getFilterChanges.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACN,UAAU,EACV,IAAI,EACJ,GAAG,EACH,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAK7B,MAAM,MAAM,0BAA0B,CACpC,WAAW,SAAS,UAAU,GAAG,UAAU,EAC3C,SAAS,SAAS,QAAQ,GAAG,SAAS,GAAG,SAAS,EAClD,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,EACnD,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,IAClE;IACF,MAAM,EAAE,MAAM,CAAC,WAAW,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;CACnD,CAAA;AAED,MAAM,MAAM,0BAA0B,CACpC,WAAW,SAAS,UAAU,GAAG,UAAU,EAC3C,SAAS,SAAS,QAAQ,GAAG,SAAS,GAAG,SAAS,EAClD,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,EACnD,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,IAClE,WAAW,SAAS,OAAO,GAC3B,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,GAClD,IAAI,EAAE,CAAA;AAEV;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiFG;AACH,wBAAsB,gBAAgB,CACpC,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,WAAW,SAAS,UAAU,EAC9B,SAAS,SAAS,QAAQ,GAAG,SAAS,EACtC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EACrC,UAAU,SAAS,MAAM,GAAG,SAAS,EAErC,OAAO,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,EACzC,EACE,MAAM,GACP,EAAE,0BAA0B,CAAC,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,iFA8BxE"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import type { Abi, AbiEvent } from 'abitype';
|
2
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
3
|
+
import type { Chain, Filter, Log, MaybeAbiEventName } from '../../types/index.js';
|
4
|
+
export type GetFilterLogsParameters<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
|
5
|
+
filter: Filter<'event', TAbi, TEventName, any>;
|
6
|
+
};
|
7
|
+
export type GetFilterLogsReturnType<TAbiEvent extends AbiEvent | undefined = undefined, TAbi extends Abi | readonly unknown[] = [TAbiEvent], TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = Log<bigint, number, TAbiEvent, TAbi, TEventName>[];
|
8
|
+
/**
|
9
|
+
* Returns a list of event logs since the filter was created.
|
10
|
+
*
|
11
|
+
* - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html
|
12
|
+
* - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)
|
13
|
+
*
|
14
|
+
* `getFilterLogs` is only compatible with **event filters**.
|
15
|
+
*
|
16
|
+
* @param client - Client to use
|
17
|
+
* @param parameters - {@link GetFilterLogsParameters}
|
18
|
+
* @returns A list of event logs. {@link GetFilterLogsReturnType}
|
19
|
+
*
|
20
|
+
* @example
|
21
|
+
* import { createPublicClient, http, parseAbiItem } from 'viem'
|
22
|
+
* import { mainnet } from 'viem/chains'
|
23
|
+
* import { createEventFilter, getFilterLogs } from 'viem/public'
|
24
|
+
*
|
25
|
+
* const client = createPublicClient({
|
26
|
+
* chain: mainnet,
|
27
|
+
* transport: http(),
|
28
|
+
* })
|
29
|
+
* const filter = await createEventFilter(client, {
|
30
|
+
* address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
31
|
+
* event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
|
32
|
+
* })
|
33
|
+
* const logs = await getFilterLogs(client, { filter })
|
34
|
+
*/
|
35
|
+
export declare function getFilterLogs<TChain extends Chain | undefined, TAbiEvent extends AbiEvent | undefined, TAbi extends Abi | readonly unknown[], TEventName extends string | undefined>(_client: PublicClient<Transport, TChain>, { filter }: GetFilterLogsParameters<TAbiEvent, TAbi, TEventName>): Promise<GetFilterLogsReturnType<TAbiEvent, TAbi, TEventName>>;
|
36
|
+
//# sourceMappingURL=getFilterLogs.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getFilterLogs.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getFilterLogs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EACV,KAAK,EACL,MAAM,EACN,GAAG,EACH,iBAAiB,EAClB,MAAM,sBAAsB,CAAA;AAK7B,MAAM,MAAM,uBAAuB,CACjC,SAAS,SAAS,QAAQ,GAAG,SAAS,GAAG,SAAS,EAClD,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,EACnD,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,IAClE;IACF,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,CAAC,CAAA;CAC/C,CAAA;AACD,MAAM,MAAM,uBAAuB,CACjC,SAAS,SAAS,QAAQ,GAAG,SAAS,GAAG,SAAS,EAClD,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,CAAC,SAAS,CAAC,EACnD,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,IAClE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,CAAA;AAEtD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,aAAa,CACjC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,SAAS,SAAS,QAAQ,GAAG,SAAS,EACtC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EACrC,UAAU,SAAS,MAAM,GAAG,SAAS,EAErC,OAAO,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACxC,EAAE,MAAM,EAAE,EAAE,uBAAuB,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,GAC/D,OAAO,CAAC,uBAAuB,CAAC,SAAS,EAAE,IAAI,EAAE,UAAU,CAAC,CAAC,CA2B/D"}
|
@@ -0,0 +1,25 @@
|
|
1
|
+
import type { PublicClient, Transport, WalletClient } from '../../clients/index.js';
|
2
|
+
import type { Account, Chain } from '../../types/index.js';
|
3
|
+
export type GetGasPriceReturnType = bigint;
|
4
|
+
/**
|
5
|
+
* Returns the current price of gas (in wei).
|
6
|
+
*
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getGasPrice.html
|
8
|
+
* - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)
|
9
|
+
*
|
10
|
+
* @param client - Client to use
|
11
|
+
* @returns The gas price (in wei). {@link GetGasPriceReturnType}
|
12
|
+
*
|
13
|
+
* @example
|
14
|
+
* import { createPublicClient, http } from 'viem'
|
15
|
+
* import { mainnet } from 'viem/chains'
|
16
|
+
* import { getGasPrice } from 'viem/public'
|
17
|
+
*
|
18
|
+
* const client = createPublicClient({
|
19
|
+
* chain: mainnet,
|
20
|
+
* transport: http(),
|
21
|
+
* })
|
22
|
+
* const gasPrice = await getGasPrice(client)
|
23
|
+
*/
|
24
|
+
export declare function getGasPrice<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: PublicClient<Transport, TChain> | WalletClient<Transport, TChain, TAccount>): Promise<GetGasPriceReturnType>;
|
25
|
+
//# sourceMappingURL=getGasPrice.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getGasPrice.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getGasPrice.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAE1D,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EACF,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/B,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAC5C,OAAO,CAAC,qBAAqB,CAAC,CAKhC"}
|