viem 1.6.4 → 1.6.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/chains/dist/cjs/celo/formatters.js.map +1 -0
- package/chains/dist/cjs/celo/parsers.js.map +1 -0
- package/chains/dist/cjs/celo/serializers.js.map +1 -0
- package/chains/dist/cjs/celo/types.js.map +1 -0
- package/chains/dist/cjs/index.js.map +1 -0
- package/chains/dist/cjs/optimism/fees.js.map +1 -0
- package/chains/dist/cjs/optimism/formatters.js.map +1 -0
- package/chains/dist/cjs/optimism/types.js.map +1 -0
- package/chains/dist/cjs/types.js.map +1 -0
- package/chains/dist/cjs/utils.js.map +1 -0
- package/chains/dist/tsconfig.build.tsbuildinfo +1 -0
- package/chains/node_modules/.bin/tsc +17 -0
- package/chains/node_modules/.bin/tsserver +17 -0
- package/chains/tsconfig.tsbuildinfo +1 -0
- package/dist/cjs/chains/celo/parsers.js +76 -0
- package/dist/cjs/chains/celo/parsers.js.map +1 -0
- package/dist/cjs/chains/celo/serializers.js +2 -1
- package/dist/cjs/chains/celo/serializers.js.map +1 -1
- package/dist/cjs/chains/utils.js +3 -1
- package/dist/cjs/chains/utils.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/utils/rpc.js +5 -7
- package/dist/cjs/utils/rpc.js.map +1 -1
- package/dist/cjs/utils/transaction/parseTransaction.js +8 -3
- package/dist/cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/dist/esm/chains/celo/parsers.js +72 -0
- package/dist/esm/chains/celo/parsers.js.map +1 -0
- package/dist/esm/chains/celo/serializers.js +1 -3
- package/dist/esm/chains/celo/serializers.js.map +1 -1
- package/dist/esm/chains/utils.js +1 -0
- package/dist/esm/chains/utils.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/utils/rpc.js +5 -7
- package/dist/esm/utils/rpc.js.map +1 -1
- package/dist/esm/utils/transaction/parseTransaction.js +6 -3
- package/dist/esm/utils/transaction/parseTransaction.js.map +1 -1
- package/package.json +1 -1
- package/src/chains/celo/parsers.ts +123 -0
- package/src/chains/celo/serializers.ts +13 -34
- package/src/chains/celo/types.ts +32 -0
- package/src/chains/utils.ts +6 -2
- package/src/errors/version.ts +1 -1
- package/src/utils/rpc.ts +5 -8
- package/src/utils/transaction/parseTransaction.ts +7 -9
- package/dist/types/abi.d.ts +0 -6
- package/dist/types/abi.d.ts.map +0 -1
- package/dist/types/accounts/generateMnemonic.d.ts +0 -9
- package/dist/types/accounts/generateMnemonic.d.ts.map +0 -1
- package/dist/types/accounts/generatePrivateKey.d.ts +0 -8
- package/dist/types/accounts/generatePrivateKey.d.ts.map +0 -1
- package/dist/types/accounts/hdKeyToAccount.d.ts +0 -9
- package/dist/types/accounts/hdKeyToAccount.d.ts.map +0 -1
- package/dist/types/accounts/index.d.ts +0 -27
- package/dist/types/accounts/index.d.ts.map +0 -1
- package/dist/types/accounts/mnemonicToAccount.d.ts +0 -8
- package/dist/types/accounts/mnemonicToAccount.d.ts.map +0 -1
- package/dist/types/accounts/privateKeyToAccount.d.ts +0 -9
- package/dist/types/accounts/privateKeyToAccount.d.ts.map +0 -1
- package/dist/types/accounts/toAccount.d.ts +0 -11
- package/dist/types/accounts/toAccount.d.ts.map +0 -1
- package/dist/types/accounts/types.d.ts +0 -52
- package/dist/types/accounts/types.d.ts.map +0 -1
- package/dist/types/accounts/utils/parseAccount.d.ts +0 -4
- package/dist/types/accounts/utils/parseAccount.d.ts.map +0 -1
- package/dist/types/accounts/utils/privateKeyToAddress.d.ts +0 -11
- package/dist/types/accounts/utils/privateKeyToAddress.d.ts.map +0 -1
- package/dist/types/accounts/utils/publicKeyToAddress.d.ts +0 -11
- package/dist/types/accounts/utils/publicKeyToAddress.d.ts.map +0 -1
- package/dist/types/accounts/utils/sign.d.ts +0 -16
- package/dist/types/accounts/utils/sign.d.ts.map +0 -1
- package/dist/types/accounts/utils/signMessage.d.ts +0 -16
- package/dist/types/accounts/utils/signMessage.d.ts.map +0 -1
- package/dist/types/accounts/utils/signTransaction.d.ts +0 -12
- package/dist/types/accounts/utils/signTransaction.d.ts.map +0 -1
- package/dist/types/accounts/utils/signTypedData.d.ts +0 -20
- package/dist/types/accounts/utils/signTypedData.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/czech.d.ts +0 -2
- package/dist/types/accounts/wordlists/czech.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/english.d.ts +0 -2
- package/dist/types/accounts/wordlists/english.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/french.d.ts +0 -2
- package/dist/types/accounts/wordlists/french.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/italian.d.ts +0 -2
- package/dist/types/accounts/wordlists/italian.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/japanese.d.ts +0 -2
- package/dist/types/accounts/wordlists/japanese.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/korean.d.ts +0 -2
- package/dist/types/accounts/wordlists/korean.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/simplifiedChinese.d.ts +0 -2
- package/dist/types/accounts/wordlists/simplifiedChinese.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/spanish.d.ts +0 -2
- package/dist/types/accounts/wordlists/spanish.d.ts.map +0 -1
- package/dist/types/accounts/wordlists/traditionalChinese.d.ts +0 -2
- package/dist/types/accounts/wordlists/traditionalChinese.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsAddress.d.ts +0 -45
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsAvatar.d.ts +0 -41
- package/dist/types/actions/ens/getEnsAvatar.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsName.d.ts +0 -41
- package/dist/types/actions/ens/getEnsName.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsResolver.d.ts +0 -43
- package/dist/types/actions/ens/getEnsResolver.d.ts.map +0 -1
- package/dist/types/actions/ens/getEnsText.d.ts +0 -46
- package/dist/types/actions/ens/getEnsText.d.ts.map +0 -1
- package/dist/types/actions/getContract.d.ts +0 -314
- package/dist/types/actions/getContract.d.ts.map +0 -1
- package/dist/types/actions/index.d.ts +0 -80
- package/dist/types/actions/index.d.ts.map +0 -1
- package/dist/types/actions/public/call.d.ts +0 -56
- package/dist/types/actions/public/call.d.ts.map +0 -1
- package/dist/types/actions/public/createBlockFilter.d.ts +0 -28
- package/dist/types/actions/public/createBlockFilter.d.ts.map +0 -1
- package/dist/types/actions/public/createContractEventFilter.d.ts +0 -50
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +0 -1
- package/dist/types/actions/public/createEventFilter.d.ts +0 -76
- package/dist/types/actions/public/createEventFilter.d.ts.map +0 -1
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts +0 -28
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts.map +0 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +0 -39
- package/dist/types/actions/public/estimateContractGas.d.ts.map +0 -1
- package/dist/types/actions/public/estimateGas.d.ts +0 -49
- package/dist/types/actions/public/estimateGas.d.ts.map +0 -1
- package/dist/types/actions/public/getBalance.d.ts +0 -55
- package/dist/types/actions/public/getBalance.d.ts.map +0 -1
- package/dist/types/actions/public/getBlock.d.ts +0 -56
- package/dist/types/actions/public/getBlock.d.ts.map +0 -1
- package/dist/types/actions/public/getBlockNumber.d.ts +0 -57
- package/dist/types/actions/public/getBlockNumber.d.ts.map +0 -1
- package/dist/types/actions/public/getBlockTransactionCount.d.ts +0 -47
- package/dist/types/actions/public/getBlockTransactionCount.d.ts.map +0 -1
- package/dist/types/actions/public/getBytecode.d.ts +0 -41
- package/dist/types/actions/public/getBytecode.d.ts.map +0 -1
- package/dist/types/actions/public/getChainId.d.ts +0 -28
- package/dist/types/actions/public/getChainId.d.ts.map +0 -1
- package/dist/types/actions/public/getFeeHistory.d.ts +0 -53
- package/dist/types/actions/public/getFeeHistory.d.ts.map +0 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +0 -96
- package/dist/types/actions/public/getFilterChanges.d.ts.map +0 -1
- package/dist/types/actions/public/getFilterLogs.d.ts +0 -40
- package/dist/types/actions/public/getFilterLogs.d.ts.map +0 -1
- package/dist/types/actions/public/getGasPrice.d.ts +0 -27
- package/dist/types/actions/public/getGasPrice.d.ts.map +0 -1
- package/dist/types/actions/public/getLogs.d.ts +0 -71
- package/dist/types/actions/public/getLogs.d.ts.map +0 -1
- package/dist/types/actions/public/getStorageAt.d.ts +0 -43
- package/dist/types/actions/public/getStorageAt.d.ts.map +0 -1
- package/dist/types/actions/public/getTransaction.d.ts +0 -65
- package/dist/types/actions/public/getTransaction.d.ts.map +0 -1
- package/dist/types/actions/public/getTransactionConfirmations.d.ts +0 -41
- package/dist/types/actions/public/getTransactionConfirmations.d.ts.map +0 -1
- package/dist/types/actions/public/getTransactionCount.d.ts +0 -44
- package/dist/types/actions/public/getTransactionCount.d.ts.map +0 -1
- package/dist/types/actions/public/getTransactionReceipt.d.ts +0 -36
- package/dist/types/actions/public/getTransactionReceipt.d.ts.map +0 -1
- package/dist/types/actions/public/multicall.d.ts +0 -56
- package/dist/types/actions/public/multicall.d.ts.map +0 -1
- package/dist/types/actions/public/readContract.d.ts +0 -41
- package/dist/types/actions/public/readContract.d.ts.map +0 -1
- package/dist/types/actions/public/simulateContract.d.ts +0 -54
- package/dist/types/actions/public/simulateContract.d.ts.map +0 -1
- package/dist/types/actions/public/uninstallFilter.d.ts +0 -34
- package/dist/types/actions/public/uninstallFilter.d.ts.map +0 -1
- package/dist/types/actions/public/verifyHash.d.ts +0 -24
- package/dist/types/actions/public/verifyHash.d.ts.map +0 -1
- package/dist/types/actions/public/verifyMessage.d.ts +0 -28
- package/dist/types/actions/public/verifyMessage.d.ts.map +0 -1
- package/dist/types/actions/public/verifyTypedData.d.ts +0 -27
- package/dist/types/actions/public/verifyTypedData.d.ts.map +0 -1
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts +0 -72
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +0 -1
- package/dist/types/actions/public/watchBlockNumber.d.ts +0 -59
- package/dist/types/actions/public/watchBlockNumber.d.ts.map +0 -1
- package/dist/types/actions/public/watchBlocks.d.ts +0 -67
- package/dist/types/actions/public/watchBlocks.d.ts.map +0 -1
- package/dist/types/actions/public/watchContractEvent.d.ts +0 -89
- package/dist/types/actions/public/watchContractEvent.d.ts.map +0 -1
- package/dist/types/actions/public/watchEvent.d.ts +0 -104
- package/dist/types/actions/public/watchEvent.d.ts.map +0 -1
- package/dist/types/actions/public/watchPendingTransactions.d.ts +0 -74
- package/dist/types/actions/public/watchPendingTransactions.d.ts.map +0 -1
- package/dist/types/actions/test/dropTransaction.d.ts +0 -33
- package/dist/types/actions/test/dropTransaction.d.ts.map +0 -1
- package/dist/types/actions/test/getAutomine.d.ts +0 -27
- package/dist/types/actions/test/getAutomine.d.ts.map +0 -1
- package/dist/types/actions/test/getTxpoolContent.d.ts +0 -34
- package/dist/types/actions/test/getTxpoolContent.d.ts.map +0 -1
- package/dist/types/actions/test/getTxpoolStatus.d.ts +0 -30
- package/dist/types/actions/test/getTxpoolStatus.d.ts.map +0 -1
- package/dist/types/actions/test/impersonateAccount.d.ts +0 -33
- package/dist/types/actions/test/impersonateAccount.d.ts.map +0 -1
- package/dist/types/actions/test/increaseTime.d.ts +0 -32
- package/dist/types/actions/test/increaseTime.d.ts.map +0 -1
- package/dist/types/actions/test/inspectTxpool.d.ts +0 -31
- package/dist/types/actions/test/inspectTxpool.d.ts.map +0 -1
- package/dist/types/actions/test/mine.d.ts +0 -32
- package/dist/types/actions/test/mine.d.ts.map +0 -1
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts +0 -25
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts.map +0 -1
- package/dist/types/actions/test/reset.d.ts +0 -32
- package/dist/types/actions/test/reset.d.ts.map +0 -1
- package/dist/types/actions/test/revert.d.ts +0 -31
- package/dist/types/actions/test/revert.d.ts.map +0 -1
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +0 -35
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +0 -1
- package/dist/types/actions/test/setAutomine.d.ts +0 -25
- package/dist/types/actions/test/setAutomine.d.ts.map +0 -1
- package/dist/types/actions/test/setBalance.d.ts +0 -36
- package/dist/types/actions/test/setBalance.d.ts.map +0 -1
- package/dist/types/actions/test/setBlockGasLimit.d.ts +0 -30
- package/dist/types/actions/test/setBlockGasLimit.d.ts.map +0 -1
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts +0 -30
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts.map +0 -1
- package/dist/types/actions/test/setCode.d.ts +0 -37
- package/dist/types/actions/test/setCode.d.ts.map +0 -1
- package/dist/types/actions/test/setCoinbase.d.ts +0 -33
- package/dist/types/actions/test/setCoinbase.d.ts.map +0 -1
- package/dist/types/actions/test/setIntervalMining.d.ts +0 -30
- package/dist/types/actions/test/setIntervalMining.d.ts.map +0 -1
- package/dist/types/actions/test/setLoggingEnabled.d.ts +0 -25
- package/dist/types/actions/test/setLoggingEnabled.d.ts.map +0 -1
- package/dist/types/actions/test/setMinGasPrice.d.ts +0 -34
- package/dist/types/actions/test/setMinGasPrice.d.ts.map +0 -1
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts +0 -32
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +0 -1
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts +0 -30
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts.map +0 -1
- package/dist/types/actions/test/setNonce.d.ts +0 -36
- package/dist/types/actions/test/setNonce.d.ts.map +0 -1
- package/dist/types/actions/test/setRpcUrl.d.ts +0 -26
- package/dist/types/actions/test/setRpcUrl.d.ts.map +0 -1
- package/dist/types/actions/test/setStorageAt.d.ts +0 -40
- package/dist/types/actions/test/setStorageAt.d.ts.map +0 -1
- package/dist/types/actions/test/snapshot.d.ts +0 -25
- package/dist/types/actions/test/snapshot.d.ts.map +0 -1
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts +0 -33
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts.map +0 -1
- package/dist/types/actions/wallet/addChain.d.ts +0 -29
- package/dist/types/actions/wallet/addChain.d.ts.map +0 -1
- package/dist/types/actions/wallet/deployContract.d.ts +0 -43
- package/dist/types/actions/wallet/deployContract.d.ts.map +0 -1
- package/dist/types/actions/wallet/getAddresses.d.ts +0 -28
- package/dist/types/actions/wallet/getAddresses.d.ts.map +0 -1
- package/dist/types/actions/wallet/getPermissions.d.ts +0 -28
- package/dist/types/actions/wallet/getPermissions.d.ts.map +0 -1
- package/dist/types/actions/wallet/requestAddresses.d.ts +0 -32
- package/dist/types/actions/wallet/requestAddresses.d.ts.map +0 -1
- package/dist/types/actions/wallet/requestPermissions.d.ts +0 -37
- package/dist/types/actions/wallet/requestPermissions.d.ts.map +0 -1
- package/dist/types/actions/wallet/sendTransaction.d.ts +0 -57
- package/dist/types/actions/wallet/sendTransaction.d.ts.map +0 -1
- package/dist/types/actions/wallet/signMessage.d.ts +0 -58
- package/dist/types/actions/wallet/signMessage.d.ts.map +0 -1
- package/dist/types/actions/wallet/signTypedData.d.ts +0 -114
- package/dist/types/actions/wallet/signTypedData.d.ts.map +0 -1
- package/dist/types/actions/wallet/switchChain.d.ts +0 -30
- package/dist/types/actions/wallet/switchChain.d.ts.map +0 -1
- package/dist/types/actions/wallet/watchAsset.d.ts +0 -37
- package/dist/types/actions/wallet/watchAsset.d.ts.map +0 -1
- package/dist/types/actions/wallet/writeContract.d.ts +0 -68
- package/dist/types/actions/wallet/writeContract.d.ts.map +0 -1
- package/dist/types/chains/celo/formatters.d.ts +0 -195
- package/dist/types/chains/celo/formatters.d.ts.map +0 -1
- package/dist/types/chains/celo/serializers.d.ts +0 -20
- package/dist/types/chains/celo/serializers.d.ts.map +0 -1
- package/dist/types/chains/celo/types.d.ts +0 -60
- package/dist/types/chains/celo/types.d.ts.map +0 -1
- package/dist/types/chains/index.d.ts +0 -5329
- package/dist/types/chains/index.d.ts.map +0 -1
- package/dist/types/chains/optimism/fees.d.ts +0 -4
- package/dist/types/chains/optimism/fees.d.ts.map +0 -1
- package/dist/types/chains/optimism/formatters.d.ts +0 -299
- package/dist/types/chains/optimism/formatters.d.ts.map +0 -1
- package/dist/types/chains/optimism/types.d.ts +0 -53
- package/dist/types/chains/optimism/types.d.ts.map +0 -1
- package/dist/types/chains/utils.d.ts +0 -6
- package/dist/types/chains/utils.d.ts.map +0 -1
- package/dist/types/clients/createClient.d.ts +0 -79
- package/dist/types/clients/createClient.d.ts.map +0 -1
- package/dist/types/clients/createPublicClient.d.ts +0 -29
- package/dist/types/clients/createPublicClient.d.ts.map +0 -1
- package/dist/types/clients/createTestClient.d.ts +0 -43
- package/dist/types/clients/createTestClient.d.ts.map +0 -1
- package/dist/types/clients/createWalletClient.d.ts +0 -49
- package/dist/types/clients/createWalletClient.d.ts.map +0 -1
- package/dist/types/clients/decorators/public.d.ts +0 -1087
- package/dist/types/clients/decorators/public.d.ts.map +0 -1
- package/dist/types/clients/decorators/test.d.ts +0 -599
- package/dist/types/clients/decorators/test.d.ts.map +0 -1
- package/dist/types/clients/decorators/wallet.d.ts +0 -449
- package/dist/types/clients/decorators/wallet.d.ts.map +0 -1
- package/dist/types/clients/transports/createTransport.d.ts +0 -34
- package/dist/types/clients/transports/createTransport.d.ts.map +0 -1
- package/dist/types/clients/transports/custom.d.ts +0 -21
- package/dist/types/clients/transports/custom.d.ts.map +0 -1
- package/dist/types/clients/transports/fallback.d.ts +0 -75
- package/dist/types/clients/transports/fallback.d.ts.map +0 -1
- package/dist/types/clients/transports/http.d.ts +0 -40
- package/dist/types/clients/transports/http.d.ts.map +0 -1
- package/dist/types/clients/transports/webSocket.d.ts +0 -46
- package/dist/types/clients/transports/webSocket.d.ts.map +0 -1
- package/dist/types/constants/abis.d.ts +0 -165
- package/dist/types/constants/abis.d.ts.map +0 -1
- package/dist/types/constants/address.d.ts +0 -2
- package/dist/types/constants/address.d.ts.map +0 -1
- package/dist/types/constants/contract.d.ts +0 -2
- package/dist/types/constants/contract.d.ts.map +0 -1
- package/dist/types/constants/contracts.d.ts +0 -2
- package/dist/types/constants/contracts.d.ts.map +0 -1
- package/dist/types/constants/number.d.ts +0 -97
- package/dist/types/constants/number.d.ts.map +0 -1
- package/dist/types/constants/solidity.d.ts +0 -15
- package/dist/types/constants/solidity.d.ts.map +0 -1
- package/dist/types/constants/unit.d.ts +0 -13
- package/dist/types/constants/unit.d.ts.map +0 -1
- package/dist/types/contract.d.ts +0 -30
- package/dist/types/contract.d.ts.map +0 -1
- package/dist/types/ens.d.ts +0 -9
- package/dist/types/ens.d.ts.map +0 -1
- package/dist/types/errors/abi.d.ts +0 -169
- package/dist/types/errors/abi.d.ts.map +0 -1
- package/dist/types/errors/account.d.ts +0 -8
- package/dist/types/errors/account.d.ts.map +0 -1
- package/dist/types/errors/address.d.ts +0 -8
- package/dist/types/errors/address.d.ts.map +0 -1
- package/dist/types/errors/base.d.ts +0 -24
- package/dist/types/errors/base.d.ts.map +0 -1
- package/dist/types/errors/block.d.ts +0 -10
- package/dist/types/errors/block.d.ts.map +0 -1
- package/dist/types/errors/ccip.d.ts +0 -29
- package/dist/types/errors/ccip.d.ts.map +0 -1
- package/dist/types/errors/chain.d.ts +0 -35
- package/dist/types/errors/chain.d.ts.map +0 -1
- package/dist/types/errors/contract.d.ts +0 -64
- package/dist/types/errors/contract.d.ts.map +0 -1
- package/dist/types/errors/data.d.ts +0 -18
- package/dist/types/errors/data.d.ts.map +0 -1
- package/dist/types/errors/encoding.d.ts +0 -53
- package/dist/types/errors/encoding.d.ts.map +0 -1
- package/dist/types/errors/ens.d.ts +0 -26
- package/dist/types/errors/ens.d.ts.map +0 -1
- package/dist/types/errors/estimateGas.d.ts +0 -14
- package/dist/types/errors/estimateGas.d.ts.map +0 -1
- package/dist/types/errors/log.d.ts +0 -6
- package/dist/types/errors/log.d.ts.map +0 -1
- package/dist/types/errors/node.d.ts +0 -105
- package/dist/types/errors/node.d.ts.map +0 -1
- package/dist/types/errors/request.d.ts +0 -61
- package/dist/types/errors/request.d.ts.map +0 -1
- package/dist/types/errors/rpc.d.ts +0 -221
- package/dist/types/errors/rpc.d.ts.map +0 -1
- package/dist/types/errors/transaction.d.ts +0 -79
- package/dist/types/errors/transaction.d.ts.map +0 -1
- package/dist/types/errors/transport.d.ts +0 -5
- package/dist/types/errors/transport.d.ts.map +0 -1
- package/dist/types/errors/utils.d.ts +0 -5
- package/dist/types/errors/utils.d.ts.map +0 -1
- package/dist/types/errors/version.d.ts +0 -2
- package/dist/types/errors/version.d.ts.map +0 -1
- package/dist/types/index.d.ts +0 -211
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/public.d.ts +0 -31
- package/dist/types/public.d.ts.map +0 -1
- package/dist/types/test.d.ts +0 -29
- package/dist/types/test.d.ts.map +0 -1
- package/dist/types/types/account.d.ts +0 -12
- package/dist/types/types/account.d.ts.map +0 -1
- package/dist/types/types/block.d.ts +0 -62
- package/dist/types/types/block.d.ts.map +0 -1
- package/dist/types/types/chain.d.ts +0 -62
- package/dist/types/types/chain.d.ts.map +0 -1
- package/dist/types/types/contract.d.ts +0 -138
- package/dist/types/types/contract.d.ts.map +0 -1
- package/dist/types/types/eip1193.d.ts +0 -1216
- package/dist/types/types/eip1193.d.ts.map +0 -1
- package/dist/types/types/ens.d.ts +0 -5
- package/dist/types/types/ens.d.ts.map +0 -1
- package/dist/types/types/fee.d.ts +0 -29
- package/dist/types/types/fee.d.ts.map +0 -1
- package/dist/types/types/filter.d.ts +0 -40
- package/dist/types/types/filter.d.ts.map +0 -1
- package/dist/types/types/log.d.ts +0 -55
- package/dist/types/types/log.d.ts.map +0 -1
- package/dist/types/types/misc.d.ts +0 -14
- package/dist/types/types/misc.d.ts.map +0 -1
- package/dist/types/types/multicall.d.ts +0 -48
- package/dist/types/types/multicall.d.ts.map +0 -1
- package/dist/types/types/rpc.d.ts +0 -20
- package/dist/types/types/rpc.d.ts.map +0 -1
- package/dist/types/types/transaction.d.ts +0 -147
- package/dist/types/types/transaction.d.ts.map +0 -1
- package/dist/types/types/transport.d.ts +0 -3
- package/dist/types/types/transport.d.ts.map +0 -1
- package/dist/types/types/typedData.d.ts +0 -47
- package/dist/types/types/typedData.d.ts.map +0 -1
- package/dist/types/types/utils.d.ts +0 -188
- package/dist/types/types/utils.d.ts.map +0 -1
- package/dist/types/types/window.d.ts +0 -7
- package/dist/types/types/window.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeAbiParameters.d.ts +0 -5
- package/dist/types/utils/abi/decodeAbiParameters.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeDeployData.d.ts +0 -13
- package/dist/types/utils/abi/decodeDeployData.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeErrorResult.d.ts +0 -16
- package/dist/types/utils/abi/decodeErrorResult.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeEventLog.d.ts +0 -20
- package/dist/types/utils/abi/decodeEventLog.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeFunctionData.d.ts +0 -15
- package/dist/types/utils/abi/decodeFunctionData.d.ts.map +0 -1
- package/dist/types/utils/abi/decodeFunctionResult.d.ts +0 -14
- package/dist/types/utils/abi/decodeFunctionResult.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeAbiParameters.d.ts +0 -9
- package/dist/types/utils/abi/encodeAbiParameters.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeDeployData.d.ts +0 -9
- package/dist/types/utils/abi/encodeDeployData.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeErrorResult.d.ts +0 -11
- package/dist/types/utils/abi/encodeErrorResult.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeEventTopics.d.ts +0 -13
- package/dist/types/utils/abi/encodeEventTopics.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeFunctionData.d.ts +0 -11
- package/dist/types/utils/abi/encodeFunctionData.d.ts.map +0 -1
- package/dist/types/utils/abi/encodeFunctionResult.d.ts +0 -13
- package/dist/types/utils/abi/encodeFunctionResult.d.ts.map +0 -1
- package/dist/types/utils/abi/encodePacked.d.ts +0 -11
- package/dist/types/utils/abi/encodePacked.d.ts.map +0 -1
- package/dist/types/utils/abi/formatAbiItem.d.ts +0 -9
- package/dist/types/utils/abi/formatAbiItem.d.ts.map +0 -1
- package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts +0 -8
- package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts.map +0 -1
- package/dist/types/utils/abi/getAbiItem.d.ts +0 -12
- package/dist/types/utils/abi/getAbiItem.d.ts.map +0 -1
- package/dist/types/utils/accounts.d.ts +0 -3
- package/dist/types/utils/accounts.d.ts.map +0 -1
- package/dist/types/utils/address/getAddress.d.ts +0 -4
- package/dist/types/utils/address/getAddress.d.ts.map +0 -1
- package/dist/types/utils/address/getContractAddress.d.ts +0 -20
- package/dist/types/utils/address/getContractAddress.d.ts.map +0 -1
- package/dist/types/utils/address/isAddress.d.ts +0 -3
- package/dist/types/utils/address/isAddress.d.ts.map +0 -1
- package/dist/types/utils/address/isAddressEqual.d.ts +0 -3
- package/dist/types/utils/address/isAddressEqual.d.ts.map +0 -1
- package/dist/types/utils/buildRequest.d.ts +0 -6
- package/dist/types/utils/buildRequest.d.ts.map +0 -1
- package/dist/types/utils/ccip.d.ts +0 -37
- package/dist/types/utils/ccip.d.ts.map +0 -1
- package/dist/types/utils/chain.d.ts +0 -14
- package/dist/types/utils/chain.d.ts.map +0 -1
- package/dist/types/utils/contract/extractFunctionParts.d.ts +0 -13
- package/dist/types/utils/contract/extractFunctionParts.d.ts.map +0 -1
- package/dist/types/utils/data/concat.d.ts +0 -6
- package/dist/types/utils/data/concat.d.ts.map +0 -1
- package/dist/types/utils/data/isBytes.d.ts +0 -3
- package/dist/types/utils/data/isBytes.d.ts.map +0 -1
- package/dist/types/utils/data/isBytesEqual.d.ts +0 -3
- package/dist/types/utils/data/isBytesEqual.d.ts.map +0 -1
- package/dist/types/utils/data/isHex.d.ts +0 -5
- package/dist/types/utils/data/isHex.d.ts.map +0 -1
- package/dist/types/utils/data/pad.d.ts +0 -11
- package/dist/types/utils/data/pad.d.ts.map +0 -1
- package/dist/types/utils/data/size.d.ts +0 -9
- package/dist/types/utils/data/size.d.ts.map +0 -1
- package/dist/types/utils/data/slice.d.ts +0 -33
- package/dist/types/utils/data/slice.d.ts.map +0 -1
- package/dist/types/utils/data/trim.d.ts +0 -8
- package/dist/types/utils/data/trim.d.ts.map +0 -1
- package/dist/types/utils/encoding/fromBytes.d.ts +0 -109
- package/dist/types/utils/encoding/fromBytes.d.ts.map +0 -1
- package/dist/types/utils/encoding/fromHex.d.ts +0 -138
- package/dist/types/utils/encoding/fromHex.d.ts.map +0 -1
- package/dist/types/utils/encoding/fromRlp.d.ts +0 -6
- package/dist/types/utils/encoding/fromRlp.d.ts.map +0 -1
- package/dist/types/utils/encoding/toBytes.d.ts +0 -125
- package/dist/types/utils/encoding/toBytes.d.ts.map +0 -1
- package/dist/types/utils/encoding/toHex.d.ts +0 -139
- package/dist/types/utils/encoding/toHex.d.ts.map +0 -1
- package/dist/types/utils/encoding/toRlp.d.ts +0 -8
- package/dist/types/utils/encoding/toRlp.d.ts.map +0 -1
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts +0 -9
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts.map +0 -1
- package/dist/types/utils/ens/avatar/utils.d.ts +0 -37
- package/dist/types/utils/ens/avatar/utils.d.ts.map +0 -1
- package/dist/types/utils/ens/encodeLabelhash.d.ts +0 -3
- package/dist/types/utils/ens/encodeLabelhash.d.ts.map +0 -1
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts +0 -3
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts.map +0 -1
- package/dist/types/utils/ens/errors.d.ts +0 -2
- package/dist/types/utils/ens/errors.d.ts.map +0 -1
- package/dist/types/utils/ens/labelhash.d.ts +0 -11
- package/dist/types/utils/ens/labelhash.d.ts.map +0 -1
- package/dist/types/utils/ens/namehash.d.ts +0 -13
- package/dist/types/utils/ens/namehash.d.ts.map +0 -1
- package/dist/types/utils/ens/normalize.d.ts +0 -12
- package/dist/types/utils/ens/normalize.d.ts.map +0 -1
- package/dist/types/utils/ens/packetToBytes.d.ts +0 -3
- package/dist/types/utils/ens/packetToBytes.d.ts.map +0 -1
- package/dist/types/utils/errors/getCallError.d.ts +0 -9
- package/dist/types/utils/errors/getCallError.d.ts.map +0 -1
- package/dist/types/utils/errors/getContractError.d.ts +0 -12
- package/dist/types/utils/errors/getContractError.d.ts.map +0 -1
- package/dist/types/utils/errors/getEstimateGasError.d.ts +0 -11
- package/dist/types/utils/errors/getEstimateGasError.d.ts.map +0 -1
- package/dist/types/utils/errors/getNodeError.d.ts +0 -7
- package/dist/types/utils/errors/getNodeError.d.ts.map +0 -1
- package/dist/types/utils/errors/getTransactionError.d.ts +0 -12
- package/dist/types/utils/errors/getTransactionError.d.ts.map +0 -1
- package/dist/types/utils/filters/createFilterRequestScope.d.ts +0 -22
- package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +0 -1
- package/dist/types/utils/formatters/block.d.ts +0 -28
- package/dist/types/utils/formatters/block.d.ts.map +0 -1
- package/dist/types/utils/formatters/extract.d.ts +0 -8
- package/dist/types/utils/formatters/extract.d.ts.map +0 -1
- package/dist/types/utils/formatters/feeHistory.d.ts +0 -4
- package/dist/types/utils/formatters/feeHistory.d.ts.map +0 -1
- package/dist/types/utils/formatters/formatter.d.ts +0 -10
- package/dist/types/utils/formatters/formatter.d.ts.map +0 -1
- package/dist/types/utils/formatters/log.d.ts +0 -7
- package/dist/types/utils/formatters/log.d.ts.map +0 -1
- package/dist/types/utils/formatters/transaction.d.ts +0 -30
- package/dist/types/utils/formatters/transaction.d.ts.map +0 -1
- package/dist/types/utils/formatters/transactionReceipt.d.ts +0 -14
- package/dist/types/utils/formatters/transactionReceipt.d.ts.map +0 -1
- package/dist/types/utils/formatters/transactionRequest.d.ts +0 -14
- package/dist/types/utils/formatters/transactionRequest.d.ts.map +0 -1
- package/dist/types/utils/hash/getEventSelector.d.ts +0 -4
- package/dist/types/utils/hash/getEventSelector.d.ts.map +0 -1
- package/dist/types/utils/hash/getFunctionSelector.d.ts +0 -3
- package/dist/types/utils/hash/getFunctionSelector.d.ts.map +0 -1
- package/dist/types/utils/hash/hashFunction.d.ts +0 -4
- package/dist/types/utils/hash/hashFunction.d.ts.map +0 -1
- package/dist/types/utils/hash/isHash.d.ts +0 -3
- package/dist/types/utils/hash/isHash.d.ts.map +0 -1
- package/dist/types/utils/hash/keccak256.d.ts +0 -6
- package/dist/types/utils/hash/keccak256.d.ts.map +0 -1
- package/dist/types/utils/index.d.ts +0 -82
- package/dist/types/utils/index.d.ts.map +0 -1
- package/dist/types/utils/observe.d.ts +0 -17
- package/dist/types/utils/observe.d.ts.map +0 -1
- package/dist/types/utils/poll.d.ts +0 -13
- package/dist/types/utils/poll.d.ts.map +0 -1
- package/dist/types/utils/promise/createBatchScheduler.d.ts +0 -17
- package/dist/types/utils/promise/createBatchScheduler.d.ts.map +0 -1
- package/dist/types/utils/promise/withCache.d.ts +0 -36
- package/dist/types/utils/promise/withCache.d.ts.map +0 -1
- package/dist/types/utils/promise/withRetry.d.ts +0 -12
- package/dist/types/utils/promise/withRetry.d.ts.map +0 -1
- package/dist/types/utils/promise/withTimeout.d.ts +0 -8
- package/dist/types/utils/promise/withTimeout.d.ts.map +0 -1
- package/dist/types/utils/regex.d.ts +0 -4
- package/dist/types/utils/regex.d.ts.map +0 -1
- package/dist/types/utils/rpc.d.ts +0 -72
- package/dist/types/utils/rpc.d.ts.map +0 -1
- package/dist/types/utils/signature/hashMessage.d.ts +0 -6
- package/dist/types/utils/signature/hashMessage.d.ts.map +0 -1
- package/dist/types/utils/signature/hashTypedData.d.ts +0 -11
- package/dist/types/utils/signature/hashTypedData.d.ts.map +0 -1
- package/dist/types/utils/signature/hexToSignature.d.ts +0 -13
- package/dist/types/utils/signature/hexToSignature.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverAddress.d.ts +0 -9
- package/dist/types/utils/signature/recoverAddress.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverMessageAddress.d.ts +0 -9
- package/dist/types/utils/signature/recoverMessageAddress.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverPublicKey.d.ts +0 -8
- package/dist/types/utils/signature/recoverPublicKey.d.ts.map +0 -1
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +0 -13
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +0 -1
- package/dist/types/utils/signature/signatureToHex.d.ts +0 -17
- package/dist/types/utils/signature/signatureToHex.d.ts.map +0 -1
- package/dist/types/utils/signature/verifyMessage.d.ts +0 -25
- package/dist/types/utils/signature/verifyMessage.d.ts.map +0 -1
- package/dist/types/utils/signature/verifyTypedData.d.ts +0 -28
- package/dist/types/utils/signature/verifyTypedData.d.ts.map +0 -1
- package/dist/types/utils/stringify.d.ts +0 -2
- package/dist/types/utils/stringify.d.ts.map +0 -1
- package/dist/types/utils/transaction/assertRequest.d.ts +0 -5
- package/dist/types/utils/transaction/assertRequest.d.ts.map +0 -1
- package/dist/types/utils/transaction/assertTransaction.d.ts +0 -5
- package/dist/types/utils/transaction/assertTransaction.d.ts.map +0 -1
- package/dist/types/utils/transaction/getSerializedTransactionType.d.ts +0 -4
- package/dist/types/utils/transaction/getSerializedTransactionType.d.ts.map +0 -1
- package/dist/types/utils/transaction/getTransactionType.d.ts +0 -4
- package/dist/types/utils/transaction/getTransactionType.d.ts.map +0 -1
- package/dist/types/utils/transaction/parseTransaction.d.ts +0 -5
- package/dist/types/utils/transaction/parseTransaction.d.ts.map +0 -1
- package/dist/types/utils/transaction/prepareRequest.d.ts +0 -20
- package/dist/types/utils/transaction/prepareRequest.d.ts.map +0 -1
- package/dist/types/utils/transaction/serializeAccessList.d.ts +0 -5
- package/dist/types/utils/transaction/serializeAccessList.d.ts.map +0 -1
- package/dist/types/utils/transaction/serializeTransaction.d.ts +0 -7
- package/dist/types/utils/transaction/serializeTransaction.d.ts.map +0 -1
- package/dist/types/utils/typedData.d.ts +0 -6
- package/dist/types/utils/typedData.d.ts.map +0 -1
- package/dist/types/utils/uid.d.ts +0 -2
- package/dist/types/utils/uid.d.ts.map +0 -1
- package/dist/types/utils/unit/formatEther.d.ts +0 -2
- package/dist/types/utils/unit/formatEther.d.ts.map +0 -1
- package/dist/types/utils/unit/formatGwei.d.ts +0 -2
- package/dist/types/utils/unit/formatGwei.d.ts.map +0 -1
- package/dist/types/utils/unit/formatUnits.d.ts +0 -2
- package/dist/types/utils/unit/formatUnits.d.ts.map +0 -1
- package/dist/types/utils/unit/parseEther.d.ts +0 -2
- package/dist/types/utils/unit/parseEther.d.ts.map +0 -1
- package/dist/types/utils/unit/parseGwei.d.ts +0 -2
- package/dist/types/utils/unit/parseGwei.d.ts.map +0 -1
- package/dist/types/utils/unit/parseUnits.d.ts +0 -2
- package/dist/types/utils/unit/parseUnits.d.ts.map +0 -1
- package/dist/types/utils/wait.d.ts +0 -2
- package/dist/types/utils/wait.d.ts.map +0 -1
- package/dist/types/wallet.d.ts +0 -11
- package/dist/types/wallet.d.ts.map +0 -1
- package/dist/types/window.d.ts +0 -2
- package/dist/types/window.d.ts.map +0 -1
@@ -1,36 +0,0 @@
|
|
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
|
@@ -1 +0,0 @@
|
|
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"}
|
@@ -1,56 +0,0 @@
|
|
1
|
-
import type { Address, Narrow } from 'abitype';
|
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
|
-
import type { ContractFunctionConfig } from '../../types/contract.js';
|
6
|
-
import type { MulticallContracts, MulticallResults } from '../../types/multicall.js';
|
7
|
-
import type { CallParameters } from './call.js';
|
8
|
-
export type MulticallParameters<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
9
|
-
allowFailure?: TAllowFailure;
|
10
|
-
/** The maximum size (in bytes) for each calldata chunk. Set to `0` to disable the size limit. @default 1_024 */
|
11
|
-
batchSize?: number;
|
12
|
-
contracts: Narrow<readonly [...MulticallContracts<TContracts>]>;
|
13
|
-
multicallAddress?: Address;
|
14
|
-
};
|
15
|
-
export type MulticallReturnType<TContracts extends ContractFunctionConfig[] = ContractFunctionConfig[], TAllowFailure extends boolean = true> = MulticallResults<TContracts, TAllowFailure>;
|
16
|
-
/**
|
17
|
-
* Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
|
18
|
-
*
|
19
|
-
* - Docs: https://viem.sh/docs/contract/multicall.html
|
20
|
-
*
|
21
|
-
* @param client - Client to use
|
22
|
-
* @param parameters - {@link MulticallParameters}
|
23
|
-
* @returns An array of results with accompanying status. {@link MulticallReturnType}
|
24
|
-
*
|
25
|
-
* @example
|
26
|
-
* import { createPublicClient, http, parseAbi } from 'viem'
|
27
|
-
* import { mainnet } from 'viem/chains'
|
28
|
-
* import { multicall } from 'viem/contract'
|
29
|
-
*
|
30
|
-
* const client = createPublicClient({
|
31
|
-
* chain: mainnet,
|
32
|
-
* transport: http(),
|
33
|
-
* })
|
34
|
-
* const abi = parseAbi([
|
35
|
-
* 'function balanceOf(address) view returns (uint256)',
|
36
|
-
* 'function totalSupply() view returns (uint256)',
|
37
|
-
* ])
|
38
|
-
* const results = await multicall(client, {
|
39
|
-
* contracts: [
|
40
|
-
* {
|
41
|
-
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
42
|
-
* abi,
|
43
|
-
* functionName: 'balanceOf',
|
44
|
-
* args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
|
45
|
-
* },
|
46
|
-
* {
|
47
|
-
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
48
|
-
* abi,
|
49
|
-
* functionName: 'totalSupply',
|
50
|
-
* },
|
51
|
-
* ],
|
52
|
-
* })
|
53
|
-
* // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]
|
54
|
-
*/
|
55
|
-
export declare function multicall<TContracts extends ContractFunctionConfig[], TChain extends Chain | undefined, TAllowFailure extends boolean = true>(client: Client<Transport, TChain>, args: MulticallParameters<TContracts, TAllowFailure>): Promise<MulticallReturnType<TContracts, TAllowFailure>>;
|
56
|
-
//# sourceMappingURL=multicall.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"multicall.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/multicall.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAK5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAErE,OAAO,KAAK,EACV,kBAAkB,EAClB,gBAAgB,EACjB,MAAM,0BAA0B,CAAA;AASjC,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,gHAAgH;IAChH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,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,UAAU,SAAS,sBAAsB,EAAE,EAC3C,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,aAAa,SAAS,OAAO,GAAG,IAAI,EAEpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,IAAI,EAAE,mBAAmB,CAAC,UAAU,EAAE,aAAa,CAAC,GACnD,OAAO,CAAC,mBAAmB,CAAC,UAAU,EAAE,aAAa,CAAC,CAAC,CA8HzD"}
|
@@ -1,41 +0,0 @@
|
|
1
|
-
import type { Abi } from 'abitype';
|
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
|
-
import type { ContractFunctionConfig, ContractFunctionResult } from '../../types/contract.js';
|
6
|
-
import { type CallParameters } from './call.js';
|
7
|
-
export type ReadContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = Pick<CallParameters, 'account' | 'blockNumber' | 'blockTag'> & ContractFunctionConfig<TAbi, TFunctionName, 'view' | 'pure'>;
|
8
|
-
export type ReadContractReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string> = ContractFunctionResult<TAbi, TFunctionName>;
|
9
|
-
/**
|
10
|
-
* Calls a read-only function on a contract, and returns the response.
|
11
|
-
*
|
12
|
-
* - Docs: https://viem.sh/docs/contract/readContract.html
|
13
|
-
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/reading-contracts
|
14
|
-
*
|
15
|
-
* 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.
|
16
|
-
*
|
17
|
-
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
|
18
|
-
*
|
19
|
-
* @param client - Client to use
|
20
|
-
* @param parameters - {@link ReadContractParameters}
|
21
|
-
* @returns The response from the contract. Type is inferred. {@link ReadContractReturnType}
|
22
|
-
*
|
23
|
-
* @example
|
24
|
-
* import { createPublicClient, http, parseAbi } from 'viem'
|
25
|
-
* import { mainnet } from 'viem/chains'
|
26
|
-
* import { readContract } from 'viem/contract'
|
27
|
-
*
|
28
|
-
* const client = createPublicClient({
|
29
|
-
* chain: mainnet,
|
30
|
-
* transport: http(),
|
31
|
-
* })
|
32
|
-
* const result = await readContract(client, {
|
33
|
-
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
34
|
-
* abi: parseAbi(['function balanceOf(address) view returns (uint256)']),
|
35
|
-
* functionName: 'balanceOf',
|
36
|
-
* args: ['0xA0Cf798816D4b9b9866b5330EEa46a18382f251e'],
|
37
|
-
* })
|
38
|
-
* // 424122n
|
39
|
-
*/
|
40
|
-
export declare function readContract<TChain extends Chain | undefined, const TAbi extends Abi | readonly unknown[], TFunctionName extends string>(client: Client<Transport, TChain>, { abi, address, args, functionName, ...callRequest }: ReadContractParameters<TAbi, TFunctionName>): Promise<ReadContractReturnType<TAbi, TFunctionName>>;
|
41
|
-
//# sourceMappingURL=readContract.d.ts.map
|
@@ -1 +0,0 @@
|
|
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,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,EACV,sBAAsB,EACtB,sBAAsB,EACvB,MAAM,yBAAyB,CAAA;AAWhC,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,WAAW,CAAA;AAErD,MAAM,MAAM,sBAAsB,CAChC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,MAAM,IACnC,IAAI,CAAC,cAAc,EAAE,SAAS,GAAG,aAAa,GAAG,UAAU,CAAC,GAC9D,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,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,aAAa,SAAS,MAAM,EAE5B,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,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,CA8BtD"}
|
@@ -1,54 +0,0 @@
|
|
1
|
-
import type { Abi } from 'abitype';
|
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
|
-
import type { ContractFunctionConfig, ContractFunctionResult, GetValue } from '../../types/contract.js';
|
6
|
-
import type { Hex } from '../../types/misc.js';
|
7
|
-
import type { UnionOmit } from '../../types/utils.js';
|
8
|
-
import type { WriteContractParameters } from '../wallet/writeContract.js';
|
9
|
-
import { type CallParameters } from './call.js';
|
10
|
-
export type SimulateContractParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = any, TChain extends Chain | undefined = Chain | undefined, TChainOverride extends Chain | undefined = Chain | undefined> = {
|
11
|
-
chain?: TChainOverride;
|
12
|
-
/** Data to append to the end of the calldata. Useful for adding a ["domain" tag](https://opensea.notion.site/opensea/Seaport-Order-Attributions-ec2d69bf455041a5baa490941aad307f). */
|
13
|
-
dataSuffix?: Hex;
|
14
|
-
} & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & UnionOmit<CallParameters<TChainOverride extends Chain ? TChainOverride : TChain>, 'batch' | 'to' | 'data' | 'value'> & GetValue<TAbi, TFunctionName, CallParameters<TChain> extends CallParameters ? CallParameters<TChain>['value'] : CallParameters['value']>;
|
15
|
-
export type SimulateContractReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain | undefined, TChainOverride extends Chain | undefined = Chain | undefined> = {
|
16
|
-
result: ContractFunctionResult<TAbi, TFunctionName>;
|
17
|
-
request: UnionOmit<WriteContractParameters<TAbi, TFunctionName, TChain, undefined, TChainOverride>, 'chain' | 'functionName'> & {
|
18
|
-
chain: TChainOverride;
|
19
|
-
functionName: TFunctionName;
|
20
|
-
} & ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'>;
|
21
|
-
};
|
22
|
-
/**
|
23
|
-
* Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.
|
24
|
-
*
|
25
|
-
* - Docs: https://viem.sh/docs/contract/simulateContract.html
|
26
|
-
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/contracts/writing-to-contracts
|
27
|
-
*
|
28
|
-
* 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.html), but also supports contract write functions.
|
29
|
-
*
|
30
|
-
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`call` action](https://viem.sh/docs/actions/public/call.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
|
31
|
-
*
|
32
|
-
* @param client - Client to use
|
33
|
-
* @param parameters - {@link SimulateContractParameters}
|
34
|
-
* @returns The simulation result and write request. {@link SimulateContractReturnType}
|
35
|
-
*
|
36
|
-
* @example
|
37
|
-
* import { createPublicClient, http } from 'viem'
|
38
|
-
* import { mainnet } from 'viem/chains'
|
39
|
-
* import { simulateContract } from 'viem/contract'
|
40
|
-
*
|
41
|
-
* const client = createPublicClient({
|
42
|
-
* chain: mainnet,
|
43
|
-
* transport: http(),
|
44
|
-
* })
|
45
|
-
* const result = await simulateContract(client, {
|
46
|
-
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
47
|
-
* abi: parseAbi(['function mint(uint32) view returns (uint32)']),
|
48
|
-
* functionName: 'mint',
|
49
|
-
* args: ['69420'],
|
50
|
-
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
51
|
-
* })
|
52
|
-
*/
|
53
|
-
export declare function simulateContract<TChain extends Chain | undefined, const TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChainOverride extends Chain | undefined>(client: Client<Transport, TChain>, { abi, address, args, dataSuffix, functionName, ...callRequest }: SimulateContractParameters<TAbi, TFunctionName, TChain, TChainOverride>): Promise<SimulateContractReturnType<TAbi, TFunctionName, TChain, TChainOverride>>;
|
54
|
-
//# sourceMappingURL=simulateContract.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"simulateContract.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/simulateContract.ts"],"names":[],"mappings":"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"}
|
@@ -1,34 +0,0 @@
|
|
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 { Filter } from '../../types/filter.js';
|
5
|
-
export type UninstallFilterParameters = {
|
6
|
-
filter: Filter<any>;
|
7
|
-
};
|
8
|
-
export type UninstallFilterReturnType = boolean;
|
9
|
-
/**
|
10
|
-
* Destroys a [`Filter`](https://viem.sh/docs/glossary/types.html#filter).
|
11
|
-
*
|
12
|
-
* - Docs: https://viem.sh/docs/actions/public/uninstallFilter.html
|
13
|
-
* - JSON-RPC Methods: [`eth_uninstallFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_uninstallFilter)
|
14
|
-
*
|
15
|
-
* Destroys a Filter that was created from one of the following Actions:
|
16
|
-
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter.html)
|
17
|
-
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter.html)
|
18
|
-
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter.html)
|
19
|
-
*
|
20
|
-
* @param client - Client to use
|
21
|
-
* @param parameters - {@link UninstallFilterParameters}
|
22
|
-
* @returns A boolean indicating if the Filter was successfully uninstalled. {@link UninstallFilterReturnType}
|
23
|
-
*
|
24
|
-
* @example
|
25
|
-
* import { createPublicClient, http } from 'viem'
|
26
|
-
* import { mainnet } from 'viem/chains'
|
27
|
-
* import { createPendingTransactionFilter, uninstallFilter } from 'viem/public'
|
28
|
-
*
|
29
|
-
* const filter = await createPendingTransactionFilter(client)
|
30
|
-
* const uninstalled = await uninstallFilter(client, { filter })
|
31
|
-
* // true
|
32
|
-
*/
|
33
|
-
export declare function uninstallFilter<TTransport extends Transport, TChain extends Chain | undefined>(_client: Client<TTransport, TChain>, { filter }: UninstallFilterParameters): Promise<UninstallFilterReturnType>;
|
34
|
-
//# sourceMappingURL=uninstallFilter.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"uninstallFilter.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/uninstallFilter.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,MAAM,EAAE,MAAM,uBAAuB,CAAA;AAEnD,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,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,EACnC,EAAE,MAAM,EAAE,EAAE,yBAAyB,GACpC,OAAO,CAAC,yBAAyB,CAAC,CAKpC"}
|
@@ -1,24 +0,0 @@
|
|
1
|
-
import type { Address } from 'abitype';
|
2
|
-
import type { Chain } from '../../chains/index.js';
|
3
|
-
import type { Client } from '../../clients/createClient.js';
|
4
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
5
|
-
import type { ByteArray, Hex } from '../../types/misc.js';
|
6
|
-
import { type CallParameters } from './call.js';
|
7
|
-
export type VerifyHashParameters = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
8
|
-
/** The address that signed the original message. */
|
9
|
-
address: Address;
|
10
|
-
/** The hash to be verified. */
|
11
|
-
hash: Hex;
|
12
|
-
/** The signature that was generated by signing the message with the address's private key. */
|
13
|
-
signature: Hex | ByteArray;
|
14
|
-
};
|
15
|
-
export type VerifyHashReturnType = boolean;
|
16
|
-
/**
|
17
|
-
* Verifies a message hash on chain using ERC-6492.
|
18
|
-
*
|
19
|
-
* @param client - Client to use.
|
20
|
-
* @param parameters - {@link VerifyHashParameters}
|
21
|
-
* @returns Whether or not the signature is valid. {@link VerifyHashReturnType}
|
22
|
-
*/
|
23
|
-
export declare function verifyHash<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { address, hash, signature, ...callRequest }: VerifyHashParameters): Promise<VerifyHashReturnType>;
|
24
|
-
//# sourceMappingURL=verifyHash.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"verifyHash.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/verifyHash.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAI5E,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAGzD,OAAO,EAAE,KAAK,cAAc,EAAQ,MAAM,WAAW,CAAA;AAErD,MAAM,MAAM,oBAAoB,GAAG,IAAI,CACrC,cAAc,EACd,aAAa,GAAG,UAAU,CAC3B,GAAG;IACF,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAA;IAChB,+BAA+B;IAC/B,IAAI,EAAE,GAAG,CAAA;IACT,8FAA8F;IAC9F,SAAS,EAAE,GAAG,GAAG,SAAS,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAE1C;;;;;;GAMG;AACH,wBAAsB,UAAU,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAC/D,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,EAAE,oBAAoB,GACjE,OAAO,CAAC,oBAAoB,CAAC,CAwB/B"}
|
@@ -1,28 +0,0 @@
|
|
1
|
-
import type { Chain } from '../../chains/index.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { ByteArray, Hex, SignableMessage } from '../../types/misc.js';
|
5
|
-
import { type VerifyHashParameters } from './verifyHash.js';
|
6
|
-
import type { Address } from 'abitype';
|
7
|
-
export type VerifyMessageParameters = Omit<VerifyHashParameters, 'hash'> & {
|
8
|
-
/** The address that signed the original message. */
|
9
|
-
address: Address;
|
10
|
-
/** The message to be verified. */
|
11
|
-
message: SignableMessage;
|
12
|
-
/** The signature that was generated by signing the message with the address's private key. */
|
13
|
-
signature: Hex | ByteArray;
|
14
|
-
};
|
15
|
-
export type VerifyMessageReturnType = boolean;
|
16
|
-
/**
|
17
|
-
* Verify that a message was signed by the provided address.
|
18
|
-
*
|
19
|
-
* Compatible with Smart Contract Accounts & Externally Owned Accounts via [ERC-6492](https://eips.ethereum.org/EIPS/eip-6492).
|
20
|
-
*
|
21
|
-
* - Docs {@link https://viem.sh/docs/actions/public/verifyMessage.html}
|
22
|
-
*
|
23
|
-
* @param client - Client to use.
|
24
|
-
* @param parameters - {@link VerifyMessageParameters}
|
25
|
-
* @returns Whether or not the signature is valid. {@link VerifyMessageReturnType}
|
26
|
-
*/
|
27
|
-
export declare function verifyMessage<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { address, message, signature, ...callRequest }: VerifyMessageParameters): Promise<VerifyMessageReturnType>;
|
28
|
-
//# sourceMappingURL=verifyMessage.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"verifyMessage.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/verifyMessage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AAE1E,OAAO,EAAE,KAAK,oBAAoB,EAAc,MAAM,iBAAiB,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GAAG;IACzE,oDAAoD;IACpD,OAAO,EAAE,OAAO,CAAA;IAChB,kCAAkC;IAClC,OAAO,EAAE,eAAe,CAAA;IACxB,8FAA8F;IAC9F,SAAS,EAAE,GAAG,GAAG,SAAS,CAAA;CAC3B,CAAA;AAED,MAAM,MAAM,uBAAuB,GAAG,OAAO,CAAA;AAE7C;;;;;;;;;;GAUG;AACH,wBAAsB,aAAa,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAClE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,OAAO,EAAE,OAAO,EAAE,SAAS,EAAE,GAAG,WAAW,EAAE,EAAE,uBAAuB,GACvE,OAAO,CAAC,uBAAuB,CAAC,CAQlC"}
|
@@ -1,27 +0,0 @@
|
|
1
|
-
import type { Chain } from '../../chains/index.js';
|
2
|
-
import type { Client } from '../../clients/createClient.js';
|
3
|
-
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
-
import type { ByteArray, Hex } from '../../types/misc.js';
|
5
|
-
import type { TypedDataDefinition } from '../../types/typedData.js';
|
6
|
-
import { type VerifyHashParameters } from './verifyHash.js';
|
7
|
-
import type { Address, TypedData } from 'abitype';
|
8
|
-
export type VerifyTypedDataParameters<TTypedData extends TypedData | {
|
9
|
-
[key: string]: unknown;
|
10
|
-
} = TypedData, TPrimaryType extends string = string> = Omit<VerifyHashParameters, 'hash'> & TypedDataDefinition<TTypedData, TPrimaryType> & {
|
11
|
-
/** The address to verify the typed data for. */
|
12
|
-
address: Address;
|
13
|
-
/** The signature to verify */
|
14
|
-
signature: Hex | ByteArray;
|
15
|
-
};
|
16
|
-
export type VerifyTypedDataReturnType = boolean;
|
17
|
-
/**
|
18
|
-
* Verify that typed data was signed by the provided address.
|
19
|
-
*
|
20
|
-
* - Docs {@link https://viem.sh/docs/actions/public/verifyTypedData.html}
|
21
|
-
*
|
22
|
-
* @param client - Client to use.
|
23
|
-
* @param parameters - {@link VerifyTypedDataParameters}
|
24
|
-
* @returns Whether or not the signature is valid. {@link VerifyTypedDataReturnType}
|
25
|
-
*/
|
26
|
-
export declare function verifyTypedData<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { address, signature, message, primaryType, types, domain, ...callRequest }: VerifyTypedDataParameters): Promise<VerifyTypedDataReturnType>;
|
27
|
-
//# sourceMappingURL=verifyTypedData.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"verifyTypedData.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/verifyTypedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAA;AAClD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AACzD,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnE,OAAO,EAAE,KAAK,oBAAoB,EAAc,MAAM,iBAAiB,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEjD,MAAM,MAAM,yBAAyB,CACnC,UAAU,SAAS,SAAS,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,GAAG,SAAS,EACrE,YAAY,SAAS,MAAM,GAAG,MAAM,IAClC,IAAI,CAAC,oBAAoB,EAAE,MAAM,CAAC,GACpC,mBAAmB,CAAC,UAAU,EAAE,YAAY,CAAC,GAAG;IAC9C,gDAAgD;IAChD,OAAO,EAAE,OAAO,CAAA;IAChB,8BAA8B;IAC9B,SAAS,EAAE,GAAG,GAAG,SAAS,CAAA;CAC3B,CAAA;AAEH,MAAM,MAAM,yBAAyB,GAAG,OAAO,CAAA;AAE/C;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EACpE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EACE,OAAO,EACP,SAAS,EACT,OAAO,EACP,WAAW,EACX,KAAK,EACL,MAAM,EACN,GAAG,WAAW,EACf,EAAE,yBAAyB,GAC3B,OAAO,CAAC,yBAAyB,CAAC,CAQpC"}
|
@@ -1,72 +0,0 @@
|
|
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 { Transaction } from '../../types/transaction.js';
|
6
|
-
import { type GetTransactionReceiptReturnType } from './getTransactionReceipt.js';
|
7
|
-
export type ReplacementReason = 'cancelled' | 'replaced' | 'repriced';
|
8
|
-
export type ReplacementReturnType<TChain extends Chain | undefined = Chain | undefined> = {
|
9
|
-
reason: ReplacementReason;
|
10
|
-
replacedTransaction: Transaction;
|
11
|
-
transaction: Transaction;
|
12
|
-
transactionReceipt: GetTransactionReceiptReturnType<TChain>;
|
13
|
-
};
|
14
|
-
export type WaitForTransactionReceiptReturnType<TChain extends Chain | undefined = Chain | undefined> = GetTransactionReceiptReturnType<TChain>;
|
15
|
-
export type WaitForTransactionReceiptParameters<TChain extends Chain | undefined = Chain | undefined> = {
|
16
|
-
/**
|
17
|
-
* The number of confirmations (blocks that have passed) to wait before resolving.
|
18
|
-
* @default 1
|
19
|
-
*/
|
20
|
-
confirmations?: number;
|
21
|
-
/** The hash of the transaction. */
|
22
|
-
hash: Hash;
|
23
|
-
/** Optional callback to emit if the transaction has been replaced. */
|
24
|
-
onReplaced?: (response: ReplacementReturnType<TChain>) => void;
|
25
|
-
/**
|
26
|
-
* Polling frequency (in ms). Defaults to the client's pollingInterval config.
|
27
|
-
* @default client.pollingInterval
|
28
|
-
*/
|
29
|
-
pollingInterval?: number;
|
30
|
-
/** Optional timeout (in milliseconds) to wait before stopping polling. */
|
31
|
-
timeout?: number;
|
32
|
-
};
|
33
|
-
/**
|
34
|
-
* Waits for the [Transaction](https://viem.sh/docs/glossary/terms.html#transaction) to be included on a [Block](https://viem.sh/docs/glossary/terms.html#block) (one confirmation), and then returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms.html#transaction-receipt). If the Transaction reverts, then the action will throw an error.
|
35
|
-
*
|
36
|
-
* - Docs: https://viem.sh/docs/actions/public/waitForTransactionReceipt.html
|
37
|
-
* - Example: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/transactions/sending-transactions
|
38
|
-
* - JSON-RPC Methods:
|
39
|
-
* - Polls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt) on each block until it has been processed.
|
40
|
-
* - If a Transaction has been replaced:
|
41
|
-
* - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) and extracts the transactions
|
42
|
-
* - Checks if one of the Transactions is a replacement
|
43
|
-
* - If so, calls [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionReceipt).
|
44
|
-
*
|
45
|
-
* The `waitForTransactionReceipt` action additionally supports Replacement detection (e.g. sped up Transactions).
|
46
|
-
*
|
47
|
-
* Transactions can be replaced when a user modifies their transaction in their wallet (to speed up or cancel). Transactions are replaced when they are sent from the same nonce.
|
48
|
-
*
|
49
|
-
* There are 3 types of Transaction Replacement reasons:
|
50
|
-
*
|
51
|
-
* - `repriced`: The gas price has been modified (e.g. different `maxFeePerGas`)
|
52
|
-
* - `cancelled`: The Transaction has been cancelled (e.g. `value === 0n`)
|
53
|
-
* - `replaced`: The Transaction has been replaced (e.g. different `value` or `data`)
|
54
|
-
*
|
55
|
-
* @param client - Client to use
|
56
|
-
* @param parameters - {@link WaitForTransactionReceiptParameters}
|
57
|
-
* @returns The transaction receipt. {@link WaitForTransactionReceiptReturnType}
|
58
|
-
*
|
59
|
-
* @example
|
60
|
-
* import { createPublicClient, waitForTransactionReceipt, http } from 'viem'
|
61
|
-
* import { mainnet } from 'viem/chains'
|
62
|
-
*
|
63
|
-
* const client = createPublicClient({
|
64
|
-
* chain: mainnet,
|
65
|
-
* transport: http(),
|
66
|
-
* })
|
67
|
-
* const transactionReceipt = await waitForTransactionReceipt(client, {
|
68
|
-
* hash: '0x4ca7ee652d57678f26e887c149ab0735f41de37bcad58c9f6d3ed5824f15b74d',
|
69
|
-
* })
|
70
|
-
*/
|
71
|
-
export declare function waitForTransactionReceipt<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { confirmations, hash, onReplaced, pollingInterval, timeout, }: WaitForTransactionReceiptParameters<TChain>): Promise<WaitForTransactionReceiptReturnType<TChain>>;
|
72
|
-
//# sourceMappingURL=waitForTransactionReceipt.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"waitForTransactionReceipt.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/waitForTransactionReceipt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAM5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,4BAA4B,CAAA;AAU7D,OAAO,EACL,KAAK,+BAA+B,EAErC,MAAM,4BAA4B,CAAA;AAGnC,MAAM,MAAM,iBAAiB,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,CAAA;AACrE,MAAM,MAAM,qBAAqB,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD;IACF,MAAM,EAAE,iBAAiB,CAAA;IACzB,mBAAmB,EAAE,WAAW,CAAA;IAChC,WAAW,EAAE,WAAW,CAAA;IACxB,kBAAkB,EAAE,+BAA+B,CAAC,MAAM,CAAC,CAAA;CAC5D,CAAA;AAED,MAAM,MAAM,mCAAmC,CAC7C,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD,+BAA+B,CAAC,MAAM,CAAC,CAAA;AAE3C,MAAM,MAAM,mCAAmC,CAC7C,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD;IACF;;;OAGG;IACH,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,mCAAmC;IACnC,IAAI,EAAE,IAAI,CAAA;IACV,sEAAsE;IACtE,UAAU,CAAC,EAAE,CAAC,QAAQ,EAAE,qBAAqB,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IAC9D;;;OAGG;IACH,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,0EAA0E;IAC1E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AACH,wBAAsB,yBAAyB,CAC7C,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EACE,aAAiB,EACjB,IAAI,EACJ,UAAU,EACV,eAAwC,EACxC,OAAO,GACR,EAAE,mCAAmC,CAAC,MAAM,CAAC,GAC7C,OAAO,CAAC,mCAAmC,CAAC,MAAM,CAAC,CAAC,CAoJtD"}
|
@@ -1,59 +0,0 @@
|
|
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 { GetTransportConfig } from '../../types/transport.js';
|
5
|
-
import { type GetBlockNumberReturnType } from './getBlockNumber.js';
|
6
|
-
export type OnBlockNumberParameter = GetBlockNumberReturnType;
|
7
|
-
export type OnBlockNumberFn = (blockNumber: OnBlockNumberParameter, prevBlockNumber: OnBlockNumberParameter | undefined) => void;
|
8
|
-
export type PollOptions = {
|
9
|
-
/** Whether or not to emit the missed block numbers to the callback. */
|
10
|
-
emitMissed?: boolean;
|
11
|
-
/** Whether or not to emit the latest block number to the callback when the subscription opens. */
|
12
|
-
emitOnBegin?: boolean;
|
13
|
-
/** Polling frequency (in ms). Defaults to Client's pollingInterval config. */
|
14
|
-
pollingInterval?: number;
|
15
|
-
};
|
16
|
-
export type WatchBlockNumberParameters<TTransport extends Transport = Transport> = {
|
17
|
-
/** The callback to call when a new block number is received. */
|
18
|
-
onBlockNumber: OnBlockNumberFn;
|
19
|
-
/** The callback to call when an error occurred when trying to get for a new block. */
|
20
|
-
onError?: (error: Error) => void;
|
21
|
-
} & (GetTransportConfig<TTransport>['type'] extends 'webSocket' ? {
|
22
|
-
emitMissed?: never;
|
23
|
-
emitOnBegin?: never;
|
24
|
-
/** Whether or not the WebSocket Transport should poll the JSON-RPC, rather than using `eth_subscribe`. */
|
25
|
-
poll?: false;
|
26
|
-
pollingInterval?: never;
|
27
|
-
} | (PollOptions & {
|
28
|
-
poll: true;
|
29
|
-
}) : PollOptions & {
|
30
|
-
poll?: true;
|
31
|
-
});
|
32
|
-
export type WatchBlockNumberReturnType = () => void;
|
33
|
-
/**
|
34
|
-
* Watches and returns incoming block numbers.
|
35
|
-
*
|
36
|
-
* - Docs: https://viem.sh/docs/actions/public/watchBlockNumber.html
|
37
|
-
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks
|
38
|
-
* - JSON-RPC Methods:
|
39
|
-
* - When `poll: true`, calls [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber) on a polling interval.
|
40
|
-
* - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
|
41
|
-
*
|
42
|
-
* @param client - Client to use
|
43
|
-
* @param parameters - {@link WatchBlockNumberParameters}
|
44
|
-
* @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlockNumberReturnType}
|
45
|
-
*
|
46
|
-
* @example
|
47
|
-
* import { createPublicClient, watchBlockNumber, http } from 'viem'
|
48
|
-
* import { mainnet } from 'viem/chains'
|
49
|
-
*
|
50
|
-
* const client = createPublicClient({
|
51
|
-
* chain: mainnet,
|
52
|
-
* transport: http(),
|
53
|
-
* })
|
54
|
-
* const unwatch = watchBlockNumber(client, {
|
55
|
-
* onBlockNumber: (blockNumber) => console.log(blockNumber),
|
56
|
-
* })
|
57
|
-
*/
|
58
|
-
export declare function watchBlockNumber<TChain extends Chain | undefined, TTransport extends Transport>(client: Client<TTransport, TChain>, { emitOnBegin, emitMissed, onBlockNumber, onError, poll: poll_, pollingInterval, }: WatchBlockNumberParameters<TTransport>): WatchBlockNumberReturnType;
|
59
|
-
//# sourceMappingURL=watchBlockNumber.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"watchBlockNumber.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/watchBlockNumber.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,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAMlE,OAAO,EACL,KAAK,wBAAwB,EAE9B,MAAM,qBAAqB,CAAA;AAE5B,MAAM,MAAM,sBAAsB,GAAG,wBAAwB,CAAA;AAC7D,MAAM,MAAM,eAAe,GAAG,CAC5B,WAAW,EAAE,sBAAsB,EACnC,eAAe,EAAE,sBAAsB,GAAG,SAAS,KAChD,IAAI,CAAA;AAET,MAAM,MAAM,WAAW,GAAG;IACxB,uEAAuE;IACvE,UAAU,CAAC,EAAE,OAAO,CAAA;IACpB,kGAAkG;IAClG,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,8EAA8E;IAC9E,eAAe,CAAC,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,MAAM,MAAM,0BAA0B,CACpC,UAAU,SAAS,SAAS,GAAG,SAAS,IACtC;IACF,gEAAgE;IAChE,aAAa,EAAE,eAAe,CAAA;IAC9B,sFAAsF;IACtF,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;CACjC,GAAG,CAAC,kBAAkB,CAAC,UAAU,CAAC,CAAC,MAAM,CAAC,SAAS,WAAW,GAEvD;IACE,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,0GAA0G;IAC1G,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,eAAe,CAAC,EAAE,KAAK,CAAA;CACxB,GACD,CAAC,WAAW,GAAG;IAAE,IAAI,EAAE,IAAI,CAAA;CAAE,CAAC,GAClC,WAAW,GAAG;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC,CAAA;AAElC,MAAM,MAAM,0BAA0B,GAAG,MAAM,IAAI,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,UAAU,SAAS,SAAS,EAE5B,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,EAClC,EACE,WAAmB,EACnB,UAAkB,EAClB,aAAa,EACb,OAAO,EACP,IAAI,EAAE,KAAK,EACX,eAAwC,GACzC,EAAE,0BAA0B,CAAC,UAAU,CAAC,GACxC,0BAA0B,CAiF5B"}
|
@@ -1,67 +0,0 @@
|
|
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 { GetTransportConfig } from '../../types/transport.js';
|
6
|
-
import { type GetBlockReturnType } from './getBlock.js';
|
7
|
-
export type OnBlockParameter<TChain extends Chain | undefined = Chain, TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'> = GetBlockReturnType<TChain, TIncludeTransactions, TBlockTag>;
|
8
|
-
export type OnBlock<TChain extends Chain | undefined = Chain, TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'> = (block: OnBlockParameter<TChain, TIncludeTransactions, TBlockTag>, prevBlock: OnBlockParameter<TChain, TIncludeTransactions, TBlockTag> | undefined) => void;
|
9
|
-
type PollOptions<TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'> = {
|
10
|
-
/** The block tag. Defaults to "latest". */
|
11
|
-
blockTag?: TBlockTag | BlockTag;
|
12
|
-
/** Whether or not to emit the missed blocks to the callback. */
|
13
|
-
emitMissed?: boolean;
|
14
|
-
/** Whether or not to emit the block to the callback when the subscription opens. */
|
15
|
-
emitOnBegin?: boolean;
|
16
|
-
/** Whether or not to include transaction data in the response. */
|
17
|
-
includeTransactions?: TIncludeTransactions;
|
18
|
-
/** Polling frequency (in ms). Defaults to the client's pollingInterval config. */
|
19
|
-
pollingInterval?: number;
|
20
|
-
};
|
21
|
-
export type WatchBlocksParameters<TTransport extends Transport = Transport, TChain extends Chain | undefined = Chain, TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'> = {
|
22
|
-
/** The callback to call when a new block is received. */
|
23
|
-
onBlock: OnBlock<TChain, TIncludeTransactions, TBlockTag>;
|
24
|
-
/** The callback to call when an error occurred when trying to get for a new block. */
|
25
|
-
onError?: (error: Error) => void;
|
26
|
-
} & (GetTransportConfig<TTransport>['type'] extends 'webSocket' ? {
|
27
|
-
blockTag?: never;
|
28
|
-
emitMissed?: never;
|
29
|
-
emitOnBegin?: never;
|
30
|
-
includeTransactions?: never;
|
31
|
-
/** Whether or not the WebSocket Transport should poll the JSON-RPC, rather than using `eth_subscribe`. */
|
32
|
-
poll?: false;
|
33
|
-
pollingInterval?: never;
|
34
|
-
} | (PollOptions<TIncludeTransactions, TBlockTag> & {
|
35
|
-
poll?: true;
|
36
|
-
}) : PollOptions<TIncludeTransactions, TBlockTag> & {
|
37
|
-
poll?: true;
|
38
|
-
});
|
39
|
-
export type WatchBlocksReturnType = () => void;
|
40
|
-
/**
|
41
|
-
* Watches and returns information for incoming blocks.
|
42
|
-
*
|
43
|
-
* - Docs: https://viem.sh/docs/actions/public/watchBlocks.html
|
44
|
-
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/watching-blocks
|
45
|
-
* - JSON-RPC Methods:
|
46
|
-
* - When `poll: true`, calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getBlockByNumber) on a polling interval.
|
47
|
-
* - When `poll: false` & WebSocket Transport, uses a WebSocket subscription via [`eth_subscribe`](https://docs.alchemy.com/reference/eth-subscribe-polygon) and the `"newHeads"` event.
|
48
|
-
*
|
49
|
-
* @param client - Client to use
|
50
|
-
* @param parameters - {@link WatchBlocksParameters}
|
51
|
-
* @returns A function that can be invoked to stop watching for new block numbers. {@link WatchBlocksReturnType}
|
52
|
-
*
|
53
|
-
* @example
|
54
|
-
* import { createPublicClient, watchBlocks, http } from 'viem'
|
55
|
-
* import { mainnet } from 'viem/chains'
|
56
|
-
*
|
57
|
-
* const client = createPublicClient({
|
58
|
-
* chain: mainnet,
|
59
|
-
* transport: http(),
|
60
|
-
* })
|
61
|
-
* const unwatch = watchBlocks(client, {
|
62
|
-
* onBlock: (block) => console.log(block),
|
63
|
-
* })
|
64
|
-
*/
|
65
|
-
export declare function watchBlocks<TTransport extends Transport, TChain extends Chain | undefined, TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'>(client: Client<TTransport, TChain>, { blockTag, emitMissed, emitOnBegin, onBlock, onError, includeTransactions: includeTransactions_, poll: poll_, pollingInterval, }: WatchBlocksParameters<TTransport, TChain, TIncludeTransactions, TBlockTag>): WatchBlocksReturnType;
|
66
|
-
export {};
|
67
|
-
//# sourceMappingURL=watchBlocks.d.ts.map
|
@@ -1 +0,0 @@
|
|
1
|
-
{"version":3,"file":"watchBlocks.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/watchBlocks.ts"],"names":[],"mappings":"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"}
|