viem 0.0.0-main.20240110T144731 → 0.0.0-main.20240110T220130
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
@@ -20,18 +20,18 @@ export type WriteContractErrorType = EncodeFunctionDataErrorType | SendTransacti
|
|
20
20
|
/**
|
21
21
|
* Executes a write function on a contract.
|
22
22
|
*
|
23
|
-
* - Docs: https://viem.sh/docs/contract/writeContract
|
23
|
+
* - Docs: https://viem.sh/docs/contract/writeContract
|
24
24
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
|
25
25
|
*
|
26
|
-
* A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms
|
26
|
+
* A "write" function on a Solidity contract modifies the state of the blockchain. These types of functions require gas to be executed, and hence a [Transaction](https://viem.sh/docs/glossary/terms) is needed to be broadcast in order to change the state.
|
27
27
|
*
|
28
|
-
* Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet
|
28
|
+
* Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet) to call the [`sendTransaction` action](https://viem.sh/docs/actions/wallet/sendTransaction) with [ABI-encoded `data`](https://viem.sh/docs/contract/encodeFunctionData).
|
29
29
|
*
|
30
|
-
* __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract
|
30
|
+
* __Warning: The `write` internally sends a transaction – it does not validate if the contract write will succeed (the contract may throw an error). It is highly recommended to [simulate the contract write with `contract.simulate`](https://viem.sh/docs/contract/writeContract#usage) before you execute it.__
|
31
31
|
*
|
32
32
|
* @param client - Client to use
|
33
33
|
* @param parameters - {@link WriteContractParameters}
|
34
|
-
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms
|
34
|
+
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
|
35
35
|
*
|
36
36
|
* @example
|
37
37
|
* import { createWalletClient, custom, parseAbi } from 'viem'
|
@@ -38,7 +38,7 @@ export type BuildDepositTransactionErrorType = ParseAccountErrorType | PrepareTr
|
|
38
38
|
/**
|
39
39
|
* Prepares parameters for a [deposit transaction](https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md) to be initiated on an L1.
|
40
40
|
*
|
41
|
-
* - Docs: https://viem.sh/op-stack/actions/buildDepositTransaction
|
41
|
+
* - Docs: https://viem.sh/op-stack/actions/buildDepositTransaction
|
42
42
|
*
|
43
43
|
* @param client - Client to use
|
44
44
|
* @param parameters - {@link BuildDepositTransactionParameters}
|
@@ -24,7 +24,7 @@ export type BuildInitiateWithdrawalErrorType = ParseAccountErrorType | PrepareTr
|
|
24
24
|
/**
|
25
25
|
* Prepares parameters for a [withdrawal](https://community.optimism.io/docs/protocol/withdrawal-flow/#withdrawal-initiating-transaction) from an L2 to the L1.
|
26
26
|
*
|
27
|
-
* - Docs: https://viem.sh/op-stack/actions/buildInitiateWithdrawal
|
27
|
+
* - Docs: https://viem.sh/op-stack/actions/buildInitiateWithdrawal
|
28
28
|
*
|
29
29
|
* @param client - Client to use
|
30
30
|
* @param parameters - {@link BuildInitiateWithdrawalParameters}
|
@@ -23,7 +23,7 @@ export type BuildProveWithdrawalErrorType = GetBlockErrorType | GetProofErrorTyp
|
|
23
23
|
/**
|
24
24
|
* Builds the transaction that proves a withdrawal was initiated on an L2. Used in the Withdrawal flow.
|
25
25
|
*
|
26
|
-
* - Docs: https://viem.sh/op-stack/actions/buildProveWithdrawal
|
26
|
+
* - Docs: https://viem.sh/op-stack/actions/buildProveWithdrawal
|
27
27
|
*
|
28
28
|
* @param client - Client to use
|
29
29
|
* @param parameters - {@link BuildProveWithdrawalParameters}
|
@@ -28,7 +28,7 @@ export type DepositTransactionErrorType = EstimateDepositTransactionGasErrorType
|
|
28
28
|
* Internally performs a contract write to the [`depositTransaction` function](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/OptimismPortal.sol#L378)
|
29
29
|
* on the [Optimism Portal contract](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/OptimismPortal.sol).
|
30
30
|
*
|
31
|
-
* - Docs: https://viem.sh/op-stack/actions/depositTransaction
|
31
|
+
* - Docs: https://viem.sh/op-stack/actions/depositTransaction
|
32
32
|
*
|
33
33
|
* @param client - Client to use
|
34
34
|
* @param parameters - {@link DepositTransactionParameters}
|
@@ -20,7 +20,7 @@ export type EstimateDepositTransactionGasErrorType = EstimateContractGasErrorTyp
|
|
20
20
|
/**
|
21
21
|
* Estimates gas required to initiate a [deposit transaction](https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md) on an L1, which executes a transaction on L2.
|
22
22
|
*
|
23
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateDepositTransactionGas
|
23
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateDepositTransactionGas
|
24
24
|
*
|
25
25
|
* @param client - Client to use
|
26
26
|
* @param parameters - {@link EstimateDepositTransactionGasParameters}
|
@@ -19,7 +19,7 @@ export type EstimateFinalizeWithdrawalGasErrorType = EstimateContractGasErrorTyp
|
|
19
19
|
/**
|
20
20
|
* Estimates gas required to finalize a withdrawal that occurred on an L2.
|
21
21
|
*
|
22
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateFinalizeWithdrawalGas
|
22
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateFinalizeWithdrawalGas
|
23
23
|
*
|
24
24
|
* @param client - Client to use
|
25
25
|
* @param parameters - {@link EstimateFinalizeWithdrawalGasParameters}
|
@@ -22,7 +22,7 @@ export type EstimateInitiateWithdrawalGasErrorType = EstimateContractGasErrorTyp
|
|
22
22
|
/**
|
23
23
|
* Estimates gas required to initiate a [withdrawal](https://community.optimism.io/docs/protocol/withdrawal-flow/#withdrawal-initiating-transaction) on an L2 to the L1.
|
24
24
|
*
|
25
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateInitiateWithdrawalGas
|
25
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateInitiateWithdrawalGas
|
26
26
|
*
|
27
27
|
* @param client - Client to use
|
28
28
|
* @param parameters - {@link EstimateInitiateWithdrawalGasParameters}
|
@@ -34,7 +34,7 @@ export type EstimateProveWithdrawalGasErrorType = EstimateContractGasErrorType |
|
|
34
34
|
/**
|
35
35
|
* Estimates gas required to prove a withdrawal that occurred on an L2.
|
36
36
|
*
|
37
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateProveWithdrawalGas
|
37
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateProveWithdrawalGas
|
38
38
|
*
|
39
39
|
* @param client - Client to use
|
40
40
|
* @param parameters - {@link EstimateProveWithdrawalGasParameters}
|
@@ -24,7 +24,7 @@ export type FinalizeWithdrawalErrorType = EstimateFinalizeWithdrawalGasErrorType
|
|
24
24
|
/**
|
25
25
|
* Finalizes a withdrawal that occurred on an L2. Used in the Withdrawal flow.
|
26
26
|
*
|
27
|
-
* - Docs: https://viem.sh/op-stack/actions/finalizeWithdrawal
|
27
|
+
* - Docs: https://viem.sh/op-stack/actions/finalizeWithdrawal
|
28
28
|
*
|
29
29
|
* @param client - Client to use
|
30
30
|
* @param parameters - {@link FinalizeWithdrawalParameters}
|
@@ -19,7 +19,7 @@ export type GetL2OutputErrorType = ReadContractErrorType | ErrorType;
|
|
19
19
|
/**
|
20
20
|
* Retrieves the first L2 output proposal that occurred after a provided block number.
|
21
21
|
*
|
22
|
-
* - Docs: https://viem.sh/op-stack/actions/getL2Output
|
22
|
+
* - Docs: https://viem.sh/op-stack/actions/getL2Output
|
23
23
|
*
|
24
24
|
* @param client - Client to use
|
25
25
|
* @param parameters - {@link GetL2OutputParameters}
|
@@ -19,9 +19,9 @@ export type GetTimeToFinalizeReturnType = {
|
|
19
19
|
};
|
20
20
|
export type GetTimeToFinalizeErrorType = MulticallErrorType | ErrorType;
|
21
21
|
/**
|
22
|
-
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
22
|
+
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
23
23
|
*
|
24
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
24
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
25
25
|
*
|
26
26
|
* @param client - Client to use
|
27
27
|
* @param parameters - {@link GetTimeToFinalizeParameters}
|
@@ -30,9 +30,9 @@ export type GetTimeToNextL2OutputReturnType = {
|
|
30
30
|
};
|
31
31
|
export type GetTimeToNextL2OutputErrorType = MulticallErrorType | ReadContractErrorType | ErrorType;
|
32
32
|
/**
|
33
|
-
* Returns the time until the next L2 output (after the provided block number) is submitted. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
33
|
+
* Returns the time until the next L2 output (after the provided block number) is submitted. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
34
34
|
*
|
35
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToNextL2Output
|
35
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToNextL2Output
|
36
36
|
*
|
37
37
|
* @param client - Client to use
|
38
38
|
* @param parameters - {@link GetTimeToNextL2OutputParameters}
|
@@ -17,9 +17,9 @@ export type GetTimeToProveParameters<chain extends Chain | undefined = Chain | u
|
|
17
17
|
export type GetTimeToProveReturnType = GetTimeToNextL2OutputReturnType;
|
18
18
|
export type GetTimeToProveErrorType = GetTimeToNextL2OutputErrorType | ErrorType;
|
19
19
|
/**
|
20
|
-
* Returns the time until the withdrawal transaction is ready to prove. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
20
|
+
* Returns the time until the withdrawal transaction is ready to prove. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
21
21
|
*
|
22
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToProve
|
22
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToProve
|
23
23
|
*
|
24
24
|
* @param client - Client to use
|
25
25
|
* @param parameters - {@link GetTimeToNextL2OutputParameters}
|
@@ -15,9 +15,9 @@ export type GetWithdrawalStatusParameters<chain extends Chain | undefined = Chai
|
|
15
15
|
export type GetWithdrawalStatusReturnType = 'waiting-to-prove' | 'ready-to-prove' | 'waiting-to-finalize' | 'ready-to-finalize' | 'finalized';
|
16
16
|
export type GetWithdrawalStatusErrorType = GetL2OutputErrorType | GetTimeToFinalizeErrorType | GetWithdrawalsErrorType | ReadContractErrorType | ErrorType;
|
17
17
|
/**
|
18
|
-
* Returns the current status of a withdrawal. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
18
|
+
* Returns the current status of a withdrawal. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
19
19
|
*
|
20
|
-
* - Docs: https://viem.sh/op-stack/actions/getWithdrawalStatus
|
20
|
+
* - Docs: https://viem.sh/op-stack/actions/getWithdrawalStatus
|
21
21
|
*
|
22
22
|
* @param client - Client to use
|
23
23
|
* @param parameters - {@link GetWithdrawalStatusParameters}
|
@@ -27,7 +27,7 @@ export type InitiateWithdrawalErrorType = EstimateInitiateWithdrawalGasErrorType
|
|
27
27
|
* Internally performs a contract write to the [`initiateWithdrawal` function](https://github.com/ethereum-optimism/optimism/blob/283f0aa2e3358ced30ff7cbd4028c0c0c3faa140/packages/contracts-bedrock/src/L2/L2ToL1MessagePasser.sol#L73)
|
28
28
|
* on the [Optimism L2ToL1MessagePasser predeploy contract](https://github.com/ethereum-optimism/optimism/blob/283f0aa2e3358ced30ff7cbd4028c0c0c3faa140/packages/contracts-bedrock/src/L2/L2ToL1MessagePasser.sol).
|
29
29
|
*
|
30
|
-
* - Docs: https://viem.sh/op-stack/actions/initiateWithdrawal
|
30
|
+
* - Docs: https://viem.sh/op-stack/actions/initiateWithdrawal
|
31
31
|
*
|
32
32
|
* @param client - Client to use
|
33
33
|
* @param parameters - {@link InitiateWithdrawalParameters}
|
@@ -38,7 +38,7 @@ export type ProveWithdrawalErrorType = EstimateProveWithdrawalGasErrorType | Wri
|
|
38
38
|
/**
|
39
39
|
* Proves a withdrawal that occurred on an L2. Used in the Withdrawal flow.
|
40
40
|
*
|
41
|
-
* - Docs: https://viem.sh/op-stack/actions/proveWithdrawal
|
41
|
+
* - Docs: https://viem.sh/op-stack/actions/proveWithdrawal
|
42
42
|
*
|
43
43
|
* @param client - Client to use
|
44
44
|
* @param parameters - {@link ProveWithdrawalParameters}
|
@@ -24,7 +24,7 @@ export type WaitForNextL2OutputErrorType = GetL2OutputErrorType | GetTimeToNextL
|
|
24
24
|
/**
|
25
25
|
* Waits for the next L2 output (after the provided block number) to be submitted.
|
26
26
|
*
|
27
|
-
* - Docs: https://viem.sh/op-stack/actions/waitForNextL2Output
|
27
|
+
* - Docs: https://viem.sh/op-stack/actions/waitForNextL2Output
|
28
28
|
*
|
29
29
|
* @param client - Client to use
|
30
30
|
* @param parameters - {@link WaitForNextL2OutputParameters}
|
@@ -8,9 +8,9 @@ export type WaitToFinalizeParameters<chain extends Chain | undefined = Chain | u
|
|
8
8
|
export type WaitToFinalizeReturnType = void;
|
9
9
|
export type WaitToFinalizeErrorType = GetTimeToFinalizeErrorType | ErrorType;
|
10
10
|
/**
|
11
|
-
* Waits until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
11
|
+
* Waits until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
12
12
|
*
|
13
|
-
* - Docs: https://viem.sh/op-stack/actions/waitToFinalize
|
13
|
+
* - Docs: https://viem.sh/op-stack/actions/waitToFinalize
|
14
14
|
*
|
15
15
|
* @param client - Client to use
|
16
16
|
* @param parameters - {@link WaitToFinalizeParameters}
|
@@ -22,9 +22,9 @@ export type WaitToProveReturnType = {
|
|
22
22
|
};
|
23
23
|
export type WaitToProveErrorType = GetWithdrawalsErrorType | WaitForNextL2OutputErrorType | ErrorType;
|
24
24
|
/**
|
25
|
-
* Waits until the L2 withdrawal transaction is ready to be proved. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
25
|
+
* Waits until the L2 withdrawal transaction is ready to be proved. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
26
26
|
*
|
27
|
-
* - Docs: https://viem.sh/op-stack/actions/waitToProve
|
27
|
+
* - Docs: https://viem.sh/op-stack/actions/waitToProve
|
28
28
|
*
|
29
29
|
* @param client - Client to use
|
30
30
|
* @param parameters - {@link WaitToProveParameters}
|
@@ -19,7 +19,7 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
19
19
|
/**
|
20
20
|
* Prepares parameters for a [deposit transaction](https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md) to be initiated on an L1.
|
21
21
|
*
|
22
|
-
* - Docs: https://viem.sh/op-stack/actions/buildInitiateWithdrawal
|
22
|
+
* - Docs: https://viem.sh/op-stack/actions/buildInitiateWithdrawal
|
23
23
|
*
|
24
24
|
* @param client - Client to use
|
25
25
|
* @param parameters - {@link BuildInitiateWithdrawalParameters}
|
@@ -45,7 +45,7 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
45
45
|
/**
|
46
46
|
* Estimates gas required to initiate a [deposit transaction](https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md) on an L1, which executes a transaction on L2.
|
47
47
|
*
|
48
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateDepositTransactionGas
|
48
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateDepositTransactionGas
|
49
49
|
*
|
50
50
|
* @param client - Client to use
|
51
51
|
* @param parameters - {@link EstimateDepositTransactionGasParameters}
|
@@ -75,7 +75,7 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
75
75
|
/**
|
76
76
|
* Estimates gas required to prove a withdrawal that occurred on an L2.
|
77
77
|
*
|
78
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateProveWithdrawalGas
|
78
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateProveWithdrawalGas
|
79
79
|
*
|
80
80
|
* @param client - Client to use
|
81
81
|
* @param parameters - {@link EstimateProveWithdrawalGasParameters}
|
@@ -104,7 +104,7 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
104
104
|
/**
|
105
105
|
* Estimates gas required to finalize a withdrawal that occurred on an L2.
|
106
106
|
*
|
107
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateFinalizeWithdrawalGas
|
107
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateFinalizeWithdrawalGas
|
108
108
|
*
|
109
109
|
* @param client - Client to use
|
110
110
|
* @param parameters - {@link EstimateFinalizeWithdrawalGasParameters}
|
@@ -128,9 +128,9 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
128
128
|
*/
|
129
129
|
estimateFinalizeWithdrawalGas: <chainOverride extends Chain | undefined = undefined>(parameters: EstimateFinalizeWithdrawalGasParameters<chain, account, chainOverride>) => Promise<EstimateFinalizeWithdrawalGasReturnType>;
|
130
130
|
/**
|
131
|
-
* Retrieves the first L2 output proposal that occurred after a provided block number. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
131
|
+
* Retrieves the first L2 output proposal that occurred after a provided block number. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
132
132
|
*
|
133
|
-
* - Docs: https://viem.sh/op-stack/actions/getL2Output
|
133
|
+
* - Docs: https://viem.sh/op-stack/actions/getL2Output
|
134
134
|
*
|
135
135
|
* @param client - Client to use
|
136
136
|
* @param parameters - {@link GetL2OutputParameters}
|
@@ -153,9 +153,9 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
153
153
|
*/
|
154
154
|
getL2Output: <chainOverride extends Chain | undefined = undefined>(parameters: GetL2OutputParameters<chain, chainOverride>) => Promise<GetL2OutputReturnType>;
|
155
155
|
/**
|
156
|
-
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
156
|
+
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
157
157
|
*
|
158
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
158
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
159
159
|
*
|
160
160
|
* @param client - Client to use
|
161
161
|
* @param parameters - {@link GetTimeToFinalizeParameters}
|
@@ -189,9 +189,9 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
189
189
|
*/
|
190
190
|
getTimeToFinalize: <chainOverride extends Chain | undefined = undefined>(parameters: GetTimeToFinalizeParameters<chain, chainOverride>) => Promise<GetTimeToFinalizeReturnType>;
|
191
191
|
/**
|
192
|
-
* Returns the time until the next L2 output (after a provided block number) is submitted. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
192
|
+
* Returns the time until the next L2 output (after a provided block number) is submitted. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
193
193
|
*
|
194
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToNextL2Output
|
194
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToNextL2Output
|
195
195
|
*
|
196
196
|
* @param client - Client to use
|
197
197
|
* @param parameters - {@link GetTimeToNextL2OutputParameters}
|
@@ -219,9 +219,9 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
219
219
|
*/
|
220
220
|
getTimeToNextL2Output: <chainOverride extends Chain | undefined = undefined>(parameters: GetTimeToNextL2OutputParameters<chain, chainOverride>) => Promise<GetTimeToNextL2OutputReturnType>;
|
221
221
|
/**
|
222
|
-
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
222
|
+
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
223
223
|
*
|
224
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
224
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
225
225
|
*
|
226
226
|
* @param client - Client to use
|
227
227
|
* @param parameters - {@link GetTimeToFinalizeParameters}
|
@@ -255,9 +255,9 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
255
255
|
*/
|
256
256
|
getTimeToProve: <chainOverride extends Chain | undefined = undefined>(parameters: GetTimeToProveParameters<chain, chainOverride>) => Promise<GetTimeToProveReturnType>;
|
257
257
|
/**
|
258
|
-
* Returns the current status of a withdrawal. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
258
|
+
* Returns the current status of a withdrawal. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
259
259
|
*
|
260
|
-
* - Docs: https://viem.sh/op-stack/actions/getWithdrawalStatus
|
260
|
+
* - Docs: https://viem.sh/op-stack/actions/getWithdrawalStatus
|
261
261
|
*
|
262
262
|
* @param client - Client to use
|
263
263
|
* @param parameters - {@link GetWithdrawalStatusParameters}
|
@@ -288,7 +288,7 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
288
288
|
/**
|
289
289
|
* Waits for the next L2 output (after the provided block number) to be submitted.
|
290
290
|
*
|
291
|
-
* - Docs: https://viem.sh/op-stack/actions/waitForNextL2Output
|
291
|
+
* - Docs: https://viem.sh/op-stack/actions/waitForNextL2Output
|
292
292
|
*
|
293
293
|
* @param client - Client to use
|
294
294
|
* @param parameters - {@link WaitForNextL2OutputParameters}
|
@@ -316,9 +316,9 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
316
316
|
*/
|
317
317
|
waitForNextL2Output: <chainOverride extends Chain | undefined = undefined>(parameters: WaitForNextL2OutputParameters<chain, chainOverride>) => Promise<WaitForNextL2OutputReturnType>;
|
318
318
|
/**
|
319
|
-
* Waits until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
319
|
+
* Waits until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
320
320
|
*
|
321
|
-
* - Docs: https://viem.sh/op-stack/actions/waitToFinalize
|
321
|
+
* - Docs: https://viem.sh/op-stack/actions/waitToFinalize
|
322
322
|
*
|
323
323
|
* @param client - Client to use
|
324
324
|
* @param parameters - {@link WaitToFinalizeParameters}
|
@@ -351,9 +351,9 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
351
351
|
*/
|
352
352
|
waitToFinalize: <chainOverride extends Chain | undefined = undefined>(parameters: WaitToFinalizeParameters<chain, chainOverride>) => Promise<WaitToFinalizeReturnType>;
|
353
353
|
/**
|
354
|
-
* Waits until the L2 withdrawal transaction is provable. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
354
|
+
* Waits until the L2 withdrawal transaction is provable. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
355
355
|
*
|
356
|
-
* - Docs: https://viem.sh/op-stack/actions/waitToProve
|
356
|
+
* - Docs: https://viem.sh/op-stack/actions/waitToProve
|
357
357
|
*
|
358
358
|
* @param client - Client to use
|
359
359
|
* @param parameters - {@link WaitToProveParameters}
|
@@ -385,7 +385,7 @@ export type PublicActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
385
385
|
/**
|
386
386
|
* A suite of Public Actions for suited for development with Layer 2 (OP Stack) chains.
|
387
387
|
*
|
388
|
-
* - Docs: https://viem.sh/op-stack/client
|
388
|
+
* - Docs: https://viem.sh/op-stack/client
|
389
389
|
*
|
390
390
|
* @example
|
391
391
|
* import { publicActionsL1 } from 'viem/op-stack'
|
@@ -19,7 +19,7 @@ export type PublicActionsL2<chain extends Chain | undefined = Chain | undefined,
|
|
19
19
|
/**
|
20
20
|
* Prepares parameters for a [deposit transaction](https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md) to be initiated on an L1.
|
21
21
|
*
|
22
|
-
* - Docs: https://viem.sh/op-stack/actions/buildDepositTransaction
|
22
|
+
* - Docs: https://viem.sh/op-stack/actions/buildDepositTransaction
|
23
23
|
*
|
24
24
|
* @param client - Client to use
|
25
25
|
* @param parameters - {@link BuildDepositTransactionParameters}
|
@@ -45,7 +45,7 @@ export type PublicActionsL2<chain extends Chain | undefined = Chain | undefined,
|
|
45
45
|
/**
|
46
46
|
* Builds the transaction that proves a withdrawal was initiated on an L2. Used in the Withdrawal flow.
|
47
47
|
*
|
48
|
-
* - Docs: https://viem.sh/op-stack/actions/buildProveWithdrawal
|
48
|
+
* - Docs: https://viem.sh/op-stack/actions/buildProveWithdrawal
|
49
49
|
*
|
50
50
|
* @param client - Client to use
|
51
51
|
* @param parameters - {@link BuildProveWithdrawalParameters}
|
@@ -170,7 +170,7 @@ export type PublicActionsL2<chain extends Chain | undefined = Chain | undefined,
|
|
170
170
|
/**
|
171
171
|
* Estimates gas required to initiate a [withdrawal](https://community.optimism.io/docs/protocol/withdrawal-flow/#withdrawal-initiating-transaction) on an L2 to the L1.
|
172
172
|
*
|
173
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateInitiateWithdrawalGas
|
173
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateInitiateWithdrawalGas
|
174
174
|
*
|
175
175
|
* @param client - Client to use
|
176
176
|
* @param parameters - {@link EstimateInitiateWithdrawalGasParameters}
|
@@ -296,7 +296,7 @@ export type PublicActionsL2<chain extends Chain | undefined = Chain | undefined,
|
|
296
296
|
/**
|
297
297
|
* A suite of Public Actions for suited for development with Layer 2 (OP Stack) chains.
|
298
298
|
*
|
299
|
-
* - Docs: https://viem.sh/op-stack/client
|
299
|
+
* - Docs: https://viem.sh/op-stack/client
|
300
300
|
*
|
301
301
|
* @example
|
302
302
|
* import { publicActionsL2 } from 'viem/op-stack'
|
@@ -12,7 +12,7 @@ export type WalletActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
12
12
|
* Internally performs a contract write to the [`depositTransaction` function](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/OptimismPortal.sol#L378)
|
13
13
|
* on the [Optimism Portal contract](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/OptimismPortal.sol).
|
14
14
|
*
|
15
|
-
* - Docs: https://viem.sh/op-stack/actions/depositTransaction
|
15
|
+
* - Docs: https://viem.sh/op-stack/actions/depositTransaction
|
16
16
|
*
|
17
17
|
* @param client - Client to use
|
18
18
|
* @param parameters - {@link DepositTransactionParameters}
|
@@ -64,7 +64,7 @@ export type WalletActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
64
64
|
/**
|
65
65
|
* Finalizes a withdrawal that occurred on an L2. Used in the Withdrawal flow.
|
66
66
|
*
|
67
|
-
* - Docs: https://viem.sh/op-stack/actions/finalizeWithdrawal
|
67
|
+
* - Docs: https://viem.sh/op-stack/actions/finalizeWithdrawal
|
68
68
|
*
|
69
69
|
* @param client - Client to use
|
70
70
|
* @param parameters - {@link FinalizeWithdrawalParameters}
|
@@ -89,7 +89,7 @@ export type WalletActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
89
89
|
/**
|
90
90
|
* Proves a withdrawal that occurred on an L2. Used in the Withdrawal flow.
|
91
91
|
*
|
92
|
-
* - Docs: https://viem.sh/op-stack/actions/proveWithdrawal
|
92
|
+
* - Docs: https://viem.sh/op-stack/actions/proveWithdrawal
|
93
93
|
*
|
94
94
|
* @param client - Client to use
|
95
95
|
* @param parameters - {@link ProveWithdrawalParameters}
|
@@ -118,7 +118,7 @@ export type WalletActionsL1<chain extends Chain | undefined = Chain | undefined,
|
|
118
118
|
/**
|
119
119
|
* A suite of Wallet Actions for suited for development with Layer 2 (OP Stack) chains.
|
120
120
|
*
|
121
|
-
* - Docs: https://viem.sh/op-stack/client
|
121
|
+
* - Docs: https://viem.sh/op-stack/client
|
122
122
|
*
|
123
123
|
* @example
|
124
124
|
* import { createPublicClient, createWalletClient, http } from 'viem'
|
@@ -10,7 +10,7 @@ export type WalletActionsL2<chain extends Chain | undefined = Chain | undefined,
|
|
10
10
|
* Internally performs a contract write to the [`initiateWithdrawal` function](https://github.com/ethereum-optimism/optimism/blob/283f0aa2e3358ced30ff7cbd4028c0c0c3faa140/packages/contracts-bedrock/src/L2/L2ToL1MessagePasser.sol#L73)
|
11
11
|
* on the [Optimism L2ToL1MessagePasser predeploy contract](https://github.com/ethereum-optimism/optimism/blob/283f0aa2e3358ced30ff7cbd4028c0c0c3faa140/packages/contracts-bedrock/src/L2/L2ToL1MessagePasser.sol).
|
12
12
|
*
|
13
|
-
* - Docs: https://viem.sh/op-stack/actions/initiateWithdrawal
|
13
|
+
* - Docs: https://viem.sh/op-stack/actions/initiateWithdrawal
|
14
14
|
*
|
15
15
|
* @param client - Client to use
|
16
16
|
* @param parameters - {@link InitiateWithdrawalParameters}
|
@@ -61,7 +61,7 @@ export type WalletActionsL2<chain extends Chain | undefined = Chain | undefined,
|
|
61
61
|
/**
|
62
62
|
* A suite of Wallet Actions for suited for development with Layer 2 (OP Stack) chains.
|
63
63
|
*
|
64
|
-
* - Docs: https://viem.sh/op-stack/client
|
64
|
+
* - Docs: https://viem.sh/op-stack/client
|
65
65
|
*
|
66
66
|
* @example
|
67
67
|
* import { createPublicClient, createWalletClient, http } from 'viem'
|
@@ -9,9 +9,9 @@ export type PublicClientConfig<transport extends Transport = Transport, chain ex
|
|
9
9
|
export type PublicClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined> = Prettify<Client<transport, chain, undefined, PublicRpcSchema, PublicActions<transport, chain>>>;
|
10
10
|
export type CreatePublicClientErrorType = CreateClientErrorType | ErrorType;
|
11
11
|
/**
|
12
|
-
* Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro
|
12
|
+
* Creates a Public Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
|
13
13
|
*
|
14
|
-
* - Docs: https://viem.sh/docs/clients/public
|
14
|
+
* - Docs: https://viem.sh/docs/clients/public
|
15
15
|
*
|
16
16
|
* A Public Client is an interface to "public" [JSON-RPC API](https://ethereum.org/en/developers/docs/apis/json-rpc/) methods such as retrieving block numbers, transactions, reading from smart contracts, etc through [Public Actions](/docs/actions/public/introduction).
|
17
17
|
*
|
@@ -21,11 +21,11 @@ export type CreateTestClientErrorType = CreateClientErrorType | ErrorType;
|
|
21
21
|
* @description Creates a test client with a given transport.
|
22
22
|
*/
|
23
23
|
/**
|
24
|
-
* Creates a Test Client with a given [Transport](https://viem.sh/docs/clients/intro
|
24
|
+
* Creates a Test Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
|
25
25
|
*
|
26
|
-
* - Docs: https://viem.sh/docs/clients/test
|
26
|
+
* - Docs: https://viem.sh/docs/clients/test
|
27
27
|
*
|
28
|
-
* A Test Client is an interface to "test" JSON-RPC API methods accessible through a local Ethereum test node such as [Anvil](https://book.getfoundry.sh/anvil/) or [Hardhat](https://hardhat.org/) such as mining blocks, impersonating accounts, setting fees, etc through [Test Actions](https://viem.sh/docs/actions/test/introduction
|
28
|
+
* A Test Client is an interface to "test" JSON-RPC API methods accessible through a local Ethereum test node such as [Anvil](https://book.getfoundry.sh/anvil/) or [Hardhat](https://hardhat.org/) such as mining blocks, impersonating accounts, setting fees, etc through [Test Actions](https://viem.sh/docs/actions/test/introduction).
|
29
29
|
*
|
30
30
|
* @param config - {@link TestClientConfig}
|
31
31
|
* @returns A Test Client. {@link TestClient}
|
@@ -12,15 +12,15 @@ export type WalletClientConfig<transport extends Transport = Transport, chain ex
|
|
12
12
|
export type WalletClient<transport extends Transport = Transport, chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = Prettify<Client<transport, chain, account, WalletRpcSchema, WalletActions<chain, account>>>;
|
13
13
|
export type CreateWalletClientErrorType = CreateClientErrorType | ErrorType;
|
14
14
|
/**
|
15
|
-
* Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro
|
15
|
+
* Creates a Wallet Client with a given [Transport](https://viem.sh/docs/clients/intro) configured for a [Chain](https://viem.sh/docs/clients/chains).
|
16
16
|
*
|
17
|
-
* - Docs: https://viem.sh/docs/clients/wallet
|
17
|
+
* - Docs: https://viem.sh/docs/clients/wallet
|
18
18
|
*
|
19
|
-
* A Wallet Client is an interface to interact with [Ethereum Account(s)](https://ethereum.org/en/glossary/#account) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through [Wallet Actions](https://viem.sh/docs/actions/wallet/introduction
|
19
|
+
* A Wallet Client is an interface to interact with [Ethereum Account(s)](https://ethereum.org/en/glossary/#account) and provides the ability to retrieve accounts, execute transactions, sign messages, etc. through [Wallet Actions](https://viem.sh/docs/actions/wallet/introduction).
|
20
20
|
*
|
21
21
|
* The Wallet Client supports signing over:
|
22
|
-
* - [JSON-RPC Accounts](https://viem.sh/docs/clients/wallet
|
23
|
-
* - [Local Accounts](https://viem.sh/docs/clients/wallet
|
22
|
+
* - [JSON-RPC Accounts](https://viem.sh/docs/clients/wallet#json-rpc-accounts) (e.g. Browser Extension Wallets, WalletConnect, etc).
|
23
|
+
* - [Local Accounts](https://viem.sh/docs/clients/wallet#local-accounts-private-key-mnemonic-etc) (e.g. private key/mnemonic wallets).
|
24
24
|
*
|
25
25
|
* @param config - {@link WalletClientConfig}
|
26
26
|
* @returns A Wallet Client. {@link WalletClient}
|