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,49 @@
|
|
1
|
+
import type { AbiEvent, Narrow } from 'abitype';
|
2
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
3
|
+
import type { Address, BlockNumber, BlockTag, Chain, Hash, Log, MaybeAbiEventName, MaybeExtractEventArgsFromAbi } from '../../types/index.js';
|
4
|
+
export type GetLogsParameters<TAbiEvent extends AbiEvent | undefined = undefined, TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = {
|
5
|
+
/** Address or list of addresses from which logs originated */
|
6
|
+
address?: Address | Address[];
|
7
|
+
} & ({
|
8
|
+
event: Narrow<TAbiEvent>;
|
9
|
+
args?: MaybeExtractEventArgsFromAbi<[TAbiEvent], TEventName>;
|
10
|
+
} | {
|
11
|
+
event?: never;
|
12
|
+
args?: never;
|
13
|
+
}) & ({
|
14
|
+
/** Block number or tag after which to include logs */
|
15
|
+
fromBlock?: BlockNumber<bigint> | BlockTag;
|
16
|
+
/** Block number or tag before which to include logs */
|
17
|
+
toBlock?: BlockNumber<bigint> | BlockTag;
|
18
|
+
blockHash?: never;
|
19
|
+
} | {
|
20
|
+
fromBlock?: never;
|
21
|
+
toBlock?: never;
|
22
|
+
/** Hash of block to include logs from */
|
23
|
+
blockHash?: Hash;
|
24
|
+
});
|
25
|
+
export type GetLogsReturnType<TAbiEvent extends AbiEvent | undefined = undefined, TEventName extends string | undefined = MaybeAbiEventName<TAbiEvent>> = Log<bigint, number, TAbiEvent, [TAbiEvent], TEventName>[];
|
26
|
+
/**
|
27
|
+
* Returns a list of event logs matching the provided parameters.
|
28
|
+
*
|
29
|
+
* - Docs: https://viem.sh/docs/actions/public/getLogs.html
|
30
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/filters-and-logs/event-logs
|
31
|
+
* - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
|
32
|
+
*
|
33
|
+
* @param client - Client to use
|
34
|
+
* @param parameters - {@link GetLogsParameters}
|
35
|
+
* @returns A list of event logs. {@link GetLogsReturnType}
|
36
|
+
*
|
37
|
+
* @example
|
38
|
+
* import { createPublicClient, http, parseAbiItem } from 'viem'
|
39
|
+
* import { mainnet } from 'viem/chains'
|
40
|
+
* import { getLogs } from 'viem/public'
|
41
|
+
*
|
42
|
+
* const client = createPublicClient({
|
43
|
+
* chain: mainnet,
|
44
|
+
* transport: http(),
|
45
|
+
* })
|
46
|
+
* const logs = await getLogs(client)
|
47
|
+
*/
|
48
|
+
export declare function getLogs<TChain extends Chain | undefined, TAbiEvent extends AbiEvent | undefined>(client: PublicClient<Transport, TChain>, { address, blockHash, fromBlock, toBlock, event, args, }?: GetLogsParameters<TAbiEvent>): Promise<GetLogsReturnType<TAbiEvent>>;
|
49
|
+
//# sourceMappingURL=getLogs.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getLogs.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getLogs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAC/C,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EACV,OAAO,EACP,WAAW,EACX,QAAQ,EACR,KAAK,EACL,IAAI,EACJ,GAAG,EAEH,iBAAiB,EACjB,4BAA4B,EAE7B,MAAM,sBAAsB,CAAA;AAS7B,MAAM,MAAM,iBAAiB,CAC3B,SAAS,SAAS,QAAQ,GAAG,SAAS,GAAG,SAAS,EAClD,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,IAClE;IACF,8DAA8D;IAC9D,OAAO,CAAC,EAAE,OAAO,GAAG,OAAO,EAAE,CAAA;CAC9B,GAAG,CACA;IACE,KAAK,EAAE,MAAM,CAAC,SAAS,CAAC,CAAA;IACxB,IAAI,CAAC,EAAE,4BAA4B,CAAC,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,CAAA;CAC7D,GACD;IACE,KAAK,CAAC,EAAE,KAAK,CAAA;IACb,IAAI,CAAC,EAAE,KAAK,CAAA;CACb,CACJ,GACC,CACI;IACE,sDAAsD;IACtD,SAAS,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAA;IAC1C,uDAAuD;IACvD,OAAO,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC,GAAG,QAAQ,CAAA;IACxC,SAAS,CAAC,EAAE,KAAK,CAAA;CAClB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,OAAO,CAAC,EAAE,KAAK,CAAA;IACf,yCAAyC;IACzC,SAAS,CAAC,EAAE,IAAI,CAAA;CACjB,CACJ,CAAA;AAEH,MAAM,MAAM,iBAAiB,CAC3B,SAAS,SAAS,QAAQ,GAAG,SAAS,GAAG,SAAS,EAClD,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,iBAAiB,CAAC,SAAS,CAAC,IAClE,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC,EAAE,CAAA;AAE7D;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAsB,OAAO,CAC3B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,SAAS,SAAS,QAAQ,GAAG,SAAS,EAEtC,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EACE,OAAO,EACP,SAAS,EACT,SAAS,EACT,OAAO,EACP,KAAK,EACL,IAAI,GACL,GAAE,iBAAiB,CAAC,SAAS,CAAM,GACnC,OAAO,CAAC,iBAAiB,CAAC,SAAS,CAAC,CAAC,CA+CvC"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Address, BlockTag, Chain, Hex } from '../../types/index.js';
|
3
|
+
export type GetStorageAtParameters = {
|
4
|
+
address: Address;
|
5
|
+
slot: Hex;
|
6
|
+
} & ({
|
7
|
+
blockNumber?: never;
|
8
|
+
blockTag?: BlockTag;
|
9
|
+
} | {
|
10
|
+
blockNumber?: bigint;
|
11
|
+
blockTag?: never;
|
12
|
+
});
|
13
|
+
export type GetStorageAtReturnType = Hex | undefined;
|
14
|
+
/**
|
15
|
+
* Returns the value from a storage slot at a given address.
|
16
|
+
*
|
17
|
+
* - Docs: https://viem.sh/docs/contract/getStorageAt.html
|
18
|
+
* - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)
|
19
|
+
*
|
20
|
+
* @param client - Client to use
|
21
|
+
* @param parameters - {@link GetStorageAtParameters}
|
22
|
+
* @returns The value of the storage slot. {@link GetStorageAtReturnType}
|
23
|
+
*
|
24
|
+
* @example
|
25
|
+
* import { createPublicClient, http } from 'viem'
|
26
|
+
* import { mainnet } from 'viem/chains'
|
27
|
+
* import { getStorageAt } from 'viem/contract'
|
28
|
+
*
|
29
|
+
* const client = createPublicClient({
|
30
|
+
* chain: mainnet,
|
31
|
+
* transport: http(),
|
32
|
+
* })
|
33
|
+
* const code = await getStorageAt(client, {
|
34
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
35
|
+
* slot: toHex(0),
|
36
|
+
* })
|
37
|
+
*/
|
38
|
+
export declare function getStorageAt<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { address, blockNumber, blockTag, slot }: GetStorageAtParameters): Promise<GetStorageAtReturnType>;
|
39
|
+
//# 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,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,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,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAmB,EAAE,IAAI,EAAE,EAAE,sBAAsB,GAC1E,OAAO,CAAC,sBAAsB,CAAC,CAQjC"}
|
@@ -0,0 +1,62 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { BlockTag, Chain, Hash } from '../../types/index.js';
|
3
|
+
import type { FormattedTransaction, TransactionFormatter } from '../../utils/formatters/transaction.js';
|
4
|
+
export type GetTransactionParameters = {
|
5
|
+
/** The block hash */
|
6
|
+
blockHash: Hash;
|
7
|
+
blockNumber?: never;
|
8
|
+
blockTag?: never;
|
9
|
+
hash?: never;
|
10
|
+
/** The index of the transaction on the block. */
|
11
|
+
index: number;
|
12
|
+
} | {
|
13
|
+
blockHash?: never;
|
14
|
+
/** The block number */
|
15
|
+
blockNumber: bigint;
|
16
|
+
blockTag?: never;
|
17
|
+
hash?: never;
|
18
|
+
/** The index of the transaction on the block. */
|
19
|
+
index: number;
|
20
|
+
} | {
|
21
|
+
blockHash?: never;
|
22
|
+
blockNumber?: never;
|
23
|
+
/** The block tag. */
|
24
|
+
blockTag: BlockTag;
|
25
|
+
hash?: never;
|
26
|
+
/** The index of the transaction on the block. */
|
27
|
+
index: number;
|
28
|
+
} | {
|
29
|
+
blockHash?: never;
|
30
|
+
blockNumber?: never;
|
31
|
+
blockTag?: never;
|
32
|
+
/** The hash of the transaction. */
|
33
|
+
hash: Hash;
|
34
|
+
index?: number;
|
35
|
+
};
|
36
|
+
export type GetTransactionReturnType<TChain extends Chain | undefined = Chain> = FormattedTransaction<TransactionFormatter<TChain>>;
|
37
|
+
/**
|
38
|
+
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
|
39
|
+
*
|
40
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransaction.html
|
41
|
+
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
42
|
+
* - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)
|
43
|
+
*
|
44
|
+
* @param client - Client to use
|
45
|
+
* @param parameters - {@link GetTransactionParameters}
|
46
|
+
* @returns The transaction information. {@link GetTransactionReturnType}
|
47
|
+
*
|
48
|
+
* @example
|
49
|
+
* import { createPublicClient, http } from 'viem'
|
50
|
+
* import { mainnet } from 'viem/chains'
|
51
|
+
* import { getTransaction } from 'viem/public'
|
52
|
+
*
|
53
|
+
* const client = createPublicClient({
|
54
|
+
* chain: mainnet,
|
55
|
+
* transport: http(),
|
56
|
+
* })
|
57
|
+
* const transaction = await getTransaction(client, {
|
58
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
59
|
+
* })
|
60
|
+
*/
|
61
|
+
export declare function getTransaction<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { blockHash, blockNumber, blockTag, hash, index, }: GetTransactionParameters): Promise<GetTransactionReturnType<TChain>>;
|
62
|
+
//# 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,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAErE,OAAO,KAAK,EACV,QAAQ,EACR,KAAK,EACL,IAAI,EAEL,MAAM,sBAAsB,CAAA;AAE7B,OAAO,KAAK,EACV,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,uCAAuC,CAAA;AAG9C,MAAM,MAAM,wBAAwB,GAChC;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,QAAQ,CAAA;IAClB,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,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,IAC3E,oBAAoB,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAA;AAEpD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,cAAc,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EACnE,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EACE,SAAS,EACT,WAAW,EACX,QAAmB,EACnB,IAAI,EACJ,KAAK,GACN,EAAE,wBAAwB,GAC1B,OAAO,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC,CAkC3C"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Chain, Hash } from '../../types/index.js';
|
3
|
+
import type { FormattedTransactionReceipt, TransactionReceiptFormatter } from '../../utils/index.js';
|
4
|
+
export type GetTransactionConfirmationsParameters<TChain extends Chain | undefined = Chain> = {
|
5
|
+
/** The transaction hash. */
|
6
|
+
hash: Hash;
|
7
|
+
transactionReceipt?: never;
|
8
|
+
} | {
|
9
|
+
hash?: never;
|
10
|
+
/** The transaction receipt. */
|
11
|
+
transactionReceipt: FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
|
12
|
+
};
|
13
|
+
export type GetTransactionConfirmationsReturnType = bigint;
|
14
|
+
/**
|
15
|
+
* Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
|
16
|
+
*
|
17
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations.html
|
18
|
+
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
19
|
+
* - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)
|
20
|
+
*
|
21
|
+
* @param client - Client to use
|
22
|
+
* @param parameters - {@link GetTransactionConfirmationsParameters}
|
23
|
+
* @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}
|
24
|
+
*
|
25
|
+
* @example
|
26
|
+
* import { createPublicClient, http } from 'viem'
|
27
|
+
* import { mainnet } from 'viem/chains'
|
28
|
+
* import { getTransactionConfirmations } from 'viem/public'
|
29
|
+
*
|
30
|
+
* const client = createPublicClient({
|
31
|
+
* chain: mainnet,
|
32
|
+
* transport: http(),
|
33
|
+
* })
|
34
|
+
* const confirmations = await getTransactionConfirmations(client, {
|
35
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
36
|
+
* })
|
37
|
+
*/
|
38
|
+
export declare function getTransactionConfirmations<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { hash, transactionReceipt }: GetTransactionConfirmationsParameters<TChain>): Promise<GetTransactionConfirmationsReturnType>;
|
39
|
+
//# 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,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AACvD,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,sBAAsB,CAAA;AAI7B,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,CAC7C,2BAA2B,CAAC,MAAM,CAAC,CACpC,CAAA;CACF,CAAA;AAEL,MAAM,MAAM,qCAAqC,GAAG,MAAM,CAAA;AAE1D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,2BAA2B,CAC/C,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EAAE,IAAI,EAAE,kBAAkB,EAAE,EAAE,qCAAqC,CAAC,MAAM,CAAC,GAC1E,OAAO,CAAC,qCAAqC,CAAC,CAShD"}
|
@@ -0,0 +1,40 @@
|
|
1
|
+
import type { PublicClient, Transport, WalletClient } from '../../clients/index.js';
|
2
|
+
import type { Account, Address, BlockTag, Chain } from '../../types/index.js';
|
3
|
+
export type GetTransactionCountParameters = {
|
4
|
+
/** The account address. */
|
5
|
+
address: Address;
|
6
|
+
} & ({
|
7
|
+
/** The block number. */
|
8
|
+
blockNumber?: bigint;
|
9
|
+
blockTag?: never;
|
10
|
+
} | {
|
11
|
+
blockNumber?: never;
|
12
|
+
/** The block tag. Defaults to 'latest'. */
|
13
|
+
blockTag?: BlockTag;
|
14
|
+
});
|
15
|
+
export type GetTransactionCountReturnType = number;
|
16
|
+
/**
|
17
|
+
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
|
18
|
+
*
|
19
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionCount.html
|
20
|
+
* - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
|
21
|
+
*
|
22
|
+
* @param client - Client to use
|
23
|
+
* @param parameters - {@link GetTransactionCountParameters}
|
24
|
+
* @returns The number of transactions an account has sent. {@link GetTransactionCountReturnType}
|
25
|
+
*
|
26
|
+
* @example
|
27
|
+
* import { createPublicClient, http } from 'viem'
|
28
|
+
* import { mainnet } from 'viem/chains'
|
29
|
+
* import { getTransactionCount } from 'viem/public'
|
30
|
+
*
|
31
|
+
* const client = createPublicClient({
|
32
|
+
* chain: mainnet,
|
33
|
+
* transport: http(),
|
34
|
+
* })
|
35
|
+
* const transactionCount = await getTransactionCount(client, {
|
36
|
+
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
37
|
+
* })
|
38
|
+
*/
|
39
|
+
export declare function getTransactionCount<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: PublicClient<Transport, TChain> | WalletClient<Transport, TChain, TAccount>, { address, blockTag, blockNumber }: GetTransactionCountParameters): Promise<GetTransactionCountReturnType>;
|
40
|
+
//# 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,EACV,YAAY,EACZ,SAAS,EACT,YAAY,EACb,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAG7E,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,EACF,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,GAC/B,YAAY,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC7C,EAAE,OAAO,EAAE,QAAmB,EAAE,WAAW,EAAE,EAAE,6BAA6B,GAC3E,OAAO,CAAC,6BAA6B,CAAC,CAMxC"}
|
@@ -0,0 +1,34 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Chain, Hash } from '../../types/index.js';
|
3
|
+
import type { FormattedTransactionReceipt, TransactionReceiptFormatter } from '../../utils/formatters/transactionReceipt.js';
|
4
|
+
export type GetTransactionReceiptParameters = {
|
5
|
+
/** The hash of the transaction. */
|
6
|
+
hash: Hash;
|
7
|
+
};
|
8
|
+
export type GetTransactionReceiptReturnType<TChain extends Chain | undefined = Chain | undefined> = FormattedTransactionReceipt<TransactionReceiptFormatter<TChain>>;
|
9
|
+
/**
|
10
|
+
* Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
|
11
|
+
*
|
12
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt.html
|
13
|
+
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/fetching-transactions
|
14
|
+
* - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt)
|
15
|
+
*
|
16
|
+
* @param client - Client to use
|
17
|
+
* @param parameters - {@link GetTransactionReceiptParameters}
|
18
|
+
* @returns The transaction receipt. {@link GetTransactionReceiptReturnType}
|
19
|
+
*
|
20
|
+
* @example
|
21
|
+
* import { createPublicClient, http } from 'viem'
|
22
|
+
* import { mainnet } from 'viem/chains'
|
23
|
+
* import { getTransactionReceipt } from 'viem/public'
|
24
|
+
*
|
25
|
+
* const client = createPublicClient({
|
26
|
+
* chain: mainnet,
|
27
|
+
* transport: http(),
|
28
|
+
* })
|
29
|
+
* const transactionReceipt = await getTransactionReceipt(client, {
|
30
|
+
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
31
|
+
* })
|
32
|
+
*/
|
33
|
+
export declare function getTransactionReceipt<TChain extends Chain | undefined>(client: PublicClient<Transport, TChain>, { hash }: GetTransactionReceiptParameters): Promise<import("../../utils/index.js").Formatted<TransactionReceiptFormatter<TChain>, import("../../types/transaction.js").TransactionReceipt, false, false>>;
|
34
|
+
//# 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,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAErE,OAAO,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAEvD,OAAO,KAAK,EACV,2BAA2B,EAC3B,2BAA2B,EAC5B,MAAM,8CAA8C,CAAA;AAGrD,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,2BAA2B,CAAC,MAAM,CAAC,CAAC,CAAA;AAEpE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,qBAAqB,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAC1E,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EAAE,IAAI,EAAE,EAAE,+BAA+B,iKAa1C"}
|
@@ -0,0 +1,67 @@
|
|
1
|
+
export { call } from './call.js';
|
2
|
+
export type { CallParameters, CallReturnType, FormattedCall } from './call.js';
|
3
|
+
export { simulateContract } from './simulateContract.js';
|
4
|
+
export type { SimulateContractParameters, SimulateContractReturnType, } from './simulateContract.js';
|
5
|
+
export { createPendingTransactionFilter } from './createPendingTransactionFilter.js';
|
6
|
+
export type { CreatePendingTransactionFilterReturnType } from './createPendingTransactionFilter.js';
|
7
|
+
export { createBlockFilter } from './createBlockFilter.js';
|
8
|
+
export type { CreateBlockFilterReturnType } from './createBlockFilter.js';
|
9
|
+
export { createEventFilter } from './createEventFilter.js';
|
10
|
+
export type { CreateEventFilterParameters, CreateEventFilterReturnType, } from './createEventFilter.js';
|
11
|
+
export { createContractEventFilter } from './createContractEventFilter.js';
|
12
|
+
export type { CreateContractEventFilterParameters, CreateContractEventFilterReturnType, } from './createContractEventFilter.js';
|
13
|
+
export { estimateGas } from './estimateGas.js';
|
14
|
+
export type { EstimateGasParameters, EstimateGasReturnType, } from './estimateGas.js';
|
15
|
+
export { estimateContractGas } from './estimateContractGas.js';
|
16
|
+
export type { EstimateContractGasParameters, EstimateContractGasReturnType, } from './estimateContractGas.js';
|
17
|
+
export { getBalance } from './getBalance.js';
|
18
|
+
export type { GetBalanceParameters, GetBalanceReturnType, } from './getBalance.js';
|
19
|
+
export { getBlock } from './getBlock.js';
|
20
|
+
export type { GetBlockParameters, GetBlockReturnType } from './getBlock.js';
|
21
|
+
export { getBlockNumber, getBlockNumberCache } from './getBlockNumber.js';
|
22
|
+
export type { GetBlockNumberParameters, GetBlockNumberReturnType, } from './getBlockNumber.js';
|
23
|
+
export { getBlockTransactionCount } from './getBlockTransactionCount.js';
|
24
|
+
export type { GetBlockTransactionCountParameters, GetBlockTransactionCountReturnType, } from './getBlockTransactionCount.js';
|
25
|
+
export { getBytecode } from './getBytecode.js';
|
26
|
+
export type { GetBytecodeParameters, GetBytecodeReturnType, } from './getBytecode.js';
|
27
|
+
export { getChainId } from './getChainId.js';
|
28
|
+
export type { GetChainIdReturnType } from './getChainId.js';
|
29
|
+
export { getFeeHistory } from './getFeeHistory.js';
|
30
|
+
export type { GetFeeHistoryParameters, GetFeeHistoryReturnType, } from './getFeeHistory.js';
|
31
|
+
export { getFilterChanges } from './getFilterChanges.js';
|
32
|
+
export type { GetFilterChangesParameters, GetFilterChangesReturnType, } from './getFilterChanges.js';
|
33
|
+
export { getFilterLogs } from './getFilterLogs.js';
|
34
|
+
export type { GetFilterLogsParameters, GetFilterLogsReturnType, } from './getFilterLogs.js';
|
35
|
+
export { getGasPrice } from './getGasPrice.js';
|
36
|
+
export type { GetGasPriceReturnType } from './getGasPrice.js';
|
37
|
+
export { getLogs } from './getLogs.js';
|
38
|
+
export type { GetLogsParameters, GetLogsReturnType } from './getLogs.js';
|
39
|
+
export { getStorageAt } from './getStorageAt.js';
|
40
|
+
export type { GetStorageAtParameters, GetStorageAtReturnType, } from './getStorageAt.js';
|
41
|
+
export { getTransaction } from './getTransaction.js';
|
42
|
+
export type { GetTransactionParameters, GetTransactionReturnType, } from './getTransaction.js';
|
43
|
+
export { getTransactionConfirmations } from './getTransactionConfirmations.js';
|
44
|
+
export type { GetTransactionConfirmationsParameters, GetTransactionConfirmationsReturnType, } from './getTransactionConfirmations.js';
|
45
|
+
export { getTransactionCount } from './getTransactionCount.js';
|
46
|
+
export type { GetTransactionCountParameters, GetTransactionCountReturnType, } from './getTransactionCount.js';
|
47
|
+
export { getTransactionReceipt } from './getTransactionReceipt.js';
|
48
|
+
export type { GetTransactionReceiptParameters, GetTransactionReceiptReturnType, } from './getTransactionReceipt.js';
|
49
|
+
export { multicall } from './multicall.js';
|
50
|
+
export type { MulticallParameters, MulticallReturnType } from './multicall.js';
|
51
|
+
export { readContract } from './readContract.js';
|
52
|
+
export type { ReadContractParameters, ReadContractReturnType, } from './readContract.js';
|
53
|
+
export { uninstallFilter } from './uninstallFilter.js';
|
54
|
+
export type { UninstallFilterParameters, UninstallFilterReturnType, } from './uninstallFilter.js';
|
55
|
+
export { waitForTransactionReceipt } from './waitForTransactionReceipt.js';
|
56
|
+
export type { WaitForTransactionReceiptParameters, WaitForTransactionReceiptReturnType, ReplacementReason, ReplacementReturnType, } from './waitForTransactionReceipt.js';
|
57
|
+
export { watchBlockNumber } from './watchBlockNumber.js';
|
58
|
+
export type { OnBlockNumberFn, OnBlockNumberParameter, WatchBlockNumberParameters, WatchBlockNumberReturnType, } from './watchBlockNumber.js';
|
59
|
+
export { watchBlocks } from './watchBlocks.js';
|
60
|
+
export type { OnBlock, OnBlockParameter, WatchBlocksParameters, WatchBlocksReturnType, } from './watchBlocks.js';
|
61
|
+
export { watchContractEvent } from './watchContractEvent.js';
|
62
|
+
export type { WatchContractEventParameters, WatchContractEventReturnType, } from './watchContractEvent.js';
|
63
|
+
export { watchEvent } from './watchEvent.js';
|
64
|
+
export type { OnLogsParameter, OnLogsFn, WatchEventParameters, WatchEventReturnType, } from './watchEvent.js';
|
65
|
+
export { watchPendingTransactions } from './watchPendingTransactions.js';
|
66
|
+
export type { OnTransactionsFn, OnTransactionsParameter, WatchPendingTransactionsParameters, WatchPendingTransactionsReturnType, } from './watchPendingTransactions.js';
|
67
|
+
//# sourceMappingURL=index.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/index.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,52 @@
|
|
1
|
+
import type { Narrow } from 'abitype';
|
2
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
3
|
+
import type { Address, Chain, ContractFunctionConfig, MulticallContracts } from '../../types/index.js';
|
4
|
+
import type { MulticallResults } from '../../types/multicall.js';
|
5
|
+
import type { CallParameters } from './call.js';
|
6
|
+
export type MulticallParameters<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
7
|
+
allowFailure?: TAllowFailure;
|
8
|
+
contracts: Narrow<readonly [...MulticallContracts<TContracts>]>;
|
9
|
+
multicallAddress?: Address;
|
10
|
+
};
|
11
|
+
export type MulticallReturnType<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true> = MulticallResults<TContracts, TAllowFailure>;
|
12
|
+
/**
|
13
|
+
* Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
|
14
|
+
*
|
15
|
+
* - Docs: https://viem.sh/docs/contract/multicall.html
|
16
|
+
*
|
17
|
+
* @param client - Client to use
|
18
|
+
* @param parameters - {@link MulticallParameters}
|
19
|
+
* @returns An array of results with accompanying status. {@link MulticallReturnType}
|
20
|
+
*
|
21
|
+
* @example
|
22
|
+
* import { createPublicClient, http, parseAbi } from 'viem'
|
23
|
+
* import { mainnet } from 'viem/chains'
|
24
|
+
* import { multicall } from 'viem/contract'
|
25
|
+
*
|
26
|
+
* const client = createPublicClient({
|
27
|
+
* chain: mainnet,
|
28
|
+
* transport: http(),
|
29
|
+
* })
|
30
|
+
* const abi = parseAbi([
|
31
|
+
* 'function balanceOf(address) view returns (uint256)',
|
32
|
+
* 'function totalSupply() view returns (uint256)',
|
33
|
+
* ])
|
34
|
+
* const results = await multicall(client, {
|
35
|
+
* contracts: [
|
36
|
+
* {
|
37
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
38
|
+
* abi,
|
39
|
+
* functionName: 'balanceOf',
|
40
|
+
* args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
|
41
|
+
* },
|
42
|
+
* {
|
43
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
44
|
+
* abi,
|
45
|
+
* functionName: 'totalSupply',
|
46
|
+
* },
|
47
|
+
* ],
|
48
|
+
* })
|
49
|
+
* // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]
|
50
|
+
*/
|
51
|
+
export declare function multicall<TChain extends Chain | undefined, TContracts extends ContractFunctionConfig[], TAllowFailure extends boolean = true>(client: PublicClient<Transport, TChain>, args: MulticallParameters<TContracts, TAllowFailure>): Promise<MulticallReturnType<TContracts, TAllowFailure>>;
|
52
|
+
//# sourceMappingURL=multicall.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"multicall.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/multicall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AACrC,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AAOrE,OAAO,KAAK,EACV,OAAO,EACP,KAAK,EACL,sBAAsB,EAEtB,kBAAkB,EACnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAQhE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAG/C,MAAM,MAAM,mBAAmB,CAC7B,UAAU,SAAS,sBAAsB,EAAE,GAAG,sBAAsB,EAAE,EACtE,aAAa,SAAS,OAAO,GAAG,IAAI,IAClC,IAAI,CAAC,cAAc,EAAE,aAAa,GAAG,UAAU,CAAC,GAAG;IACrD,YAAY,CAAC,EAAE,aAAa,CAAA;IAC5B,SAAS,EAAE,MAAM,CAAC,SAAS,CAAC,GAAG,kBAAkB,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IAC/D,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,mBAAmB,CAC7B,UAAU,SAAS,sBAAsB,EAAE,GAAG,sBAAsB,EAAE,EACtE,aAAa,SAAS,OAAO,GAAG,IAAI,IAClC,gBAAgB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,wBAAsB,SAAS,CAC7B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,UAAU,SAAS,sBAAsB,EAAE,EAC3C,aAAa,SAAS,OAAO,GAAG,IAAI,EAEpC,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,IAAI,EAAE,mBAAmB,CAAC,UAAU,EAAE,aAAa,CAAC,GACnD,OAAO,CAAC,mBAAmB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CAsFzD"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import type { Abi } from 'abitype';
|
2
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
3
|
+
import type { Chain, ContractFunctionConfig, ContractFunctionResult } from '../../types/index.js';
|
4
|
+
import type { CallParameters } from './call.js';
|
5
|
+
export type ReadContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & ContractFunctionConfig<TAbi, TFunctionName, 'view' | 'pure'>;
|
6
|
+
export type ReadContractReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ContractFunctionResult<TAbi, TFunctionName>;
|
7
|
+
/**
|
8
|
+
* Calls a read-only function on a contract, and returns the response.
|
9
|
+
*
|
10
|
+
* - Docs: https://viem.sh/docs/contract/readContract.html
|
11
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts
|
12
|
+
*
|
13
|
+
* A "read-only" function (constant function) on a Solidity contract is denoted by a `view` or `pure` keyword. They can only read the state of the contract, and cannot make any changes to it. Since read-only methods do not change the state of the contract, they do not require any gas to be executed, and can be called by any user without the need to pay for gas.
|
14
|
+
*
|
15
|
+
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
|
16
|
+
*
|
17
|
+
* @param client - Client to use
|
18
|
+
* @param parameters - {@link ReadContractParameters}
|
19
|
+
* @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}
|
20
|
+
*
|
21
|
+
* @example
|
22
|
+
* import { createPublicClient, http, parseAbi } from 'viem'
|
23
|
+
* import { mainnet } from 'viem/chains'
|
24
|
+
* import { readContract } from 'viem/contract'
|
25
|
+
*
|
26
|
+
* const client = createPublicClient({
|
27
|
+
* chain: mainnet,
|
28
|
+
* transport: http(),
|
29
|
+
* })
|
30
|
+
* const result = await readContract(client, {
|
31
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
32
|
+
* abi: parseAbi(['function balanceOf(address) view returns (uint256)']),
|
33
|
+
* functionName: 'balanceOf',
|
34
|
+
* args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
|
35
|
+
* })
|
36
|
+
* // 424122n
|
37
|
+
*/
|
38
|
+
export declare function readContract<TChain extends Chain | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: PublicClient<Transport, TChain>, { abi, address, args, functionName, ...callRequest }: ReadContractParameters<TAbi, TFunctionName>): Promise<ReadContractReturnType<TAbi, TFunctionName>>;
|
39
|
+
//# sourceMappingURL=readContract.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"readContract.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/readContract.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,sBAAsB,EACvB,MAAM,sBAAsB,CAAA;AAW7B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,MAAM,MAAM,sBAAsB,CAChC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,MAAM,IACnC,IAAI,CAAC,cAAc,EAAE,aAAa,GAAG,UAAU,CAAC,GAClD,sBAAsB,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC,CAAA;AAE9D,MAAM,MAAM,sBAAsB,CAChC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,MAAM,IACnC,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,YAAY,CAChC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EACrC,aAAa,SAAS,MAAM,EAE5B,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EACE,GAAG,EACH,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,GAAG,WAAW,EACf,EAAE,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,GAC7C,OAAO,CAAC,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,CA2BtD"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import type { Abi } from 'abitype';
|
2
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
3
|
+
import type { Chain, ContractFunctionConfig, ContractFunctionResult, GetValue } from '../../types/index.js';
|
4
|
+
import type { WriteContractParameters } from '../wallet/index.js';
|
5
|
+
import type { CallParameters } from './call.js';
|
6
|
+
export type SimulateContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChain extends Chain | undefined = Chain | undefined, TChainOverride extends Chain | undefined = undefined> = {
|
7
|
+
chain?: TChainOverride;
|
8
|
+
} & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & Omit<CallParameters<TChainOverride extends Chain ? TChainOverride : TChain>, 'batch' | 'to' | 'data' | 'value'> & GetValue<TAbi, TFunctionName, CallParameters<TChain>['value']>;
|
9
|
+
export type SimulateContractReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain | undefined, TChainOverride extends Chain | undefined = undefined> = {
|
10
|
+
result: ContractFunctionResult<TAbi, TFunctionName>;
|
11
|
+
request: Omit<WriteContractParameters<TAbi, TFunctionName, TChain, undefined, TChainOverride>, 'chain'> & {
|
12
|
+
chain: TChainOverride;
|
13
|
+
} & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
|
14
|
+
};
|
15
|
+
/**
|
16
|
+
* Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.
|
17
|
+
*
|
18
|
+
* - Docs: https://viem.sh/docs/contract/simulateContract.html
|
19
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
|
20
|
+
*
|
21
|
+
* This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract), but also supports contract write functions.
|
22
|
+
*
|
23
|
+
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
|
24
|
+
*
|
25
|
+
* @param client - Client to use
|
26
|
+
* @param parameters - {@link SimulateContractParameters}
|
27
|
+
* @returns The simulation result and write request. {@link SimulateContractReturnType}
|
28
|
+
*
|
29
|
+
* @example
|
30
|
+
* import { createPublicClient, http } from 'viem'
|
31
|
+
* import { mainnet } from 'viem/chains'
|
32
|
+
* import { simulateContract } from 'viem/contract'
|
33
|
+
*
|
34
|
+
* const client = createPublicClient({
|
35
|
+
* chain: mainnet,
|
36
|
+
* transport: http(),
|
37
|
+
* })
|
38
|
+
* const result = await simulateContract(client, {
|
39
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
40
|
+
* abi: parseAbi(['function mint(uint32) view returns (uint32)']),
|
41
|
+
* functionName: 'mint',
|
42
|
+
* args: ['69420'],
|
43
|
+
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
44
|
+
* })
|
45
|
+
*/
|
46
|
+
export declare function simulateContract<TChain extends Chain | undefined, TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined>(client: PublicClient<Transport, TChain>, { abi, address, args, functionName, ...callRequest }: SimulateContractParameters<TAbi, TFunctionName, TChain, TChainOverride>): Promise<SimulateContractReturnType<TAbi, TFunctionName, TChain, TChainOverride>>;
|
47
|
+
//# sourceMappingURL=simulateContract.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"simulateContract.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/simulateContract.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,sBAAsB,EACtB,QAAQ,EACT,MAAM,sBAAsB,CAAA;AAW7B,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,oBAAoB,CAAA;AAEjE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,WAAW,CAAA;AAE/C,MAAM,MAAM,0BAA0B,CACpC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,GAAG,EAClC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,IAClD;IACF,KAAK,CAAC,EAAE,cAAc,CAAA;CACvB,GAAG,sBAAsB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,GAAG,YAAY,CAAC,GACvE,IAAI,CACF,cAAc,CAAC,cAAc,SAAS,KAAK,GAAG,cAAc,GAAG,MAAM,CAAC,EACtE,OAAO,GAAG,IAAI,GAAG,MAAM,GAAG,OAAO,CAClC,GACD,QAAQ,CAAC,IAAI,EAAE,aAAa,EAAE,cAAc,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,CAAC,CAAA;AAEhE,MAAM,MAAM,0BAA0B,CACpC,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,EACpD,cAAc,SAAS,KAAK,GAAG,SAAS,GAAG,SAAS,IAClD;IACF,MAAM,EAAE,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;IACnD,OAAO,EAAE,IAAI,CACX,uBAAuB,CACrB,IAAI,EACJ,aAAa,EACb,MAAM,EACN,SAAS,EACT,cAAc,CACf,EACD,OAAO,CACR,GAAG;QACF,KAAK,EAAE,cAAc,CAAA;KACtB,GAAG,sBAAsB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,GAAG,YAAY,CAAC,CAAA;CAC1E,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,gBAAgB,CACpC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EACrC,aAAa,SAAS,MAAM,EAC5B,cAAc,SAAS,KAAK,GAAG,SAAS,EAExC,MAAM,EAAE,YAAY,CAAC,SAAS,EAAE,MAAM,CAAC,EACvC,EACE,GAAG,EACH,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,GAAG,WAAW,EACf,EAAE,0BAA0B,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,GACzE,OAAO,CACR,0BAA0B,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,cAAc,CAAC,CACxE,CA+CA"}
|
@@ -0,0 +1,32 @@
|
|
1
|
+
import type { PublicClient, Transport } from '../../clients/index.js';
|
2
|
+
import type { Chain, Filter } from '../../types/index.js';
|
3
|
+
export type UninstallFilterParameters = {
|
4
|
+
filter: Filter<any>;
|
5
|
+
};
|
6
|
+
export type UninstallFilterReturnType = boolean;
|
7
|
+
/**
|
8
|
+
* Destroys a [`Filter`](https://viem.sh/docs/glossary/types.html#filter).
|
9
|
+
*
|
10
|
+
* - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html
|
11
|
+
* - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
|
12
|
+
*
|
13
|
+
* Destroys a Filter that was created from one of the following Actions:
|
14
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
|
15
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
|
16
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
|
17
|
+
*
|
18
|
+
* @param client - Client to use
|
19
|
+
* @param parameters - {@link UninstallFilterParameters}
|
20
|
+
* @returns A boolean indicating if the Filter was successfully uninstalled. {@link UninstallFilterReturnType}
|
21
|
+
*
|
22
|
+
* @example
|
23
|
+
* import { createPublicClient, http } from 'viem'
|
24
|
+
* import { mainnet } from 'viem/chains'
|
25
|
+
* import { createPendingTransactionFilter, uninstallFilter } from 'viem/public'
|
26
|
+
*
|
27
|
+
* const filter = await createPendingTransactionFilter(client)
|
28
|
+
* const uninstalled = await uninstallFilter(client, { filter })
|
29
|
+
* // true
|
30
|
+
*/
|
31
|
+
export declare function uninstallFilter<TTransport extends Transport, TChain extends Chain | undefined>(_client: PublicClient<TTransport, TChain>, { filter }: UninstallFilterParameters): Promise<UninstallFilterReturnType>;
|
32
|
+
//# sourceMappingURL=uninstallFilter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"uninstallFilter.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/uninstallFilter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,SAAS,EAAE,MAAM,wBAAwB,CAAA;AACrE,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAEzD,MAAM,MAAM,yBAAyB,GAAG;IACtC,MAAM,EAAE,MAAM,CAAC,GAAG,CAAC,CAAA;CACpB,CAAA;AACD,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAA;AAE/C;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,eAAe,CACnC,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,OAAO,EAAE,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,EACzC,EAAE,MAAM,EAAE,EAAE,yBAAyB,GACpC,OAAO,CAAC,yBAAyB,CAAC,CAKpC"}
|