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 @@
|
|
1
|
+
{"version":3,"file":"getChainId.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getChainId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,UAAU,CAC9B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAK5E"}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { BlockTag } from '../../types/block.js';
|
4
|
+
import type { Chain } from '../../types/chain.js';
|
5
|
+
import type { FeeHistory } from '../../types/fee.js';
|
6
|
+
export type GetFeeHistoryParameters = {
|
7
|
+
/**
|
8
|
+
* 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.
|
9
|
+
*/
|
10
|
+
blockCount: number;
|
11
|
+
/**
|
12
|
+
* 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.
|
13
|
+
*/
|
14
|
+
rewardPercentiles: number[];
|
15
|
+
} & ({
|
16
|
+
blockNumber?: never;
|
17
|
+
/**
|
18
|
+
* Highest number block of the requested range.
|
19
|
+
* @default 'latest'
|
20
|
+
*/
|
21
|
+
blockTag?: BlockTag;
|
22
|
+
} | {
|
23
|
+
/** Highest number block of the requested range. */
|
24
|
+
blockNumber?: bigint;
|
25
|
+
blockTag?: never;
|
26
|
+
});
|
27
|
+
export type GetFeeHistoryReturnType = FeeHistory;
|
28
|
+
/**
|
29
|
+
* Returns a collection of historical gas information.
|
30
|
+
*
|
31
|
+
* - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html
|
32
|
+
* - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)
|
33
|
+
*
|
34
|
+
* @param client - Client to use
|
35
|
+
* @param parameters - {@link GetFeeHistoryParameters}
|
36
|
+
* @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}
|
37
|
+
*
|
38
|
+
* @example
|
39
|
+
* import { createPublicClient, http } from 'viem'
|
40
|
+
* import { mainnet } from 'viem/chains'
|
41
|
+
* import { getFeeHistory } from 'viem/public'
|
42
|
+
*
|
43
|
+
* const client = createPublicClient({
|
44
|
+
* chain: mainnet,
|
45
|
+
* transport: http(),
|
46
|
+
* })
|
47
|
+
* const feeHistory = await getFeeHistory(client, {
|
48
|
+
* blockCount: 4,
|
49
|
+
* rewardPercentiles: [25, 75],
|
50
|
+
* })
|
51
|
+
*/
|
52
|
+
export declare function getFeeHistory<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { blockCount, blockNumber, blockTag, rewardPercentiles, }: GetFeeHistoryParameters): Promise<GetFeeHistoryReturnType>;
|
53
|
+
//# 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,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAIpD,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,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EACE,UAAU,EACV,WAAW,EACX,QAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAWlC"}
|
@@ -0,0 +1,96 @@
|
|
1
|
+
import type { Abi, AbiEvent, ExtractAbiEvent } from 'abitype';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockNumber, BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { Filter, FilterType } from '../../types/filter.js';
|
7
|
+
import type { Log } from '../../types/log.js';
|
8
|
+
import type { Hash } from '../../types/misc.js';
|
9
|
+
export type GetFilterChangesParameters<TFilterType extends FilterType = FilterType, TAbi extends Abi | readonly unknown[] | undefined = undefined, TEventName extends string | undefined = undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined> = {
|
10
|
+
filter: Filter<TFilterType, TAbi, TEventName, any, TStrict, TFromBlock, TToBlock>;
|
11
|
+
};
|
12
|
+
export type GetFilterChangesReturnType<TFilterType extends FilterType = FilterType, TAbi extends Abi | readonly unknown[] | undefined = undefined, TEventName extends string | undefined = undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined, _AbiEvent extends AbiEvent | undefined = TAbi extends Abi ? TEventName extends string ? ExtractAbiEvent<TAbi, TEventName> : undefined : undefined, _Pending extends boolean = (TFromBlock extends 'pending' ? true : false) | (TToBlock extends 'pending' ? true : false)> = TFilterType extends 'event' ? Log<bigint, number, _Pending, _AbiEvent, TStrict, TAbi, TEventName>[] : Hash[];
|
13
|
+
/**
|
14
|
+
* Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.
|
15
|
+
*
|
16
|
+
* - Docs: https://viem.sh/docs/actions/public/getFilterChanges.html
|
17
|
+
* - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
|
18
|
+
*
|
19
|
+
* A Filter can be created from the following actions:
|
20
|
+
*
|
21
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
|
22
|
+
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter.html)
|
23
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
|
24
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
|
25
|
+
*
|
26
|
+
* Depending on the type of filter, the return value will be different:
|
27
|
+
*
|
28
|
+
* - If the filter was created with `createContractEventFilter` or `createEventFilter`, it returns a list of logs.
|
29
|
+
* - If the filter was created with `createPendingTransactionFilter`, it returns a list of transaction hashes.
|
30
|
+
* - If the filter was created with `createBlockFilter`, it returns a list of block hashes.
|
31
|
+
*
|
32
|
+
* @param client - Client to use
|
33
|
+
* @param parameters - {@link GetFilterChangesParameters}
|
34
|
+
* @returns Logs or hashes. {@link GetFilterChangesReturnType}
|
35
|
+
*
|
36
|
+
* @example
|
37
|
+
* // Blocks
|
38
|
+
* import { createPublicClient, http } from 'viem'
|
39
|
+
* import { mainnet } from 'viem/chains'
|
40
|
+
* import { createBlockFilter, getFilterChanges } from 'viem/public'
|
41
|
+
*
|
42
|
+
* const client = createPublicClient({
|
43
|
+
* chain: mainnet,
|
44
|
+
* transport: http(),
|
45
|
+
* })
|
46
|
+
* const filter = await createBlockFilter(client)
|
47
|
+
* const hashes = await getFilterChanges(client, { filter })
|
48
|
+
*
|
49
|
+
* @example
|
50
|
+
* // Contract Events
|
51
|
+
* import { createPublicClient, http, parseAbi } from 'viem'
|
52
|
+
* import { mainnet } from 'viem/chains'
|
53
|
+
* import { createContractEventFilter, getFilterChanges } from 'viem/public'
|
54
|
+
*
|
55
|
+
* const client = createPublicClient({
|
56
|
+
* chain: mainnet,
|
57
|
+
* transport: http(),
|
58
|
+
* })
|
59
|
+
* const filter = await createContractEventFilter(client, {
|
60
|
+
* address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
61
|
+
* abi: parseAbi(['event Transfer(address indexed, address indexed, uint256)']),
|
62
|
+
* eventName: 'Transfer',
|
63
|
+
* })
|
64
|
+
* const logs = await getFilterChanges(client, { filter })
|
65
|
+
*
|
66
|
+
* @example
|
67
|
+
* // Raw Events
|
68
|
+
* import { createPublicClient, http, parseAbiItem } from 'viem'
|
69
|
+
* import { mainnet } from 'viem/chains'
|
70
|
+
* import { createEventFilter, getFilterChanges } from 'viem/public'
|
71
|
+
*
|
72
|
+
* const client = createPublicClient({
|
73
|
+
* chain: mainnet,
|
74
|
+
* transport: http(),
|
75
|
+
* })
|
76
|
+
* const filter = await createEventFilter(client, {
|
77
|
+
* address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
78
|
+
* event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
|
79
|
+
* })
|
80
|
+
* const logs = await getFilterChanges(client, { filter })
|
81
|
+
*
|
82
|
+
* @example
|
83
|
+
* // Transactions
|
84
|
+
* import { createPublicClient, http } from 'viem'
|
85
|
+
* import { mainnet } from 'viem/chains'
|
86
|
+
* import { createPendingTransactionFilter, getFilterChanges } from 'viem/public'
|
87
|
+
*
|
88
|
+
* const client = createPublicClient({
|
89
|
+
* chain: mainnet,
|
90
|
+
* transport: http(),
|
91
|
+
* })
|
92
|
+
* const filter = await createPendingTransactionFilter(client)
|
93
|
+
* const hashes = await getFilterChanges(client, { filter })
|
94
|
+
*/
|
95
|
+
export declare function getFilterChanges<TTransport extends Transport, TChain extends Chain | undefined, TFilterType extends FilterType, const TAbi extends Abi | readonly unknown[] | undefined, TEventName extends string | undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined>(_client: Client<TTransport, TChain>, { filter, }: GetFilterChangesParameters<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>): Promise<GetFilterChangesReturnType<TFilterType, TAbi, TEventName, TStrict, TFromBlock, TToBlock>>;
|
96
|
+
//# sourceMappingURL=getFilterChanges.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getFilterChanges.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getFilterChanges.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import type { Abi, AbiEvent, ExtractAbiEvent } from 'abitype';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockNumber, BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { Filter } from '../../types/filter.js';
|
7
|
+
import type { Log } from '../../types/log.js';
|
8
|
+
export type GetFilterLogsParameters<TAbi extends Abi | readonly unknown[] | undefined = undefined, TEventName extends string | undefined = undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined> = {
|
9
|
+
filter: Filter<'event', TAbi, TEventName, any, TStrict, TFromBlock, TToBlock>;
|
10
|
+
};
|
11
|
+
export type GetFilterLogsReturnType<TAbi extends Abi | readonly unknown[] | undefined = undefined, TEventName extends string | undefined = undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined, _AbiEvent extends AbiEvent | undefined = TAbi extends Abi ? TEventName extends string ? ExtractAbiEvent<TAbi, TEventName> : undefined : undefined, _Pending extends boolean = (TFromBlock extends 'pending' ? true : false) | (TToBlock extends 'pending' ? true : false)> = Log<bigint, number, _Pending, _AbiEvent, TStrict, TAbi, TEventName>[];
|
12
|
+
/**
|
13
|
+
* Returns a list of event logs since the filter was created.
|
14
|
+
*
|
15
|
+
* - Docs: https://viem.sh/docs/actions/public/getFilterLogs.html
|
16
|
+
* - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)
|
17
|
+
*
|
18
|
+
* `getFilterLogs` is only compatible with **event filters**.
|
19
|
+
*
|
20
|
+
* @param client - Client to use
|
21
|
+
* @param parameters - {@link GetFilterLogsParameters}
|
22
|
+
* @returns A list of event logs. {@link GetFilterLogsReturnType}
|
23
|
+
*
|
24
|
+
* @example
|
25
|
+
* import { createPublicClient, http, parseAbiItem } from 'viem'
|
26
|
+
* import { mainnet } from 'viem/chains'
|
27
|
+
* import { createEventFilter, getFilterLogs } from 'viem/public'
|
28
|
+
*
|
29
|
+
* const client = createPublicClient({
|
30
|
+
* chain: mainnet,
|
31
|
+
* transport: http(),
|
32
|
+
* })
|
33
|
+
* const filter = await createEventFilter(client, {
|
34
|
+
* address: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
35
|
+
* event: parseAbiItem('event Transfer(address indexed, address indexed, uint256)'),
|
36
|
+
* })
|
37
|
+
* const logs = await getFilterLogs(client, { filter })
|
38
|
+
*/
|
39
|
+
export declare function getFilterLogs<TChain extends Chain | undefined, const TAbi extends Abi | readonly unknown[] | undefined, TEventName extends string | undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined>(_client: Client<Transport, TChain>, { filter, }: GetFilterLogsParameters<TAbi, TEventName, TStrict, TFromBlock, TToBlock>): Promise<GetFilterLogsReturnType<TAbi, TEventName, TStrict, TFromBlock, TToBlock>>;
|
40
|
+
//# 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,eAAe,EAAE,MAAM,SAAS,CAAA;AAE7D,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAK5E,OAAO,KAAK,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACjE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,oBAAoB,CAAA;AAI7C,MAAM,MAAM,uBAAuB,CACjC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,SAAS,GAAG,SAAS,EAC7D,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACjD,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAC/C,UAAU,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,EACjE,QAAQ,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,IAC7D;IACF,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CAAA;CAC9E,CAAA;AACD,MAAM,MAAM,uBAAuB,CACjC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,SAAS,GAAG,SAAS,EAC7D,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACjD,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAC/C,UAAU,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,EACjE,QAAQ,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,EAC/D,SAAS,SAAS,QAAQ,GAAG,SAAS,GAAG,IAAI,SAAS,GAAG,GACrD,UAAU,SAAS,MAAM,GACvB,eAAe,CAAC,IAAI,EAAE,UAAU,CAAC,GACjC,SAAS,GACX,SAAS,EACb,QAAQ,SAAS,OAAO,GACpB,CAAC,UAAU,SAAS,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,GAC7C,CAAC,QAAQ,SAAS,SAAS,GAAG,IAAI,GAAG,KAAK,CAAC,IAC7C,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,UAAU,CAAC,EAAE,CAAA;AAEzE;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,aAAa,CACjC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,SAAS,EACvD,UAAU,SAAS,MAAM,GAAG,SAAS,EACrC,OAAO,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAC/C,UAAU,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,EACjE,QAAQ,SAAS,WAAW,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,EAE/D,OAAO,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EAClC,EACE,MAAM,GACP,EAAE,uBAAuB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,GAC1E,OAAO,CACR,uBAAuB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAE,QAAQ,CAAC,CACzE,CA4CA"}
|
@@ -0,0 +1,27 @@
|
|
1
|
+
import type { Account } from '../../accounts/types.js';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { Chain } from '../../types/chain.js';
|
5
|
+
export type GetGasPriceReturnType = bigint;
|
6
|
+
/**
|
7
|
+
* Returns the current price of gas (in wei).
|
8
|
+
*
|
9
|
+
* - Docs: https://viem.sh/docs/actions/public/getGasPrice.html
|
10
|
+
* - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)
|
11
|
+
*
|
12
|
+
* @param client - Client to use
|
13
|
+
* @returns The gas price (in wei). {@link GetGasPriceReturnType}
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* import { createPublicClient, http } from 'viem'
|
17
|
+
* import { mainnet } from 'viem/chains'
|
18
|
+
* import { getGasPrice } from 'viem/public'
|
19
|
+
*
|
20
|
+
* const client = createPublicClient({
|
21
|
+
* chain: mainnet,
|
22
|
+
* transport: http(),
|
23
|
+
* })
|
24
|
+
* const gasPrice = await getGasPrice(client)
|
25
|
+
*/
|
26
|
+
export declare function getGasPrice<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>): Promise<GetGasPriceReturnType>;
|
27
|
+
//# 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,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,qBAAqB,CAAC,CAK7E"}
|
@@ -0,0 +1,71 @@
|
|
1
|
+
import type { AbiEvent, Address } from 'abitype';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockNumber, BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { MaybeAbiEventName, MaybeExtractEventArgsFromAbi } from '../../types/contract.js';
|
7
|
+
import type { Log } from '../../types/log.js';
|
8
|
+
import type { Hash } from '../../types/misc.js';
|
9
|
+
export type GetLogsParameters<TAbiEvent extends AbiEvent | undefined = undefined, TAbiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined, _EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
|
10
|
+
/** Address or list of addresses from which logs originated */
|
11
|
+
address?: Address | Address[];
|
12
|
+
} & ({
|
13
|
+
event: TAbiEvent;
|
14
|
+
events?: never;
|
15
|
+
args?: MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName>;
|
16
|
+
/**
|
17
|
+
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
18
|
+
* @default false
|
19
|
+
*/
|
20
|
+
strict?: TStrict;
|
21
|
+
} | {
|
22
|
+
event?: never;
|
23
|
+
events: TAbiEvents;
|
24
|
+
args?: never;
|
25
|
+
/**
|
26
|
+
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
27
|
+
* @default false
|
28
|
+
*/
|
29
|
+
strict?: TStrict;
|
30
|
+
} | {
|
31
|
+
event?: never;
|
32
|
+
events?: never;
|
33
|
+
args?: never;
|
34
|
+
strict?: never;
|
35
|
+
}) & ({
|
36
|
+
/** Block number or tag after which to include logs */
|
37
|
+
fromBlock?: TFromBlock | BlockNumber | BlockTag;
|
38
|
+
/** Block number or tag before which to include logs */
|
39
|
+
toBlock?: TToBlock | BlockNumber | BlockTag;
|
40
|
+
blockHash?: never;
|
41
|
+
} | {
|
42
|
+
fromBlock?: never;
|
43
|
+
toBlock?: never;
|
44
|
+
/** Hash of block to include logs from */
|
45
|
+
blockHash?: Hash;
|
46
|
+
});
|
47
|
+
export type GetLogsReturnType<TAbiEvent extends AbiEvent | undefined = undefined, TAbiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined, _EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, _Pending extends boolean = (TFromBlock extends 'pending' ? true : false) | (TToBlock extends 'pending' ? true : false)> = Log<bigint, number, _Pending, TAbiEvent, TStrict, TAbiEvents, _EventName>[];
|
48
|
+
/**
|
49
|
+
* Returns a list of event logs matching the provided parameters.
|
50
|
+
*
|
51
|
+
* - Docs: https://viem.sh/docs/actions/public/getLogs.html
|
52
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs
|
53
|
+
* - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
|
54
|
+
*
|
55
|
+
* @param client - Client to use
|
56
|
+
* @param parameters - {@link GetLogsParameters}
|
57
|
+
* @returns A list of event logs. {@link GetLogsReturnType}
|
58
|
+
*
|
59
|
+
* @example
|
60
|
+
* import { createPublicClient, http, parseAbiItem } from 'viem'
|
61
|
+
* import { mainnet } from 'viem/chains'
|
62
|
+
* import { getLogs } from 'viem/public'
|
63
|
+
*
|
64
|
+
* const client = createPublicClient({
|
65
|
+
* chain: mainnet,
|
66
|
+
* transport: http(),
|
67
|
+
* })
|
68
|
+
* const logs = await getLogs(client)
|
69
|
+
*/
|
70
|
+
export declare function getLogs<TChain extends Chain | undefined, const TAbiEvent extends AbiEvent | undefined = undefined, const TAbiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined>(client: Client<Transport, TChain>, { address, blockHash, fromBlock, toBlock, event, events: events_, args, strict: strict_, }?: GetLogsParameters<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>): Promise<GetLogsReturnType<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock>>;
|
71
|
+
//# sourceMappingURL=getLogs.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getLogs.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getLogs.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,43 @@
|
|
1
|
+
import type { Address } from 'abitype';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { Hex } from '../../types/misc.js';
|
7
|
+
export type GetStorageAtParameters = {
|
8
|
+
address: Address;
|
9
|
+
slot: Hex;
|
10
|
+
} & ({
|
11
|
+
blockNumber?: never;
|
12
|
+
blockTag?: BlockTag;
|
13
|
+
} | {
|
14
|
+
blockNumber?: bigint;
|
15
|
+
blockTag?: never;
|
16
|
+
});
|
17
|
+
export type GetStorageAtReturnType = Hex | undefined;
|
18
|
+
/**
|
19
|
+
* Returns the value from a storage slot at a given address.
|
20
|
+
*
|
21
|
+
* - Docs: https://viem.sh/docs/contract/getStorageAt.html
|
22
|
+
* - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)
|
23
|
+
*
|
24
|
+
* @param client - Client to use
|
25
|
+
* @param parameters - {@link GetStorageAtParameters}
|
26
|
+
* @returns The value of the storage slot. {@link GetStorageAtReturnType}
|
27
|
+
*
|
28
|
+
* @example
|
29
|
+
* import { createPublicClient, http } from 'viem'
|
30
|
+
* import { mainnet } from 'viem/chains'
|
31
|
+
* import { getStorageAt } from 'viem/contract'
|
32
|
+
*
|
33
|
+
* const client = createPublicClient({
|
34
|
+
* chain: mainnet,
|
35
|
+
* transport: http(),
|
36
|
+
* })
|
37
|
+
* const code = await getStorageAt(client, {
|
38
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
39
|
+
* slot: toHex(0),
|
40
|
+
* })
|
41
|
+
*/
|
42
|
+
export declare function getStorageAt<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { address, blockNumber, blockTag, slot }: GetStorageAtParameters): Promise<GetStorageAtReturnType>;
|
43
|
+
//# sourceMappingURL=getStorageAt.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getStorageAt.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getStorageAt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAG9C,MAAM,MAAM,sBAAsB,GAAG;IACnC,OAAO,EAAE,OAAO,CAAA;IAChB,IAAI,EAAE,GAAG,CAAA;CACV,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,sBAAsB,GAAG,GAAG,GAAG,SAAS,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,YAAY,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EACjE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAmB,EAAE,IAAI,EAAE,EAAE,sBAAsB,GAC1E,OAAO,CAAC,sBAAsB,CAAC,CAQjC"}
|
@@ -0,0 +1,65 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { BlockTag } from '../../types/block.js';
|
4
|
+
import type { Chain } from '../../types/chain.js';
|
5
|
+
import type { Hash } from '../../types/misc.js';
|
6
|
+
import { type FormattedTransaction } from '../../utils/formatters/transaction.js';
|
7
|
+
export type GetTransactionParameters<TBlockTag extends BlockTag = 'latest'> = {
|
8
|
+
/** The block hash */
|
9
|
+
blockHash: Hash;
|
10
|
+
blockNumber?: never;
|
11
|
+
blockTag?: never;
|
12
|
+
hash?: never;
|
13
|
+
/** The index of the transaction on the block. */
|
14
|
+
index: number;
|
15
|
+
} | {
|
16
|
+
blockHash?: never;
|
17
|
+
/** The block number */
|
18
|
+
blockNumber: bigint;
|
19
|
+
blockTag?: never;
|
20
|
+
hash?: never;
|
21
|
+
/** The index of the transaction on the block. */
|
22
|
+
index: number;
|
23
|
+
} | {
|
24
|
+
blockHash?: never;
|
25
|
+
blockNumber?: never;
|
26
|
+
/** The block tag. */
|
27
|
+
blockTag: TBlockTag | BlockTag;
|
28
|
+
hash?: never;
|
29
|
+
/** The index of the transaction on the block. */
|
30
|
+
index: number;
|
31
|
+
} | {
|
32
|
+
blockHash?: never;
|
33
|
+
blockNumber?: never;
|
34
|
+
blockTag?: never;
|
35
|
+
/** The hash of the transaction. */
|
36
|
+
hash: Hash;
|
37
|
+
index?: number;
|
38
|
+
};
|
39
|
+
export type GetTransactionReturnType<TChain extends Chain | undefined = Chain, TBlockTag extends BlockTag = 'latest'> = FormattedTransaction<TChain, TBlockTag>;
|
40
|
+
/**
|
41
|
+
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) given a hash or block identifier.
|
42
|
+
*
|
43
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransaction.html
|
44
|
+
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
45
|
+
* - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)
|
46
|
+
*
|
47
|
+
* @param client - Client to use
|
48
|
+
* @param parameters - {@link GetTransactionParameters}
|
49
|
+
* @returns The transaction information. {@link GetTransactionReturnType}
|
50
|
+
*
|
51
|
+
* @example
|
52
|
+
* import { createPublicClient, http } from 'viem'
|
53
|
+
* import { mainnet } from 'viem/chains'
|
54
|
+
* import { getTransaction } from 'viem/public'
|
55
|
+
*
|
56
|
+
* const client = createPublicClient({
|
57
|
+
* chain: mainnet,
|
58
|
+
* transport: http(),
|
59
|
+
* })
|
60
|
+
* const transaction = await getTransaction(client, {
|
61
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
62
|
+
* })
|
63
|
+
*/
|
64
|
+
export declare function getTransaction<TChain extends Chain | undefined, TBlockTag extends BlockTag = 'latest'>(client: Client<Transport, TChain>, { blockHash, blockNumber, blockTag: blockTag_, hash, index, }: GetTransactionParameters<TBlockTag>): Promise<GetTransactionReturnType<TChain, TBlockTag>>;
|
65
|
+
//# sourceMappingURL=getTransaction.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTransaction.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAE5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAG/C,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,uCAAuC,CAAA;AAE9C,MAAM,MAAM,wBAAwB,CAAC,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACtE;IACE,qBAAqB;IACrB,SAAS,EAAE,IAAI,CAAA;IACf,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;CACd,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,uBAAuB;IACvB,WAAW,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;CACd,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,qBAAqB;IACrB,QAAQ,EAAE,SAAS,GAAG,QAAQ,CAAA;IAC9B,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAA;CACd,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;IAChB,mCAAmC;IACnC,IAAI,EAAE,IAAI,CAAA;IACV,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,CAAA;AAEL,MAAM,MAAM,wBAAwB,CAClC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,EACxC,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACnC,oBAAoB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,cAAc,CAClC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,SAAS,SAAS,QAAQ,GAAG,QAAQ,EAErC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EACE,SAAS,EACT,WAAW,EACX,QAAQ,EAAE,SAAS,EACnB,IAAI,EACJ,KAAK,GACN,EAAE,wBAAwB,CAAC,SAAS,CAAC,GACrC,OAAO,CAAC,wBAAwB,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAoCtD"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { Chain } from '../../types/chain.js';
|
4
|
+
import type { Hash } from '../../types/misc.js';
|
5
|
+
import type { FormattedTransactionReceipt } from '../../utils/formatters/transactionReceipt.js';
|
6
|
+
export type GetTransactionConfirmationsParameters<TChain extends Chain | undefined = Chain> = {
|
7
|
+
/** The transaction hash. */
|
8
|
+
hash: Hash;
|
9
|
+
transactionReceipt?: never;
|
10
|
+
} | {
|
11
|
+
hash?: never;
|
12
|
+
/** The transaction receipt. */
|
13
|
+
transactionReceipt: FormattedTransactionReceipt<TChain>;
|
14
|
+
};
|
15
|
+
export type GetTransactionConfirmationsReturnType = bigint;
|
16
|
+
/**
|
17
|
+
* Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
|
18
|
+
*
|
19
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html
|
20
|
+
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
21
|
+
* - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)
|
22
|
+
*
|
23
|
+
* @param client - Client to use
|
24
|
+
* @param parameters - {@link GetTransactionConfirmationsParameters}
|
25
|
+
* @returns The number of blocks passed since the transaction was processed. If confirmations is 0, then the Transaction has not been confirmed & processed yet. {@link GetTransactionConfirmationsReturnType}
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
* import { createPublicClient, http } from 'viem'
|
29
|
+
* import { mainnet } from 'viem/chains'
|
30
|
+
* import { getTransactionConfirmations } from 'viem/public'
|
31
|
+
*
|
32
|
+
* const client = createPublicClient({
|
33
|
+
* chain: mainnet,
|
34
|
+
* transport: http(),
|
35
|
+
* })
|
36
|
+
* const confirmations = await getTransactionConfirmations(client, {
|
37
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
38
|
+
* })
|
39
|
+
*/
|
40
|
+
export declare function getTransactionConfirmations<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { hash, transactionReceipt }: GetTransactionConfirmationsParameters<TChain>): Promise<GetTransactionConfirmationsReturnType>;
|
41
|
+
//# sourceMappingURL=getTransactionConfirmations.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTransactionConfirmations.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getTransactionConfirmations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,8CAA8C,CAAA;AAK/F,MAAM,MAAM,qCAAqC,CAC/C,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,IAEtC;IACE,4BAA4B;IAC5B,IAAI,EAAE,IAAI,CAAA;IACV,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IACE,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,+BAA+B;IAC/B,kBAAkB,EAAE,2BAA2B,CAAC,MAAM,CAAC,CAAA;CACxD,CAAA;AAEL,MAAM,MAAM,qCAAqC,GAAG,MAAM,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,qCAAqC,CAAC,MAAM,CAAC,GAC1E,OAAO,CAAC,qCAAqC,CAAC,CAShD"}
|
@@ -0,0 +1,44 @@
|
|
1
|
+
import type { Address } from 'abitype';
|
2
|
+
import type { Account } from '../../accounts/types.js';
|
3
|
+
import type { Client } from '../../clients/createClient.js';
|
4
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
5
|
+
import type { BlockTag } from '../../types/block.js';
|
6
|
+
import type { Chain } from '../../types/chain.js';
|
7
|
+
export type GetTransactionCountParameters = {
|
8
|
+
/** The account address. */
|
9
|
+
address: Address;
|
10
|
+
} & ({
|
11
|
+
/** The block number. */
|
12
|
+
blockNumber?: bigint;
|
13
|
+
blockTag?: never;
|
14
|
+
} | {
|
15
|
+
blockNumber?: never;
|
16
|
+
/** The block tag. Defaults to 'latest'. */
|
17
|
+
blockTag?: BlockTag;
|
18
|
+
});
|
19
|
+
export type GetTransactionCountReturnType = number;
|
20
|
+
/**
|
21
|
+
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms.html#transaction) an Account has broadcast / sent.
|
22
|
+
*
|
23
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
|
24
|
+
* - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
|
25
|
+
*
|
26
|
+
* @param client - Client to use
|
27
|
+
* @param parameters - {@link GetTransactionCountParameters}
|
28
|
+
* @returns The number of transactions an account has sent. {@link GetTransactionCountReturnType}
|
29
|
+
*
|
30
|
+
* @example
|
31
|
+
* import { createPublicClient, http } from 'viem'
|
32
|
+
* import { mainnet } from 'viem/chains'
|
33
|
+
* import { getTransactionCount } from 'viem/public'
|
34
|
+
*
|
35
|
+
* const client = createPublicClient({
|
36
|
+
* chain: mainnet,
|
37
|
+
* transport: http(),
|
38
|
+
* })
|
39
|
+
* const transactionCount = await getTransactionCount(client, {
|
40
|
+
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
41
|
+
* })
|
42
|
+
*/
|
43
|
+
export declare function getTransactionCount<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>, { address, blockTag, blockNumber }: GetTransactionCountParameters): Promise<GetTransactionCountReturnType>;
|
44
|
+
//# sourceMappingURL=getTransactionCount.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTransactionCount.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getTransactionCount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAIjD,MAAM,MAAM,6BAA6B,GAAG;IAC1C,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,CACA;IACE,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CACJ,CAAA;AACD,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,mBAAmB,CACvC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EAEpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,EAAE,OAAO,EAAE,QAAmB,EAAE,WAAW,EAAE,EAAE,6BAA6B,GAC3E,OAAO,CAAC,6BAA6B,CAAC,CAMxC"}
|
@@ -0,0 +1,36 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { Chain } from '../../types/chain.js';
|
4
|
+
import type { Hash } from '../../types/misc.js';
|
5
|
+
import { type FormattedTransactionReceipt } from '../../utils/formatters/transactionReceipt.js';
|
6
|
+
export type GetTransactionReceiptParameters = {
|
7
|
+
/** The hash of the transaction. */
|
8
|
+
hash: Hash;
|
9
|
+
};
|
10
|
+
export type GetTransactionReceiptReturnType<TChain extends Chain | undefined = Chain | undefined> = FormattedTransactionReceipt<TChain>;
|
11
|
+
/**
|
12
|
+
* Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) hash.
|
13
|
+
*
|
14
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
|
15
|
+
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
16
|
+
* - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)
|
17
|
+
*
|
18
|
+
* @param client - Client to use
|
19
|
+
* @param parameters - {@link GetTransactionReceiptParameters}
|
20
|
+
* @returns The transaction receipt. {@link GetTransactionReceiptReturnType}
|
21
|
+
*
|
22
|
+
* @example
|
23
|
+
* import { createPublicClient, http } from 'viem'
|
24
|
+
* import { mainnet } from 'viem/chains'
|
25
|
+
* import { getTransactionReceipt } from 'viem/public'
|
26
|
+
*
|
27
|
+
* const client = createPublicClient({
|
28
|
+
* chain: mainnet,
|
29
|
+
* transport: http(),
|
30
|
+
* })
|
31
|
+
* const transactionReceipt = await getTransactionReceipt(client, {
|
32
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
33
|
+
* })
|
34
|
+
*/
|
35
|
+
export declare function getTransactionReceipt<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { hash }: GetTransactionReceiptParameters): Promise<import("../../types/chain.js").ExtractChainFormatterReturnType<TChain, "transactionReceipt", import("../../index.js").TransactionReceipt>>;
|
36
|
+
//# sourceMappingURL=getTransactionReceipt.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTransactionReceipt.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getTransactionReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAE5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,8CAA8C,CAAA;AAErD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,mCAAmC;IACnC,IAAI,EAAE,IAAI,CAAA;CACX,CAAA;AAED,MAAM,MAAM,+BAA+B,CACzC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD,2BAA2B,CAAC,MAAM,CAAC,CAAA;AAEvC;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAC1E,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,IAAI,EAAE,EAAE,+BAA+B,sJAa1C"}
|