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
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Adds an EVM chain to the wallet.
|
3
3
|
*
|
4
|
-
* - Docs: https://viem.sh/docs/actions/wallet/watchAsset
|
4
|
+
* - Docs: https://viem.sh/docs/actions/wallet/watchAsset
|
5
5
|
* - JSON-RPC Methods: [`eth_switchEthereumChain`](https://eips.ethereum.org/EIPS/eip-747)
|
6
6
|
*
|
7
7
|
* @param client - Client to use
|
@@ -4,18 +4,18 @@ import { sendTransaction, } from './sendTransaction.js';
|
|
4
4
|
/**
|
5
5
|
* Executes a write function on a contract.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/docs/contract/writeContract
|
7
|
+
* - Docs: https://viem.sh/docs/contract/writeContract
|
8
8
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/contracts/writing-to-contracts
|
9
9
|
*
|
10
|
-
* 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
|
10
|
+
* 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.
|
11
11
|
*
|
12
|
-
* Internally, uses a [Wallet Client](https://viem.sh/docs/clients/wallet
|
12
|
+
* 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).
|
13
13
|
*
|
14
|
-
* __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
|
14
|
+
* __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.__
|
15
15
|
*
|
16
16
|
* @param client - Client to use
|
17
17
|
* @param parameters - {@link WriteContractParameters}
|
18
|
-
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms
|
18
|
+
* @returns A [Transaction Hash](https://viem.sh/docs/glossary/terms#hash). {@link WriteContractReturnType}
|
19
19
|
*
|
20
20
|
* @example
|
21
21
|
* import { createWalletClient, custom, parseAbi } from 'viem'
|
@@ -3,7 +3,7 @@ import { prepareTransactionRequest, } from '../../../actions/wallet/prepareTrans
|
|
3
3
|
/**
|
4
4
|
* Prepares parameters for a [deposit transaction](https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md) to be initiated on an L1.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/op-stack/actions/buildDepositTransaction
|
6
|
+
* - Docs: https://viem.sh/op-stack/actions/buildDepositTransaction
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
9
|
* @param parameters - {@link BuildDepositTransactionParameters}
|
@@ -3,7 +3,7 @@ import { prepareTransactionRequest, } from '../../../actions/wallet/prepareTrans
|
|
3
3
|
/**
|
4
4
|
* Prepares parameters for a [withdrawal](https://community.optimism.io/docs/protocol/withdrawal-flow/#withdrawal-initiating-transaction) from an L2 to the L1.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/op-stack/actions/buildInitiateWithdrawal
|
6
|
+
* - Docs: https://viem.sh/op-stack/actions/buildInitiateWithdrawal
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
9
|
* @param parameters - {@link BuildInitiateWithdrawalParameters}
|
@@ -6,7 +6,7 @@ const outputRootProofVersion = '0x0000000000000000000000000000000000000000000000
|
|
6
6
|
/**
|
7
7
|
* Builds the transaction that proves a withdrawal was initiated on an L2. Used in the Withdrawal flow.
|
8
8
|
*
|
9
|
-
* - Docs: https://viem.sh/op-stack/actions/buildProveWithdrawal
|
9
|
+
* - Docs: https://viem.sh/op-stack/actions/buildProveWithdrawal
|
10
10
|
*
|
11
11
|
* @param client - Client to use
|
12
12
|
* @param parameters - {@link BuildProveWithdrawalParameters}
|
@@ -8,7 +8,7 @@ import { estimateDepositTransactionGas, } from './estimateDepositTransactionGas.
|
|
8
8
|
* 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)
|
9
9
|
* on the [Optimism Portal contract](https://github.com/ethereum-optimism/optimism/blob/develop/packages/contracts-bedrock/src/L1/OptimismPortal.sol).
|
10
10
|
*
|
11
|
-
* - Docs: https://viem.sh/op-stack/actions/depositTransaction
|
11
|
+
* - Docs: https://viem.sh/op-stack/actions/depositTransaction
|
12
12
|
*
|
13
13
|
* @param client - Client to use
|
14
14
|
* @param parameters - {@link DepositTransactionParameters}
|
@@ -4,7 +4,7 @@ import { portalAbi } from '../abis.js';
|
|
4
4
|
/**
|
5
5
|
* 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.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateDepositTransactionGas
|
7
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateDepositTransactionGas
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link EstimateDepositTransactionGasParameters}
|
@@ -3,7 +3,7 @@ import { portalAbi } from '../abis.js';
|
|
3
3
|
/**
|
4
4
|
* Estimates gas required to finalize a withdrawal that occurred on an L2.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateFinalizeWithdrawalGas
|
6
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateFinalizeWithdrawalGas
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
9
|
* @param parameters - {@link EstimateFinalizeWithdrawalGasParameters}
|
@@ -4,7 +4,7 @@ import { contracts } from '../contracts.js';
|
|
4
4
|
/**
|
5
5
|
* Estimates gas required to initiate a [withdrawal](https://community.optimism.io/docs/protocol/withdrawal-flow/#withdrawal-initiating-transaction) on an L2 to the L1.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateInitiateWithdrawalGas
|
7
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateInitiateWithdrawalGas
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link EstimateInitiateWithdrawalGasParameters}
|
@@ -3,7 +3,7 @@ import { portalAbi } from '../abis.js';
|
|
3
3
|
/**
|
4
4
|
* Estimates gas required to prove a withdrawal that occurred on an L2.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/op-stack/actions/estimateProveWithdrawalGas
|
6
|
+
* - Docs: https://viem.sh/op-stack/actions/estimateProveWithdrawalGas
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
9
|
* @param parameters - {@link EstimateProveWithdrawalGasParameters}
|
@@ -4,7 +4,7 @@ import { estimateFinalizeWithdrawalGas, } from './estimateFinalizeWithdrawalGas.
|
|
4
4
|
/**
|
5
5
|
* Finalizes a withdrawal that occurred on an L2. Used in the Withdrawal flow.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/actions/finalizeWithdrawal
|
7
|
+
* - Docs: https://viem.sh/op-stack/actions/finalizeWithdrawal
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link FinalizeWithdrawalParameters}
|
@@ -3,7 +3,7 @@ import { l2OutputOracleAbi } from '../abis.js';
|
|
3
3
|
/**
|
4
4
|
* Retrieves the first L2 output proposal that occurred after a provided block number.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/op-stack/actions/getL2Output
|
6
|
+
* - Docs: https://viem.sh/op-stack/actions/getL2Output
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
9
|
* @param parameters - {@link GetL2OutputParameters}
|
@@ -2,9 +2,9 @@ import { multicall, } from '../../../actions/public/multicall.js';
|
|
2
2
|
import { l2OutputOracleAbi, portalAbi } from '../abis.js';
|
3
3
|
const buffer = 10;
|
4
4
|
/**
|
5
|
-
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
5
|
+
* Returns the time until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
7
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToFinalize
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link GetTimeToFinalizeParameters}
|
@@ -2,9 +2,9 @@ import { multicall, } from '../../../actions/public/multicall.js';
|
|
2
2
|
import { readContract, } from '../../../actions/public/readContract.js';
|
3
3
|
import { l2OutputOracleAbi } from '../abis.js';
|
4
4
|
/**
|
5
|
-
* Returns the time until the next L2 output (after the provided block number) is submitted. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
5
|
+
* Returns the time until the next L2 output (after the provided block number) is submitted. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToNextL2Output
|
7
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToNextL2Output
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link GetTimeToNextL2OutputParameters}
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { getTimeToNextL2Output, } from './getTimeToNextL2Output.js';
|
2
2
|
/**
|
3
|
-
* Returns the time until the withdrawal transaction is ready to prove. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
3
|
+
* Returns the time until the withdrawal transaction is ready to prove. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/op-stack/actions/getTimeToProve
|
5
|
+
* - Docs: https://viem.sh/op-stack/actions/getTimeToProve
|
6
6
|
*
|
7
7
|
* @param client - Client to use
|
8
8
|
* @param parameters - {@link GetTimeToNextL2OutputParameters}
|
@@ -6,9 +6,9 @@ import { getWithdrawals, } from '../utils/getWithdrawals.js';
|
|
6
6
|
import { getL2Output } from './getL2Output.js';
|
7
7
|
import { getTimeToFinalize, } from './getTimeToFinalize.js';
|
8
8
|
/**
|
9
|
-
* Returns the current status of a withdrawal. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
9
|
+
* Returns the current status of a withdrawal. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
10
10
|
*
|
11
|
-
* - Docs: https://viem.sh/op-stack/actions/getWithdrawalStatus
|
11
|
+
* - Docs: https://viem.sh/op-stack/actions/getWithdrawalStatus
|
12
12
|
*
|
13
13
|
* @param client - Client to use
|
14
14
|
* @param parameters - {@link GetWithdrawalStatusParameters}
|
@@ -8,7 +8,7 @@ import { estimateInitiateWithdrawalGas, } from './estimateInitiateWithdrawalGas.
|
|
8
8
|
* 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)
|
9
9
|
* on the [Optimism L2ToL1MessagePasser predeploy contract](https://github.com/ethereum-optimism/optimism/blob/283f0aa2e3358ced30ff7cbd4028c0c0c3faa140/packages/contracts-bedrock/src/L2/L2ToL1MessagePasser.sol).
|
10
10
|
*
|
11
|
-
* - Docs: https://viem.sh/op-stack/actions/initiateWithdrawal
|
11
|
+
* - Docs: https://viem.sh/op-stack/actions/initiateWithdrawal
|
12
12
|
*
|
13
13
|
* @param client - Client to use
|
14
14
|
* @param parameters - {@link InitiateWithdrawalParameters}
|
@@ -4,7 +4,7 @@ import { estimateProveWithdrawalGas, } from './estimateProveWithdrawalGas.js';
|
|
4
4
|
/**
|
5
5
|
* Proves a withdrawal that occurred on an L2. Used in the Withdrawal flow.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/actions/proveWithdrawal
|
7
|
+
* - Docs: https://viem.sh/op-stack/actions/proveWithdrawal
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link ProveWithdrawalParameters}
|
@@ -5,7 +5,7 @@ import { getTimeToNextL2Output, } from './getTimeToNextL2Output.js';
|
|
5
5
|
/**
|
6
6
|
* Waits for the next L2 output (after the provided block number) to be submitted.
|
7
7
|
*
|
8
|
-
* - Docs: https://viem.sh/op-stack/actions/waitForNextL2Output
|
8
|
+
* - Docs: https://viem.sh/op-stack/actions/waitForNextL2Output
|
9
9
|
*
|
10
10
|
* @param client - Client to use
|
11
11
|
* @param parameters - {@link WaitForNextL2OutputParameters}
|
@@ -1,9 +1,9 @@
|
|
1
1
|
import { wait } from '../../../utils/wait.js';
|
2
2
|
import { getTimeToFinalize, } from './getTimeToFinalize.js';
|
3
3
|
/**
|
4
|
-
* Waits until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
4
|
+
* Waits until the withdrawal transaction can be finalized. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/op-stack/actions/waitToFinalize
|
6
|
+
* - Docs: https://viem.sh/op-stack/actions/waitToFinalize
|
7
7
|
*
|
8
8
|
* @param client - Client to use
|
9
9
|
* @param parameters - {@link WaitToFinalizeParameters}
|
@@ -2,9 +2,9 @@ import { ReceiptContainsNoWithdrawalsError } from '../errors/withdrawal.js';
|
|
2
2
|
import { getWithdrawals, } from '../utils/getWithdrawals.js';
|
3
3
|
import { waitForNextL2Output, } from './waitForNextL2Output.js';
|
4
4
|
/**
|
5
|
-
* Waits until the L2 withdrawal transaction is ready to be proved. Used for the [Withdrawal](/op-stack/guides/withdrawals
|
5
|
+
* Waits until the L2 withdrawal transaction is ready to be proved. Used for the [Withdrawal](/op-stack/guides/withdrawals) flow.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/actions/waitToProve
|
7
|
+
* - Docs: https://viem.sh/op-stack/actions/waitToProve
|
8
8
|
*
|
9
9
|
* @param client - Client to use
|
10
10
|
* @param parameters - {@link WaitToProveParameters}
|
@@ -13,7 +13,7 @@ import { waitToProve, } from '../actions/waitToProve.js';
|
|
13
13
|
/**
|
14
14
|
* A suite of Public Actions for suited for development with Layer 2 (OP Stack) chains.
|
15
15
|
*
|
16
|
-
* - Docs: https://viem.sh/op-stack/client
|
16
|
+
* - Docs: https://viem.sh/op-stack/client
|
17
17
|
*
|
18
18
|
* @example
|
19
19
|
* import { publicActionsL1 } from 'viem/op-stack'
|
@@ -12,7 +12,7 @@ import { estimateTotalGas, } from '../actions/estimateTotalGas.js';
|
|
12
12
|
/**
|
13
13
|
* A suite of Public Actions for suited for development with Layer 2 (OP Stack) chains.
|
14
14
|
*
|
15
|
-
* - Docs: https://viem.sh/op-stack/client
|
15
|
+
* - Docs: https://viem.sh/op-stack/client
|
16
16
|
*
|
17
17
|
* @example
|
18
18
|
* import { publicActionsL2 } from 'viem/op-stack'
|
@@ -4,7 +4,7 @@ import { proveWithdrawal, } from '../actions/proveWithdrawal.js';
|
|
4
4
|
/**
|
5
5
|
* A suite of Wallet Actions for suited for development with Layer 2 (OP Stack) chains.
|
6
6
|
*
|
7
|
-
* - Docs: https://viem.sh/op-stack/client
|
7
|
+
* - Docs: https://viem.sh/op-stack/client
|
8
8
|
*
|
9
9
|
* @example
|
10
10
|
* import { createPublicClient, createWalletClient, http } from 'viem'
|
@@ -2,7 +2,7 @@ import { initiateWithdrawal, } from '../actions/initiateWithdrawal.js';
|
|
2
2
|
/**
|
3
3
|
* A suite of Wallet Actions for suited for development with Layer 2 (OP Stack) chains.
|
4
4
|
*
|
5
|
-
* - Docs: https://viem.sh/op-stack/client
|
5
|
+
* - Docs: https://viem.sh/op-stack/client
|
6
6
|
*
|
7
7
|
* @example
|
8
8
|
* import { createPublicClient, createWalletClient, http } from 'viem'
|
package/_esm/errors/base.js
CHANGED
@@ -52,7 +52,7 @@ export class BaseError extends Error {
|
|
52
52
|
...(args.metaMessages ? [...args.metaMessages, ''] : []),
|
53
53
|
...(docsPath
|
54
54
|
? [
|
55
|
-
`Docs: https://viem.sh${docsPath}
|
55
|
+
`Docs: https://viem.sh${docsPath}${args.docsSlug ? `#${args.docsSlug}` : ''}`,
|
56
56
|
]
|
57
57
|
: []),
|
58
58
|
...(details ? [`Details: ${details}`] : []),
|
package/_esm/errors/base.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"base.js","sourceRoot":"","sources":["../../errors/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAkBvC,MAAM,OAAO,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,UAAU,EAAE;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,OAAO,EAAE,UAAU,EAAE,MAAM,YAAY,CAAA;AAkBvC,MAAM,OAAO,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,UAAU,EAAE;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;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/_esm/errors/version.js
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export const version = '0.0.0-main.
|
1
|
+
export const version = '0.0.0-main.20240110T220130';
|
2
2
|
//# sourceMappingURL=version.js.map
|
@@ -5,8 +5,8 @@ import { bytesToHex } from './toHex.js';
|
|
5
5
|
/**
|
6
6
|
* Decodes a byte array into a UTF-8 string, hex value, number, bigint or boolean.
|
7
7
|
*
|
8
|
-
* - Docs: https://viem.sh/docs/utilities/fromBytes
|
9
|
-
* - Example: https://viem.sh/docs/utilities/fromBytes
|
8
|
+
* - Docs: https://viem.sh/docs/utilities/fromBytes
|
9
|
+
* - Example: https://viem.sh/docs/utilities/fromBytes#usage
|
10
10
|
*
|
11
11
|
* @param bytes Byte array to decode.
|
12
12
|
* @param toOrOpts Type to convert to or options.
|
@@ -41,7 +41,7 @@ export function fromBytes(bytes, toOrOpts) {
|
|
41
41
|
/**
|
42
42
|
* Decodes a byte array into a bigint.
|
43
43
|
*
|
44
|
-
* - Docs: https://viem.sh/docs/utilities/fromBytes
|
44
|
+
* - Docs: https://viem.sh/docs/utilities/fromBytes#bytestobigint
|
45
45
|
*
|
46
46
|
* @param bytes Byte array to decode.
|
47
47
|
* @param opts Options.
|
@@ -61,7 +61,7 @@ export function bytesToBigInt(bytes, opts = {}) {
|
|
61
61
|
/**
|
62
62
|
* Decodes a byte array into a boolean.
|
63
63
|
*
|
64
|
-
* - Docs: https://viem.sh/docs/utilities/fromBytes
|
64
|
+
* - Docs: https://viem.sh/docs/utilities/fromBytes#bytestobool
|
65
65
|
*
|
66
66
|
* @param bytes Byte array to decode.
|
67
67
|
* @param opts Options.
|
@@ -85,7 +85,7 @@ export function bytesToBool(bytes_, opts = {}) {
|
|
85
85
|
/**
|
86
86
|
* Decodes a byte array into a number.
|
87
87
|
*
|
88
|
-
* - Docs: https://viem.sh/docs/utilities/fromBytes
|
88
|
+
* - Docs: https://viem.sh/docs/utilities/fromBytes#bytestonumber
|
89
89
|
*
|
90
90
|
* @param bytes Byte array to decode.
|
91
91
|
* @param opts Options.
|
@@ -105,7 +105,7 @@ export function bytesToNumber(bytes, opts = {}) {
|
|
105
105
|
/**
|
106
106
|
* Decodes a byte array into a UTF-8 string.
|
107
107
|
*
|
108
|
-
* - Docs: https://viem.sh/docs/utilities/fromBytes
|
108
|
+
* - Docs: https://viem.sh/docs/utilities/fromBytes#bytestostring
|
109
109
|
*
|
110
110
|
* @param bytes Byte array to decode.
|
111
111
|
* @param opts Options.
|
@@ -12,8 +12,8 @@ export function assertSize(hexOrBytes, { size }) {
|
|
12
12
|
/**
|
13
13
|
* Decodes a hex string into a string, number, bigint, boolean, or byte array.
|
14
14
|
*
|
15
|
-
* - Docs: https://viem.sh/docs/utilities/fromHex
|
16
|
-
* - Example: https://viem.sh/docs/utilities/fromHex
|
15
|
+
* - Docs: https://viem.sh/docs/utilities/fromHex
|
16
|
+
* - Example: https://viem.sh/docs/utilities/fromHex#usage
|
17
17
|
*
|
18
18
|
* @param hex Hex string to decode.
|
19
19
|
* @param toOrOpts Type to convert to or options.
|
@@ -53,7 +53,7 @@ export function fromHex(hex, toOrOpts) {
|
|
53
53
|
/**
|
54
54
|
* Decodes a hex value into a bigint.
|
55
55
|
*
|
56
|
-
* - Docs: https://viem.sh/docs/utilities/fromHex
|
56
|
+
* - Docs: https://viem.sh/docs/utilities/fromHex#hextobigint
|
57
57
|
*
|
58
58
|
* @param hex Hex value to decode.
|
59
59
|
* @param opts Options.
|
@@ -85,7 +85,7 @@ export function hexToBigInt(hex, opts = {}) {
|
|
85
85
|
/**
|
86
86
|
* Decodes a hex value into a boolean.
|
87
87
|
*
|
88
|
-
* - Docs: https://viem.sh/docs/utilities/fromHex
|
88
|
+
* - Docs: https://viem.sh/docs/utilities/fromHex#hextobool
|
89
89
|
*
|
90
90
|
* @param hex Hex value to decode.
|
91
91
|
* @param opts Options.
|
@@ -116,7 +116,7 @@ export function hexToBool(hex_, opts = {}) {
|
|
116
116
|
/**
|
117
117
|
* Decodes a hex string into a number.
|
118
118
|
*
|
119
|
-
* - Docs: https://viem.sh/docs/utilities/fromHex
|
119
|
+
* - Docs: https://viem.sh/docs/utilities/fromHex#hextonumber
|
120
120
|
*
|
121
121
|
* @param hex Hex value to decode.
|
122
122
|
* @param opts Options.
|
@@ -138,7 +138,7 @@ export function hexToNumber(hex, opts = {}) {
|
|
138
138
|
/**
|
139
139
|
* Decodes a hex value into a UTF-8 string.
|
140
140
|
*
|
141
|
-
* - Docs: https://viem.sh/docs/utilities/fromHex
|
141
|
+
* - Docs: https://viem.sh/docs/utilities/fromHex#hextostring
|
142
142
|
*
|
143
143
|
* @param hex Hex value to decode.
|
144
144
|
* @param opts Options.
|
@@ -7,8 +7,8 @@ const encoder = /*#__PURE__*/ new TextEncoder();
|
|
7
7
|
/**
|
8
8
|
* Encodes a UTF-8 string, hex value, bigint, number or boolean to a byte array.
|
9
9
|
*
|
10
|
-
* - Docs: https://viem.sh/docs/utilities/toBytes
|
11
|
-
* - Example: https://viem.sh/docs/utilities/toBytes
|
10
|
+
* - Docs: https://viem.sh/docs/utilities/toBytes
|
11
|
+
* - Example: https://viem.sh/docs/utilities/toBytes#usage
|
12
12
|
*
|
13
13
|
* @param value Value to encode.
|
14
14
|
* @param opts Options.
|
@@ -41,7 +41,7 @@ export function toBytes(value, opts = {}) {
|
|
41
41
|
/**
|
42
42
|
* Encodes a boolean into a byte array.
|
43
43
|
*
|
44
|
-
* - Docs: https://viem.sh/docs/utilities/toBytes
|
44
|
+
* - Docs: https://viem.sh/docs/utilities/toBytes#booltobytes
|
45
45
|
*
|
46
46
|
* @param value Boolean value to encode.
|
47
47
|
* @param opts Options.
|
@@ -87,7 +87,7 @@ function charCodeToBase16(char) {
|
|
87
87
|
/**
|
88
88
|
* Encodes a hex string into a byte array.
|
89
89
|
*
|
90
|
-
* - Docs: https://viem.sh/docs/utilities/toBytes
|
90
|
+
* - Docs: https://viem.sh/docs/utilities/toBytes#hextobytes
|
91
91
|
*
|
92
92
|
* @param hex Hex string to encode.
|
93
93
|
* @param opts Options.
|
@@ -127,7 +127,7 @@ export function hexToBytes(hex_, opts = {}) {
|
|
127
127
|
/**
|
128
128
|
* Encodes a number into a byte array.
|
129
129
|
*
|
130
|
-
* - Docs: https://viem.sh/docs/utilities/toBytes
|
130
|
+
* - Docs: https://viem.sh/docs/utilities/toBytes#numbertobytes
|
131
131
|
*
|
132
132
|
* @param value Number to encode.
|
133
133
|
* @param opts Options.
|
@@ -150,7 +150,7 @@ export function numberToBytes(value, opts) {
|
|
150
150
|
/**
|
151
151
|
* Encodes a UTF-8 string into a byte array.
|
152
152
|
*
|
153
|
-
* - Docs: https://viem.sh/docs/utilities/toBytes
|
153
|
+
* - Docs: https://viem.sh/docs/utilities/toBytes#stringtobytes
|
154
154
|
*
|
155
155
|
* @param value String to encode.
|
156
156
|
* @param opts Options.
|
@@ -5,8 +5,8 @@ const hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) => i.toString(16
|
|
5
5
|
/**
|
6
6
|
* Encodes a string, number, bigint, or ByteArray into a hex string
|
7
7
|
*
|
8
|
-
* - Docs: https://viem.sh/docs/utilities/toHex
|
9
|
-
* - Example: https://viem.sh/docs/utilities/toHex
|
8
|
+
* - Docs: https://viem.sh/docs/utilities/toHex
|
9
|
+
* - Example: https://viem.sh/docs/utilities/toHex#usage
|
10
10
|
*
|
11
11
|
* @param value Value to encode.
|
12
12
|
* @param opts Options.
|
@@ -40,7 +40,7 @@ export function toHex(value, opts = {}) {
|
|
40
40
|
/**
|
41
41
|
* Encodes a boolean into a hex string
|
42
42
|
*
|
43
|
-
* - Docs: https://viem.sh/docs/utilities/toHex
|
43
|
+
* - Docs: https://viem.sh/docs/utilities/toHex#booltohex
|
44
44
|
*
|
45
45
|
* @param value Value to encode.
|
46
46
|
* @param opts Options.
|
@@ -72,7 +72,7 @@ export function boolToHex(value, opts = {}) {
|
|
72
72
|
/**
|
73
73
|
* Encodes a bytes array into a hex string
|
74
74
|
*
|
75
|
-
* - Docs: https://viem.sh/docs/utilities/toHex
|
75
|
+
* - Docs: https://viem.sh/docs/utilities/toHex#bytestohex
|
76
76
|
*
|
77
77
|
* @param value Value to encode.
|
78
78
|
* @param opts Options.
|
@@ -103,7 +103,7 @@ export function bytesToHex(value, opts = {}) {
|
|
103
103
|
/**
|
104
104
|
* Encodes a number or bigint into a hex string
|
105
105
|
*
|
106
|
-
* - Docs: https://viem.sh/docs/utilities/toHex
|
106
|
+
* - Docs: https://viem.sh/docs/utilities/toHex#numbertohex
|
107
107
|
*
|
108
108
|
* @param value Value to encode.
|
109
109
|
* @param opts Options.
|
@@ -154,7 +154,7 @@ const encoder = /*#__PURE__*/ new TextEncoder();
|
|
154
154
|
/**
|
155
155
|
* Encodes a UTF-8 string into a hex string
|
156
156
|
*
|
157
|
-
* - Docs: https://viem.sh/docs/utilities/toHex
|
157
|
+
* - Docs: https://viem.sh/docs/utilities/toHex#stringtohex
|
158
158
|
*
|
159
159
|
* @param value Value to encode.
|
160
160
|
* @param opts Options.
|
@@ -5,7 +5,7 @@ import { encodedLabelToLabelhash, } from './encodedLabelToLabelhash.js';
|
|
5
5
|
/**
|
6
6
|
* @description Hashes ENS label
|
7
7
|
*
|
8
|
-
* - Since ENS labels prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS labels](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `labelhash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize
|
8
|
+
* - Since ENS labels prohibit certain forbidden characters (e.g. underscore) and have other validation rules, you likely want to [normalize ENS labels](https://docs.ens.domains/contract-api-reference/name-processing#normalising-names) with [UTS-46 normalization](https://unicode.org/reports/tr46) before passing them to `labelhash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
|
9
9
|
*
|
10
10
|
* @example
|
11
11
|
* labelhash('eth')
|
@@ -6,7 +6,7 @@ import { encodedLabelToLabelhash, } from './encodedLabelToLabelhash.js';
|
|
6
6
|
/**
|
7
7
|
* @description Hashes ENS name
|
8
8
|
*
|
9
|
-
* - 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 `namehash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize
|
9
|
+
* - 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 `namehash`. You can use the built-in [`normalize`](https://viem.sh/docs/ens/utilities/normalize) function for this.
|
10
10
|
*
|
11
11
|
* @example
|
12
12
|
* namehash('wevm.eth')
|
@@ -8,7 +8,7 @@ import { recoverMessageAddress, } from './recoverMessageAddress.js';
|
|
8
8
|
* It is highly recommended to use `publicClient.verifyMessage` instead to ensure
|
9
9
|
* wallet interoperability.
|
10
10
|
*
|
11
|
-
* - Docs {@link https://viem.sh/docs/utilities/verifyMessage
|
11
|
+
* - Docs {@link https://viem.sh/docs/utilities/verifyMessage}
|
12
12
|
*
|
13
13
|
* @param parameters - {@link VerifyMessageParameters}
|
14
14
|
* @returns Whether or not the signature is valid. {@link VerifyMessageReturnType}
|
@@ -8,7 +8,7 @@ import { recoverTypedDataAddress, } from './recoverTypedDataAddress.js';
|
|
8
8
|
* It is highly recommended to use `publicClient.verifyTypedData` instead to ensure
|
9
9
|
* wallet interoperability.
|
10
10
|
*
|
11
|
-
* - Docs {@link https://viem.sh/docs/utilities/verifyTypedData
|
11
|
+
* - Docs {@link https://viem.sh/docs/utilities/verifyTypedData}
|
12
12
|
*
|
13
13
|
* @param parameters - {@link VerifyTypedDataParameters}
|
14
14
|
* @returns Whether or not the signature is valid. {@link VerifyTypedDataReturnType}
|
@@ -3,7 +3,7 @@ import { formatUnits } from './formatUnits.js';
|
|
3
3
|
/**
|
4
4
|
* Converts numerical wei to a string representation of ether.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/utilities/formatEther
|
6
|
+
* - Docs: https://viem.sh/docs/utilities/formatEther
|
7
7
|
*
|
8
8
|
* @example
|
9
9
|
* import { formatEther } from 'viem'
|
@@ -3,7 +3,7 @@ import { formatUnits } from './formatUnits.js';
|
|
3
3
|
/**
|
4
4
|
* Converts numerical wei to a string representation of gwei.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/utilities/formatGwei
|
6
|
+
* - Docs: https://viem.sh/docs/utilities/formatGwei
|
7
7
|
*
|
8
8
|
* @example
|
9
9
|
* import { formatGwei } from 'viem'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Divides a number by a given exponent of base 10 (10exponent), and formats it into a string representation of the number..
|
3
3
|
*
|
4
|
-
* - Docs: https://viem.sh/docs/utilities/formatUnits
|
4
|
+
* - Docs: https://viem.sh/docs/utilities/formatUnits
|
5
5
|
*
|
6
6
|
* @example
|
7
7
|
* import { formatUnits } from 'viem'
|
@@ -3,7 +3,7 @@ import { parseUnits } from './parseUnits.js';
|
|
3
3
|
/**
|
4
4
|
* Converts a string representation of ether to numerical wei.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/utilities/parseEther
|
6
|
+
* - Docs: https://viem.sh/docs/utilities/parseEther
|
7
7
|
*
|
8
8
|
* @example
|
9
9
|
* import { parseEther } from 'viem'
|
@@ -3,7 +3,7 @@ import { parseUnits } from './parseUnits.js';
|
|
3
3
|
/**
|
4
4
|
* Converts a string representation of gwei to numerical wei.
|
5
5
|
*
|
6
|
-
* - Docs: https://viem.sh/docs/utilities/parseGwei
|
6
|
+
* - Docs: https://viem.sh/docs/utilities/parseGwei
|
7
7
|
*
|
8
8
|
* @example
|
9
9
|
* import { parseGwei } from 'viem'
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/**
|
2
2
|
* Multiplies a string representation of a number by a given exponent of base 10 (10exponent).
|
3
3
|
*
|
4
|
-
* - Docs: https://viem.sh/docs/utilities/parseUnits
|
4
|
+
* - Docs: https://viem.sh/docs/utilities/parseUnits
|
5
5
|
*
|
6
6
|
* @example
|
7
7
|
* import { parseUnits } from 'viem'
|
@@ -25,12 +25,12 @@ export type GetEnsAddressErrorType = GetChainContractAddressErrorType | EncodeFu
|
|
25
25
|
/**
|
26
26
|
* Gets address for ENS name.
|
27
27
|
*
|
28
|
-
* - Docs: https://viem.sh/docs/ens/actions/getEnsAddress
|
28
|
+
* - Docs: https://viem.sh/docs/ens/actions/getEnsAddress
|
29
29
|
* - Examples: https://stackblitz.com/github/wevm/viem/tree/main/examples/ens
|
30
30
|
*
|
31
31
|
* Calls `resolve(bytes, bytes)` on ENS Universal Resolver Contract.
|
32
32
|
*
|
33
|
-
* 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
|
33
|
+
* 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.
|
34
34
|
*
|
35
35
|
* @param client - Client to use
|
36
36
|
* @param parameters - {@link GetEnsAddressParameters}
|