viem 0.0.0-main.20240110T155739 → 0.0.0-main.20240110T222121
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/CHANGELOG.md +7 -7
- package/README.md +1 -1
- package/_cjs/errors/base.js +1 -1
- package/_cjs/errors/base.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_esm/actions/ens/getEnsAddress.js +2 -2
- package/_esm/actions/ens/getEnsAvatar.js +3 -3
- package/_esm/actions/ens/getEnsName.js +1 -1
- package/_esm/actions/ens/getEnsResolver.js +2 -2
- package/_esm/actions/ens/getEnsText.js +2 -2
- package/_esm/actions/getContract.js +2 -2
- package/_esm/actions/public/call.js +1 -1
- package/_esm/actions/public/createBlockFilter.js +3 -3
- package/_esm/actions/public/createContractEventFilter.js +3 -3
- package/_esm/actions/public/createEventFilter.js +3 -3
- package/_esm/actions/public/createPendingTransactionFilter.js +3 -3
- package/_esm/actions/public/estimateContractGas.js +2 -2
- package/_esm/actions/public/estimateFeesPerGas.js +2 -2
- package/_esm/actions/public/estimateGas.js +1 -1
- package/_esm/actions/public/estimateMaxPriorityFeePerGas.js +2 -2
- package/_esm/actions/public/getBalance.js +2 -2
- package/_esm/actions/public/getBlock.js +1 -1
- package/_esm/actions/public/getBlockNumber.js +1 -1
- package/_esm/actions/public/getBlockTransactionCount.js +1 -1
- package/_esm/actions/public/getBytecode.js +1 -1
- package/_esm/actions/public/getChainId.js +1 -1
- package/_esm/actions/public/getContractEvents.js +1 -1
- package/_esm/actions/public/getFeeHistory.js +1 -1
- package/_esm/actions/public/getFilterChanges.js +5 -5
- package/_esm/actions/public/getFilterLogs.js +1 -1
- package/_esm/actions/public/getGasPrice.js +1 -1
- package/_esm/actions/public/getLogs.js +1 -1
- package/_esm/actions/public/getProof.js +1 -1
- package/_esm/actions/public/getStorageAt.js +1 -1
- package/_esm/actions/public/getTransaction.js +2 -2
- package/_esm/actions/public/getTransactionConfirmations.js +1 -1
- package/_esm/actions/public/getTransactionCount.js +2 -2
- package/_esm/actions/public/getTransactionReceipt.js +2 -2
- package/_esm/actions/public/multicall.js +2 -2
- package/_esm/actions/public/readContract.js +2 -2
- package/_esm/actions/public/simulateContract.js +3 -3
- package/_esm/actions/public/uninstallFilter.js +5 -5
- package/_esm/actions/public/verifyMessage.js +1 -1
- package/_esm/actions/public/verifyTypedData.js +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js +2 -2
- package/_esm/actions/public/watchBlockNumber.js +1 -1
- package/_esm/actions/public/watchBlocks.js +1 -1
- package/_esm/actions/public/watchContractEvent.js +3 -3
- package/_esm/actions/public/watchEvent.js +4 -4
- package/_esm/actions/public/watchPendingTransactions.js +2 -2
- package/_esm/actions/test/dropTransaction.js +1 -1
- package/_esm/actions/test/dumpState.js +1 -1
- package/_esm/actions/test/getAutomine.js +1 -1
- package/_esm/actions/test/getTxpoolContent.js +1 -1
- package/_esm/actions/test/getTxpoolStatus.js +1 -1
- package/_esm/actions/test/impersonateAccount.js +1 -1
- package/_esm/actions/test/increaseTime.js +1 -1
- package/_esm/actions/test/inspectTxpool.js +1 -1
- package/_esm/actions/test/loadState.js +1 -1
- package/_esm/actions/test/mine.js +1 -1
- package/_esm/actions/test/removeBlockTimestampInterval.js +2 -2
- package/_esm/actions/test/reset.js +1 -1
- package/_esm/actions/test/revert.js +1 -1
- package/_esm/actions/test/sendUnsignedTransaction.js +1 -1
- package/_esm/actions/test/setAutomine.js +1 -1
- package/_esm/actions/test/setBalance.js +1 -1
- package/_esm/actions/test/setBlockGasLimit.js +1 -1
- package/_esm/actions/test/setBlockTimestampInterval.js +2 -2
- package/_esm/actions/test/setCode.js +1 -1
- package/_esm/actions/test/setCoinbase.js +1 -1
- package/_esm/actions/test/setIntervalMining.js +1 -1
- package/_esm/actions/test/setLoggingEnabled.js +1 -1
- package/_esm/actions/test/setMinGasPrice.js +1 -1
- package/_esm/actions/test/setNextBlockBaseFeePerGas.js +1 -1
- package/_esm/actions/test/setNextBlockTimestamp.js +1 -1
- package/_esm/actions/test/setNonce.js +1 -1
- package/_esm/actions/test/setRpcUrl.js +1 -1
- package/_esm/actions/test/setStorageAt.js +1 -1
- package/_esm/actions/test/snapshot.js +1 -1
- package/_esm/actions/test/stopImpersonatingAccount.js +2 -2
- package/_esm/actions/wallet/addChain.js +1 -1
- package/_esm/actions/wallet/deployContract.js +2 -2
- package/_esm/actions/wallet/getAddresses.js +1 -1
- package/_esm/actions/wallet/getPermissions.js +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +1 -1
- package/_esm/actions/wallet/requestAddresses.js +1 -1
- package/_esm/actions/wallet/requestPermissions.js +1 -1
- package/_esm/actions/wallet/sendRawTransaction.js +1 -1
- package/_esm/actions/wallet/sendTransaction.js +2 -2
- package/_esm/actions/wallet/signMessage.js +4 -4
- package/_esm/actions/wallet/signTransaction.js +1 -1
- package/_esm/actions/wallet/signTypedData.js +2 -2
- package/_esm/actions/wallet/switchChain.js +1 -1
- package/_esm/actions/wallet/watchAsset.js +1 -1
- package/_esm/actions/wallet/writeContract.js +5 -5
- package/_esm/chains/opStack/actions/buildDepositTransaction.js +1 -1
- package/_esm/chains/opStack/actions/buildInitiateWithdrawal.js +1 -1
- package/_esm/chains/opStack/actions/buildProveWithdrawal.js +1 -1
- package/_esm/chains/opStack/actions/depositTransaction.js +1 -1
- package/_esm/chains/opStack/actions/estimateDepositTransactionGas.js +1 -1
- package/_esm/chains/opStack/actions/estimateFinalizeWithdrawalGas.js +1 -1
- package/_esm/chains/opStack/actions/estimateInitiateWithdrawalGas.js +1 -1
- package/_esm/chains/opStack/actions/estimateProveWithdrawalGas.js +1 -1
- package/_esm/chains/opStack/actions/finalizeWithdrawal.js +1 -1
- package/_esm/chains/opStack/actions/getL2Output.js +1 -1
- package/_esm/chains/opStack/actions/getTimeToFinalize.js +2 -2
- package/_esm/chains/opStack/actions/getTimeToNextL2Output.js +2 -2
- package/_esm/chains/opStack/actions/getTimeToProve.js +2 -2
- package/_esm/chains/opStack/actions/getWithdrawalStatus.js +2 -2
- package/_esm/chains/opStack/actions/initiateWithdrawal.js +1 -1
- package/_esm/chains/opStack/actions/proveWithdrawal.js +1 -1
- package/_esm/chains/opStack/actions/waitForNextL2Output.js +1 -1
- package/_esm/chains/opStack/actions/waitToFinalize.js +2 -2
- package/_esm/chains/opStack/actions/waitToProve.js +2 -2
- package/_esm/chains/opStack/decorators/publicL1.js +1 -1
- package/_esm/chains/opStack/decorators/publicL2.js +1 -1
- package/_esm/chains/opStack/decorators/walletL1.js +1 -1
- package/_esm/chains/opStack/decorators/walletL2.js +1 -1
- package/_esm/errors/base.js +1 -1
- package/_esm/errors/base.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/utils/encoding/fromBytes.js +6 -6
- package/_esm/utils/encoding/fromHex.js +6 -6
- package/_esm/utils/encoding/toBytes.js +6 -6
- package/_esm/utils/encoding/toHex.js +6 -6
- package/_esm/utils/ens/labelhash.js +1 -1
- package/_esm/utils/ens/namehash.js +1 -1
- package/_esm/utils/signature/verifyMessage.js +1 -1
- package/_esm/utils/signature/verifyTypedData.js +1 -1
- package/_esm/utils/unit/formatEther.js +1 -1
- package/_esm/utils/unit/formatGwei.js +1 -1
- package/_esm/utils/unit/formatUnits.js +1 -1
- package/_esm/utils/unit/parseEther.js +1 -1
- package/_esm/utils/unit/parseGwei.js +1 -1
- package/_esm/utils/unit/parseUnits.js +1 -1
- package/_types/actions/ens/getEnsAddress.d.ts +2 -2
- package/_types/actions/ens/getEnsAvatar.d.ts +3 -3
- package/_types/actions/ens/getEnsName.d.ts +1 -1
- package/_types/actions/ens/getEnsResolver.d.ts +2 -2
- package/_types/actions/ens/getEnsText.d.ts +2 -2
- package/_types/actions/getContract.d.ts +22 -22
- package/_types/actions/public/call.d.ts +1 -1
- package/_types/actions/public/createBlockFilter.d.ts +3 -3
- package/_types/actions/public/createContractEventFilter.d.ts +3 -3
- package/_types/actions/public/createEventFilter.d.ts +3 -3
- package/_types/actions/public/createPendingTransactionFilter.d.ts +3 -3
- package/_types/actions/public/estimateContractGas.d.ts +2 -2
- package/_types/actions/public/estimateFeesPerGas.d.ts +2 -2
- package/_types/actions/public/estimateGas.d.ts +1 -1
- package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts +2 -2
- package/_types/actions/public/getBalance.d.ts +2 -2
- package/_types/actions/public/getBlock.d.ts +1 -1
- package/_types/actions/public/getBlockNumber.d.ts +1 -1
- package/_types/actions/public/getBlockTransactionCount.d.ts +1 -1
- package/_types/actions/public/getBytecode.d.ts +1 -1
- package/_types/actions/public/getChainId.d.ts +1 -1
- package/_types/actions/public/getContractEvents.d.ts +1 -1
- package/_types/actions/public/getFeeHistory.d.ts +1 -1
- package/_types/actions/public/getFilterChanges.d.ts +5 -5
- package/_types/actions/public/getFilterLogs.d.ts +1 -1
- package/_types/actions/public/getGasPrice.d.ts +1 -1
- package/_types/actions/public/getLogs.d.ts +1 -1
- package/_types/actions/public/getProof.d.ts +1 -1
- package/_types/actions/public/getStorageAt.d.ts +1 -1
- package/_types/actions/public/getTransaction.d.ts +2 -2
- package/_types/actions/public/getTransactionConfirmations.d.ts +1 -1
- package/_types/actions/public/getTransactionCount.d.ts +2 -2
- package/_types/actions/public/getTransactionReceipt.d.ts +2 -2
- package/_types/actions/public/multicall.d.ts +2 -2
- package/_types/actions/public/readContract.d.ts +2 -2
- package/_types/actions/public/simulateContract.d.ts +3 -3
- package/_types/actions/public/uninstallFilter.d.ts +5 -5
- package/_types/actions/public/verifyMessage.d.ts +1 -1
- package/_types/actions/public/verifyTypedData.d.ts +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts +2 -2
- package/_types/actions/public/watchBlockNumber.d.ts +1 -1
- package/_types/actions/public/watchBlocks.d.ts +1 -1
- package/_types/actions/public/watchContractEvent.d.ts +3 -3
- package/_types/actions/public/watchEvent.d.ts +4 -4
- package/_types/actions/public/watchPendingTransactions.d.ts +2 -2
- package/_types/actions/test/dropTransaction.d.ts +1 -1
- package/_types/actions/test/dumpState.d.ts +1 -1
- package/_types/actions/test/getAutomine.d.ts +1 -1
- package/_types/actions/test/getTxpoolContent.d.ts +1 -1
- package/_types/actions/test/getTxpoolStatus.d.ts +1 -1
- package/_types/actions/test/impersonateAccount.d.ts +1 -1
- package/_types/actions/test/increaseTime.d.ts +1 -1
- package/_types/actions/test/inspectTxpool.d.ts +1 -1
- package/_types/actions/test/loadState.d.ts +1 -1
- package/_types/actions/test/mine.d.ts +1 -1
- package/_types/actions/test/removeBlockTimestampInterval.d.ts +2 -2
- package/_types/actions/test/reset.d.ts +1 -1
- package/_types/actions/test/revert.d.ts +1 -1
- package/_types/actions/test/sendUnsignedTransaction.d.ts +1 -1
- package/_types/actions/test/setAutomine.d.ts +1 -1
- package/_types/actions/test/setBalance.d.ts +1 -1
- package/_types/actions/test/setBlockGasLimit.d.ts +1 -1
- package/_types/actions/test/setBlockTimestampInterval.d.ts +2 -2
- package/_types/actions/test/setCode.d.ts +1 -1
- package/_types/actions/test/setCoinbase.d.ts +1 -1
- package/_types/actions/test/setIntervalMining.d.ts +1 -1
- package/_types/actions/test/setLoggingEnabled.d.ts +1 -1
- package/_types/actions/test/setMinGasPrice.d.ts +1 -1
- package/_types/actions/test/setNextBlockBaseFeePerGas.d.ts +1 -1
- package/_types/actions/test/setNextBlockTimestamp.d.ts +1 -1
- package/_types/actions/test/setNonce.d.ts +1 -1
- package/_types/actions/test/setRpcUrl.d.ts +1 -1
- package/_types/actions/test/setStorageAt.d.ts +1 -1
- package/_types/actions/test/snapshot.d.ts +1 -1
- package/_types/actions/test/stopImpersonatingAccount.d.ts +2 -2
- package/_types/actions/wallet/addChain.d.ts +1 -1
- package/_types/actions/wallet/deployContract.d.ts +2 -2
- package/_types/actions/wallet/getAddresses.d.ts +1 -1
- package/_types/actions/wallet/getPermissions.d.ts +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +1 -1
- package/_types/actions/wallet/requestAddresses.d.ts +1 -1
- package/_types/actions/wallet/requestPermissions.d.ts +1 -1
- package/_types/actions/wallet/sendRawTransaction.d.ts +1 -1
- package/_types/actions/wallet/sendTransaction.d.ts +2 -2
- package/_types/actions/wallet/signMessage.d.ts +4 -4
- package/_types/actions/wallet/signTransaction.d.ts +1 -1
- package/_types/actions/wallet/signTypedData.d.ts +2 -2
- package/_types/actions/wallet/switchChain.d.ts +1 -1
- package/_types/actions/wallet/watchAsset.d.ts +1 -1
- package/_types/actions/wallet/writeContract.d.ts +5 -5
- package/_types/chains/opStack/actions/buildDepositTransaction.d.ts +1 -1
- package/_types/chains/opStack/actions/buildInitiateWithdrawal.d.ts +1 -1
- package/_types/chains/opStack/actions/buildProveWithdrawal.d.ts +1 -1
- package/_types/chains/opStack/actions/depositTransaction.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateDepositTransactionGas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateFinalizeWithdrawalGas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateInitiateWithdrawalGas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateProveWithdrawalGas.d.ts +1 -1
- package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts +1 -1
- package/_types/chains/opStack/actions/getL2Output.d.ts +1 -1
- package/_types/chains/opStack/actions/getTimeToFinalize.d.ts +2 -2
- package/_types/chains/opStack/actions/getTimeToNextL2Output.d.ts +2 -2
- package/_types/chains/opStack/actions/getTimeToProve.d.ts +2 -2
- package/_types/chains/opStack/actions/getWithdrawalStatus.d.ts +2 -2
- package/_types/chains/opStack/actions/initiateWithdrawal.d.ts +1 -1
- package/_types/chains/opStack/actions/proveWithdrawal.d.ts +1 -1
- package/_types/chains/opStack/actions/waitForNextL2Output.d.ts +1 -1
- package/_types/chains/opStack/actions/waitToFinalize.d.ts +2 -2
- package/_types/chains/opStack/actions/waitToProve.d.ts +2 -2
- package/_types/chains/opStack/decorators/publicL1.d.ts +20 -20
- package/_types/chains/opStack/decorators/publicL2.d.ts +4 -4
- package/_types/chains/opStack/decorators/walletL1.d.ts +4 -4
- package/_types/chains/opStack/decorators/walletL2.d.ts +2 -2
- package/_types/clients/createPublicClient.d.ts +2 -2
- package/_types/clients/createTestClient.d.ts +3 -3
- package/_types/clients/createWalletClient.d.ts +5 -5
- package/_types/clients/decorators/public.d.ts +79 -79
- package/_types/clients/decorators/test.d.ts +33 -33
- package/_types/clients/decorators/wallet.d.ts +26 -26
- package/_types/errors/version.d.ts +1 -1
- package/_types/utils/encoding/fromBytes.d.ts +6 -6
- package/_types/utils/encoding/fromHex.d.ts +6 -6
- package/_types/utils/encoding/toBytes.d.ts +6 -6
- package/_types/utils/encoding/toHex.d.ts +6 -6
- package/_types/utils/ens/labelhash.d.ts +1 -1
- package/_types/utils/ens/namehash.d.ts +1 -1
- package/_types/utils/signature/verifyMessage.d.ts +1 -1
- package/_types/utils/signature/verifyTypedData.d.ts +1 -1
- package/_types/utils/unit/formatEther.d.ts +1 -1
- package/_types/utils/unit/formatGwei.d.ts +1 -1
- package/_types/utils/unit/formatUnits.d.ts +1 -1
- package/_types/utils/unit/parseEther.d.ts +1 -1
- package/_types/utils/unit/parseGwei.d.ts +1 -1
- package/_types/utils/unit/parseUnits.d.ts +1 -1
- package/actions/ens/getEnsAddress.ts +2 -2
- package/actions/ens/getEnsAvatar.ts +3 -3
- package/actions/ens/getEnsName.ts +1 -1
- package/actions/ens/getEnsResolver.ts +2 -2
- package/actions/ens/getEnsText.ts +2 -2
- package/actions/getContract.ts +22 -22
- package/actions/public/call.ts +1 -1
- package/actions/public/createBlockFilter.ts +3 -3
- package/actions/public/createContractEventFilter.ts +3 -3
- package/actions/public/createEventFilter.ts +3 -3
- package/actions/public/createPendingTransactionFilter.ts +3 -3
- package/actions/public/estimateContractGas.ts +2 -2
- package/actions/public/estimateFeesPerGas.ts +2 -2
- package/actions/public/estimateGas.ts +1 -1
- package/actions/public/estimateMaxPriorityFeePerGas.ts +2 -2
- package/actions/public/getBalance.ts +2 -2
- package/actions/public/getBlock.ts +1 -1
- package/actions/public/getBlockNumber.ts +1 -1
- package/actions/public/getBlockTransactionCount.ts +1 -1
- package/actions/public/getBytecode.ts +1 -1
- package/actions/public/getChainId.ts +1 -1
- package/actions/public/getContractEvents.ts +1 -1
- package/actions/public/getFeeHistory.ts +1 -1
- package/actions/public/getFilterChanges.ts +5 -5
- package/actions/public/getFilterLogs.ts +1 -1
- package/actions/public/getGasPrice.ts +1 -1
- package/actions/public/getLogs.ts +1 -1
- package/actions/public/getProof.ts +1 -1
- package/actions/public/getStorageAt.ts +1 -1
- package/actions/public/getTransaction.ts +2 -2
- package/actions/public/getTransactionConfirmations.ts +1 -1
- package/actions/public/getTransactionCount.ts +2 -2
- package/actions/public/getTransactionReceipt.ts +2 -2
- package/actions/public/multicall.ts +2 -2
- package/actions/public/readContract.ts +2 -2
- package/actions/public/simulateContract.ts +3 -3
- package/actions/public/uninstallFilter.ts +5 -5
- package/actions/public/verifyMessage.ts +1 -1
- package/actions/public/verifyTypedData.ts +1 -1
- package/actions/public/waitForTransactionReceipt.ts +2 -2
- package/actions/public/watchBlockNumber.ts +1 -1
- package/actions/public/watchBlocks.ts +1 -1
- package/actions/public/watchContractEvent.ts +3 -3
- package/actions/public/watchEvent.ts +4 -4
- package/actions/public/watchPendingTransactions.ts +2 -2
- package/actions/test/dropTransaction.ts +1 -1
- package/actions/test/dumpState.ts +1 -1
- package/actions/test/getAutomine.ts +1 -1
- package/actions/test/getTxpoolContent.ts +1 -1
- package/actions/test/getTxpoolStatus.ts +1 -1
- package/actions/test/impersonateAccount.ts +1 -1
- package/actions/test/increaseTime.ts +1 -1
- package/actions/test/inspectTxpool.ts +1 -1
- package/actions/test/loadState.ts +1 -1
- package/actions/test/mine.ts +1 -1
- package/actions/test/removeBlockTimestampInterval.ts +2 -2
- package/actions/test/reset.ts +1 -1
- package/actions/test/revert.ts +1 -1
- package/actions/test/sendUnsignedTransaction.ts +1 -1
- package/actions/test/setAutomine.ts +1 -1
- package/actions/test/setBalance.ts +1 -1
- package/actions/test/setBlockGasLimit.ts +1 -1
- package/actions/test/setBlockTimestampInterval.ts +2 -2
- package/actions/test/setCode.ts +1 -1
- package/actions/test/setCoinbase.ts +1 -1
- package/actions/test/setIntervalMining.ts +1 -1
- package/actions/test/setLoggingEnabled.ts +1 -1
- package/actions/test/setMinGasPrice.ts +1 -1
- package/actions/test/setNextBlockBaseFeePerGas.ts +1 -1
- package/actions/test/setNextBlockTimestamp.ts +1 -1
- package/actions/test/setNonce.ts +1 -1
- package/actions/test/setRpcUrl.ts +1 -1
- package/actions/test/setStorageAt.ts +1 -1
- package/actions/test/snapshot.ts +1 -1
- package/actions/test/stopImpersonatingAccount.ts +2 -2
- package/actions/wallet/addChain.ts +1 -1
- package/actions/wallet/deployContract.ts +2 -2
- package/actions/wallet/getAddresses.ts +1 -1
- package/actions/wallet/getPermissions.ts +1 -1
- package/actions/wallet/prepareTransactionRequest.ts +1 -1
- package/actions/wallet/requestAddresses.ts +1 -1
- package/actions/wallet/requestPermissions.ts +1 -1
- package/actions/wallet/sendRawTransaction.ts +1 -1
- package/actions/wallet/sendTransaction.ts +2 -2
- package/actions/wallet/signMessage.ts +4 -4
- package/actions/wallet/signTransaction.ts +1 -1
- package/actions/wallet/signTypedData.ts +2 -2
- package/actions/wallet/switchChain.ts +1 -1
- package/actions/wallet/watchAsset.ts +1 -1
- package/actions/wallet/writeContract.ts +5 -5
- package/chains/opStack/actions/buildDepositTransaction.ts +1 -1
- package/chains/opStack/actions/buildInitiateWithdrawal.ts +1 -1
- package/chains/opStack/actions/buildProveWithdrawal.ts +1 -1
- package/chains/opStack/actions/depositTransaction.ts +1 -1
- package/chains/opStack/actions/estimateDepositTransactionGas.ts +1 -1
- package/chains/opStack/actions/estimateFinalizeWithdrawalGas.ts +1 -1
- package/chains/opStack/actions/estimateInitiateWithdrawalGas.ts +1 -1
- package/chains/opStack/actions/estimateProveWithdrawalGas.ts +1 -1
- package/chains/opStack/actions/finalizeWithdrawal.ts +1 -1
- package/chains/opStack/actions/getL2Output.ts +1 -1
- package/chains/opStack/actions/getTimeToFinalize.ts +2 -2
- package/chains/opStack/actions/getTimeToNextL2Output.ts +2 -2
- package/chains/opStack/actions/getTimeToProve.ts +2 -2
- package/chains/opStack/actions/getWithdrawalStatus.ts +2 -2
- package/chains/opStack/actions/initiateWithdrawal.ts +1 -1
- package/chains/opStack/actions/proveWithdrawal.ts +1 -1
- package/chains/opStack/actions/waitForNextL2Output.ts +1 -1
- package/chains/opStack/actions/waitToFinalize.ts +2 -2
- package/chains/opStack/actions/waitToProve.ts +2 -2
- package/chains/opStack/decorators/publicL1.ts +20 -20
- package/chains/opStack/decorators/publicL2.ts +4 -4
- package/chains/opStack/decorators/walletL1.ts +4 -4
- package/chains/opStack/decorators/walletL2.ts +2 -2
- package/chains/zksync/types.ts +6 -6
- package/clients/createPublicClient.ts +2 -2
- package/clients/createTestClient.ts +3 -3
- package/clients/createWalletClient.ts +5 -5
- package/clients/decorators/public.ts +79 -79
- package/clients/decorators/test.ts +33 -33
- package/clients/decorators/wallet.ts +26 -26
- package/errors/base.ts +1 -1
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/utils/encoding/fromBytes.ts +6 -6
- package/utils/encoding/fromHex.ts +6 -6
- package/utils/encoding/toBytes.ts +6 -6
- package/utils/encoding/toHex.ts +6 -6
- package/utils/ens/labelhash.ts +1 -1
- package/utils/ens/namehash.ts +1 -1
- package/utils/signature/verifyMessage.ts +1 -1
- package/utils/signature/verifyTypedData.ts +1 -1
- package/utils/unit/formatEther.ts +1 -1
- package/utils/unit/formatGwei.ts +1 -1
- package/utils/unit/formatUnits.ts +1 -1
- package/utils/unit/parseEther.ts +1 -1
- package/utils/unit/parseGwei.ts +1 -1
- package/utils/unit/parseUnits.ts +1 -1
package/CHANGELOG.md
CHANGED
@@ -52,11 +52,11 @@
|
|
52
52
|
|
53
53
|
- [#1610](https://github.com/wevm/viem/pull/1610) [`440b3ba7`](https://github.com/wevm/viem/commit/440b3ba7d7faa9e51fe87df07acd6a5d373b3b9a) Thanks [@tmm](https://github.com/tmm)! - Viem 2.0 featuring:
|
54
54
|
|
55
|
-
- [Low-level OP Stack extensions](https://viem.sh/op-stack
|
55
|
+
- [Low-level OP Stack extensions](https://viem.sh/op-stack),
|
56
56
|
- Enhanced types,
|
57
57
|
- Miscellaneous improvements and bug fixes.
|
58
58
|
|
59
|
-
[Breaking Changes & Migration Guide](https://viem.sh/docs/migration-guide
|
59
|
+
[Breaking Changes & Migration Guide](https://viem.sh/docs/migration-guide)
|
60
60
|
|
61
61
|
## 1.21.4
|
62
62
|
|
@@ -478,7 +478,7 @@
|
|
478
478
|
|
479
479
|
### Minor Changes
|
480
480
|
|
481
|
-
- [#1263](https://github.com/wevm/viem/pull/1263) [`399a43db`](https://github.com/wevm/viem/commit/399a43db5e559cd84dafb5c66bfe0a7ad24c2d67) Thanks [@jxom](https://github.com/jxom)! - Added error types for exported modules (e.g. `<Module>ErrorType`). [Read more.](https://viem.sh/docs/error-handling
|
481
|
+
- [#1263](https://github.com/wevm/viem/pull/1263) [`399a43db`](https://github.com/wevm/viem/commit/399a43db5e559cd84dafb5c66bfe0a7ad24c2d67) Thanks [@jxom](https://github.com/jxom)! - Added error types for exported modules (e.g. `<Module>ErrorType`). [Read more.](https://viem.sh/docs/error-handling)
|
482
482
|
|
483
483
|
### Patch Changes
|
484
484
|
|
@@ -1218,7 +1218,7 @@
|
|
1218
1218
|
|
1219
1219
|
## 1.0.0
|
1220
1220
|
|
1221
|
-
### [Migration Guide](https://viem.sh/docs/migration-guide
|
1221
|
+
### [Migration Guide](https://viem.sh/docs/migration-guide)
|
1222
1222
|
|
1223
1223
|
### Major Changes
|
1224
1224
|
|
@@ -1230,7 +1230,7 @@
|
|
1230
1230
|
|
1231
1231
|
- [#576](https://github.com/wevm/viem/pull/576) [`7d42767`](https://github.com/wevm/viem/commit/7d4276775a6d42cfab850498e522fe31134f0880) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed `ethersWalletToAccount` adapter.
|
1232
1232
|
|
1233
|
-
This adapter was introduced when viem did not have Private Key & HD Accounts. Since 0.2, viem provides all the utilities needed to create and import [Private Key](https://viem.sh/docs/accounts/privateKey
|
1233
|
+
This adapter was introduced when viem did not have Private Key & HD Accounts. Since 0.2, viem provides all the utilities needed to create and import [Private Key](https://viem.sh/docs/accounts/privateKey) & [HD Accounts](https://viem.sh/docs/accounts/mnemonic).
|
1234
1234
|
|
1235
1235
|
If you still need it, you can copy + paste the [old implementation](https://github.com/wevm/viem/blob/a9a71507032db896295fa1f3fa2dd6c2bdc85137/src/adapters/ethers.ts).
|
1236
1236
|
|
@@ -1702,7 +1702,7 @@
|
|
1702
1702
|
|
1703
1703
|
- [#285](https://github.com/wevm/viem/pull/285) [`ab9fd12`](https://github.com/wevm/viem/commit/ab9fd121fbe271ba9bee43aea2d7bba122dc4f03) Thanks [@tmm](https://github.com/tmm)! - Exported `hdKeyToAccount` and `mnemonicToAccount`.
|
1704
1704
|
|
1705
|
-
## 0.2.0 – [Migration Guide](https://viem.sh/docs/migration-guide
|
1705
|
+
## 0.2.0 – [Migration Guide](https://viem.sh/docs/migration-guide)
|
1706
1706
|
|
1707
1707
|
### Minor Changes
|
1708
1708
|
|
@@ -1728,7 +1728,7 @@
|
|
1728
1728
|
|
1729
1729
|
If you were using the Ethers Wallet adapter, you can use the `ethersWalletToAccount` function.
|
1730
1730
|
|
1731
|
-
> Note: viem 0.2.0 now has a [Private Key](/docs/accounts/privateKey
|
1731
|
+
> Note: viem 0.2.0 now has a [Private Key](/docs/accounts/privateKey) & [Mnemonic Account](/docs/accounts/mnemonic) implementation. You probably do not need this adapter anymore. This adapter may be removed in a future version.
|
1732
1732
|
|
1733
1733
|
```diff
|
1734
1734
|
import { createWalletClient, custom } from 'viem'
|
package/README.md
CHANGED
@@ -81,7 +81,7 @@ const blockNumber = await client.getBlockNumber();
|
|
81
81
|
|
82
82
|
## Documentation
|
83
83
|
|
84
|
-
[Head to the documentation](https://viem.sh/docs/getting-started
|
84
|
+
[Head to the documentation](https://viem.sh/docs/getting-started) to read and learn more about viem.
|
85
85
|
|
86
86
|
## Community
|
87
87
|
|
package/_cjs/errors/base.js
CHANGED
@@ -55,7 +55,7 @@ class BaseError extends Error {
|
|
55
55
|
...(args.metaMessages ? [...args.metaMessages, ''] : []),
|
56
56
|
...(docsPath
|
57
57
|
? [
|
58
|
-
`Docs: https://viem.sh${docsPath}
|
58
|
+
`Docs: https://viem.sh${docsPath}${args.docsSlug ? `#${args.docsSlug}` : ''}`,
|
59
59
|
]
|
60
60
|
: []),
|
61
61
|
...(details ? [`Details: ${details}`] : []),
|
package/_cjs/errors/base.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../errors/base.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAkBvC,MAAa,SAAU,SAAQ,KAAK;IASlC,YAAY,YAAoB,EAAE,OAA4B,EAAE;QAC9D,KAAK,EAAE,CAAA;QATT;;;;;WAAe;QACf;;;;;WAAiB;QACjB;;;;;WAAuB;QACvB;;;;;WAAoB;QAEX;;;;mBAAO,WAAW;WAAA;QAC3B;;;;mBAAU,IAAA,qBAAU,GAAE;WAAA;QAKpB,MAAM,OAAO,GACX,IAAI,CAAC,KAAK,YAAY,SAAS;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;YACpB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO;gBACnB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;gBACpB,CAAC,CAAC,IAAI,CAAC,OAAQ,CAAA;QACrB,MAAM,QAAQ,GACZ,IAAI,CAAC,KAAK,YAAY,SAAS;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;YACtC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAA;QAEnB,IAAI,CAAC,OAAO,GAAG;YACb,YAAY,IAAI,oBAAoB;YACpC,EAAE;YACF,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,QAAQ;gBACV,CAAC,CAAC;oBACE,wBAAwB,QAAQ,
|
1
|
+
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../errors/base.ts"],"names":[],"mappings":";;;AAAA,yCAAuC;AAkBvC,MAAa,SAAU,SAAQ,KAAK;IASlC,YAAY,YAAoB,EAAE,OAA4B,EAAE;QAC9D,KAAK,EAAE,CAAA;QATT;;;;;WAAe;QACf;;;;;WAAiB;QACjB;;;;;WAAuB;QACvB;;;;;WAAoB;QAEX;;;;mBAAO,WAAW;WAAA;QAC3B;;;;mBAAU,IAAA,qBAAU,GAAE;WAAA;QAKpB,MAAM,OAAO,GACX,IAAI,CAAC,KAAK,YAAY,SAAS;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;YACpB,CAAC,CAAC,IAAI,CAAC,KAAK,EAAE,OAAO;gBACnB,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO;gBACpB,CAAC,CAAC,IAAI,CAAC,OAAQ,CAAA;QACrB,MAAM,QAAQ,GACZ,IAAI,CAAC,KAAK,YAAY,SAAS;YAC7B,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ;YACtC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAA;QAEnB,IAAI,CAAC,OAAO,GAAG;YACb,YAAY,IAAI,oBAAoB;YACpC,EAAE;YACF,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,GAAG,IAAI,CAAC,YAAY,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YACxD,GAAG,CAAC,QAAQ;gBACV,CAAC,CAAC;oBACE,wBAAwB,QAAQ,GAC9B,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,EACxC,EAAE;iBACH;gBACH,CAAC,CAAC,EAAE,CAAC;YACP,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;YAC3C,YAAY,IAAI,CAAC,OAAO,EAAE;SAC3B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAEZ,IAAI,IAAI,CAAC,KAAK;YAAE,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAA;QACvC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAA;QACtB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,IAAI,CAAC,YAAY,CAAA;QACrC,IAAI,CAAC,YAAY,GAAG,YAAY,CAAA;IAClC,CAAC;IAID,IAAI,CAAC,EAAQ;QACX,OAAO,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC,CAAA;IACvB,CAAC;CACF;AAlDD,8BAkDC;AAED,SAAS,IAAI,CAAC,GAAY,EAAE,EAA8B;IACxD,IAAI,EAAE,EAAE,CAAC,GAAG,CAAC;QAAE,OAAO,GAAG,CAAA;IACzB,IAAI,GAAG,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,IAAI,GAAG;QAClD,OAAO,IAAI,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;IAC5B,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,GAAG,CAAA;AACxB,CAAC"}
|
package/_cjs/errors/version.js
CHANGED
@@ -12,12 +12,12 @@ import { readContract, } from '../public/readContract.js';
|
|
12
12
|
/**
|
13
13
|
* Gets address for ENS name.
|
14
14
|
*
|
15
|
-
* - Docs: https://viem.sh/docs/ens/actions/getEnsAddress
|
15
|
+
* - Docs: https://viem.sh/docs/ens/actions/getEnsAddress
|
16
16
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
17
17
|
*
|
18
18
|
* Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
|
19
19
|
*
|
20
|
-
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize
|
20
|
+
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
|
21
21
|
*
|
22
22
|
* @param client - Client to use
|
23
23
|
* @param parameters - {@link GetEnsAddressParameters}
|
@@ -4,12 +4,12 @@ import { getEnsText, } from './getEnsText.js';
|
|
4
4
|
/**
|
5
5
|
* Gets the avatar of an ENS name.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar
|
7
|
+
* - Docs: https://viem.sh/docs/ens/actions/getEnsAvatar
|
8
8
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
9
9
|
*
|
10
|
-
* Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText
|
10
|
+
* Calls [`getEnsText`](https://viem.sh/docs/ens/actions/getEnsText) with `key` set to `'avatar'`.
|
11
11
|
*
|
12
|
-
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize
|
12
|
+
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
|
13
13
|
*
|
14
14
|
* @param client - Client to use
|
15
15
|
* @param parameters - {@link GetEnsAvatarParameters}
|
@@ -8,7 +8,7 @@ import { readContract, } from '../public/readContract.js';
|
|
8
8
|
/**
|
9
9
|
* Gets primary name for specified address.
|
10
10
|
*
|
11
|
-
* - Docs: https://viem.sh/docs/ens/actions/getEnsName
|
11
|
+
* - Docs: https://viem.sh/docs/ens/actions/getEnsName
|
12
12
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
13
13
|
*
|
14
14
|
* Calls `reverse(bytes)` on ENS Universal Resolver Contract to "reverse resolve" the address to the primary ENS name.
|
@@ -6,12 +6,12 @@ import { readContract, } from '../public/readContract.js';
|
|
6
6
|
/**
|
7
7
|
* Gets resolver for ENS name.
|
8
8
|
*
|
9
|
-
* - Docs: https://viem.sh/docs/ens/actions/getEnsResolver
|
9
|
+
* - Docs: https://viem.sh/docs/ens/actions/getEnsResolver
|
10
10
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
11
11
|
*
|
12
12
|
* Calls `findResolver(bytes)` on ENS Universal Resolver Contract to retrieve the resolver of an ENS name.
|
13
13
|
*
|
14
|
-
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize
|
14
|
+
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
|
15
15
|
*
|
16
16
|
* @param client - Client to use
|
17
17
|
* @param parameters - {@link GetEnsResolverParameters}
|
@@ -11,12 +11,12 @@ import { readContract, } from '../public/readContract.js';
|
|
11
11
|
/**
|
12
12
|
* Gets a text record for specified ENS name.
|
13
13
|
*
|
14
|
-
* - Docs: https://viem.sh/docs/ens/actions/getEnsResolver
|
14
|
+
* - Docs: https://viem.sh/docs/ens/actions/getEnsResolver
|
15
15
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
16
16
|
*
|
17
17
|
* Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
|
18
18
|
*
|
19
|
-
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize
|
19
|
+
* Since ENS names prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS names](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `getEnsAddress`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
|
20
20
|
*
|
21
21
|
* @param client - Client to use
|
22
22
|
* @param parameters - {@link GetEnsTextParameters}
|
@@ -9,9 +9,9 @@ import { writeContract, } from './wallet/writeContract.js';
|
|
9
9
|
/**
|
10
10
|
* Gets type-safe interface for performing contract-related actions with a specific `abi` and `address`.
|
11
11
|
*
|
12
|
-
* - Docs https://viem.sh/docs/contract/getContract
|
12
|
+
* - Docs https://viem.sh/docs/contract/getContract
|
13
13
|
*
|
14
|
-
* Using Contract Instances can make it easier to work with contracts if you don't want to pass the `abi` and `address` properites every time you perform contract actions, e.g. [`readContract`](https://viem.sh/docs/contract/readContract
|
14
|
+
* Using Contract Instances can make it easier to work with contracts if you don't want to pass the `abi` and `address` properites every time you perform contract actions, e.g. [`readContract`](https://viem.sh/docs/contract/readContract), [`writeContract`](https://viem.sh/docs/contract/writeContract), [`estimateContractGas`](https://viem.sh/docs/contract/estimateContractGas), etc.
|
15
15
|
*
|
16
16
|
* @example
|
17
17
|
* import { createPublicClient, getContract, http, parseAbi } from 'viem'
|
@@ -16,7 +16,7 @@ import { assertRequest } from '../../utils/transaction/assertRequest.js';
|
|
16
16
|
/**
|
17
17
|
* Executes a new message call immediately without submitting a transaction to the network.
|
18
18
|
*
|
19
|
-
* - Docs: https://viem.sh/docs/actions/public/call
|
19
|
+
* - Docs: https://viem.sh/docs/actions/public/call
|
20
20
|
* - JSON-RPC Methods: [`eth_call`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_call)
|
21
21
|
*
|
22
22
|
* @param client - Client to use
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';
|
2
2
|
/**
|
3
|
-
* Creates a [`Filter`](https://viem.sh/docs/glossary/types
|
3
|
+
* Creates a [`Filter`](https://viem.sh/docs/glossary/types#filter) to listen for new block hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/docs/actions/public/createBlockFilter
|
5
|
+
* - Docs: https://viem.sh/docs/actions/public/createBlockFilter
|
6
6
|
* - JSON-RPC Methods: [`eth_newBlockFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newBlockFilter)
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
|
-
* @returns [`Filter`](https://viem.sh/docs/glossary/types
|
9
|
+
* @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateBlockFilterReturnType}
|
10
10
|
*
|
11
11
|
* @example
|
12
12
|
* import { createPublicClient, http } from 'viem'
|
@@ -2,13 +2,13 @@ import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';
|
|
2
2
|
import { numberToHex, } from '../../utils/encoding/toHex.js';
|
3
3
|
import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';
|
4
4
|
/**
|
5
|
-
* Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges
|
5
|
+
* Creates a Filter to retrieve event logs that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges) or [`getFilterLogs`](https://viem.sh/docs/actions/public/getFilterLogs).
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/contract/createContractEventFilter
|
7
|
+
* - Docs: https://viem.sh/docs/contract/createContractEventFilter
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link CreateContractEventFilterParameters}
|
11
|
-
* @returns [`Filter`](https://viem.sh/docs/glossary/types
|
11
|
+
* @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateContractEventFilterReturnType}
|
12
12
|
*
|
13
13
|
* @example
|
14
14
|
* import { createPublicClient, http, parseAbi } from 'viem'
|
@@ -2,14 +2,14 @@ import { encodeEventTopics, } from '../../utils/abi/encodeEventTopics.js';
|
|
2
2
|
import { numberToHex, } from '../../utils/encoding/toHex.js';
|
3
3
|
import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';
|
4
4
|
/**
|
5
|
-
* Creates a [`Filter`](https://viem.sh/docs/glossary/types
|
5
|
+
* Creates a [`Filter`](https://viem.sh/docs/glossary/types#filter) to listen for new events that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/actions/public/createEventFilter
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/createEventFilter
|
8
8
|
* - JSON-RPC Methods: [`eth_newFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newfilter)
|
9
9
|
*
|
10
10
|
* @param client - Client to use
|
11
11
|
* @param parameters - {@link CreateEventFilterParameters}
|
12
|
-
* @returns [`Filter`](https://viem.sh/docs/glossary/types
|
12
|
+
* @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateEventFilterReturnType}
|
13
13
|
*
|
14
14
|
* @example
|
15
15
|
* import { createPublicClient, http } from 'viem'
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { createFilterRequestScope } from '../../utils/filters/createFilterRequestScope.js';
|
2
2
|
/**
|
3
|
-
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges
|
3
|
+
* Creates a Filter to listen for new pending transaction hashes that can be used with [`getFilterChanges`](https://viem.sh/docs/actions/public/getFilterChanges).
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter
|
5
|
+
* - Docs: https://viem.sh/docs/actions/public/createPendingTransactionFilter
|
6
6
|
* - JSON-RPC Methods: [`eth_newPendingTransactionFilter`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_newpendingtransactionfilter)
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
|
-
* @returns [`Filter`](https://viem.sh/docs/glossary/types
|
9
|
+
* @returns [`Filter`](https://viem.sh/docs/glossary/types#filter). {@link CreateBlockFilterReturnType}
|
10
10
|
*
|
11
11
|
* @example
|
12
12
|
* import { createPublicClient, http } from 'viem'
|
@@ -6,9 +6,9 @@ import { estimateGas, } from './estimateGas.js';
|
|
6
6
|
/**
|
7
7
|
* Estimates the gas required to successfully execute a contract write function call.
|
8
8
|
*
|
9
|
-
* - Docs: https://viem.sh/docs/contract/estimateContractGas
|
9
|
+
* - Docs: https://viem.sh/docs/contract/estimateContractGas
|
10
10
|
*
|
11
|
-
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public
|
11
|
+
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`estimateGas` action](https://viem.sh/docs/actions/public/estimateGas) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
|
12
12
|
*
|
13
13
|
* @param client - Client to use
|
14
14
|
* @param parameters - {@link EstimateContractGasParameters}
|
@@ -6,9 +6,9 @@ import { getGasPrice } from './getGasPrice.js';
|
|
6
6
|
/**
|
7
7
|
* Returns an estimate for the fees per gas (in wei) for a
|
8
8
|
* transaction to be likely included in the next block.
|
9
|
-
* Defaults to [`chain.fees.estimateFeesPerGas`](/docs/clients/chains
|
9
|
+
* Defaults to [`chain.fees.estimateFeesPerGas`](/docs/clients/chains#fees-estimatefeespergas) if set.
|
10
10
|
*
|
11
|
-
* - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas
|
11
|
+
* - Docs: https://viem.sh/docs/actions/public/estimateFeesPerGas
|
12
12
|
*
|
13
13
|
* @param client - Client to use
|
14
14
|
* @param parameters - {@link EstimateFeesPerGasParameters}
|
@@ -8,7 +8,7 @@ import { prepareTransactionRequest, } from '../wallet/prepareTransactionRequest.
|
|
8
8
|
/**
|
9
9
|
* Estimates the gas necessary to complete a transaction without submitting it to the network.
|
10
10
|
*
|
11
|
-
* - Docs: https://viem.sh/docs/actions/public/estimateGas
|
11
|
+
* - Docs: https://viem.sh/docs/actions/public/estimateGas
|
12
12
|
* - JSON-RPC Methods: [`eth_estimateGas`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_estimategas)
|
13
13
|
*
|
14
14
|
* @param client - Client to use
|
@@ -6,9 +6,9 @@ import { getGasPrice } from './getGasPrice.js';
|
|
6
6
|
/**
|
7
7
|
* Returns an estimate for the max priority fee per gas (in wei) for a
|
8
8
|
* transaction to be likely included in the next block.
|
9
|
-
* Defaults to [`chain.fees.defaultPriorityFee`](/docs/clients/chains
|
9
|
+
* Defaults to [`chain.fees.defaultPriorityFee`](/docs/clients/chains#fees-defaultpriorityfee) if set.
|
10
10
|
*
|
11
|
-
* - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas
|
11
|
+
* - Docs: https://viem.sh/docs/actions/public/estimateMaxPriorityFeePerGas
|
12
12
|
*
|
13
13
|
* @param client - Client to use
|
14
14
|
* @returns An estimate (in wei) for the max priority fee per gas. {@link EstimateMaxPriorityFeePerGasReturnType}
|
@@ -2,10 +2,10 @@ import { numberToHex, } from '../../utils/encoding/toHex.js';
|
|
2
2
|
/**
|
3
3
|
* Returns the balance of an address in wei.
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/docs/actions/public/getBalance
|
5
|
+
* - Docs: https://viem.sh/docs/actions/public/getBalance
|
6
6
|
* - JSON-RPC Methods: [`eth_getBalance`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getbalance)
|
7
7
|
*
|
8
|
-
* You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther
|
8
|
+
* You can convert the balance to ether units with [`formatEther`](https://viem.sh/docs/utilities/formatEther).
|
9
9
|
*
|
10
10
|
* ```ts
|
11
11
|
* const balance = await getBalance(client, {
|
@@ -4,7 +4,7 @@ import { formatBlock, } from '../../utils/formatters/block.js';
|
|
4
4
|
/**
|
5
5
|
* Returns information about a block at a block number, hash, or tag.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/actions/public/getBlock
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlock
|
8
8
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks
|
9
9
|
* - JSON-RPC Methods:
|
10
10
|
* - Calls [`eth_getBlockByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblockbynumber) for `blockNumber` & `blockTag`.
|
@@ -6,7 +6,7 @@ export function getBlockNumberCache(id) {
|
|
6
6
|
/**
|
7
7
|
* Returns the number of the most recent block seen.
|
8
8
|
*
|
9
|
-
* - Docs: https://viem.sh/docs/actions/public/getBlockNumber
|
9
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlockNumber
|
10
10
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/blocks/fetching-blocks
|
11
11
|
* - JSON-RPC Methods: [`eth_blockNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_blocknumber)
|
12
12
|
*
|
@@ -3,7 +3,7 @@ import { numberToHex, } from '../../utils/encoding/toHex.js';
|
|
3
3
|
/**
|
4
4
|
* Returns the number of Transactions at a block number, hash, or tag.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount
|
6
|
+
* - Docs: https://viem.sh/docs/actions/public/getBlockTransactionCount
|
7
7
|
* - JSON-RPC Methods:
|
8
8
|
* - Calls [`eth_getBlockTransactionCountByNumber`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbynumber) for `blockNumber` & `blockTag`.
|
9
9
|
* - Calls [`eth_getBlockTransactionCountByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getblocktransactioncountbyhash) for `blockHash`.
|
@@ -2,7 +2,7 @@ import { numberToHex, } from '../../utils/encoding/toHex.js';
|
|
2
2
|
/**
|
3
3
|
* Retrieves the bytecode at an address.
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/docs/contract/getBytecode
|
5
|
+
* - Docs: https://viem.sh/docs/contract/getBytecode
|
6
6
|
* - JSON-RPC Methods: [`eth_getCode`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getcode)
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
@@ -2,7 +2,7 @@ import { hexToNumber, } from '../../utils/encoding/fromHex.js';
|
|
2
2
|
/**
|
3
3
|
* Returns the chain ID associated with the current network.
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/docs/actions/public/getChainId
|
5
|
+
* - Docs: https://viem.sh/docs/actions/public/getChainId
|
6
6
|
* - JSON-RPC Methods: [`eth_chainId`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_chainid)
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
@@ -4,7 +4,7 @@ import { getLogs, } from './getLogs.js';
|
|
4
4
|
/**
|
5
5
|
* Returns a list of event logs emitted by a contract.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/actions/public/getContractEvents
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getContractEvents
|
8
8
|
* - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
|
9
9
|
*
|
10
10
|
* @param client - Client to use
|
@@ -3,7 +3,7 @@ import { formatFeeHistory, } from '../../utils/formatters/feeHistory.js';
|
|
3
3
|
/**
|
4
4
|
* Returns a collection of historical gas information.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/actions/public/getFeeHistory
|
6
|
+
* - Docs: https://viem.sh/docs/actions/public/getFeeHistory
|
7
7
|
* - JSON-RPC Methods: [`eth_feeHistory`](https://docs.alchemy.com/reference/eth-feehistory)
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
@@ -4,15 +4,15 @@ import { formatLog, } from '../../utils/formatters/log.js';
|
|
4
4
|
/**
|
5
5
|
* Returns a list of logs or hashes based on a [Filter](/docs/glossary/terms#filter) since the last time it was called.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/actions/public/getFilterChanges
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getFilterChanges
|
8
8
|
* - JSON-RPC Methods: [`eth_getFilterChanges`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterchanges)
|
9
9
|
*
|
10
10
|
* A Filter can be created from the following actions:
|
11
11
|
*
|
12
|
-
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter
|
13
|
-
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter
|
14
|
-
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter
|
15
|
-
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter
|
12
|
+
* - [`createBlockFilter`](https://viem.sh/docs/actions/public/createBlockFilter)
|
13
|
+
* - [`createContractEventFilter`](https://viem.sh/docs/contract/createContractEventFilter)
|
14
|
+
* - [`createEventFilter`](https://viem.sh/docs/actions/public/createEventFilter)
|
15
|
+
* - [`createPendingTransactionFilter`](https://viem.sh/docs/actions/public/createPendingTransactionFilter)
|
16
16
|
*
|
17
17
|
* Depending on the type of filter, the return value will be different:
|
18
18
|
*
|
@@ -4,7 +4,7 @@ import { formatLog, } from '../../utils/formatters/log.js';
|
|
4
4
|
/**
|
5
5
|
* Returns a list of event logs since the filter was created.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/actions/public/getFilterLogs
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getFilterLogs
|
8
8
|
* - JSON-RPC Methods: [`eth_getFilterLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getfilterlogs)
|
9
9
|
*
|
10
10
|
* `getFilterLogs` is only compatible with **event filters**.
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Returns the current price of gas (in wei).
|
3
3
|
*
|
4
|
-
* - Docs: https://viem.sh/docs/actions/public/getGasPrice
|
4
|
+
* - Docs: https://viem.sh/docs/actions/public/getGasPrice
|
5
5
|
* - JSON-RPC Methods: [`eth_gasPrice`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gasprice)
|
6
6
|
*
|
7
7
|
* @param client - Client to use
|
@@ -6,7 +6,7 @@ import { formatLog, } from '../../utils/formatters/log.js';
|
|
6
6
|
/**
|
7
7
|
* Returns a list of event logs matching the provided parameters.
|
8
8
|
*
|
9
|
-
* - Docs: https://viem.sh/docs/actions/public/getLogs
|
9
|
+
* - Docs: https://viem.sh/docs/actions/public/getLogs
|
10
10
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/filters-and-logs/event-logs
|
11
11
|
* - JSON-RPC Methods: [`eth_getLogs`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs)
|
12
12
|
*
|
@@ -3,7 +3,7 @@ import { formatProof, } from '../../utils/formatters/proof.js';
|
|
3
3
|
/**
|
4
4
|
* Returns the account and storage values of the specified account including the Merkle-proof.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/actions/public/getProof
|
6
|
+
* - Docs: https://viem.sh/docs/actions/public/getProof
|
7
7
|
* - JSON-RPC Methods:
|
8
8
|
* - Calls [`eth_getProof`](https://eips.ethereum.org/EIPS/eip-1186)
|
9
9
|
*
|
@@ -2,7 +2,7 @@ import { numberToHex, } from '../../utils/encoding/toHex.js';
|
|
2
2
|
/**
|
3
3
|
* Returns the value from a storage slot at a given address.
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/docs/contract/getStorageAt
|
5
|
+
* - Docs: https://viem.sh/docs/contract/getStorageAt
|
6
6
|
* - JSON-RPC Methods: [`eth_getStorageAt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getstorageat)
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
@@ -2,9 +2,9 @@ import { TransactionNotFoundError } from '../../errors/transaction.js';
|
|
2
2
|
import { numberToHex, } from '../../utils/encoding/toHex.js';
|
3
3
|
import { formatTransaction, } from '../../utils/formatters/transaction.js';
|
4
4
|
/**
|
5
|
-
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms
|
5
|
+
* Returns information about a [Transaction](https://viem.sh/docs/glossary/terms#transaction) given a hash or block identifier.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/actions/public/getTransaction
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransaction
|
8
8
|
* - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
|
9
9
|
* - JSON-RPC Methods: [`eth_getTransactionByHash`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionByHash)
|
10
10
|
*
|
@@ -4,7 +4,7 @@ import { getTransaction, } from './getTransaction.js';
|
|
4
4
|
/**
|
5
5
|
* Returns the number of blocks passed (confirmations) since the transaction was processed on a block.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations
|
7
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionConfirmations
|
8
8
|
* - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
|
9
9
|
* - JSON-RPC Methods: [`eth_getTransactionConfirmations`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getTransactionConfirmations)
|
10
10
|
*
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { hexToNumber, } from '../../utils/encoding/fromHex.js';
|
2
2
|
import { numberToHex, } from '../../utils/encoding/toHex.js';
|
3
3
|
/**
|
4
|
-
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms
|
4
|
+
* Returns the number of [Transactions](https://viem.sh/docs/glossary/terms#transaction) an Account has broadcast / sent.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/actions/public/getTransactionCount
|
6
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionCount
|
7
7
|
* - JSON-RPC Methods: [`eth_getTransactionCount`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactioncount)
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { TransactionReceiptNotFoundError, } from '../../errors/transaction.js';
|
2
2
|
import { formatTransactionReceipt, } from '../../utils/formatters/transactionReceipt.js';
|
3
3
|
/**
|
4
|
-
* Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms
|
4
|
+
* Returns the [Transaction Receipt](https://viem.sh/docs/glossary/terms#transaction-receipt) given a [Transaction](https://viem.sh/docs/glossary/terms#transaction) hash.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt
|
6
|
+
* - Docs: https://viem.sh/docs/actions/public/getTransactionReceipt
|
7
7
|
* - Example: https://stackblitz.com/github/wevm/viem/tree/main/examples/transactions/fetching-transactions
|
8
8
|
* - JSON-RPC Methods: [`eth_getTransactionReceipt`](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_gettransactionreceipt)
|
9
9
|
*
|
@@ -9,9 +9,9 @@ import { getContractError, } from '../../utils/errors/getContractError.js';
|
|
9
9
|
import { getAction } from '../../utils/getAction.js';
|
10
10
|
import { readContract } from './readContract.js';
|
11
11
|
/**
|
12
|
-
* Similar to [`readContract`](https://viem.sh/docs/contract/readContract
|
12
|
+
* Similar to [`readContract`](https://viem.sh/docs/contract/readContract), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
|
13
13
|
*
|
14
|
-
* - Docs: https://viem.sh/docs/contract/multicall
|
14
|
+
* - Docs: https://viem.sh/docs/contract/multicall
|
15
15
|
*
|
16
16
|
* @param client - Client to use
|
17
17
|
* @param parameters - {@link MulticallParameters}
|
@@ -6,12 +6,12 @@ import { call } from './call.js';
|
|
6
6
|
/**
|
7
7
|
* Calls a read-only function on a contract, and returns the response.
|
8
8
|
*
|
9
|
-
* - Docs: https://viem.sh/docs/contract/readContract
|
9
|
+
* - Docs: https://viem.sh/docs/contract/readContract
|
10
10
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/reading-contracts
|
11
11
|
*
|
12
12
|
* 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.
|
13
13
|
*
|
14
|
-
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public
|
14
|
+
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
|
15
15
|
*
|
16
16
|
* @param client - Client to use
|
17
17
|
* @param parameters - {@link ReadContractParameters}
|
@@ -7,12 +7,12 @@ import { call } from './call.js';
|
|
7
7
|
/**
|
8
8
|
* Simulates/validates a contract interaction. This is useful for retrieving **return data** and **revert reasons** of contract write functions.
|
9
9
|
*
|
10
|
-
* - Docs: https://viem.sh/docs/contract/simulateContract
|
10
|
+
* - Docs: https://viem.sh/docs/contract/simulateContract
|
11
11
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
|
12
12
|
*
|
13
|
-
* 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
|
13
|
+
* This function does not require gas to execute and _**does not**_ change the state of the blockchain. It is almost identical to [`readContract`](https://viem.sh/docs/contract/readContract), but also supports contract write functions.
|
14
14
|
*
|
15
|
-
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public
|
15
|
+
* Internally, uses a [Public Client](https://viem.sh/docs/clients/public) to call the [`call` action](https://viem.sh/docs/actions/public/call) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
|
16
16
|
*
|
17
17
|
* @param client - Client to use
|
18
18
|
* @param parameters - {@link SimulateContractParameters}
|