viem 1.6.6 → 1.6.7
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 +58 -0
- package/chains/dist/cjs/celo/parsers.js +72 -0
- package/chains/dist/cjs/celo/serializers.js +75 -0
- package/chains/dist/cjs/celo/types.js +3 -0
- package/chains/dist/cjs/index.js +135 -0
- package/chains/dist/cjs/optimism/fees.js +7 -0
- package/chains/dist/cjs/optimism/formatters.js +52 -0
- package/chains/dist/cjs/optimism/types.js +3 -0
- package/chains/dist/cjs/types.js +3 -0
- package/chains/dist/cjs/utils.js +49 -0
- package/chains/dist/tsconfig.build.tsbuildinfo +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/types/abi.d.ts +6 -0
- package/dist/types/abi.d.ts.map +1 -0
- package/dist/types/accounts/generateMnemonic.d.ts +9 -0
- package/dist/types/accounts/generateMnemonic.d.ts.map +1 -0
- package/dist/types/accounts/generatePrivateKey.d.ts +8 -0
- package/dist/types/accounts/generatePrivateKey.d.ts.map +1 -0
- package/dist/types/accounts/hdKeyToAccount.d.ts +9 -0
- package/dist/types/accounts/hdKeyToAccount.d.ts.map +1 -0
- package/dist/types/accounts/index.d.ts +27 -0
- package/dist/types/accounts/index.d.ts.map +1 -0
- package/dist/types/accounts/mnemonicToAccount.d.ts +8 -0
- package/dist/types/accounts/mnemonicToAccount.d.ts.map +1 -0
- package/dist/types/accounts/privateKeyToAccount.d.ts +9 -0
- package/dist/types/accounts/privateKeyToAccount.d.ts.map +1 -0
- package/dist/types/accounts/toAccount.d.ts +11 -0
- package/dist/types/accounts/toAccount.d.ts.map +1 -0
- package/dist/types/accounts/types.d.ts +52 -0
- package/dist/types/accounts/types.d.ts.map +1 -0
- package/dist/types/accounts/utils/parseAccount.d.ts +4 -0
- package/dist/types/accounts/utils/parseAccount.d.ts.map +1 -0
- package/dist/types/accounts/utils/privateKeyToAddress.d.ts +11 -0
- package/dist/types/accounts/utils/privateKeyToAddress.d.ts.map +1 -0
- package/dist/types/accounts/utils/publicKeyToAddress.d.ts +11 -0
- package/dist/types/accounts/utils/publicKeyToAddress.d.ts.map +1 -0
- package/dist/types/accounts/utils/sign.d.ts +16 -0
- package/dist/types/accounts/utils/sign.d.ts.map +1 -0
- package/dist/types/accounts/utils/signMessage.d.ts +16 -0
- package/dist/types/accounts/utils/signMessage.d.ts.map +1 -0
- package/dist/types/accounts/utils/signTransaction.d.ts +12 -0
- package/dist/types/accounts/utils/signTransaction.d.ts.map +1 -0
- package/dist/types/accounts/utils/signTypedData.d.ts +20 -0
- package/dist/types/accounts/utils/signTypedData.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/czech.d.ts +2 -0
- package/dist/types/accounts/wordlists/czech.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/english.d.ts +2 -0
- package/dist/types/accounts/wordlists/english.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/french.d.ts +2 -0
- package/dist/types/accounts/wordlists/french.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/italian.d.ts +2 -0
- package/dist/types/accounts/wordlists/italian.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/japanese.d.ts +2 -0
- package/dist/types/accounts/wordlists/japanese.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/korean.d.ts +2 -0
- package/dist/types/accounts/wordlists/korean.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/simplifiedChinese.d.ts +2 -0
- package/dist/types/accounts/wordlists/simplifiedChinese.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/spanish.d.ts +2 -0
- package/dist/types/accounts/wordlists/spanish.d.ts.map +1 -0
- package/dist/types/accounts/wordlists/traditionalChinese.d.ts +2 -0
- package/dist/types/accounts/wordlists/traditionalChinese.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsAddress.d.ts +45 -0
- package/dist/types/actions/ens/getEnsAddress.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsAvatar.d.ts +41 -0
- package/dist/types/actions/ens/getEnsAvatar.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsName.d.ts +41 -0
- package/dist/types/actions/ens/getEnsName.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsResolver.d.ts +43 -0
- package/dist/types/actions/ens/getEnsResolver.d.ts.map +1 -0
- package/dist/types/actions/ens/getEnsText.d.ts +46 -0
- package/dist/types/actions/ens/getEnsText.d.ts.map +1 -0
- package/dist/types/actions/getContract.d.ts +314 -0
- package/dist/types/actions/getContract.d.ts.map +1 -0
- package/dist/types/actions/index.d.ts +80 -0
- package/dist/types/actions/index.d.ts.map +1 -0
- package/dist/types/actions/public/call.d.ts +56 -0
- package/dist/types/actions/public/call.d.ts.map +1 -0
- package/dist/types/actions/public/createBlockFilter.d.ts +28 -0
- package/dist/types/actions/public/createBlockFilter.d.ts.map +1 -0
- package/dist/types/actions/public/createContractEventFilter.d.ts +50 -0
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -0
- package/dist/types/actions/public/createEventFilter.d.ts +76 -0
- package/dist/types/actions/public/createEventFilter.d.ts.map +1 -0
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts +28 -0
- package/dist/types/actions/public/createPendingTransactionFilter.d.ts.map +1 -0
- package/dist/types/actions/public/estimateContractGas.d.ts +39 -0
- package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -0
- package/dist/types/actions/public/estimateGas.d.ts +49 -0
- package/dist/types/actions/public/estimateGas.d.ts.map +1 -0
- package/dist/types/actions/public/getBalance.d.ts +55 -0
- package/dist/types/actions/public/getBalance.d.ts.map +1 -0
- package/dist/types/actions/public/getBlock.d.ts +56 -0
- package/dist/types/actions/public/getBlock.d.ts.map +1 -0
- package/dist/types/actions/public/getBlockNumber.d.ts +57 -0
- package/dist/types/actions/public/getBlockNumber.d.ts.map +1 -0
- package/dist/types/actions/public/getBlockTransactionCount.d.ts +47 -0
- package/dist/types/actions/public/getBlockTransactionCount.d.ts.map +1 -0
- package/dist/types/actions/public/getBytecode.d.ts +41 -0
- package/dist/types/actions/public/getBytecode.d.ts.map +1 -0
- package/dist/types/actions/public/getChainId.d.ts +28 -0
- package/dist/types/actions/public/getChainId.d.ts.map +1 -0
- package/dist/types/actions/public/getFeeHistory.d.ts +53 -0
- package/dist/types/actions/public/getFeeHistory.d.ts.map +1 -0
- package/dist/types/actions/public/getFilterChanges.d.ts +96 -0
- package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -0
- package/dist/types/actions/public/getFilterLogs.d.ts +40 -0
- package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -0
- package/dist/types/actions/public/getGasPrice.d.ts +27 -0
- package/dist/types/actions/public/getGasPrice.d.ts.map +1 -0
- package/dist/types/actions/public/getLogs.d.ts +71 -0
- package/dist/types/actions/public/getLogs.d.ts.map +1 -0
- package/dist/types/actions/public/getStorageAt.d.ts +43 -0
- package/dist/types/actions/public/getStorageAt.d.ts.map +1 -0
- package/dist/types/actions/public/getTransaction.d.ts +65 -0
- package/dist/types/actions/public/getTransaction.d.ts.map +1 -0
- package/dist/types/actions/public/getTransactionConfirmations.d.ts +41 -0
- package/dist/types/actions/public/getTransactionConfirmations.d.ts.map +1 -0
- package/dist/types/actions/public/getTransactionCount.d.ts +44 -0
- package/dist/types/actions/public/getTransactionCount.d.ts.map +1 -0
- package/dist/types/actions/public/getTransactionReceipt.d.ts +36 -0
- package/dist/types/actions/public/getTransactionReceipt.d.ts.map +1 -0
- package/dist/types/actions/public/multicall.d.ts +56 -0
- package/dist/types/actions/public/multicall.d.ts.map +1 -0
- package/dist/types/actions/public/readContract.d.ts +41 -0
- package/dist/types/actions/public/readContract.d.ts.map +1 -0
- package/dist/types/actions/public/simulateContract.d.ts +54 -0
- package/dist/types/actions/public/simulateContract.d.ts.map +1 -0
- package/dist/types/actions/public/uninstallFilter.d.ts +34 -0
- package/dist/types/actions/public/uninstallFilter.d.ts.map +1 -0
- package/dist/types/actions/public/verifyHash.d.ts +24 -0
- package/dist/types/actions/public/verifyHash.d.ts.map +1 -0
- package/dist/types/actions/public/verifyMessage.d.ts +28 -0
- package/dist/types/actions/public/verifyMessage.d.ts.map +1 -0
- package/dist/types/actions/public/verifyTypedData.d.ts +27 -0
- package/dist/types/actions/public/verifyTypedData.d.ts.map +1 -0
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts +72 -0
- package/dist/types/actions/public/waitForTransactionReceipt.d.ts.map +1 -0
- package/dist/types/actions/public/watchBlockNumber.d.ts +59 -0
- package/dist/types/actions/public/watchBlockNumber.d.ts.map +1 -0
- package/dist/types/actions/public/watchBlocks.d.ts +67 -0
- package/dist/types/actions/public/watchBlocks.d.ts.map +1 -0
- package/dist/types/actions/public/watchContractEvent.d.ts +89 -0
- package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -0
- package/dist/types/actions/public/watchEvent.d.ts +104 -0
- package/dist/types/actions/public/watchEvent.d.ts.map +1 -0
- package/dist/types/actions/public/watchPendingTransactions.d.ts +74 -0
- package/dist/types/actions/public/watchPendingTransactions.d.ts.map +1 -0
- package/dist/types/actions/test/dropTransaction.d.ts +33 -0
- package/dist/types/actions/test/dropTransaction.d.ts.map +1 -0
- package/dist/types/actions/test/getAutomine.d.ts +27 -0
- package/dist/types/actions/test/getAutomine.d.ts.map +1 -0
- package/dist/types/actions/test/getTxpoolContent.d.ts +34 -0
- package/dist/types/actions/test/getTxpoolContent.d.ts.map +1 -0
- package/dist/types/actions/test/getTxpoolStatus.d.ts +30 -0
- package/dist/types/actions/test/getTxpoolStatus.d.ts.map +1 -0
- package/dist/types/actions/test/impersonateAccount.d.ts +33 -0
- package/dist/types/actions/test/impersonateAccount.d.ts.map +1 -0
- package/dist/types/actions/test/increaseTime.d.ts +32 -0
- package/dist/types/actions/test/increaseTime.d.ts.map +1 -0
- package/dist/types/actions/test/inspectTxpool.d.ts +31 -0
- package/dist/types/actions/test/inspectTxpool.d.ts.map +1 -0
- package/dist/types/actions/test/mine.d.ts +32 -0
- package/dist/types/actions/test/mine.d.ts.map +1 -0
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts +25 -0
- package/dist/types/actions/test/removeBlockTimestampInterval.d.ts.map +1 -0
- package/dist/types/actions/test/reset.d.ts +32 -0
- package/dist/types/actions/test/reset.d.ts.map +1 -0
- package/dist/types/actions/test/revert.d.ts +31 -0
- package/dist/types/actions/test/revert.d.ts.map +1 -0
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts +35 -0
- package/dist/types/actions/test/sendUnsignedTransaction.d.ts.map +1 -0
- package/dist/types/actions/test/setAutomine.d.ts +25 -0
- package/dist/types/actions/test/setAutomine.d.ts.map +1 -0
- package/dist/types/actions/test/setBalance.d.ts +36 -0
- package/dist/types/actions/test/setBalance.d.ts.map +1 -0
- package/dist/types/actions/test/setBlockGasLimit.d.ts +30 -0
- package/dist/types/actions/test/setBlockGasLimit.d.ts.map +1 -0
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts +30 -0
- package/dist/types/actions/test/setBlockTimestampInterval.d.ts.map +1 -0
- package/dist/types/actions/test/setCode.d.ts +37 -0
- package/dist/types/actions/test/setCode.d.ts.map +1 -0
- package/dist/types/actions/test/setCoinbase.d.ts +33 -0
- package/dist/types/actions/test/setCoinbase.d.ts.map +1 -0
- package/dist/types/actions/test/setIntervalMining.d.ts +30 -0
- package/dist/types/actions/test/setIntervalMining.d.ts.map +1 -0
- package/dist/types/actions/test/setLoggingEnabled.d.ts +25 -0
- package/dist/types/actions/test/setLoggingEnabled.d.ts.map +1 -0
- package/dist/types/actions/test/setMinGasPrice.d.ts +34 -0
- package/dist/types/actions/test/setMinGasPrice.d.ts.map +1 -0
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts +32 -0
- package/dist/types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +1 -0
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts +30 -0
- package/dist/types/actions/test/setNextBlockTimestamp.d.ts.map +1 -0
- package/dist/types/actions/test/setNonce.d.ts +36 -0
- package/dist/types/actions/test/setNonce.d.ts.map +1 -0
- package/dist/types/actions/test/setRpcUrl.d.ts +26 -0
- package/dist/types/actions/test/setRpcUrl.d.ts.map +1 -0
- package/dist/types/actions/test/setStorageAt.d.ts +40 -0
- package/dist/types/actions/test/setStorageAt.d.ts.map +1 -0
- package/dist/types/actions/test/snapshot.d.ts +25 -0
- package/dist/types/actions/test/snapshot.d.ts.map +1 -0
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts +33 -0
- package/dist/types/actions/test/stopImpersonatingAccount.d.ts.map +1 -0
- package/dist/types/actions/wallet/addChain.d.ts +29 -0
- package/dist/types/actions/wallet/addChain.d.ts.map +1 -0
- package/dist/types/actions/wallet/deployContract.d.ts +43 -0
- package/dist/types/actions/wallet/deployContract.d.ts.map +1 -0
- package/dist/types/actions/wallet/getAddresses.d.ts +28 -0
- package/dist/types/actions/wallet/getAddresses.d.ts.map +1 -0
- package/dist/types/actions/wallet/getPermissions.d.ts +28 -0
- package/dist/types/actions/wallet/getPermissions.d.ts.map +1 -0
- package/dist/types/actions/wallet/requestAddresses.d.ts +32 -0
- package/dist/types/actions/wallet/requestAddresses.d.ts.map +1 -0
- package/dist/types/actions/wallet/requestPermissions.d.ts +37 -0
- package/dist/types/actions/wallet/requestPermissions.d.ts.map +1 -0
- package/dist/types/actions/wallet/sendTransaction.d.ts +57 -0
- package/dist/types/actions/wallet/sendTransaction.d.ts.map +1 -0
- package/dist/types/actions/wallet/signMessage.d.ts +58 -0
- package/dist/types/actions/wallet/signMessage.d.ts.map +1 -0
- package/dist/types/actions/wallet/signTypedData.d.ts +114 -0
- package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -0
- package/dist/types/actions/wallet/switchChain.d.ts +30 -0
- package/dist/types/actions/wallet/switchChain.d.ts.map +1 -0
- package/dist/types/actions/wallet/watchAsset.d.ts +37 -0
- package/dist/types/actions/wallet/watchAsset.d.ts.map +1 -0
- package/dist/types/actions/wallet/writeContract.d.ts +68 -0
- package/dist/types/actions/wallet/writeContract.d.ts.map +1 -0
- package/dist/types/chains/celo/formatters.d.ts +195 -0
- package/dist/types/chains/celo/formatters.d.ts.map +1 -0
- package/dist/types/chains/celo/parsers.d.ts +6 -0
- package/dist/types/chains/celo/parsers.d.ts.map +1 -0
- package/dist/types/chains/celo/serializers.d.ts +9 -0
- package/dist/types/chains/celo/serializers.d.ts.map +1 -0
- package/dist/types/chains/celo/types.d.ts +74 -0
- package/dist/types/chains/celo/types.d.ts.map +1 -0
- package/dist/types/chains/index.d.ts +5329 -0
- package/dist/types/chains/index.d.ts.map +1 -0
- package/dist/types/chains/optimism/fees.d.ts +4 -0
- package/dist/types/chains/optimism/fees.d.ts.map +1 -0
- package/dist/types/chains/optimism/formatters.d.ts +299 -0
- package/dist/types/chains/optimism/formatters.d.ts.map +1 -0
- package/dist/types/chains/optimism/types.d.ts +53 -0
- package/dist/types/chains/optimism/types.d.ts.map +1 -0
- package/dist/types/chains/utils.d.ts +7 -0
- package/dist/types/chains/utils.d.ts.map +1 -0
- package/dist/types/clients/createClient.d.ts +79 -0
- package/dist/types/clients/createClient.d.ts.map +1 -0
- package/dist/types/clients/createPublicClient.d.ts +29 -0
- package/dist/types/clients/createPublicClient.d.ts.map +1 -0
- package/dist/types/clients/createTestClient.d.ts +43 -0
- package/dist/types/clients/createTestClient.d.ts.map +1 -0
- package/dist/types/clients/createWalletClient.d.ts +49 -0
- package/dist/types/clients/createWalletClient.d.ts.map +1 -0
- package/dist/types/clients/decorators/public.d.ts +1087 -0
- package/dist/types/clients/decorators/public.d.ts.map +1 -0
- package/dist/types/clients/decorators/test.d.ts +599 -0
- package/dist/types/clients/decorators/test.d.ts.map +1 -0
- package/dist/types/clients/decorators/wallet.d.ts +449 -0
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -0
- package/dist/types/clients/transports/createTransport.d.ts +34 -0
- package/dist/types/clients/transports/createTransport.d.ts.map +1 -0
- package/dist/types/clients/transports/custom.d.ts +21 -0
- package/dist/types/clients/transports/custom.d.ts.map +1 -0
- package/dist/types/clients/transports/fallback.d.ts +75 -0
- package/dist/types/clients/transports/fallback.d.ts.map +1 -0
- package/dist/types/clients/transports/http.d.ts +40 -0
- package/dist/types/clients/transports/http.d.ts.map +1 -0
- package/dist/types/clients/transports/webSocket.d.ts +46 -0
- package/dist/types/clients/transports/webSocket.d.ts.map +1 -0
- package/dist/types/constants/abis.d.ts +165 -0
- package/dist/types/constants/abis.d.ts.map +1 -0
- package/dist/types/constants/address.d.ts +2 -0
- package/dist/types/constants/address.d.ts.map +1 -0
- package/dist/types/constants/contract.d.ts +2 -0
- package/dist/types/constants/contract.d.ts.map +1 -0
- package/dist/types/constants/contracts.d.ts +2 -0
- package/dist/types/constants/contracts.d.ts.map +1 -0
- package/dist/types/constants/number.d.ts +97 -0
- package/dist/types/constants/number.d.ts.map +1 -0
- package/dist/types/constants/solidity.d.ts +15 -0
- package/dist/types/constants/solidity.d.ts.map +1 -0
- package/dist/types/constants/unit.d.ts +13 -0
- package/dist/types/constants/unit.d.ts.map +1 -0
- package/dist/types/contract.d.ts +30 -0
- package/dist/types/contract.d.ts.map +1 -0
- package/dist/types/ens.d.ts +9 -0
- package/dist/types/ens.d.ts.map +1 -0
- package/dist/types/errors/abi.d.ts +169 -0
- package/dist/types/errors/abi.d.ts.map +1 -0
- package/dist/types/errors/account.d.ts +8 -0
- package/dist/types/errors/account.d.ts.map +1 -0
- package/dist/types/errors/address.d.ts +8 -0
- package/dist/types/errors/address.d.ts.map +1 -0
- package/dist/types/errors/base.d.ts +24 -0
- package/dist/types/errors/base.d.ts.map +1 -0
- package/dist/types/errors/block.d.ts +10 -0
- package/dist/types/errors/block.d.ts.map +1 -0
- package/dist/types/errors/ccip.d.ts +29 -0
- package/dist/types/errors/ccip.d.ts.map +1 -0
- package/dist/types/errors/chain.d.ts +35 -0
- package/dist/types/errors/chain.d.ts.map +1 -0
- package/dist/types/errors/contract.d.ts +64 -0
- package/dist/types/errors/contract.d.ts.map +1 -0
- package/dist/types/errors/data.d.ts +18 -0
- package/dist/types/errors/data.d.ts.map +1 -0
- package/dist/types/errors/encoding.d.ts +53 -0
- package/dist/types/errors/encoding.d.ts.map +1 -0
- package/dist/types/errors/ens.d.ts +26 -0
- package/dist/types/errors/ens.d.ts.map +1 -0
- package/dist/types/errors/estimateGas.d.ts +14 -0
- package/dist/types/errors/estimateGas.d.ts.map +1 -0
- package/dist/types/errors/log.d.ts +6 -0
- package/dist/types/errors/log.d.ts.map +1 -0
- package/dist/types/errors/node.d.ts +105 -0
- package/dist/types/errors/node.d.ts.map +1 -0
- package/dist/types/errors/request.d.ts +61 -0
- package/dist/types/errors/request.d.ts.map +1 -0
- package/dist/types/errors/rpc.d.ts +221 -0
- package/dist/types/errors/rpc.d.ts.map +1 -0
- package/dist/types/errors/transaction.d.ts +79 -0
- package/dist/types/errors/transaction.d.ts.map +1 -0
- package/dist/types/errors/transport.d.ts +5 -0
- package/dist/types/errors/transport.d.ts.map +1 -0
- package/dist/types/errors/utils.d.ts +5 -0
- package/dist/types/errors/utils.d.ts.map +1 -0
- package/dist/types/errors/version.d.ts +2 -0
- package/dist/types/errors/version.d.ts.map +1 -0
- package/dist/types/index.d.ts +211 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/public.d.ts +31 -0
- package/dist/types/public.d.ts.map +1 -0
- package/dist/types/test.d.ts +29 -0
- package/dist/types/test.d.ts.map +1 -0
- package/dist/types/types/account.d.ts +12 -0
- package/dist/types/types/account.d.ts.map +1 -0
- package/dist/types/types/block.d.ts +62 -0
- package/dist/types/types/block.d.ts.map +1 -0
- package/dist/types/types/chain.d.ts +62 -0
- package/dist/types/types/chain.d.ts.map +1 -0
- package/dist/types/types/contract.d.ts +138 -0
- package/dist/types/types/contract.d.ts.map +1 -0
- package/dist/types/types/eip1193.d.ts +1216 -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 +29 -0
- package/dist/types/types/fee.d.ts.map +1 -0
- package/dist/types/types/filter.d.ts +40 -0
- package/dist/types/types/filter.d.ts.map +1 -0
- package/dist/types/types/log.d.ts +55 -0
- package/dist/types/types/log.d.ts.map +1 -0
- package/dist/types/types/misc.d.ts +14 -0
- package/dist/types/types/misc.d.ts.map +1 -0
- package/dist/types/types/multicall.d.ts +48 -0
- package/dist/types/types/multicall.d.ts.map +1 -0
- package/dist/types/types/rpc.d.ts +20 -0
- package/dist/types/types/rpc.d.ts.map +1 -0
- package/dist/types/types/transaction.d.ts +147 -0
- package/dist/types/types/transaction.d.ts.map +1 -0
- package/dist/types/types/transport.d.ts +3 -0
- package/dist/types/types/transport.d.ts.map +1 -0
- package/dist/types/types/typedData.d.ts +47 -0
- package/dist/types/types/typedData.d.ts.map +1 -0
- package/dist/types/types/utils.d.ts +188 -0
- package/dist/types/types/utils.d.ts.map +1 -0
- package/dist/types/types/window.d.ts +7 -0
- package/dist/types/types/window.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeAbiParameters.d.ts +5 -0
- package/dist/types/utils/abi/decodeAbiParameters.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeDeployData.d.ts +13 -0
- package/dist/types/utils/abi/decodeDeployData.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeErrorResult.d.ts +16 -0
- package/dist/types/utils/abi/decodeErrorResult.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeEventLog.d.ts +20 -0
- package/dist/types/utils/abi/decodeEventLog.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeFunctionData.d.ts +15 -0
- package/dist/types/utils/abi/decodeFunctionData.d.ts.map +1 -0
- package/dist/types/utils/abi/decodeFunctionResult.d.ts +14 -0
- package/dist/types/utils/abi/decodeFunctionResult.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeAbiParameters.d.ts +9 -0
- package/dist/types/utils/abi/encodeAbiParameters.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeDeployData.d.ts +9 -0
- package/dist/types/utils/abi/encodeDeployData.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeErrorResult.d.ts +11 -0
- package/dist/types/utils/abi/encodeErrorResult.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeEventTopics.d.ts +13 -0
- package/dist/types/utils/abi/encodeEventTopics.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeFunctionData.d.ts +11 -0
- package/dist/types/utils/abi/encodeFunctionData.d.ts.map +1 -0
- package/dist/types/utils/abi/encodeFunctionResult.d.ts +13 -0
- package/dist/types/utils/abi/encodeFunctionResult.d.ts.map +1 -0
- package/dist/types/utils/abi/encodePacked.d.ts +11 -0
- package/dist/types/utils/abi/encodePacked.d.ts.map +1 -0
- package/dist/types/utils/abi/formatAbiItem.d.ts +9 -0
- package/dist/types/utils/abi/formatAbiItem.d.ts.map +1 -0
- package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts +8 -0
- package/dist/types/utils/abi/formatAbiItemWithArgs.d.ts.map +1 -0
- package/dist/types/utils/abi/getAbiItem.d.ts +12 -0
- package/dist/types/utils/abi/getAbiItem.d.ts.map +1 -0
- package/dist/types/utils/accounts.d.ts +3 -0
- package/dist/types/utils/accounts.d.ts.map +1 -0
- package/dist/types/utils/address/getAddress.d.ts +4 -0
- package/dist/types/utils/address/getAddress.d.ts.map +1 -0
- package/dist/types/utils/address/getContractAddress.d.ts +20 -0
- package/dist/types/utils/address/getContractAddress.d.ts.map +1 -0
- package/dist/types/utils/address/isAddress.d.ts +3 -0
- package/dist/types/utils/address/isAddress.d.ts.map +1 -0
- package/dist/types/utils/address/isAddressEqual.d.ts +3 -0
- package/dist/types/utils/address/isAddressEqual.d.ts.map +1 -0
- package/dist/types/utils/buildRequest.d.ts +6 -0
- package/dist/types/utils/buildRequest.d.ts.map +1 -0
- package/dist/types/utils/ccip.d.ts +37 -0
- package/dist/types/utils/ccip.d.ts.map +1 -0
- package/dist/types/utils/chain.d.ts +14 -0
- package/dist/types/utils/chain.d.ts.map +1 -0
- package/dist/types/utils/contract/extractFunctionParts.d.ts +13 -0
- package/dist/types/utils/contract/extractFunctionParts.d.ts.map +1 -0
- package/dist/types/utils/data/concat.d.ts +6 -0
- package/dist/types/utils/data/concat.d.ts.map +1 -0
- package/dist/types/utils/data/isBytes.d.ts +3 -0
- package/dist/types/utils/data/isBytes.d.ts.map +1 -0
- package/dist/types/utils/data/isBytesEqual.d.ts +3 -0
- package/dist/types/utils/data/isBytesEqual.d.ts.map +1 -0
- package/dist/types/utils/data/isHex.d.ts +5 -0
- package/dist/types/utils/data/isHex.d.ts.map +1 -0
- package/dist/types/utils/data/pad.d.ts +11 -0
- package/dist/types/utils/data/pad.d.ts.map +1 -0
- package/dist/types/utils/data/size.d.ts +9 -0
- package/dist/types/utils/data/size.d.ts.map +1 -0
- package/dist/types/utils/data/slice.d.ts +33 -0
- package/dist/types/utils/data/slice.d.ts.map +1 -0
- package/dist/types/utils/data/trim.d.ts +8 -0
- package/dist/types/utils/data/trim.d.ts.map +1 -0
- package/dist/types/utils/encoding/fromBytes.d.ts +109 -0
- package/dist/types/utils/encoding/fromBytes.d.ts.map +1 -0
- package/dist/types/utils/encoding/fromHex.d.ts +138 -0
- package/dist/types/utils/encoding/fromHex.d.ts.map +1 -0
- package/dist/types/utils/encoding/fromRlp.d.ts +6 -0
- package/dist/types/utils/encoding/fromRlp.d.ts.map +1 -0
- package/dist/types/utils/encoding/toBytes.d.ts +125 -0
- package/dist/types/utils/encoding/toBytes.d.ts.map +1 -0
- package/dist/types/utils/encoding/toHex.d.ts +139 -0
- package/dist/types/utils/encoding/toHex.d.ts.map +1 -0
- package/dist/types/utils/encoding/toRlp.d.ts +8 -0
- package/dist/types/utils/encoding/toRlp.d.ts.map +1 -0
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts +9 -0
- package/dist/types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -0
- package/dist/types/utils/ens/avatar/utils.d.ts +37 -0
- package/dist/types/utils/ens/avatar/utils.d.ts.map +1 -0
- package/dist/types/utils/ens/encodeLabelhash.d.ts +3 -0
- package/dist/types/utils/ens/encodeLabelhash.d.ts.map +1 -0
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts +3 -0
- package/dist/types/utils/ens/encodedLabelToLabelhash.d.ts.map +1 -0
- package/dist/types/utils/ens/errors.d.ts +2 -0
- package/dist/types/utils/ens/errors.d.ts.map +1 -0
- package/dist/types/utils/ens/labelhash.d.ts +11 -0
- package/dist/types/utils/ens/labelhash.d.ts.map +1 -0
- package/dist/types/utils/ens/namehash.d.ts +13 -0
- package/dist/types/utils/ens/namehash.d.ts.map +1 -0
- package/dist/types/utils/ens/normalize.d.ts +12 -0
- package/dist/types/utils/ens/normalize.d.ts.map +1 -0
- package/dist/types/utils/ens/packetToBytes.d.ts +3 -0
- package/dist/types/utils/ens/packetToBytes.d.ts.map +1 -0
- package/dist/types/utils/errors/getCallError.d.ts +9 -0
- package/dist/types/utils/errors/getCallError.d.ts.map +1 -0
- package/dist/types/utils/errors/getContractError.d.ts +12 -0
- package/dist/types/utils/errors/getContractError.d.ts.map +1 -0
- package/dist/types/utils/errors/getEstimateGasError.d.ts +11 -0
- package/dist/types/utils/errors/getEstimateGasError.d.ts.map +1 -0
- package/dist/types/utils/errors/getNodeError.d.ts +7 -0
- package/dist/types/utils/errors/getNodeError.d.ts.map +1 -0
- package/dist/types/utils/errors/getTransactionError.d.ts +12 -0
- package/dist/types/utils/errors/getTransactionError.d.ts.map +1 -0
- package/dist/types/utils/filters/createFilterRequestScope.d.ts +22 -0
- package/dist/types/utils/filters/createFilterRequestScope.d.ts.map +1 -0
- package/dist/types/utils/formatters/block.d.ts +28 -0
- package/dist/types/utils/formatters/block.d.ts.map +1 -0
- package/dist/types/utils/formatters/extract.d.ts +8 -0
- package/dist/types/utils/formatters/extract.d.ts.map +1 -0
- package/dist/types/utils/formatters/feeHistory.d.ts +4 -0
- package/dist/types/utils/formatters/feeHistory.d.ts.map +1 -0
- package/dist/types/utils/formatters/formatter.d.ts +10 -0
- package/dist/types/utils/formatters/formatter.d.ts.map +1 -0
- package/dist/types/utils/formatters/log.d.ts +7 -0
- package/dist/types/utils/formatters/log.d.ts.map +1 -0
- package/dist/types/utils/formatters/transaction.d.ts +30 -0
- package/dist/types/utils/formatters/transaction.d.ts.map +1 -0
- package/dist/types/utils/formatters/transactionReceipt.d.ts +14 -0
- package/dist/types/utils/formatters/transactionReceipt.d.ts.map +1 -0
- package/dist/types/utils/formatters/transactionRequest.d.ts +14 -0
- package/dist/types/utils/formatters/transactionRequest.d.ts.map +1 -0
- package/dist/types/utils/hash/getEventSelector.d.ts +4 -0
- package/dist/types/utils/hash/getEventSelector.d.ts.map +1 -0
- package/dist/types/utils/hash/getFunctionSelector.d.ts +3 -0
- package/dist/types/utils/hash/getFunctionSelector.d.ts.map +1 -0
- package/dist/types/utils/hash/hashFunction.d.ts +4 -0
- package/dist/types/utils/hash/hashFunction.d.ts.map +1 -0
- package/dist/types/utils/hash/isHash.d.ts +3 -0
- package/dist/types/utils/hash/isHash.d.ts.map +1 -0
- package/dist/types/utils/hash/keccak256.d.ts +6 -0
- package/dist/types/utils/hash/keccak256.d.ts.map +1 -0
- package/dist/types/utils/index.d.ts +82 -0
- package/dist/types/utils/index.d.ts.map +1 -0
- package/dist/types/utils/observe.d.ts +17 -0
- package/dist/types/utils/observe.d.ts.map +1 -0
- package/dist/types/utils/poll.d.ts +13 -0
- package/dist/types/utils/poll.d.ts.map +1 -0
- package/dist/types/utils/promise/createBatchScheduler.d.ts +17 -0
- package/dist/types/utils/promise/createBatchScheduler.d.ts.map +1 -0
- package/dist/types/utils/promise/withCache.d.ts +36 -0
- package/dist/types/utils/promise/withCache.d.ts.map +1 -0
- package/dist/types/utils/promise/withRetry.d.ts +12 -0
- package/dist/types/utils/promise/withRetry.d.ts.map +1 -0
- package/dist/types/utils/promise/withTimeout.d.ts +8 -0
- package/dist/types/utils/promise/withTimeout.d.ts.map +1 -0
- package/dist/types/utils/regex.d.ts +4 -0
- package/dist/types/utils/regex.d.ts.map +1 -0
- package/dist/types/utils/rpc.d.ts +72 -0
- package/dist/types/utils/rpc.d.ts.map +1 -0
- package/dist/types/utils/signature/hashMessage.d.ts +6 -0
- package/dist/types/utils/signature/hashMessage.d.ts.map +1 -0
- package/dist/types/utils/signature/hashTypedData.d.ts +11 -0
- package/dist/types/utils/signature/hashTypedData.d.ts.map +1 -0
- package/dist/types/utils/signature/hexToSignature.d.ts +13 -0
- package/dist/types/utils/signature/hexToSignature.d.ts.map +1 -0
- package/dist/types/utils/signature/recoverAddress.d.ts +9 -0
- package/dist/types/utils/signature/recoverAddress.d.ts.map +1 -0
- package/dist/types/utils/signature/recoverMessageAddress.d.ts +9 -0
- package/dist/types/utils/signature/recoverMessageAddress.d.ts.map +1 -0
- package/dist/types/utils/signature/recoverPublicKey.d.ts +8 -0
- package/dist/types/utils/signature/recoverPublicKey.d.ts.map +1 -0
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +13 -0
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +1 -0
- package/dist/types/utils/signature/signatureToHex.d.ts +17 -0
- package/dist/types/utils/signature/signatureToHex.d.ts.map +1 -0
- package/dist/types/utils/signature/verifyMessage.d.ts +25 -0
- package/dist/types/utils/signature/verifyMessage.d.ts.map +1 -0
- package/dist/types/utils/signature/verifyTypedData.d.ts +28 -0
- package/dist/types/utils/signature/verifyTypedData.d.ts.map +1 -0
- package/dist/types/utils/stringify.d.ts +2 -0
- package/dist/types/utils/stringify.d.ts.map +1 -0
- package/dist/types/utils/transaction/assertRequest.d.ts +5 -0
- package/dist/types/utils/transaction/assertRequest.d.ts.map +1 -0
- package/dist/types/utils/transaction/assertTransaction.d.ts +5 -0
- package/dist/types/utils/transaction/assertTransaction.d.ts.map +1 -0
- package/dist/types/utils/transaction/getSerializedTransactionType.d.ts +4 -0
- package/dist/types/utils/transaction/getSerializedTransactionType.d.ts.map +1 -0
- package/dist/types/utils/transaction/getTransactionType.d.ts +4 -0
- package/dist/types/utils/transaction/getTransactionType.d.ts.map +1 -0
- package/dist/types/utils/transaction/parseTransaction.d.ts +9 -0
- package/dist/types/utils/transaction/parseTransaction.d.ts.map +1 -0
- package/dist/types/utils/transaction/prepareRequest.d.ts +20 -0
- package/dist/types/utils/transaction/prepareRequest.d.ts.map +1 -0
- package/dist/types/utils/transaction/serializeAccessList.d.ts +5 -0
- package/dist/types/utils/transaction/serializeAccessList.d.ts.map +1 -0
- package/dist/types/utils/transaction/serializeTransaction.d.ts +7 -0
- package/dist/types/utils/transaction/serializeTransaction.d.ts.map +1 -0
- package/dist/types/utils/typedData.d.ts +6 -0
- package/dist/types/utils/typedData.d.ts.map +1 -0
- package/dist/types/utils/uid.d.ts +2 -0
- package/dist/types/utils/uid.d.ts.map +1 -0
- package/dist/types/utils/unit/formatEther.d.ts +2 -0
- package/dist/types/utils/unit/formatEther.d.ts.map +1 -0
- package/dist/types/utils/unit/formatGwei.d.ts +2 -0
- package/dist/types/utils/unit/formatGwei.d.ts.map +1 -0
- package/dist/types/utils/unit/formatUnits.d.ts +2 -0
- package/dist/types/utils/unit/formatUnits.d.ts.map +1 -0
- package/dist/types/utils/unit/parseEther.d.ts +2 -0
- package/dist/types/utils/unit/parseEther.d.ts.map +1 -0
- package/dist/types/utils/unit/parseGwei.d.ts +2 -0
- package/dist/types/utils/unit/parseGwei.d.ts.map +1 -0
- package/dist/types/utils/unit/parseUnits.d.ts +2 -0
- package/dist/types/utils/unit/parseUnits.d.ts.map +1 -0
- package/dist/types/utils/wait.d.ts +2 -0
- package/dist/types/utils/wait.d.ts.map +1 -0
- package/dist/types/wallet.d.ts +11 -0
- package/dist/types/wallet.d.ts.map +1 -0
- package/dist/types/window.d.ts +2 -0
- package/dist/types/window.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/errors/version.ts +1 -1
@@ -0,0 +1,76 @@
|
|
1
|
+
import type { AbiEvent, Address } from 'abitype';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockNumber, BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { MaybeAbiEventName, MaybeExtractEventArgsFromAbi } from '../../types/contract.js';
|
7
|
+
import type { Filter } from '../../types/filter.js';
|
8
|
+
import type { Prettify } from '../../types/utils.js';
|
9
|
+
export type CreateEventFilterParameters<TAbiEvent extends AbiEvent | undefined = undefined, TAbiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined, _EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, _Args extends MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName> | undefined = undefined> = {
|
10
|
+
address?: Address | Address[];
|
11
|
+
fromBlock?: TFromBlock | BlockNumber | BlockTag;
|
12
|
+
toBlock?: TToBlock | BlockNumber | BlockTag;
|
13
|
+
} & (MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName> extends infer TEventFilterArgs ? {
|
14
|
+
args: TEventFilterArgs | (_Args extends TEventFilterArgs ? _Args : never);
|
15
|
+
event: TAbiEvent;
|
16
|
+
events?: never;
|
17
|
+
/**
|
18
|
+
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
19
|
+
* @default false
|
20
|
+
*/
|
21
|
+
strict?: TStrict;
|
22
|
+
} | {
|
23
|
+
args?: never;
|
24
|
+
event?: TAbiEvent;
|
25
|
+
events?: never;
|
26
|
+
/**
|
27
|
+
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
28
|
+
* @default false
|
29
|
+
*/
|
30
|
+
strict?: TStrict;
|
31
|
+
} | {
|
32
|
+
args?: never;
|
33
|
+
event?: never;
|
34
|
+
events: TAbiEvents;
|
35
|
+
/**
|
36
|
+
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
37
|
+
* @default false
|
38
|
+
*/
|
39
|
+
strict?: TStrict;
|
40
|
+
} | {
|
41
|
+
args?: never;
|
42
|
+
event?: never;
|
43
|
+
events?: never;
|
44
|
+
strict?: never;
|
45
|
+
} : {
|
46
|
+
args?: never;
|
47
|
+
event?: never;
|
48
|
+
events?: never;
|
49
|
+
strict?: never;
|
50
|
+
});
|
51
|
+
export type CreateEventFilterReturnType<TAbiEvent extends AbiEvent | undefined = undefined, TAbiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber | BlockTag | undefined = undefined, TToBlock extends BlockNumber | BlockTag | undefined = undefined, _EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, _Args extends MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName> | undefined = undefined> = Prettify<Filter<'event', TAbiEvents, _EventName, _Args, TStrict, TFromBlock, TToBlock>>;
|
52
|
+
/**
|
53
|
+
* Creates a [`Filter`](https://viem.sh/docs/glossary/types.html#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
54
|
+
*
|
55
|
+
* - Docs: https://viem.sh/docs/actions/public/createEventFilter.html
|
56
|
+
* - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
|
57
|
+
*
|
58
|
+
* @param client - Client to use
|
59
|
+
* @param parameters - {@link CreateEventFilterParameters}
|
60
|
+
* @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateEventFilterReturnType}
|
61
|
+
*
|
62
|
+
* @example
|
63
|
+
* import { createPublicClient, http } from 'viem'
|
64
|
+
* import { mainnet } from 'viem/chains'
|
65
|
+
* import { createEventFilter } from 'viem/public'
|
66
|
+
*
|
67
|
+
* const client = createPublicClient({
|
68
|
+
* chain: mainnet,
|
69
|
+
* transport: http(),
|
70
|
+
* })
|
71
|
+
* const filter = await createEventFilter(client, {
|
72
|
+
* address: '0xfba3912ca04dd458c843e2ee08967fc04f3579c2',
|
73
|
+
* })
|
74
|
+
*/
|
75
|
+
export declare function createEventFilter<TChain extends Chain | undefined, const TAbiEvent extends AbiEvent | undefined = undefined, const TAbiEvents extends readonly AbiEvent[] | readonly unknown[] | undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined, TStrict extends boolean | undefined = undefined, TFromBlock extends BlockNumber<bigint> | BlockTag | undefined = undefined, TToBlock extends BlockNumber<bigint> | BlockTag | undefined = undefined, _EventName extends string | undefined = MaybeAbiEventName<TAbiEvent>, _Args extends MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName> | undefined = undefined>(client: Client<Transport, TChain>, { address, args, event, events: events_, fromBlock, strict, toBlock, }?: CreateEventFilterParameters<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock, _EventName, _Args>): Promise<CreateEventFilterReturnType<TAbiEvent, TAbiEvents, TStrict, TFromBlock, TToBlock, _EventName, _Args>>;
|
76
|
+
//# sourceMappingURL=createEventFilter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createEventFilter.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/createEventFilter.ts"],"names":[],"mappings":"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"}
|
@@ -0,0 +1,28 @@
|
|
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 CreatePendingTransactionFilterReturnType = Filter<'transaction'>;
|
6
|
+
/**
|
7
|
+
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges.html).
|
8
|
+
*
|
9
|
+
* - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter.html
|
10
|
+
* - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
|
11
|
+
*
|
12
|
+
* @param client - Client to use
|
13
|
+
* @returns [`Filter`](https://viem.sh/docs/glossary/types.html#filter). {@link CreateBlockFilterReturnType}
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* import { createPublicClient, http } from 'viem'
|
17
|
+
* import { mainnet } from 'viem/chains'
|
18
|
+
* import { createPendingTransactionFilter } from 'viem/public'
|
19
|
+
*
|
20
|
+
* const client = createPublicClient({
|
21
|
+
* chain: mainnet,
|
22
|
+
* transport: http(),
|
23
|
+
* })
|
24
|
+
* const filter = await createPendingTransactionFilter(client)
|
25
|
+
* // { id: "0x345a6572337856574a76364e457a4366", type: 'transaction' }
|
26
|
+
*/
|
27
|
+
export declare function createPendingTransactionFilter<TTransport extends Transport, TChain extends Chain | undefined>(client: Client<TTransport, TChain>): Promise<CreatePendingTransactionFilterReturnType>;
|
28
|
+
//# sourceMappingURL=createPendingTransactionFilter.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"createPendingTransactionFilter.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/createPendingTransactionFilter.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;AAGnD,MAAM,MAAM,wCAAwC,GAAG,MAAM,CAAC,aAAa,CAAC,CAAA;AAE5E;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,8BAA8B,CAClD,UAAU,SAAS,SAAS,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,MAAM,EAAE,MAAM,CAAC,UAAU,EAAE,MAAM,CAAC,GACjC,OAAO,CAAC,wCAAwC,CAAC,CAQnD"}
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import type { Abi } from 'abitype';
|
2
|
+
import type { Account } from '../../accounts/types.js';
|
3
|
+
import type { Client } from '../../clients/createClient.js';
|
4
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { ContractFunctionConfig, GetValue } from '../../types/contract.js';
|
7
|
+
import type { UnionOmit } from '../../types/utils.js';
|
8
|
+
import { type EstimateGasParameters } from './estimateGas.js';
|
9
|
+
export type EstimateContractGasParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = undefined> = ContractFunctionConfig<TAbi, TFunctionName, 'payable' | 'nonpayable'> & UnionOmit<EstimateGasParameters<TChain, TAccount>, 'data' | 'to' | 'value'> & GetValue<TAbi, TFunctionName, EstimateGasParameters<TChain> extends EstimateGasParameters ? EstimateGasParameters<TChain>['value'] : EstimateGasParameters['value']>;
|
10
|
+
export type EstimateContractGasReturnType = bigint;
|
11
|
+
/**
|
12
|
+
* Estimates the gas required to successfully execute a contract write function call.
|
13
|
+
*
|
14
|
+
* - Docs: https://viem.sh/docs/contract/estimateContractGas.html
|
15
|
+
*
|
16
|
+
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public.html) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas.html) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData.html).
|
17
|
+
*
|
18
|
+
* @param client - Client to use
|
19
|
+
* @param parameters - {@link EstimateContractGasParameters}
|
20
|
+
* @returns The gas estimate (in wei). {@link EstimateContractGasReturnType}
|
21
|
+
*
|
22
|
+
* @example
|
23
|
+
* import { createPublicClient, http, parseAbi } from 'viem'
|
24
|
+
* import { mainnet } from 'viem/chains'
|
25
|
+
* import { estimateContractGas } from 'viem/contract'
|
26
|
+
*
|
27
|
+
* const client = createPublicClient({
|
28
|
+
* chain: mainnet,
|
29
|
+
* transport: http(),
|
30
|
+
* })
|
31
|
+
* const gas = await estimateContractGas(client, {
|
32
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
33
|
+
* abi: parseAbi(['function mint() public']),
|
34
|
+
* functionName: 'mint',
|
35
|
+
* account: '0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266',
|
36
|
+
* })
|
37
|
+
*/
|
38
|
+
export declare function estimateContractGas<const TAbi extends Abi | readonly unknown[], TFunctionName extends string, TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>, { abi, address, args, functionName, ...request }: EstimateContractGasParameters<TAbi, TFunctionName, TChain, TAccount>): Promise<EstimateContractGasReturnType>;
|
39
|
+
//# sourceMappingURL=estimateContractGas.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"estimateContractGas.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/estimateContractGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAElC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,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,sBAAsB,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAC/E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAMrD,OAAO,EAAE,KAAK,qBAAqB,EAAe,MAAM,kBAAkB,CAAA;AAE1E,MAAM,MAAM,6BAA6B,CACvC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,MAAM,EACrC,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,IAC9C,sBAAsB,CAAC,IAAI,EAAE,aAAa,EAAE,SAAS,GAAG,YAAY,CAAC,GACvE,SAAS,CAAC,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,GAC3E,QAAQ,CACN,IAAI,EACJ,aAAa,EACb,qBAAqB,CAAC,MAAM,CAAC,SAAS,qBAAqB,GACvD,qBAAqB,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC,GACtC,qBAAqB,CAAC,OAAO,CAAC,CACnC,CAAA;AAEH,MAAM,MAAM,6BAA6B,GAAG,MAAM,CAAA;AAElD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAsB,mBAAmB,CACvC,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,aAAa,SAAS,MAAM,EAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,EACE,GAAG,EACH,OAAO,EACP,IAAI,EACJ,YAAY,EACZ,GAAG,OAAO,EACX,EAAE,6BAA6B,CAAC,IAAI,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,GACtE,OAAO,CAAC,6BAA6B,CAAC,CAwBxC"}
|
@@ -0,0 +1,49 @@
|
|
1
|
+
import type { Account } from '../../accounts/types.js';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { GetAccountParameter } from '../../types/account.js';
|
5
|
+
import type { BlockTag } from '../../types/block.js';
|
6
|
+
import type { Chain } from '../../types/chain.js';
|
7
|
+
import type { UnionOmit } from '../../types/utils.js';
|
8
|
+
import { type FormattedTransactionRequest } from '../../utils/formatters/transactionRequest.js';
|
9
|
+
export type FormattedEstimateGas<TChain extends Chain | undefined = Chain | undefined> = FormattedTransactionRequest<TChain>;
|
10
|
+
export type EstimateGasParameters<TChain extends Chain | undefined = Chain | undefined, TAccount extends Account | undefined = undefined> = UnionOmit<FormattedEstimateGas<TChain>, 'from'> & GetAccountParameter<TAccount> & ({
|
11
|
+
/** The balance of the account at a block number. */
|
12
|
+
blockNumber?: bigint;
|
13
|
+
blockTag?: never;
|
14
|
+
} | {
|
15
|
+
blockNumber?: never;
|
16
|
+
/**
|
17
|
+
* The balance of the account at a block tag.
|
18
|
+
* @default 'latest'
|
19
|
+
*/
|
20
|
+
blockTag?: BlockTag;
|
21
|
+
});
|
22
|
+
export type EstimateGasReturnType = bigint;
|
23
|
+
/**
|
24
|
+
* Estimates the gas necessary to complete a transaction without submitting it to the network.
|
25
|
+
*
|
26
|
+
* - Docs: https://viem.sh/docs/actions/public/estimateGas.html
|
27
|
+
* - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
|
28
|
+
*
|
29
|
+
* @param client - Client to use
|
30
|
+
* @param parameters - {@link EstimateGasParameters}
|
31
|
+
* @returns The gas estimate (in wei). {@link EstimateGasReturnType}
|
32
|
+
*
|
33
|
+
* @example
|
34
|
+
* import { createPublicClient, http, parseEther } from 'viem'
|
35
|
+
* import { mainnet } from 'viem/chains'
|
36
|
+
* import { estimateGas } from 'viem/public'
|
37
|
+
*
|
38
|
+
* const client = createPublicClient({
|
39
|
+
* chain: mainnet,
|
40
|
+
* transport: http(),
|
41
|
+
* })
|
42
|
+
* const gasEstimate = await estimateGas(client, {
|
43
|
+
* account: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
44
|
+
* to: '0x70997970c51812dc3a010c7d01b50e0d17dc79c8',
|
45
|
+
* value: parseEther('1'),
|
46
|
+
* })
|
47
|
+
*/
|
48
|
+
export declare function estimateGas<TChain extends Chain | undefined, TAccount extends Account | undefined = undefined>(client: Client<Transport, TChain, TAccount>, args: EstimateGasParameters<TChain, TAccount>): Promise<EstimateGasReturnType>;
|
49
|
+
//# sourceMappingURL=estimateGas.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"estimateGas.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/estimateGas.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAG5E,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAA;AACjE,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,sBAAsB,CAAA;AAIrD,OAAO,EACL,KAAK,2BAA2B,EAEjC,MAAM,8CAA8C,CAAA;AAUrD,MAAM,MAAM,oBAAoB,CAC9B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,IAClD,2BAA2B,CAAC,MAAM,CAAC,CAAA;AAEvC,MAAM,MAAM,qBAAqB,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,IAC9C,SAAS,CAAC,oBAAoB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,GACjD,mBAAmB,CAAC,QAAQ,CAAC,GAC7B,CACI;IACE,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CACJ,CAAA;AAEH,MAAM,MAAM,qBAAqB,GAAG,MAAM,CAAA;AAE1C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAsB,WAAW,CAC/B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,GAAG,SAAS,EAEhD,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,IAAI,EAAE,qBAAqB,CAAC,MAAM,EAAE,QAAQ,CAAC,GAC5C,OAAO,CAAC,qBAAqB,CAAC,CAiEhC"}
|
@@ -0,0 +1,55 @@
|
|
1
|
+
import type { Address } from 'abitype';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
export type GetBalanceParameters = {
|
7
|
+
/** The address of the account. */
|
8
|
+
address: Address;
|
9
|
+
} & ({
|
10
|
+
/** The balance of the account at a block number. */
|
11
|
+
blockNumber?: bigint;
|
12
|
+
blockTag?: never;
|
13
|
+
} | {
|
14
|
+
blockNumber?: never;
|
15
|
+
/** The balance of the account at a block tag. */
|
16
|
+
blockTag?: BlockTag;
|
17
|
+
});
|
18
|
+
export type GetBalanceReturnType = bigint;
|
19
|
+
/**
|
20
|
+
* Returns the balance of an address in wei.
|
21
|
+
*
|
22
|
+
* - Docs: https://viem.sh/docs/actions/public/getBalance.html
|
23
|
+
* - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)
|
24
|
+
*
|
25
|
+
* You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther.html).
|
26
|
+
*
|
27
|
+
* ```ts
|
28
|
+
* const balance = await getBalance(client, {
|
29
|
+
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
30
|
+
* blockTag: 'safe'
|
31
|
+
* })
|
32
|
+
* const balanceAsEther = formatEther(balance)
|
33
|
+
* // "6.942"
|
34
|
+
* ```
|
35
|
+
*
|
36
|
+
* @param client - Client to use
|
37
|
+
* @param parameters - {@link GetBalanceParameters}
|
38
|
+
* @returns The balance of the address in wei. {@link GetBalanceReturnType}
|
39
|
+
*
|
40
|
+
* @example
|
41
|
+
* import { createPublicClient, http } from 'viem'
|
42
|
+
* import { mainnet } from 'viem/chains'
|
43
|
+
* import { getBalance } from 'viem/public'
|
44
|
+
*
|
45
|
+
* const client = createPublicClient({
|
46
|
+
* chain: mainnet,
|
47
|
+
* transport: http(),
|
48
|
+
* })
|
49
|
+
* const balance = await getBalance(client, {
|
50
|
+
* address: '0xA0Cf798816D4b9b9866b5330EEa46a18382f251e',
|
51
|
+
* })
|
52
|
+
* // 10000000000000000000000n (wei)
|
53
|
+
*/
|
54
|
+
export declare function getBalance<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { address, blockNumber, blockTag }: GetBalanceParameters): Promise<GetBalanceReturnType>;
|
55
|
+
//# sourceMappingURL=getBalance.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBalance.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBalance.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,oBAAoB,GAAG;IACjC,kCAAkC;IAClC,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,CACA;IACE,oDAAoD;IACpD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,iDAAiD;IACjD,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CACJ,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH,wBAAsB,UAAU,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAC/D,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAmB,EAAE,EAAE,oBAAoB,GAClE,OAAO,CAAC,oBAAoB,CAAC,CAQ/B"}
|
@@ -0,0 +1,56 @@
|
|
1
|
+
import type { Account } from '../../accounts/types.js';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { Hash } from '../../types/misc.js';
|
7
|
+
import { type FormattedBlock } from '../../utils/formatters/block.js';
|
8
|
+
export type GetBlockParameters<TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'> = {
|
9
|
+
/** Whether or not to include transaction data in the response. */
|
10
|
+
includeTransactions?: TIncludeTransactions;
|
11
|
+
} & ({
|
12
|
+
/** Hash of the block. */
|
13
|
+
blockHash?: Hash;
|
14
|
+
blockNumber?: never;
|
15
|
+
blockTag?: never;
|
16
|
+
} | {
|
17
|
+
blockHash?: never;
|
18
|
+
/** The block number. */
|
19
|
+
blockNumber?: bigint;
|
20
|
+
blockTag?: never;
|
21
|
+
} | {
|
22
|
+
blockHash?: never;
|
23
|
+
blockNumber?: never;
|
24
|
+
/**
|
25
|
+
* The block tag.
|
26
|
+
* @default 'latest'
|
27
|
+
*/
|
28
|
+
blockTag?: TBlockTag | BlockTag;
|
29
|
+
});
|
30
|
+
export type GetBlockReturnType<TChain extends Chain | undefined = Chain | undefined, TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'> = FormattedBlock<TChain, TIncludeTransactions, TBlockTag>;
|
31
|
+
/**
|
32
|
+
* Returns information about a block at a block number, hash, or tag.
|
33
|
+
*
|
34
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlock.html
|
35
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
|
36
|
+
* - JSON-RPC Methods:
|
37
|
+
* - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.
|
38
|
+
* - Calls [`eth_getBlockByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbyhash) for `blockHash`.
|
39
|
+
*
|
40
|
+
* @param client - Client to use
|
41
|
+
* @param parameters - {@link GetBlockParameters}
|
42
|
+
* @returns Information about the block. {@link GetBlockReturnType}
|
43
|
+
*
|
44
|
+
* @example
|
45
|
+
* import { createPublicClient, http } from 'viem'
|
46
|
+
* import { mainnet } from 'viem/chains'
|
47
|
+
* import { getBlock } from 'viem/public'
|
48
|
+
*
|
49
|
+
* const client = createPublicClient({
|
50
|
+
* chain: mainnet,
|
51
|
+
* transport: http(),
|
52
|
+
* })
|
53
|
+
* const block = await getBlock(client)
|
54
|
+
*/
|
55
|
+
export declare function getBlock<TChain extends Chain | undefined, TAccount extends Account | undefined, TIncludeTransactions extends boolean = false, TBlockTag extends BlockTag = 'latest'>(client: Client<Transport, TChain, TAccount>, { blockHash, blockNumber, blockTag: blockTag_, includeTransactions: includeTransactions_, }?: GetBlockParameters<TIncludeTransactions, TBlockTag>): Promise<GetBlockReturnType<TChain, TIncludeTransactions, TBlockTag>>;
|
56
|
+
//# sourceMappingURL=getBlock.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBlock.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBlock.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAE5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAG/C,OAAO,EACL,KAAK,cAAc,EAEpB,MAAM,iCAAiC,CAAA;AAExC,MAAM,MAAM,kBAAkB,CAC5B,oBAAoB,SAAS,OAAO,GAAG,KAAK,EAC5C,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACnC;IACF,kEAAkE;IAClE,mBAAmB,CAAC,EAAE,oBAAoB,CAAA;CAC3C,GAAG,CACA;IACE,yBAAyB;IACzB,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,QAAQ,CAAA;CAChC,CACJ,CAAA;AAED,MAAM,MAAM,kBAAkB,CAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,EACpD,oBAAoB,SAAS,OAAO,GAAG,KAAK,EAC5C,SAAS,SAAS,QAAQ,GAAG,QAAQ,IACnC,cAAc,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,CAAC,CAAA;AAE3D;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,QAAQ,CAC5B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,oBAAoB,SAAS,OAAO,GAAG,KAAK,EAC5C,SAAS,SAAS,QAAQ,GAAG,QAAQ,EAErC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,EAC3C,EACE,SAAS,EACT,WAAW,EACX,QAAQ,EAAE,SAAS,EACnB,mBAAmB,EAAE,oBAAoB,GAC1C,GAAE,kBAAkB,CAAC,oBAAoB,EAAE,SAAS,CAAM,GAC1D,OAAO,CAAC,kBAAkB,CAAC,MAAM,EAAE,oBAAoB,EAAE,SAAS,CAAC,CAAC,CAwBtE"}
|
@@ -0,0 +1,57 @@
|
|
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
|
+
export type GetBlockNumberParameters = {
|
5
|
+
/** Time (in ms) that cached block number will remain in memory. */
|
6
|
+
cacheTime?: number;
|
7
|
+
/** @deprecated use `cacheTime` instead. */
|
8
|
+
maxAge?: number;
|
9
|
+
};
|
10
|
+
export type GetBlockNumberReturnType = bigint;
|
11
|
+
export declare function getBlockNumberCache(id: string): {
|
12
|
+
clear: () => void;
|
13
|
+
promise: {
|
14
|
+
clear: () => boolean;
|
15
|
+
get: () => Promise<unknown> | undefined;
|
16
|
+
set: (data: Promise<unknown>) => Map<string, Promise<unknown>>;
|
17
|
+
};
|
18
|
+
response: {
|
19
|
+
clear: () => boolean;
|
20
|
+
get: () => {
|
21
|
+
created: Date;
|
22
|
+
data: unknown;
|
23
|
+
} | undefined;
|
24
|
+
set: (data: {
|
25
|
+
created: Date;
|
26
|
+
data: unknown;
|
27
|
+
}) => Map<string, {
|
28
|
+
created: Date;
|
29
|
+
data: unknown;
|
30
|
+
}>;
|
31
|
+
};
|
32
|
+
};
|
33
|
+
/**
|
34
|
+
* Returns the number of the most recent block seen.
|
35
|
+
*
|
36
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlockNumber.html
|
37
|
+
* - Examples: https://stackblitz.com/github/wagmi-dev/viem/tree/main/examples/blocks/fetching-blocks
|
38
|
+
* - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)
|
39
|
+
*
|
40
|
+
* @param client - Client to use
|
41
|
+
* @param parameters - {@link GetBlockNumberParameters}
|
42
|
+
* @returns The number of the block. {@link GetBlockNumberReturnType}
|
43
|
+
*
|
44
|
+
* @example
|
45
|
+
* import { createPublicClient, http } from 'viem'
|
46
|
+
* import { mainnet } from 'viem/chains'
|
47
|
+
* import { getBlockNumber } from 'viem/public'
|
48
|
+
*
|
49
|
+
* const client = createPublicClient({
|
50
|
+
* chain: mainnet,
|
51
|
+
* transport: http(),
|
52
|
+
* })
|
53
|
+
* const blockNumber = await getBlockNumber(client)
|
54
|
+
* // 69420n
|
55
|
+
*/
|
56
|
+
export declare function getBlockNumber<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { cacheTime, maxAge }?: GetBlockNumberParameters): Promise<GetBlockNumberReturnType>;
|
57
|
+
//# sourceMappingURL=getBlockNumber.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBlockNumber.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBlockNumber.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,wBAAwB,GAAG;IACrC,mEAAmE;IACnE,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,2CAA2C;IAC3C,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAA;AAI7C,wBAAgB,mBAAmB,CAAC,EAAE,EAAE,MAAM;;;;;;;;;;;;;;;;;;;;;EAE7C;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,cAAc,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EACnE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,SAA4B,EAAE,MAAM,EAAE,GAAE,wBAA6B,GACtE,OAAO,CAAC,wBAAwB,CAAC,CASnC"}
|
@@ -0,0 +1,47 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { BlockTag } from '../../types/block.js';
|
4
|
+
import type { Chain } from '../../types/chain.js';
|
5
|
+
import type { Hash } from '../../types/misc.js';
|
6
|
+
export type GetBlockTransactionCountParameters = {
|
7
|
+
/** Hash of the block. */
|
8
|
+
blockHash?: Hash;
|
9
|
+
blockNumber?: never;
|
10
|
+
blockTag?: never;
|
11
|
+
} | {
|
12
|
+
blockHash?: never;
|
13
|
+
/** The block number. */
|
14
|
+
blockNumber?: bigint;
|
15
|
+
blockTag?: never;
|
16
|
+
} | {
|
17
|
+
blockHash?: never;
|
18
|
+
blockNumber?: never;
|
19
|
+
/** The block tag. Defaults to 'latest'. */
|
20
|
+
blockTag?: BlockTag;
|
21
|
+
};
|
22
|
+
export type GetBlockTransactionCountReturnType = number;
|
23
|
+
/**
|
24
|
+
* Returns the number of Transactions at a block number, hash, or tag.
|
25
|
+
*
|
26
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount.html
|
27
|
+
* - JSON-RPC Methods:
|
28
|
+
* - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.
|
29
|
+
* - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.
|
30
|
+
*
|
31
|
+
* @param client - Client to use
|
32
|
+
* @param parameters - {@link GetBlockTransactionCountParameters}
|
33
|
+
* @returns The block transaction count. {@link GetBlockTransactionCountReturnType}
|
34
|
+
*
|
35
|
+
* @example
|
36
|
+
* import { createPublicClient, http } from 'viem'
|
37
|
+
* import { mainnet } from 'viem/chains'
|
38
|
+
* import { getBlockTransactionCount } from 'viem/public'
|
39
|
+
*
|
40
|
+
* const client = createPublicClient({
|
41
|
+
* chain: mainnet,
|
42
|
+
* transport: http(),
|
43
|
+
* })
|
44
|
+
* const count = await getBlockTransactionCount(client)
|
45
|
+
*/
|
46
|
+
export declare function getBlockTransactionCount<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { blockHash, blockNumber, blockTag, }?: GetBlockTransactionCountParameters): Promise<GetBlockTransactionCountReturnType>;
|
47
|
+
//# sourceMappingURL=getBlockTransactionCount.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBlockTransactionCount.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBlockTransactionCount.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,qBAAqB,CAAA;AAK/C,MAAM,MAAM,kCAAkC,GAC1C;IACE,yBAAyB;IACzB,SAAS,CAAC,EAAE,IAAI,CAAA;IAChB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,wBAAwB;IACxB,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,GACD;IACE,SAAS,CAAC,EAAE,KAAK,CAAA;IACjB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,2CAA2C;IAC3C,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,CAAA;AAEL,MAAM,MAAM,kCAAkC,GAAG,MAAM,CAAA;AAEvD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,wBAAwB,CAC5C,MAAM,SAAS,KAAK,GAAG,SAAS,EAEhC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EACE,SAAS,EACT,WAAW,EACX,QAAmB,GACpB,GAAE,kCAAuC,GACzC,OAAO,CAAC,kCAAkC,CAAC,CAkB7C"}
|
@@ -0,0 +1,41 @@
|
|
1
|
+
import type { Address } from 'abitype';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { BlockTag } from '../../types/block.js';
|
5
|
+
import type { Chain } from '../../types/chain.js';
|
6
|
+
import type { Hex } from '../../types/misc.js';
|
7
|
+
export type GetBytecodeParameters = {
|
8
|
+
address: Address;
|
9
|
+
} & ({
|
10
|
+
blockNumber?: never;
|
11
|
+
blockTag?: BlockTag;
|
12
|
+
} | {
|
13
|
+
blockNumber?: bigint;
|
14
|
+
blockTag?: never;
|
15
|
+
});
|
16
|
+
export type GetBytecodeReturnType = Hex | undefined;
|
17
|
+
/**
|
18
|
+
* Retrieves the bytecode at an address.
|
19
|
+
*
|
20
|
+
* - Docs: https://viem.sh/docs/contract/getBytecode.html
|
21
|
+
* - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)
|
22
|
+
*
|
23
|
+
* @param client - Client to use
|
24
|
+
* @param parameters - {@link GetBytecodeParameters}
|
25
|
+
* @returns The contract's bytecode. {@link GetBytecodeReturnType}
|
26
|
+
*
|
27
|
+
* @example
|
28
|
+
* import { createPublicClient, http } from 'viem'
|
29
|
+
* import { mainnet } from 'viem/chains'
|
30
|
+
* import { getBytecode } from 'viem/contract'
|
31
|
+
*
|
32
|
+
* const client = createPublicClient({
|
33
|
+
* chain: mainnet,
|
34
|
+
* transport: http(),
|
35
|
+
* })
|
36
|
+
* const code = await getBytecode(client, {
|
37
|
+
* address: '0xFBA3912Ca04dd458c843e2EE08967fC04f3579c2',
|
38
|
+
* })
|
39
|
+
*/
|
40
|
+
export declare function getBytecode<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { address, blockNumber, blockTag }: GetBytecodeParameters): Promise<GetBytecodeReturnType>;
|
41
|
+
//# sourceMappingURL=getBytecode.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getBytecode.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getBytecode.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAG9C,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,OAAO,CAAA;CACjB,GAAG,CACA;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,GACD;IACE,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CACJ,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,GAAG,GAAG,SAAS,CAAA;AAEnD;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAsB,WAAW,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAChE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EAAE,OAAO,EAAE,WAAW,EAAE,QAAmB,EAAE,EAAE,qBAAqB,GACnE,OAAO,CAAC,qBAAqB,CAAC,CAShC"}
|
@@ -0,0 +1,28 @@
|
|
1
|
+
import type { Account } from '../../accounts/types.js';
|
2
|
+
import type { Client } from '../../clients/createClient.js';
|
3
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
4
|
+
import type { Chain } from '../../types/chain.js';
|
5
|
+
export type GetChainIdReturnType = number;
|
6
|
+
/**
|
7
|
+
* Returns the chain ID associated with the current network.
|
8
|
+
*
|
9
|
+
* - Docs: https://viem.sh/docs/actions/public/getChainId.html
|
10
|
+
* - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)
|
11
|
+
*
|
12
|
+
* @param client - Client to use
|
13
|
+
* @returns The current chain ID. {@link GetChainIdReturnType}
|
14
|
+
*
|
15
|
+
* @example
|
16
|
+
* import { createPublicClient, http } from 'viem'
|
17
|
+
* import { mainnet } from 'viem/chains'
|
18
|
+
* import { getChainId } from 'viem/public'
|
19
|
+
*
|
20
|
+
* const client = createPublicClient({
|
21
|
+
* chain: mainnet,
|
22
|
+
* transport: http(),
|
23
|
+
* })
|
24
|
+
* const chainId = await getChainId(client)
|
25
|
+
* // 1
|
26
|
+
*/
|
27
|
+
export declare function getChainId<TChain extends Chain | undefined, TAccount extends Account | undefined>(client: Client<Transport, TChain, TAccount>): Promise<GetChainIdReturnType>;
|
28
|
+
//# sourceMappingURL=getChainId.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getChainId.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getChainId.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAA;AACtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAGjD,MAAM,MAAM,oBAAoB,GAAG,MAAM,CAAA;AAEzC;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAsB,UAAU,CAC9B,MAAM,SAAS,KAAK,GAAG,SAAS,EAChC,QAAQ,SAAS,OAAO,GAAG,SAAS,EACpC,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,EAAE,QAAQ,CAAC,GAAG,OAAO,CAAC,oBAAoB,CAAC,CAK5E"}
|
@@ -0,0 +1,53 @@
|
|
1
|
+
import type { Client } from '../../clients/createClient.js';
|
2
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
3
|
+
import type { BlockTag } from '../../types/block.js';
|
4
|
+
import type { Chain } from '../../types/chain.js';
|
5
|
+
import type { FeeHistory } from '../../types/fee.js';
|
6
|
+
export type GetFeeHistoryParameters = {
|
7
|
+
/**
|
8
|
+
* Number of blocks in the requested range. Between 1 and 1024 blocks can be requested in a single query. Less than requested may be returned if not all blocks are available.
|
9
|
+
*/
|
10
|
+
blockCount: number;
|
11
|
+
/**
|
12
|
+
* A monotonically increasing list of percentile values to sample from each block's effective priority fees per gas in ascending order, weighted by gas used.
|
13
|
+
*/
|
14
|
+
rewardPercentiles: number[];
|
15
|
+
} & ({
|
16
|
+
blockNumber?: never;
|
17
|
+
/**
|
18
|
+
* Highest number block of the requested range.
|
19
|
+
* @default 'latest'
|
20
|
+
*/
|
21
|
+
blockTag?: BlockTag;
|
22
|
+
} | {
|
23
|
+
/** Highest number block of the requested range. */
|
24
|
+
blockNumber?: bigint;
|
25
|
+
blockTag?: never;
|
26
|
+
});
|
27
|
+
export type GetFeeHistoryReturnType = FeeHistory;
|
28
|
+
/**
|
29
|
+
* Returns a collection of historical gas information.
|
30
|
+
*
|
31
|
+
* - Docs: https://viem.sh/docs/actions/public/getFeeHistory.html
|
32
|
+
* - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)
|
33
|
+
*
|
34
|
+
* @param client - Client to use
|
35
|
+
* @param parameters - {@link GetFeeHistoryParameters}
|
36
|
+
* @returns The gas estimate (in wei). {@link GetFeeHistoryReturnType}
|
37
|
+
*
|
38
|
+
* @example
|
39
|
+
* import { createPublicClient, http } from 'viem'
|
40
|
+
* import { mainnet } from 'viem/chains'
|
41
|
+
* import { getFeeHistory } from 'viem/public'
|
42
|
+
*
|
43
|
+
* const client = createPublicClient({
|
44
|
+
* chain: mainnet,
|
45
|
+
* transport: http(),
|
46
|
+
* })
|
47
|
+
* const feeHistory = await getFeeHistory(client, {
|
48
|
+
* blockCount: 4,
|
49
|
+
* rewardPercentiles: [25, 75],
|
50
|
+
* })
|
51
|
+
*/
|
52
|
+
export declare function getFeeHistory<TChain extends Chain | undefined>(client: Client<Transport, TChain>, { blockCount, blockNumber, blockTag, rewardPercentiles, }: GetFeeHistoryParameters): Promise<GetFeeHistoryReturnType>;
|
53
|
+
//# sourceMappingURL=getFeeHistory.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getFeeHistory.d.ts","sourceRoot":"","sources":["../../../../src/actions/public/getFeeHistory.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,+BAA+B,CAAA;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,6CAA6C,CAAA;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AACjD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAA;AAIpD,MAAM,MAAM,uBAAuB,GAAG;IACpC;;OAEG;IACH,UAAU,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,iBAAiB,EAAE,MAAM,EAAE,CAAA;CAC5B,GAAG,CACA;IACE,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB;;;OAGG;IACH,QAAQ,CAAC,EAAE,QAAQ,CAAA;CACpB,GACD;IACE,mDAAmD;IACnD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,QAAQ,CAAC,EAAE,KAAK,CAAA;CACjB,CACJ,CAAA;AACD,MAAM,MAAM,uBAAuB,GAAG,UAAU,CAAA;AAEhD;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,wBAAsB,aAAa,CAAC,MAAM,SAAS,KAAK,GAAG,SAAS,EAClE,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,EACjC,EACE,UAAU,EACV,WAAW,EACX,QAAmB,EACnB,iBAAiB,GAClB,EAAE,uBAAuB,GACzB,OAAO,CAAC,uBAAuB,CAAC,CAWlC"}
|