viem 2.0.0-beta.3 → 2.0.0-beta.5
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 +22 -0
- package/_cjs/accounts/generateMnemonic.js +9 -0
- package/_cjs/accounts/generateMnemonic.js.map +1 -0
- package/_cjs/accounts/generatePrivateKey.js +10 -0
- package/_cjs/accounts/generatePrivateKey.js.map +1 -0
- package/_cjs/accounts/hdKeyToAccount.js +16 -0
- package/_cjs/accounts/hdKeyToAccount.js.map +1 -0
- package/_cjs/accounts/index.js +52 -0
- package/_cjs/accounts/index.js.map +1 -0
- package/_cjs/accounts/mnemonicToAccount.js +12 -0
- package/_cjs/accounts/mnemonicToAccount.js.map +1 -0
- package/_cjs/accounts/privateKeyToAccount.js +33 -0
- package/_cjs/accounts/privateKeyToAccount.js.map +1 -0
- package/_cjs/accounts/toAccount.js +27 -0
- package/_cjs/accounts/toAccount.js.map +1 -0
- package/_cjs/accounts/types.js +3 -0
- package/_cjs/accounts/types.js.map +1 -0
- package/_cjs/accounts/utils/parseAccount.js +10 -0
- package/_cjs/accounts/utils/parseAccount.js.map +1 -0
- package/_cjs/accounts/utils/privateKeyToAddress.js +12 -0
- package/_cjs/accounts/utils/privateKeyToAddress.js.map +1 -0
- package/_cjs/accounts/utils/publicKeyToAddress.js +11 -0
- package/_cjs/accounts/utils/publicKeyToAddress.js.map +1 -0
- package/_cjs/accounts/utils/sign.js +15 -0
- package/_cjs/accounts/utils/sign.js.map +1 -0
- package/_cjs/accounts/utils/signMessage.js +12 -0
- package/_cjs/accounts/utils/signMessage.js.map +1 -0
- package/_cjs/accounts/utils/signTransaction.js +15 -0
- package/_cjs/accounts/utils/signTransaction.js.map +1 -0
- package/_cjs/accounts/utils/signTypedData.js +16 -0
- package/_cjs/accounts/utils/signTypedData.js.map +1 -0
- package/_cjs/actions/ens/getEnsAddress.js +63 -0
- package/_cjs/actions/ens/getEnsAddress.js.map +1 -0
- package/_cjs/actions/ens/getEnsAvatar.js +25 -0
- package/_cjs/actions/ens/getEnsAvatar.js.map +1 -0
- package/_cjs/actions/ens/getEnsName.js +41 -0
- package/_cjs/actions/ens/getEnsName.js.map +1 -0
- package/_cjs/actions/ens/getEnsResolver.js +39 -0
- package/_cjs/actions/ens/getEnsResolver.js.map +1 -0
- package/_cjs/actions/ens/getEnsText.js +57 -0
- package/_cjs/actions/ens/getEnsText.js.map +1 -0
- package/_cjs/actions/getContract.js +184 -0
- package/_cjs/actions/getContract.js.map +1 -0
- package/_cjs/actions/index.js +167 -0
- package/_cjs/actions/index.js.map +1 -0
- package/_cjs/actions/public/call.js +156 -0
- package/_cjs/actions/public/call.js.map +1 -0
- package/_cjs/actions/public/createBlockFilter.js +15 -0
- package/_cjs/actions/public/createBlockFilter.js.map +1 -0
- package/_cjs/actions/public/createContractEventFilter.js +41 -0
- package/_cjs/actions/public/createContractEventFilter.js.map +1 -0
- package/_cjs/actions/public/createEventFilter.js +48 -0
- package/_cjs/actions/public/createEventFilter.js.map +1 -0
- package/_cjs/actions/public/createPendingTransactionFilter.js +15 -0
- package/_cjs/actions/public/createPendingTransactionFilter.js.map +1 -0
- package/_cjs/actions/public/estimateContractGas.js +37 -0
- package/_cjs/actions/public/estimateContractGas.js.map +1 -0
- package/_cjs/actions/public/estimateFeesPerGas.js +62 -0
- package/_cjs/actions/public/estimateFeesPerGas.js.map +1 -0
- package/_cjs/actions/public/estimateGas.js +56 -0
- package/_cjs/actions/public/estimateGas.js.map +1 -0
- package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js +45 -0
- package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -0
- package/_cjs/actions/public/getBalance.js +14 -0
- package/_cjs/actions/public/getBalance.js.map +1 -0
- package/_cjs/actions/public/getBlock.js +30 -0
- package/_cjs/actions/public/getBlock.js.map +1 -0
- package/_cjs/actions/public/getBlockNumber.js +17 -0
- package/_cjs/actions/public/getBlockNumber.js.map +1 -0
- package/_cjs/actions/public/getBlockTransactionCount.js +24 -0
- package/_cjs/actions/public/getBlockTransactionCount.js.map +1 -0
- package/_cjs/actions/public/getBytecode.js +16 -0
- package/_cjs/actions/public/getBytecode.js.map +1 -0
- package/_cjs/actions/public/getChainId.js +12 -0
- package/_cjs/actions/public/getChainId.js.map +1 -0
- package/_cjs/actions/public/getContractEvents.js +27 -0
- package/_cjs/actions/public/getContractEvents.js.map +1 -0
- package/_cjs/actions/public/getFeeHistory.js +19 -0
- package/_cjs/actions/public/getFeeHistory.js.map +1 -0
- package/_cjs/actions/public/getFilterChanges.js +44 -0
- package/_cjs/actions/public/getFilterChanges.js.map +1 -0
- package/_cjs/actions/public/getFilterLogs.js +42 -0
- package/_cjs/actions/public/getFilterLogs.js.map +1 -0
- package/_cjs/actions/public/getGasPrice.js +11 -0
- package/_cjs/actions/public/getGasPrice.js.map +1 -0
- package/_cjs/actions/public/getLogs.js +73 -0
- package/_cjs/actions/public/getLogs.js.map +1 -0
- package/_cjs/actions/public/getProof.js +16 -0
- package/_cjs/actions/public/getProof.js.map +1 -0
- package/_cjs/actions/public/getStorageAt.js +14 -0
- package/_cjs/actions/public/getStorageAt.js.map +1 -0
- package/_cjs/actions/public/getTransaction.js +41 -0
- package/_cjs/actions/public/getTransaction.js.map +1 -0
- package/_cjs/actions/public/getTransactionConfirmations.js +18 -0
- package/_cjs/actions/public/getTransactionConfirmations.js.map +1 -0
- package/_cjs/actions/public/getTransactionCount.js +14 -0
- package/_cjs/actions/public/getTransactionCount.js.map +1 -0
- package/_cjs/actions/public/getTransactionReceipt.js +18 -0
- package/_cjs/actions/public/getTransactionReceipt.js.map +1 -0
- package/_cjs/actions/public/multicall.js +135 -0
- package/_cjs/actions/public/multicall.js.map +1 -0
- package/_cjs/actions/public/readContract.js +40 -0
- package/_cjs/actions/public/readContract.js.map +1 -0
- package/_cjs/actions/public/simulateContract.js +56 -0
- package/_cjs/actions/public/simulateContract.js.map +1 -0
- package/_cjs/actions/public/uninstallFilter.js +11 -0
- package/_cjs/actions/public/uninstallFilter.js.map +1 -0
- package/_cjs/actions/public/verifyHash.js +32 -0
- package/_cjs/actions/public/verifyHash.js.map +1 -0
- package/_cjs/actions/public/verifyMessage.js +16 -0
- package/_cjs/actions/public/verifyMessage.js.map +1 -0
- package/_cjs/actions/public/verifyTypedData.js +16 -0
- package/_cjs/actions/public/verifyTypedData.js.map +1 -0
- package/_cjs/actions/public/waitForTransactionReceipt.js +119 -0
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -0
- package/_cjs/actions/public/watchBlockNumber.js +78 -0
- package/_cjs/actions/public/watchBlockNumber.js.map +1 -0
- package/_cjs/actions/public/watchBlocks.js +90 -0
- package/_cjs/actions/public/watchBlocks.js.map +1 -0
- package/_cjs/actions/public/watchContractEvent.js +162 -0
- package/_cjs/actions/public/watchContractEvent.js.map +1 -0
- package/_cjs/actions/public/watchEvent.js +161 -0
- package/_cjs/actions/public/watchEvent.js.map +1 -0
- package/_cjs/actions/public/watchPendingTransactions.js +88 -0
- package/_cjs/actions/public/watchPendingTransactions.js.map +1 -0
- package/_cjs/actions/test/dropTransaction.js +11 -0
- package/_cjs/actions/test/dropTransaction.js.map +1 -0
- package/_cjs/actions/test/dumpState.js +10 -0
- package/_cjs/actions/test/dumpState.js.map +1 -0
- package/_cjs/actions/test/getAutomine.js +14 -0
- package/_cjs/actions/test/getAutomine.js.map +1 -0
- package/_cjs/actions/test/getTxpoolContent.js +10 -0
- package/_cjs/actions/test/getTxpoolContent.js.map +1 -0
- package/_cjs/actions/test/getTxpoolStatus.js +15 -0
- package/_cjs/actions/test/getTxpoolStatus.js.map +1 -0
- package/_cjs/actions/test/impersonateAccount.js +11 -0
- package/_cjs/actions/test/impersonateAccount.js.map +1 -0
- package/_cjs/actions/test/increaseTime.js +12 -0
- package/_cjs/actions/test/increaseTime.js.map +1 -0
- package/_cjs/actions/test/inspectTxpool.js +10 -0
- package/_cjs/actions/test/inspectTxpool.js.map +1 -0
- package/_cjs/actions/test/loadState.js +11 -0
- package/_cjs/actions/test/loadState.js.map +1 -0
- package/_cjs/actions/test/mine.js +18 -0
- package/_cjs/actions/test/mine.js.map +1 -0
- package/_cjs/actions/test/removeBlockTimestampInterval.js +10 -0
- package/_cjs/actions/test/removeBlockTimestampInterval.js.map +1 -0
- package/_cjs/actions/test/reset.js +11 -0
- package/_cjs/actions/test/reset.js.map +1 -0
- package/_cjs/actions/test/revert.js +11 -0
- package/_cjs/actions/test/revert.js.map +1 -0
- package/_cjs/actions/test/sendUnsignedTransaction.js +30 -0
- package/_cjs/actions/test/sendUnsignedTransaction.js.map +1 -0
- package/_cjs/actions/test/setAutomine.js +18 -0
- package/_cjs/actions/test/setAutomine.js.map +1 -0
- package/_cjs/actions/test/setBalance.js +18 -0
- package/_cjs/actions/test/setBalance.js.map +1 -0
- package/_cjs/actions/test/setBlockGasLimit.js +12 -0
- package/_cjs/actions/test/setBlockGasLimit.js.map +1 -0
- package/_cjs/actions/test/setBlockTimestampInterval.js +16 -0
- package/_cjs/actions/test/setBlockTimestampInterval.js.map +1 -0
- package/_cjs/actions/test/setCode.js +11 -0
- package/_cjs/actions/test/setCode.js.map +1 -0
- package/_cjs/actions/test/setCoinbase.js +11 -0
- package/_cjs/actions/test/setCoinbase.js.map +1 -0
- package/_cjs/actions/test/setIntervalMining.js +16 -0
- package/_cjs/actions/test/setIntervalMining.js.map +1 -0
- package/_cjs/actions/test/setLoggingEnabled.js +11 -0
- package/_cjs/actions/test/setLoggingEnabled.js.map +1 -0
- package/_cjs/actions/test/setMinGasPrice.js +12 -0
- package/_cjs/actions/test/setMinGasPrice.js.map +1 -0
- package/_cjs/actions/test/setNextBlockBaseFeePerGas.js +12 -0
- package/_cjs/actions/test/setNextBlockBaseFeePerGas.js.map +1 -0
- package/_cjs/actions/test/setNextBlockTimestamp.js +12 -0
- package/_cjs/actions/test/setNextBlockTimestamp.js.map +1 -0
- package/_cjs/actions/test/setNonce.js +12 -0
- package/_cjs/actions/test/setNonce.js.map +1 -0
- package/_cjs/actions/test/setRpcUrl.js +11 -0
- package/_cjs/actions/test/setRpcUrl.js.map +1 -0
- package/_cjs/actions/test/setStorageAt.js +16 -0
- package/_cjs/actions/test/setStorageAt.js.map +1 -0
- package/_cjs/actions/test/snapshot.js +10 -0
- package/_cjs/actions/test/snapshot.js.map +1 -0
- package/_cjs/actions/test/stopImpersonatingAccount.js +11 -0
- package/_cjs/actions/test/stopImpersonatingAccount.js.map +1 -0
- package/_cjs/actions/wallet/addChain.js +23 -0
- package/_cjs/actions/wallet/addChain.js.map +1 -0
- package/_cjs/actions/wallet/deployContract.js +15 -0
- package/_cjs/actions/wallet/deployContract.js.map +1 -0
- package/_cjs/actions/wallet/getAddresses.js +12 -0
- package/_cjs/actions/wallet/getAddresses.js.map +1 -0
- package/_cjs/actions/wallet/getPermissions.js +9 -0
- package/_cjs/actions/wallet/getPermissions.js.map +1 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.js +71 -0
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -0
- package/_cjs/actions/wallet/requestAddresses.js +10 -0
- package/_cjs/actions/wallet/requestAddresses.js.map +1 -0
- package/_cjs/actions/wallet/requestPermissions.js +11 -0
- package/_cjs/actions/wallet/requestPermissions.js.map +1 -0
- package/_cjs/actions/wallet/sendRawTransaction.js +11 -0
- package/_cjs/actions/wallet/sendRawTransaction.js.map +1 -0
- package/_cjs/actions/wallet/sendTransaction.js +87 -0
- package/_cjs/actions/wallet/sendTransaction.js.map +1 -0
- package/_cjs/actions/wallet/signMessage.js +28 -0
- package/_cjs/actions/wallet/signMessage.js.map +1 -0
- package/_cjs/actions/wallet/signTransaction.js +48 -0
- package/_cjs/actions/wallet/signTransaction.js.map +1 -0
- package/_cjs/actions/wallet/signTypedData.js +30 -0
- package/_cjs/actions/wallet/signTypedData.js.map +1 -0
- package/_cjs/actions/wallet/switchChain.js +16 -0
- package/_cjs/actions/wallet/switchChain.js.map +1 -0
- package/_cjs/actions/wallet/watchAsset.js +12 -0
- package/_cjs/actions/wallet/watchAsset.js.map +1 -0
- package/_cjs/actions/wallet/writeContract.js +18 -0
- package/_cjs/actions/wallet/writeContract.js.map +1 -0
- package/_cjs/chains/celo/chainConfig.js +10 -0
- package/_cjs/chains/celo/chainConfig.js.map +1 -0
- package/_cjs/chains/celo/formatters.js +82 -0
- package/_cjs/chains/celo/formatters.js.map +1 -0
- package/_cjs/chains/celo/index.js +10 -0
- package/_cjs/chains/celo/index.js.map +1 -0
- package/_cjs/chains/celo/parsers.js +131 -0
- package/_cjs/chains/celo/parsers.js.map +1 -0
- package/_cjs/chains/celo/serializers.js +131 -0
- package/_cjs/chains/celo/serializers.js.map +1 -0
- package/_cjs/chains/celo/types.js +3 -0
- package/_cjs/chains/celo/types.js.map +1 -0
- package/_cjs/chains/celo/utils.js +44 -0
- package/_cjs/chains/celo/utils.js.map +1 -0
- package/_cjs/chains/definitions/arbitrum.js +24 -0
- package/_cjs/chains/definitions/arbitrum.js.map +1 -0
- package/_cjs/chains/definitions/arbitrumGoerli.js +30 -0
- package/_cjs/chains/definitions/arbitrumGoerli.js.map +1 -0
- package/_cjs/chains/definitions/arbitrumNova.js +24 -0
- package/_cjs/chains/definitions/arbitrumNova.js.map +1 -0
- package/_cjs/chains/definitions/arbitrumSepolia.js +32 -0
- package/_cjs/chains/definitions/arbitrumSepolia.js.map +1 -0
- package/_cjs/chains/definitions/astar.js +29 -0
- package/_cjs/chains/definitions/astar.js.map +1 -0
- package/_cjs/chains/definitions/astarZkatana.js +42 -0
- package/_cjs/chains/definitions/astarZkatana.js.map +1 -0
- package/_cjs/chains/definitions/aurora.js +20 -0
- package/_cjs/chains/definitions/aurora.js.map +1 -0
- package/_cjs/chains/definitions/auroraTestnet.js +21 -0
- package/_cjs/chains/definitions/auroraTestnet.js.map +1 -0
- package/_cjs/chains/definitions/avalanche.js +26 -0
- package/_cjs/chains/definitions/avalanche.js.map +1 -0
- package/_cjs/chains/definitions/avalancheFuji.js +27 -0
- package/_cjs/chains/definitions/avalancheFuji.js.map +1 -0
- package/_cjs/chains/definitions/base.js +30 -0
- package/_cjs/chains/definitions/base.js.map +1 -0
- package/_cjs/chains/definitions/baseGoerli.js +30 -0
- package/_cjs/chains/definitions/baseGoerli.js.map +1 -0
- package/_cjs/chains/definitions/baseSepolia.js +34 -0
- package/_cjs/chains/definitions/baseSepolia.js.map +1 -0
- package/_cjs/chains/definitions/bearNetworkChainMainnet.js +20 -0
- package/_cjs/chains/definitions/bearNetworkChainMainnet.js.map +1 -0
- package/_cjs/chains/definitions/bearNetworkChainTestnet.js +24 -0
- package/_cjs/chains/definitions/bearNetworkChainTestnet.js.map +1 -0
- package/_cjs/chains/definitions/boba.js +26 -0
- package/_cjs/chains/definitions/boba.js.map +1 -0
- package/_cjs/chains/definitions/bronos.js +20 -0
- package/_cjs/chains/definitions/bronos.js.map +1 -0
- package/_cjs/chains/definitions/bronosTestnet.js +21 -0
- package/_cjs/chains/definitions/bronosTestnet.js.map +1 -0
- package/_cjs/chains/definitions/bsc.js +26 -0
- package/_cjs/chains/definitions/bsc.js.map +1 -0
- package/_cjs/chains/definitions/bscTestnet.js +27 -0
- package/_cjs/chains/definitions/bscTestnet.js.map +1 -0
- package/_cjs/chains/definitions/bxn.js +21 -0
- package/_cjs/chains/definitions/bxn.js.map +1 -0
- package/_cjs/chains/definitions/bxnTestnet.js +25 -0
- package/_cjs/chains/definitions/bxnTestnet.js.map +1 -0
- package/_cjs/chains/definitions/canto.js +29 -0
- package/_cjs/chains/definitions/canto.js.map +1 -0
- package/_cjs/chains/definitions/celo.js +32 -0
- package/_cjs/chains/definitions/celo.js.map +1 -0
- package/_cjs/chains/definitions/celoAlfajores.js +34 -0
- package/_cjs/chains/definitions/celoAlfajores.js.map +1 -0
- package/_cjs/chains/definitions/celoCannoli.js +34 -0
- package/_cjs/chains/definitions/celoCannoli.js.map +1 -0
- package/_cjs/chains/definitions/chiliz.js +26 -0
- package/_cjs/chains/definitions/chiliz.js.map +1 -0
- package/_cjs/chains/definitions/classic.js +23 -0
- package/_cjs/chains/definitions/classic.js.map +1 -0
- package/_cjs/chains/definitions/confluxESpace.js +27 -0
- package/_cjs/chains/definitions/confluxESpace.js.map +1 -0
- package/_cjs/chains/definitions/coreDao.js +27 -0
- package/_cjs/chains/definitions/coreDao.js.map +1 -0
- package/_cjs/chains/definitions/cronos.js +26 -0
- package/_cjs/chains/definitions/cronos.js.map +1 -0
- package/_cjs/chains/definitions/cronosTestnet.js +30 -0
- package/_cjs/chains/definitions/cronosTestnet.js.map +1 -0
- package/_cjs/chains/definitions/crossbell.js +28 -0
- package/_cjs/chains/definitions/crossbell.js.map +1 -0
- package/_cjs/chains/definitions/dfk.js +25 -0
- package/_cjs/chains/definitions/dfk.js.map +1 -0
- package/_cjs/chains/definitions/dogechain.js +23 -0
- package/_cjs/chains/definitions/dogechain.js.map +1 -0
- package/_cjs/chains/definitions/edgeware.js +26 -0
- package/_cjs/chains/definitions/edgeware.js.map +1 -0
- package/_cjs/chains/definitions/edgewareTestnet.js +23 -0
- package/_cjs/chains/definitions/edgewareTestnet.js.map +1 -0
- package/_cjs/chains/definitions/ekta.js +20 -0
- package/_cjs/chains/definitions/ekta.js.map +1 -0
- package/_cjs/chains/definitions/ektaTestnet.js +21 -0
- package/_cjs/chains/definitions/ektaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/eon.js +24 -0
- package/_cjs/chains/definitions/eon.js.map +1 -0
- package/_cjs/chains/definitions/eos.js +29 -0
- package/_cjs/chains/definitions/eos.js.map +1 -0
- package/_cjs/chains/definitions/eosTestnet.js +30 -0
- package/_cjs/chains/definitions/eosTestnet.js.map +1 -0
- package/_cjs/chains/definitions/evmos.js +20 -0
- package/_cjs/chains/definitions/evmos.js.map +1 -0
- package/_cjs/chains/definitions/evmosTestnet.js +23 -0
- package/_cjs/chains/definitions/evmosTestnet.js.map +1 -0
- package/_cjs/chains/definitions/fantom.js +26 -0
- package/_cjs/chains/definitions/fantom.js.map +1 -0
- package/_cjs/chains/definitions/fantomTestnet.js +26 -0
- package/_cjs/chains/definitions/fantomTestnet.js.map +1 -0
- package/_cjs/chains/definitions/fibo.js +20 -0
- package/_cjs/chains/definitions/fibo.js.map +1 -0
- package/_cjs/chains/definitions/filecoin.js +20 -0
- package/_cjs/chains/definitions/filecoin.js.map +1 -0
- package/_cjs/chains/definitions/filecoinCalibration.js +20 -0
- package/_cjs/chains/definitions/filecoinCalibration.js.map +1 -0
- package/_cjs/chains/definitions/filecoinHyperspace.js +20 -0
- package/_cjs/chains/definitions/filecoinHyperspace.js.map +1 -0
- package/_cjs/chains/definitions/flare.js +23 -0
- package/_cjs/chains/definitions/flare.js.map +1 -0
- package/_cjs/chains/definitions/flareTestnet.js +24 -0
- package/_cjs/chains/definitions/flareTestnet.js.map +1 -0
- package/_cjs/chains/definitions/foundry.js +20 -0
- package/_cjs/chains/definitions/foundry.js.map +1 -0
- package/_cjs/chains/definitions/fuse.js +22 -0
- package/_cjs/chains/definitions/fuse.js.map +1 -0
- package/_cjs/chains/definitions/fuseSparknet.js +19 -0
- package/_cjs/chains/definitions/fuseSparknet.js.map +1 -0
- package/_cjs/chains/definitions/gnosis.js +32 -0
- package/_cjs/chains/definitions/gnosis.js.map +1 -0
- package/_cjs/chains/definitions/gnosisChiado.js +33 -0
- package/_cjs/chains/definitions/gnosisChiado.js.map +1 -0
- package/_cjs/chains/definitions/gobi.js +22 -0
- package/_cjs/chains/definitions/gobi.js.map +1 -0
- package/_cjs/chains/definitions/goerli.js +35 -0
- package/_cjs/chains/definitions/goerli.js.map +1 -0
- package/_cjs/chains/definitions/haqqMainnet.js +25 -0
- package/_cjs/chains/definitions/haqqMainnet.js.map +1 -0
- package/_cjs/chains/definitions/haqqTestedge2.js +25 -0
- package/_cjs/chains/definitions/haqqTestedge2.js.map +1 -0
- package/_cjs/chains/definitions/hardhat.js +17 -0
- package/_cjs/chains/definitions/hardhat.js.map +1 -0
- package/_cjs/chains/definitions/harmonyOne.js +26 -0
- package/_cjs/chains/definitions/harmonyOne.js.map +1 -0
- package/_cjs/chains/definitions/holesky.js +22 -0
- package/_cjs/chains/definitions/holesky.js.map +1 -0
- package/_cjs/chains/definitions/iotex.js +23 -0
- package/_cjs/chains/definitions/iotex.js.map +1 -0
- package/_cjs/chains/definitions/iotexTestnet.js +23 -0
- package/_cjs/chains/definitions/iotexTestnet.js.map +1 -0
- package/_cjs/chains/definitions/kava.js +29 -0
- package/_cjs/chains/definitions/kava.js.map +1 -0
- package/_cjs/chains/definitions/kavaTestnet.js +32 -0
- package/_cjs/chains/definitions/kavaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/klaytn.js +20 -0
- package/_cjs/chains/definitions/klaytn.js.map +1 -0
- package/_cjs/chains/definitions/kroma.js +22 -0
- package/_cjs/chains/definitions/kroma.js.map +1 -0
- package/_cjs/chains/definitions/kromaSepolia.js +22 -0
- package/_cjs/chains/definitions/kromaSepolia.js.map +1 -0
- package/_cjs/chains/definitions/linea.js +29 -0
- package/_cjs/chains/definitions/linea.js.map +1 -0
- package/_cjs/chains/definitions/lineaTestnet.js +29 -0
- package/_cjs/chains/definitions/lineaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/localhost.js +17 -0
- package/_cjs/chains/definitions/localhost.js.map +1 -0
- package/_cjs/chains/definitions/lukso.js +31 -0
- package/_cjs/chains/definitions/lukso.js.map +1 -0
- package/_cjs/chains/definitions/mainnet.js +34 -0
- package/_cjs/chains/definitions/mainnet.js.map +1 -0
- package/_cjs/chains/definitions/manta.js +35 -0
- package/_cjs/chains/definitions/manta.js.map +1 -0
- package/_cjs/chains/definitions/mantaTestnet.js +36 -0
- package/_cjs/chains/definitions/mantaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/mantle.js +29 -0
- package/_cjs/chains/definitions/mantle.js.map +1 -0
- package/_cjs/chains/definitions/mantleTestnet.js +24 -0
- package/_cjs/chains/definitions/mantleTestnet.js.map +1 -0
- package/_cjs/chains/definitions/meter.js +20 -0
- package/_cjs/chains/definitions/meter.js.map +1 -0
- package/_cjs/chains/definitions/meterTestnet.js +23 -0
- package/_cjs/chains/definitions/meterTestnet.js.map +1 -0
- package/_cjs/chains/definitions/metis.js +29 -0
- package/_cjs/chains/definitions/metis.js.map +1 -0
- package/_cjs/chains/definitions/metisGoerli.js +29 -0
- package/_cjs/chains/definitions/metisGoerli.js.map +1 -0
- package/_cjs/chains/definitions/mev.js +31 -0
- package/_cjs/chains/definitions/mev.js.map +1 -0
- package/_cjs/chains/definitions/mevTestnet.js +32 -0
- package/_cjs/chains/definitions/mevTestnet.js.map +1 -0
- package/_cjs/chains/definitions/modeTestnet.js +28 -0
- package/_cjs/chains/definitions/modeTestnet.js.map +1 -0
- package/_cjs/chains/definitions/moonbaseAlpha.js +33 -0
- package/_cjs/chains/definitions/moonbaseAlpha.js.map +1 -0
- package/_cjs/chains/definitions/moonbeam.js +33 -0
- package/_cjs/chains/definitions/moonbeam.js.map +1 -0
- package/_cjs/chains/definitions/moonbeamDev.js +20 -0
- package/_cjs/chains/definitions/moonbeamDev.js.map +1 -0
- package/_cjs/chains/definitions/moonriver.js +33 -0
- package/_cjs/chains/definitions/moonriver.js.map +1 -0
- package/_cjs/chains/definitions/neonDevnet.js +28 -0
- package/_cjs/chains/definitions/neonDevnet.js.map +1 -0
- package/_cjs/chains/definitions/neonMainnet.js +27 -0
- package/_cjs/chains/definitions/neonMainnet.js.map +1 -0
- package/_cjs/chains/definitions/nexi.js +27 -0
- package/_cjs/chains/definitions/nexi.js.map +1 -0
- package/_cjs/chains/definitions/nexilix.js +26 -0
- package/_cjs/chains/definitions/nexilix.js.map +1 -0
- package/_cjs/chains/definitions/oasys.js +21 -0
- package/_cjs/chains/definitions/oasys.js.map +1 -0
- package/_cjs/chains/definitions/okc.js +26 -0
- package/_cjs/chains/definitions/okc.js.map +1 -0
- package/_cjs/chains/definitions/opBNB.js +26 -0
- package/_cjs/chains/definitions/opBNB.js.map +1 -0
- package/_cjs/chains/definitions/opBNBTestnet.js +27 -0
- package/_cjs/chains/definitions/opBNBTestnet.js.map +1 -0
- package/_cjs/chains/definitions/optimism.js +30 -0
- package/_cjs/chains/definitions/optimism.js.map +1 -0
- package/_cjs/chains/definitions/optimismGoerli.js +31 -0
- package/_cjs/chains/definitions/optimismGoerli.js.map +1 -0
- package/_cjs/chains/definitions/optimismSepolia.js +31 -0
- package/_cjs/chains/definitions/optimismSepolia.js.map +1 -0
- package/_cjs/chains/definitions/plinga.js +27 -0
- package/_cjs/chains/definitions/plinga.js.map +1 -0
- package/_cjs/chains/definitions/polygon.js +27 -0
- package/_cjs/chains/definitions/polygon.js.map +1 -0
- package/_cjs/chains/definitions/polygonMumbai.js +28 -0
- package/_cjs/chains/definitions/polygonMumbai.js.map +1 -0
- package/_cjs/chains/definitions/polygonZkEvm.js +27 -0
- package/_cjs/chains/definitions/polygonZkEvm.js.map +1 -0
- package/_cjs/chains/definitions/polygonZkEvmTestnet.js +28 -0
- package/_cjs/chains/definitions/polygonZkEvmTestnet.js.map +1 -0
- package/_cjs/chains/definitions/pulsechain.js +32 -0
- package/_cjs/chains/definitions/pulsechain.js.map +1 -0
- package/_cjs/chains/definitions/pulsechainV4.js +32 -0
- package/_cjs/chains/definitions/pulsechainV4.js.map +1 -0
- package/_cjs/chains/definitions/qMainnet.js +23 -0
- package/_cjs/chains/definitions/qMainnet.js.map +1 -0
- package/_cjs/chains/definitions/qTestnet.js +24 -0
- package/_cjs/chains/definitions/qTestnet.js.map +1 -0
- package/_cjs/chains/definitions/rollux.js +29 -0
- package/_cjs/chains/definitions/rollux.js.map +1 -0
- package/_cjs/chains/definitions/rolluxTestnet.js +32 -0
- package/_cjs/chains/definitions/rolluxTestnet.js.map +1 -0
- package/_cjs/chains/definitions/ronin.js +24 -0
- package/_cjs/chains/definitions/ronin.js.map +1 -0
- package/_cjs/chains/definitions/saigon.js +28 -0
- package/_cjs/chains/definitions/saigon.js.map +1 -0
- package/_cjs/chains/definitions/scroll.js +29 -0
- package/_cjs/chains/definitions/scroll.js.map +1 -0
- package/_cjs/chains/definitions/scrollSepolia.js +28 -0
- package/_cjs/chains/definitions/scrollSepolia.js.map +1 -0
- package/_cjs/chains/definitions/scrollTestnet.js +23 -0
- package/_cjs/chains/definitions/scrollTestnet.js.map +1 -0
- package/_cjs/chains/definitions/sepolia.js +33 -0
- package/_cjs/chains/definitions/sepolia.js.map +1 -0
- package/_cjs/chains/definitions/shardeumSphinx.js +22 -0
- package/_cjs/chains/definitions/shardeumSphinx.js.map +1 -0
- package/_cjs/chains/definitions/skale/brawl.js +23 -0
- package/_cjs/chains/definitions/skale/brawl.js.map +1 -0
- package/_cjs/chains/definitions/skale/calypso.js +30 -0
- package/_cjs/chains/definitions/skale/calypso.js.map +1 -0
- package/_cjs/chains/definitions/skale/calypsoTestnet.js +33 -0
- package/_cjs/chains/definitions/skale/calypsoTestnet.js.map +1 -0
- package/_cjs/chains/definitions/skale/chaosTestnet.js +33 -0
- package/_cjs/chains/definitions/skale/chaosTestnet.js.map +1 -0
- package/_cjs/chains/definitions/skale/cryptoBlades.js +25 -0
- package/_cjs/chains/definitions/skale/cryptoBlades.js.map +1 -0
- package/_cjs/chains/definitions/skale/cryptoColosseum.js +23 -0
- package/_cjs/chains/definitions/skale/cryptoColosseum.js.map +1 -0
- package/_cjs/chains/definitions/skale/europa.js +28 -0
- package/_cjs/chains/definitions/skale/europa.js.map +1 -0
- package/_cjs/chains/definitions/skale/europaTestnet.js +31 -0
- package/_cjs/chains/definitions/skale/europaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/skale/exorde.js +23 -0
- package/_cjs/chains/definitions/skale/exorde.js.map +1 -0
- package/_cjs/chains/definitions/skale/humanProtocol.js +23 -0
- package/_cjs/chains/definitions/skale/humanProtocol.js.map +1 -0
- package/_cjs/chains/definitions/skale/nebula.js +28 -0
- package/_cjs/chains/definitions/skale/nebula.js.map +1 -0
- package/_cjs/chains/definitions/skale/nebulaTestnet.js +31 -0
- package/_cjs/chains/definitions/skale/nebulaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/skale/razor.js +23 -0
- package/_cjs/chains/definitions/skale/razor.js.map +1 -0
- package/_cjs/chains/definitions/skale/titan.js +28 -0
- package/_cjs/chains/definitions/skale/titan.js.map +1 -0
- package/_cjs/chains/definitions/skale/titanTestnet.js +33 -0
- package/_cjs/chains/definitions/skale/titanTestnet.js.map +1 -0
- package/_cjs/chains/definitions/songbird.js +23 -0
- package/_cjs/chains/definitions/songbird.js.map +1 -0
- package/_cjs/chains/definitions/songbirdTestnet.js +24 -0
- package/_cjs/chains/definitions/songbirdTestnet.js.map +1 -0
- package/_cjs/chains/definitions/spicy.js +34 -0
- package/_cjs/chains/definitions/spicy.js.map +1 -0
- package/_cjs/chains/definitions/syscoin.js +29 -0
- package/_cjs/chains/definitions/syscoin.js.map +1 -0
- package/_cjs/chains/definitions/syscoinTestnet.js +29 -0
- package/_cjs/chains/definitions/syscoinTestnet.js.map +1 -0
- package/_cjs/chains/definitions/taikoJolnir.js +21 -0
- package/_cjs/chains/definitions/taikoJolnir.js.map +1 -0
- package/_cjs/chains/definitions/taikoTestnetSepolia.js +21 -0
- package/_cjs/chains/definitions/taikoTestnetSepolia.js.map +1 -0
- package/_cjs/chains/definitions/taraxa.js +21 -0
- package/_cjs/chains/definitions/taraxa.js.map +1 -0
- package/_cjs/chains/definitions/taraxaTestnet.js +22 -0
- package/_cjs/chains/definitions/taraxaTestnet.js.map +1 -0
- package/_cjs/chains/definitions/telos.js +29 -0
- package/_cjs/chains/definitions/telos.js.map +1 -0
- package/_cjs/chains/definitions/telosTestnet.js +24 -0
- package/_cjs/chains/definitions/telosTestnet.js.map +1 -0
- package/_cjs/chains/definitions/tenet.js +23 -0
- package/_cjs/chains/definitions/tenet.js.map +1 -0
- package/_cjs/chains/definitions/thunderTestnet.js +22 -0
- package/_cjs/chains/definitions/thunderTestnet.js.map +1 -0
- package/_cjs/chains/definitions/vechain.js +25 -0
- package/_cjs/chains/definitions/vechain.js.map +1 -0
- package/_cjs/chains/definitions/wanchain.js +30 -0
- package/_cjs/chains/definitions/wanchain.js.map +1 -0
- package/_cjs/chains/definitions/wanchainTestnet.js +28 -0
- package/_cjs/chains/definitions/wanchainTestnet.js.map +1 -0
- package/_cjs/chains/definitions/xdc.js +21 -0
- package/_cjs/chains/definitions/xdc.js.map +1 -0
- package/_cjs/chains/definitions/xdcTestnet.js +21 -0
- package/_cjs/chains/definitions/xdcTestnet.js.map +1 -0
- package/_cjs/chains/definitions/zetachainAthensTestnet.js +26 -0
- package/_cjs/chains/definitions/zetachainAthensTestnet.js.map +1 -0
- package/_cjs/chains/definitions/zhejiang.js +22 -0
- package/_cjs/chains/definitions/zhejiang.js.map +1 -0
- package/_cjs/chains/definitions/zkSync.js +34 -0
- package/_cjs/chains/definitions/zkSync.js.map +1 -0
- package/_cjs/chains/definitions/zkSyncTestnet.js +31 -0
- package/_cjs/chains/definitions/zkSyncTestnet.js.map +1 -0
- package/_cjs/chains/definitions/zora.js +32 -0
- package/_cjs/chains/definitions/zora.js.map +1 -0
- package/_cjs/chains/definitions/zoraSepolia.js +41 -0
- package/_cjs/chains/definitions/zoraSepolia.js.map +1 -0
- package/_cjs/chains/definitions/zoraTestnet.js +36 -0
- package/_cjs/chains/definitions/zoraTestnet.js.map +1 -0
- package/_cjs/chains/index.js +325 -0
- package/_cjs/chains/index.js.map +1 -0
- package/_cjs/chains/opStack/abis.js +77 -0
- package/_cjs/chains/opStack/abis.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateContractL1Fee.js +36 -0
- package/_cjs/chains/opStack/actions/estimateContractL1Fee.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateContractL1Gas.js +36 -0
- package/_cjs/chains/opStack/actions/estimateContractL1Gas.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateContractTotalFee.js +36 -0
- package/_cjs/chains/opStack/actions/estimateContractTotalFee.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateContractTotalGas.js +36 -0
- package/_cjs/chains/opStack/actions/estimateContractTotalGas.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateL1Fee.js +53 -0
- package/_cjs/chains/opStack/actions/estimateL1Fee.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateL1Gas.js +53 -0
- package/_cjs/chains/opStack/actions/estimateL1Gas.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateTotalFee.js +18 -0
- package/_cjs/chains/opStack/actions/estimateTotalFee.js.map +1 -0
- package/_cjs/chains/opStack/actions/estimateTotalGas.js +16 -0
- package/_cjs/chains/opStack/actions/estimateTotalGas.js.map +1 -0
- package/_cjs/chains/opStack/chainConfig.js +10 -0
- package/_cjs/chains/opStack/chainConfig.js.map +1 -0
- package/_cjs/chains/opStack/contracts.js +16 -0
- package/_cjs/chains/opStack/contracts.js.map +1 -0
- package/_cjs/chains/opStack/decorators/public.js +27 -0
- package/_cjs/chains/opStack/decorators/public.js.map +1 -0
- package/_cjs/chains/opStack/formatters.js +54 -0
- package/_cjs/chains/opStack/formatters.js.map +1 -0
- package/_cjs/chains/opStack/index.js +42 -0
- package/_cjs/chains/opStack/index.js.map +1 -0
- package/_cjs/chains/opStack/types.js +3 -0
- package/_cjs/chains/opStack/types.js.map +1 -0
- package/_cjs/chains/utils.js +12 -0
- package/_cjs/chains/utils.js.map +1 -0
- package/_cjs/chains/zksync/chainConfig.js +10 -0
- package/_cjs/chains/zksync/chainConfig.js.map +1 -0
- package/_cjs/chains/zksync/formatters.js +128 -0
- package/_cjs/chains/zksync/formatters.js.map +1 -0
- package/_cjs/chains/zksync/index.js +8 -0
- package/_cjs/chains/zksync/index.js.map +1 -0
- package/_cjs/chains/zksync/serializers.js +74 -0
- package/_cjs/chains/zksync/serializers.js.map +1 -0
- package/_cjs/chains/zksync/types.js +3 -0
- package/_cjs/chains/zksync/types.js.map +1 -0
- package/_cjs/clients/createClient.js +42 -0
- package/_cjs/clients/createClient.js.map +1 -0
- package/_cjs/clients/createPublicClient.js +17 -0
- package/_cjs/clients/createPublicClient.js.map +1 -0
- package/_cjs/clients/createTestClient.js +20 -0
- package/_cjs/clients/createTestClient.js.map +1 -0
- package/_cjs/clients/createWalletClient.js +18 -0
- package/_cjs/clients/createWalletClient.js.map +1 -0
- package/_cjs/clients/decorators/public.js +101 -0
- package/_cjs/clients/decorators/public.js.map +1 -0
- package/_cjs/clients/decorators/test.js +74 -0
- package/_cjs/clients/decorators/test.js.map +1 -0
- package/_cjs/clients/decorators/wallet.js +41 -0
- package/_cjs/clients/decorators/wallet.js.map +1 -0
- package/_cjs/clients/transports/createTransport.js +13 -0
- package/_cjs/clients/transports/createTransport.js.map +1 -0
- package/_cjs/clients/transports/custom.js +17 -0
- package/_cjs/clients/transports/custom.js.map +1 -0
- package/_cjs/clients/transports/fallback.js +122 -0
- package/_cjs/clients/transports/fallback.js.map +1 -0
- package/_cjs/clients/transports/http.js +59 -0
- package/_cjs/clients/transports/http.js.map +1 -0
- package/_cjs/clients/transports/webSocket.js +81 -0
- package/_cjs/clients/transports/webSocket.js.map +1 -0
- package/_cjs/constants/abis.js +1350 -0
- package/_cjs/constants/abis.js.map +1 -0
- package/_cjs/constants/address.js +5 -0
- package/_cjs/constants/address.js.map +1 -0
- package/_cjs/constants/bytes.js +5 -0
- package/_cjs/constants/bytes.js.map +1 -0
- package/_cjs/constants/contract.js +5 -0
- package/_cjs/constants/contract.js.map +1 -0
- package/_cjs/constants/contracts.js +5 -0
- package/_cjs/constants/contracts.js.map +1 -0
- package/_cjs/constants/number.js +101 -0
- package/_cjs/constants/number.js.map +1 -0
- package/_cjs/constants/solidity.js +35 -0
- package/_cjs/constants/solidity.js.map +1 -0
- package/_cjs/constants/strings.js +5 -0
- package/_cjs/constants/strings.js.map +1 -0
- package/_cjs/constants/unit.js +16 -0
- package/_cjs/constants/unit.js.map +1 -0
- package/_cjs/ens/index.js +20 -0
- package/_cjs/ens/index.js.map +1 -0
- package/_cjs/errors/abi.js +461 -0
- package/_cjs/errors/abi.js.map +1 -0
- package/_cjs/errors/account.js +23 -0
- package/_cjs/errors/account.js.map +1 -0
- package/_cjs/errors/address.js +17 -0
- package/_cjs/errors/address.js.map +1 -0
- package/_cjs/errors/base.js +83 -0
- package/_cjs/errors/base.js.map +1 -0
- package/_cjs/errors/block.js +22 -0
- package/_cjs/errors/block.js.map +1 -0
- package/_cjs/errors/ccip.js +69 -0
- package/_cjs/errors/ccip.js.map +1 -0
- package/_cjs/errors/chain.js +86 -0
- package/_cjs/errors/chain.js.map +1 -0
- package/_cjs/errors/contract.js +286 -0
- package/_cjs/errors/contract.js.map +1 -0
- package/_cjs/errors/cursor.js +29 -0
- package/_cjs/errors/cursor.js.map +1 -0
- package/_cjs/errors/data.js +31 -0
- package/_cjs/errors/data.js.map +1 -0
- package/_cjs/errors/encoding.js +65 -0
- package/_cjs/errors/encoding.js.map +1 -0
- package/_cjs/errors/ens.js +59 -0
- package/_cjs/errors/ens.js.map +1 -0
- package/_cjs/errors/estimateGas.js +49 -0
- package/_cjs/errors/estimateGas.js.map +1 -0
- package/_cjs/errors/fee.js +42 -0
- package/_cjs/errors/fee.js.map +1 -0
- package/_cjs/errors/log.js +17 -0
- package/_cjs/errors/log.js.map +1 -0
- package/_cjs/errors/node.js +262 -0
- package/_cjs/errors/node.js.map +1 -0
- package/_cjs/errors/request.js +107 -0
- package/_cjs/errors/request.js.map +1 -0
- package/_cjs/errors/rpc.js +448 -0
- package/_cjs/errors/rpc.js.map +1 -0
- package/_cjs/errors/transaction.js +225 -0
- package/_cjs/errors/transaction.js.map +1 -0
- package/_cjs/errors/transport.js +13 -0
- package/_cjs/errors/transport.js.map +1 -0
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +486 -0
- package/_cjs/index.js.map +1 -0
- package/_cjs/types/account.js +3 -0
- package/_cjs/types/account.js.map +1 -0
- package/_cjs/types/block.js +3 -0
- package/_cjs/types/block.js.map +1 -0
- package/_cjs/types/chain.js +3 -0
- package/_cjs/types/chain.js.map +1 -0
- package/_cjs/types/contract.js +3 -0
- package/_cjs/types/contract.js.map +1 -0
- package/_cjs/types/eip1193.js +24 -0
- package/_cjs/types/eip1193.js.map +1 -0
- package/_cjs/types/ens.js +3 -0
- package/_cjs/types/ens.js.map +1 -0
- package/_cjs/types/fee.js +3 -0
- package/_cjs/types/fee.js.map +1 -0
- package/_cjs/types/filter.js +3 -0
- package/_cjs/types/filter.js.map +1 -0
- package/_cjs/types/log.js +3 -0
- package/_cjs/types/log.js.map +1 -0
- package/_cjs/types/misc.js +3 -0
- package/_cjs/types/misc.js.map +1 -0
- package/_cjs/types/multicall.js +3 -0
- package/_cjs/types/multicall.js.map +1 -0
- package/_cjs/types/proof.js +3 -0
- package/_cjs/types/proof.js.map +1 -0
- package/_cjs/types/rpc.js +3 -0
- package/_cjs/types/rpc.js.map +1 -0
- package/_cjs/types/transaction.js +3 -0
- package/_cjs/types/transaction.js.map +1 -0
- package/_cjs/types/transport.js +3 -0
- package/_cjs/types/transport.js.map +1 -0
- package/_cjs/types/typedData.js +3 -0
- package/_cjs/types/typedData.js.map +1 -0
- package/_cjs/types/utils.js +3 -0
- package/_cjs/types/utils.js.map +1 -0
- package/_cjs/types/window.js +3 -0
- package/_cjs/types/window.js.map +1 -0
- package/_cjs/types/withdrawal.js +3 -0
- package/_cjs/types/withdrawal.js.map +1 -0
- package/_cjs/utils/abi/decodeAbiParameters.js +210 -0
- package/_cjs/utils/abi/decodeAbiParameters.js.map +1 -0
- package/_cjs/utils/abi/decodeDeployData.js +22 -0
- package/_cjs/utils/abi/decodeDeployData.js.map +1 -0
- package/_cjs/utils/abi/decodeErrorResult.js +30 -0
- package/_cjs/utils/abi/decodeErrorResult.js.map +1 -0
- package/_cjs/utils/abi/decodeEventLog.js +85 -0
- package/_cjs/utils/abi/decodeEventLog.js.map +1 -0
- package/_cjs/utils/abi/decodeFunctionData.js +28 -0
- package/_cjs/utils/abi/decodeFunctionData.js.map +1 -0
- package/_cjs/utils/abi/decodeFunctionResult.js +29 -0
- package/_cjs/utils/abi/decodeFunctionResult.js.map +1 -0
- package/_cjs/utils/abi/encodeAbiParameters.js +211 -0
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -0
- package/_cjs/utils/abi/encodeDeployData.js +23 -0
- package/_cjs/utils/abi/encodeDeployData.js.map +1 -0
- package/_cjs/utils/abi/encodeErrorResult.js +33 -0
- package/_cjs/utils/abi/encodeErrorResult.js.map +1 -0
- package/_cjs/utils/abi/encodeEventTopics.js +53 -0
- package/_cjs/utils/abi/encodeEventTopics.js.map +1 -0
- package/_cjs/utils/abi/encodeFunctionData.js +34 -0
- package/_cjs/utils/abi/encodeFunctionData.js.map +1 -0
- package/_cjs/utils/abi/encodeFunctionResult.js +27 -0
- package/_cjs/utils/abi/encodeFunctionResult.js.map +1 -0
- package/_cjs/utils/abi/encodePacked.js +73 -0
- package/_cjs/utils/abi/encodePacked.js.map +1 -0
- package/_cjs/utils/abi/formatAbiItem.js +27 -0
- package/_cjs/utils/abi/formatAbiItem.js.map +1 -0
- package/_cjs/utils/abi/formatAbiItemWithArgs.js +17 -0
- package/_cjs/utils/abi/formatAbiItemWithArgs.js.map +1 -0
- package/_cjs/utils/abi/getAbiItem.js +84 -0
- package/_cjs/utils/abi/getAbiItem.js.map +1 -0
- package/_cjs/utils/accounts.js +8 -0
- package/_cjs/utils/accounts.js.map +1 -0
- package/_cjs/utils/address/getAddress.js +31 -0
- package/_cjs/utils/address/getAddress.js.map +1 -0
- package/_cjs/utils/address/getContractAddress.js +42 -0
- package/_cjs/utils/address/getContractAddress.js.map +1 -0
- package/_cjs/utils/address/isAddress.js +9 -0
- package/_cjs/utils/address/isAddress.js.map +1 -0
- package/_cjs/utils/address/isAddressEqual.js +14 -0
- package/_cjs/utils/address/isAddressEqual.js.map +1 -0
- package/_cjs/utils/buildRequest.js +93 -0
- package/_cjs/utils/buildRequest.js.map +1 -0
- package/_cjs/utils/ccip.js +121 -0
- package/_cjs/utils/ccip.js.map +1 -0
- package/_cjs/utils/chain/assertCurrentChain.js +12 -0
- package/_cjs/utils/chain/assertCurrentChain.js.map +1 -0
- package/_cjs/utils/chain/defineChain.js +13 -0
- package/_cjs/utils/chain/defineChain.js.map +1 -0
- package/_cjs/utils/chain/extractChain.js +8 -0
- package/_cjs/utils/chain/extractChain.js.map +1 -0
- package/_cjs/utils/chain/getChainContractAddress.js +26 -0
- package/_cjs/utils/chain/getChainContractAddress.js.map +1 -0
- package/_cjs/utils/cursor.js +134 -0
- package/_cjs/utils/cursor.js.map +1 -0
- package/_cjs/utils/data/concat.js +28 -0
- package/_cjs/utils/data/concat.js.map +1 -0
- package/_cjs/utils/data/isBytes.js +14 -0
- package/_cjs/utils/data/isBytes.js.map +1 -0
- package/_cjs/utils/data/isBytesEqual.js +13 -0
- package/_cjs/utils/data/isBytesEqual.js.map +1 -0
- package/_cjs/utils/data/isHex.js +12 -0
- package/_cjs/utils/data/isHex.js.map +1 -0
- package/_cjs/utils/data/pad.js +42 -0
- package/_cjs/utils/data/pad.js.map +1 -0
- package/_cjs/utils/data/size.js +11 -0
- package/_cjs/utils/data/size.js.map +1 -0
- package/_cjs/utils/data/slice.js +54 -0
- package/_cjs/utils/data/slice.js.map +1 -0
- package/_cjs/utils/data/trim.js +25 -0
- package/_cjs/utils/data/trim.js.map +1 -0
- package/_cjs/utils/encoding/fromBytes.js +56 -0
- package/_cjs/utils/encoding/fromBytes.js.map +1 -0
- package/_cjs/utils/encoding/fromHex.js +70 -0
- package/_cjs/utils/encoding/fromHex.js.map +1 -0
- package/_cjs/utils/encoding/fromRlp.js +67 -0
- package/_cjs/utils/encoding/fromRlp.js.map +1 -0
- package/_cjs/utils/encoding/toBytes.js +83 -0
- package/_cjs/utils/encoding/toBytes.js.map +1 -0
- package/_cjs/utils/encoding/toHex.js +79 -0
- package/_cjs/utils/encoding/toHex.js.map +1 -0
- package/_cjs/utils/encoding/toRlp.js +105 -0
- package/_cjs/utils/encoding/toRlp.js.map +1 -0
- package/_cjs/utils/ens/avatar/parseAvatarRecord.js +34 -0
- package/_cjs/utils/ens/avatar/parseAvatarRecord.js.map +1 -0
- package/_cjs/utils/ens/avatar/utils.js +186 -0
- package/_cjs/utils/ens/avatar/utils.js.map +1 -0
- package/_cjs/utils/ens/encodeLabelhash.js +8 -0
- package/_cjs/utils/ens/encodeLabelhash.js.map +1 -0
- package/_cjs/utils/ens/encodedLabelToLabelhash.js +18 -0
- package/_cjs/utils/ens/encodedLabelToLabelhash.js.map +1 -0
- package/_cjs/utils/ens/errors.js +24 -0
- package/_cjs/utils/ens/errors.js.map +1 -0
- package/_cjs/utils/ens/labelhash.js +15 -0
- package/_cjs/utils/ens/labelhash.js.map +1 -0
- package/_cjs/utils/ens/namehash.js +24 -0
- package/_cjs/utils/ens/namehash.js.map +1 -0
- package/_cjs/utils/ens/normalize.js +9 -0
- package/_cjs/utils/ens/normalize.js.map +1 -0
- package/_cjs/utils/ens/packetToBytes.js +27 -0
- package/_cjs/utils/ens/packetToBytes.js.map +1 -0
- package/_cjs/utils/errors/getCallError.js +20 -0
- package/_cjs/utils/errors/getCallError.js.map +1 -0
- package/_cjs/utils/errors/getContractError.js +39 -0
- package/_cjs/utils/errors/getContractError.js.map +1 -0
- package/_cjs/utils/errors/getEstimateGasError.js +20 -0
- package/_cjs/utils/errors/getEstimateGasError.js.map +1 -0
- package/_cjs/utils/errors/getNodeError.js +65 -0
- package/_cjs/utils/errors/getNodeError.js.map +1 -0
- package/_cjs/utils/errors/getTransactionError.js +20 -0
- package/_cjs/utils/errors/getTransactionError.js.map +1 -0
- package/_cjs/utils/filters/createFilterRequestScope.js +14 -0
- package/_cjs/utils/filters/createFilterRequestScope.js.map +1 -0
- package/_cjs/utils/formatters/block.js +32 -0
- package/_cjs/utils/formatters/block.js.map +1 -0
- package/_cjs/utils/formatters/extract.js +24 -0
- package/_cjs/utils/formatters/extract.js.map +1 -0
- package/_cjs/utils/formatters/feeHistory.js +13 -0
- package/_cjs/utils/formatters/feeHistory.js.map +1 -0
- package/_cjs/utils/formatters/formatter.js +25 -0
- package/_cjs/utils/formatters/formatter.js.map +1 -0
- package/_cjs/utils/formatters/log.js +18 -0
- package/_cjs/utils/formatters/log.js.map +1 -0
- package/_cjs/utils/formatters/proof.js +22 -0
- package/_cjs/utils/formatters/proof.js.map +1 -0
- package/_cjs/utils/formatters/transaction.js +66 -0
- package/_cjs/utils/formatters/transaction.js.map +1 -0
- package/_cjs/utils/formatters/transactionReceipt.js +47 -0
- package/_cjs/utils/formatters/transactionReceipt.js.map +1 -0
- package/_cjs/utils/formatters/transactionRequest.js +39 -0
- package/_cjs/utils/formatters/transactionRequest.js.map +1 -0
- package/_cjs/utils/getAction.js +8 -0
- package/_cjs/utils/getAction.js.map +1 -0
- package/_cjs/utils/hash/getEventSelector.js +10 -0
- package/_cjs/utils/hash/getEventSelector.js.map +1 -0
- package/_cjs/utils/hash/getEventSignature.js +9 -0
- package/_cjs/utils/hash/getEventSignature.js.map +1 -0
- package/_cjs/utils/hash/getFunctionSelector.js +11 -0
- package/_cjs/utils/hash/getFunctionSelector.js.map +1 -0
- package/_cjs/utils/hash/getFunctionSignature.js +15 -0
- package/_cjs/utils/hash/getFunctionSignature.js.map +1 -0
- package/_cjs/utils/hash/hashFunction.js +17 -0
- package/_cjs/utils/hash/hashFunction.js.map +1 -0
- package/_cjs/utils/hash/isHash.js +10 -0
- package/_cjs/utils/hash/isHash.js.map +1 -0
- package/_cjs/utils/hash/keccak256.js +16 -0
- package/_cjs/utils/hash/keccak256.js.map +1 -0
- package/_cjs/utils/hash/normalizeSignature.js +48 -0
- package/_cjs/utils/hash/normalizeSignature.js.map +1 -0
- package/_cjs/utils/index.js +213 -0
- package/_cjs/utils/index.js.map +1 -0
- package/_cjs/utils/observe.js +42 -0
- package/_cjs/utils/observe.js.map +1 -0
- package/_cjs/utils/poll.js +27 -0
- package/_cjs/utils/poll.js.map +1 -0
- package/_cjs/utils/promise/createBatchScheduler.js +49 -0
- package/_cjs/utils/promise/createBatchScheduler.js.map +1 -0
- package/_cjs/utils/promise/withCache.js +47 -0
- package/_cjs/utils/promise/withCache.js.map +1 -0
- package/_cjs/utils/promise/withRetry.js +29 -0
- package/_cjs/utils/promise/withRetry.js.map +1 -0
- package/_cjs/utils/promise/withTimeout.js +35 -0
- package/_cjs/utils/promise/withTimeout.js.map +1 -0
- package/_cjs/utils/regex.js +7 -0
- package/_cjs/utils/regex.js.map +1 -0
- package/_cjs/utils/rpc.js +154 -0
- package/_cjs/utils/rpc.js.map +1 -0
- package/_cjs/utils/signature/compactSignatureToHex.js +10 -0
- package/_cjs/utils/signature/compactSignatureToHex.js.map +1 -0
- package/_cjs/utils/signature/compactSignatureToSignature.js +15 -0
- package/_cjs/utils/signature/compactSignatureToSignature.js.map +1 -0
- package/_cjs/utils/signature/hashMessage.js +20 -0
- package/_cjs/utils/signature/hashMessage.js.map +1 -0
- package/_cjs/utils/signature/hashTypedData.js +124 -0
- package/_cjs/utils/signature/hashTypedData.js.map +1 -0
- package/_cjs/utils/signature/hexToCompactSignature.js +14 -0
- package/_cjs/utils/signature/hexToCompactSignature.js.map +1 -0
- package/_cjs/utils/signature/hexToSignature.js +12 -0
- package/_cjs/utils/signature/hexToSignature.js.map +1 -0
- package/_cjs/utils/signature/recoverAddress.js +10 -0
- package/_cjs/utils/signature/recoverAddress.js.map +1 -0
- package/_cjs/utils/signature/recoverMessageAddress.js +10 -0
- package/_cjs/utils/signature/recoverMessageAddress.js.map +1 -0
- package/_cjs/utils/signature/recoverPublicKey.js +21 -0
- package/_cjs/utils/signature/recoverPublicKey.js.map +1 -0
- package/_cjs/utils/signature/recoverTypedDataAddress.js +19 -0
- package/_cjs/utils/signature/recoverTypedDataAddress.js.map +1 -0
- package/_cjs/utils/signature/signatureToCompactSignature.js +17 -0
- package/_cjs/utils/signature/signatureToCompactSignature.js.map +1 -0
- package/_cjs/utils/signature/signatureToHex.js +11 -0
- package/_cjs/utils/signature/signatureToHex.js.map +1 -0
- package/_cjs/utils/signature/verifyMessage.js +11 -0
- package/_cjs/utils/signature/verifyMessage.js.map +1 -0
- package/_cjs/utils/signature/verifyTypedData.js +18 -0
- package/_cjs/utils/signature/verifyTypedData.js.map +1 -0
- package/_cjs/utils/stringify.js +9 -0
- package/_cjs/utils/stringify.js.map +1 -0
- package/_cjs/utils/transaction/assertRequest.js +28 -0
- package/_cjs/utils/transaction/assertRequest.js.map +1 -0
- package/_cjs/utils/transaction/assertTransaction.js +51 -0
- package/_cjs/utils/transaction/assertTransaction.js.map +1 -0
- package/_cjs/utils/transaction/getSerializedTransactionType.js +18 -0
- package/_cjs/utils/transaction/getSerializedTransactionType.js.map +1 -0
- package/_cjs/utils/transaction/getTransactionType.js +19 -0
- package/_cjs/utils/transaction/getTransactionType.js.map +1 -0
- package/_cjs/utils/transaction/parseTransaction.js +213 -0
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -0
- package/_cjs/utils/transaction/serializeAccessList.js +26 -0
- package/_cjs/utils/transaction/serializeAccessList.js.map +1 -0
- package/_cjs/utils/transaction/serializeTransaction.js +123 -0
- package/_cjs/utils/transaction/serializeTransaction.js.map +1 -0
- package/_cjs/utils/typedData.js +75 -0
- package/_cjs/utils/typedData.js.map +1 -0
- package/_cjs/utils/uid.js +18 -0
- package/_cjs/utils/uid.js.map +1 -0
- package/_cjs/utils/unit/formatEther.js +10 -0
- package/_cjs/utils/unit/formatEther.js.map +1 -0
- package/_cjs/utils/unit/formatGwei.js +10 -0
- package/_cjs/utils/unit/formatGwei.js.map +1 -0
- package/_cjs/utils/unit/formatUnits.js +18 -0
- package/_cjs/utils/unit/formatUnits.js.map +1 -0
- package/_cjs/utils/unit/parseEther.js +10 -0
- package/_cjs/utils/unit/parseEther.js.map +1 -0
- package/_cjs/utils/unit/parseGwei.js +10 -0
- package/_cjs/utils/unit/parseGwei.js.map +1 -0
- package/_cjs/utils/unit/parseUnits.js +38 -0
- package/_cjs/utils/unit/parseUnits.js.map +1 -0
- package/_cjs/utils/wait.js +8 -0
- package/_cjs/utils/wait.js.map +1 -0
- package/_cjs/window/index.js +4 -0
- package/_cjs/window/index.js.map +1 -0
- package/_esm/actions/test/dumpState.js +26 -0
- package/_esm/actions/test/dumpState.js.map +1 -0
- package/_esm/actions/test/loadState.js +27 -0
- package/_esm/actions/test/loadState.js.map +1 -0
- package/_esm/chains/celo/formatters.js.map +1 -1
- package/_esm/chains/definitions/chiliz.js +23 -0
- package/_esm/chains/definitions/chiliz.js.map +1 -0
- package/_esm/chains/definitions/lukso.js +28 -0
- package/_esm/chains/definitions/lukso.js.map +1 -0
- package/_esm/chains/definitions/spicy.js +31 -0
- package/_esm/chains/definitions/spicy.js.map +1 -0
- package/_esm/chains/index.js +3 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/chains/opStack/decorators/public.js +1 -1
- package/_esm/chains/opStack/decorators/public.js.map +1 -1
- package/_esm/chains/opStack/index.js +1 -1
- package/_esm/chains/opStack/index.js.map +1 -1
- package/_esm/clients/decorators/test.js +4 -0
- package/_esm/clients/decorators/test.js.map +1 -1
- package/_esm/constants/bytes.js +2 -0
- package/_esm/constants/bytes.js.map +1 -0
- package/_esm/constants/strings.js +2 -0
- package/_esm/constants/strings.js.map +1 -0
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +2 -0
- package/_esm/index.js.map +1 -1
- package/_esm/utils/formatters/transaction.js +19 -1
- package/_esm/utils/formatters/transaction.js.map +1 -1
- package/_esm/utils/signature/hashMessage.js +2 -1
- package/_esm/utils/signature/hashMessage.js.map +1 -1
- package/_esm/utils/transaction/serializeTransaction.js +20 -6
- package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/_types/actions/test/dumpState.d.ts +31 -0
- package/_types/actions/test/dumpState.d.ts.map +1 -0
- package/_types/actions/test/loadState.d.ts +34 -0
- package/_types/actions/test/loadState.d.ts.map +1 -0
- package/_types/chains/celo/chainConfig.d.ts +193 -163
- package/_types/chains/celo/chainConfig.d.ts.map +1 -1
- package/_types/chains/celo/formatters.d.ts +193 -163
- package/_types/chains/celo/formatters.d.ts.map +1 -1
- package/_types/chains/celo/types.d.ts +2 -0
- package/_types/chains/celo/types.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts +149 -131
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/baseGoerli.d.ts +149 -131
- package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/baseSepolia.d.ts +149 -131
- package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/celo.d.ts +193 -163
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +193 -163
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/celoCannoli.d.ts +193 -163
- package/_types/chains/definitions/celoCannoli.d.ts.map +1 -1
- package/_types/chains/definitions/chiliz.d.ts +35 -0
- package/_types/chains/definitions/chiliz.d.ts.map +1 -0
- package/_types/chains/definitions/lukso.d.ts +40 -0
- package/_types/chains/definitions/lukso.d.ts.map +1 -0
- package/_types/chains/definitions/optimism.d.ts +149 -131
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +149 -131
- package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/optimismSepolia.d.ts +149 -131
- package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/spicy.d.ts +36 -0
- package/_types/chains/definitions/spicy.d.ts.map +1 -0
- package/_types/chains/definitions/zkSync.d.ts +11 -0
- package/_types/chains/definitions/zkSync.d.ts.map +1 -1
- package/_types/chains/definitions/zkSyncTestnet.d.ts +11 -0
- package/_types/chains/definitions/zkSyncTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zora.d.ts +149 -131
- package/_types/chains/definitions/zora.d.ts.map +1 -1
- package/_types/chains/definitions/zoraSepolia.d.ts +149 -131
- package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zoraTestnet.d.ts +149 -131
- package/_types/chains/definitions/zoraTestnet.d.ts.map +1 -1
- package/_types/chains/index.d.ts +5 -1
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/chains/opStack/chainConfig.d.ts +145 -127
- package/_types/chains/opStack/chainConfig.d.ts.map +1 -1
- package/_types/chains/opStack/decorators/public.d.ts +18 -18
- package/_types/chains/opStack/decorators/public.d.ts.map +1 -1
- package/_types/chains/opStack/formatters.d.ts +145 -127
- package/_types/chains/opStack/formatters.d.ts.map +1 -1
- package/_types/chains/opStack/index.d.ts +1 -1
- package/_types/chains/opStack/index.d.ts.map +1 -1
- package/_types/chains/zksync/chainConfig.d.ts +11 -0
- package/_types/chains/zksync/chainConfig.d.ts.map +1 -1
- package/_types/chains/zksync/formatters.d.ts +11 -0
- package/_types/chains/zksync/formatters.d.ts.map +1 -1
- package/_types/clients/decorators/test.d.ts +41 -0
- package/_types/clients/decorators/test.d.ts.map +1 -1
- package/_types/constants/bytes.d.ts +2 -0
- package/_types/constants/bytes.d.ts.map +1 -0
- package/_types/constants/strings.d.ts +2 -0
- package/_types/constants/strings.d.ts.map +1 -0
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +2 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +16 -0
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/rpc.d.ts +2 -2
- package/_types/types/rpc.d.ts.map +1 -1
- package/_types/types/transaction.d.ts +10 -1
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/types/utils.d.ts +16 -0
- package/_types/types/utils.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +1 -1
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +1 -1
- package/_types/utils/signature/hashMessage.d.ts.map +1 -1
- package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
- package/actions/test/dumpState.ts +44 -0
- package/actions/test/loadState.ts +47 -0
- package/chains/celo/formatters.ts +0 -1
- package/chains/celo/types.ts +2 -0
- package/chains/definitions/chiliz.ts +23 -0
- package/chains/definitions/lukso.ts +28 -0
- package/chains/definitions/spicy.ts +31 -0
- package/chains/index.ts +21 -3
- package/chains/opStack/decorators/public.ts +19 -19
- package/chains/opStack/index.ts +1 -1
- package/clients/decorators/test.ts +50 -0
- package/constants/bytes.ts +2 -0
- package/constants/strings.ts +1 -0
- package/errors/version.ts +1 -1
- package/index.ts +2 -0
- package/package.json +34 -11
- package/types/eip1193.ts +16 -0
- package/types/rpc.ts +10 -5
- package/types/transaction.ts +10 -1
- package/types/utils.ts +20 -0
- package/utils/formatters/transaction.ts +20 -3
- package/utils/signature/hashMessage.ts +2 -1
- package/utils/transaction/serializeTransaction.ts +18 -12
@@ -0,0 +1,51 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.assertTransactionLegacy = exports.assertTransactionEIP2930 = exports.assertTransactionEIP1559 = void 0;
|
4
|
+
const address_js_1 = require("../../errors/address.js");
|
5
|
+
const base_js_1 = require("../../errors/base.js");
|
6
|
+
const chain_js_1 = require("../../errors/chain.js");
|
7
|
+
const node_js_1 = require("../../errors/node.js");
|
8
|
+
const isAddress_js_1 = require("../address/isAddress.js");
|
9
|
+
function assertTransactionEIP1559(transaction) {
|
10
|
+
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
|
11
|
+
if (chainId <= 0)
|
12
|
+
throw new chain_js_1.InvalidChainIdError({ chainId });
|
13
|
+
if (to && !(0, isAddress_js_1.isAddress)(to))
|
14
|
+
throw new address_js_1.InvalidAddressError({ address: to });
|
15
|
+
if (gasPrice)
|
16
|
+
throw new base_js_1.BaseError('`gasPrice` is not a valid EIP-1559 Transaction attribute.');
|
17
|
+
if (maxFeePerGas && maxFeePerGas > 2n ** 256n - 1n)
|
18
|
+
throw new node_js_1.FeeCapTooHighError({ maxFeePerGas });
|
19
|
+
if (maxPriorityFeePerGas &&
|
20
|
+
maxFeePerGas &&
|
21
|
+
maxPriorityFeePerGas > maxFeePerGas)
|
22
|
+
throw new node_js_1.TipAboveFeeCapError({ maxFeePerGas, maxPriorityFeePerGas });
|
23
|
+
}
|
24
|
+
exports.assertTransactionEIP1559 = assertTransactionEIP1559;
|
25
|
+
function assertTransactionEIP2930(transaction) {
|
26
|
+
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to } = transaction;
|
27
|
+
if (chainId <= 0)
|
28
|
+
throw new chain_js_1.InvalidChainIdError({ chainId });
|
29
|
+
if (to && !(0, isAddress_js_1.isAddress)(to))
|
30
|
+
throw new address_js_1.InvalidAddressError({ address: to });
|
31
|
+
if (maxPriorityFeePerGas || maxFeePerGas)
|
32
|
+
throw new base_js_1.BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid EIP-2930 Transaction attribute.');
|
33
|
+
if (gasPrice && gasPrice > 2n ** 256n - 1n)
|
34
|
+
throw new node_js_1.FeeCapTooHighError({ maxFeePerGas: gasPrice });
|
35
|
+
}
|
36
|
+
exports.assertTransactionEIP2930 = assertTransactionEIP2930;
|
37
|
+
function assertTransactionLegacy(transaction) {
|
38
|
+
const { chainId, maxPriorityFeePerGas, gasPrice, maxFeePerGas, to, accessList, } = transaction;
|
39
|
+
if (to && !(0, isAddress_js_1.isAddress)(to))
|
40
|
+
throw new address_js_1.InvalidAddressError({ address: to });
|
41
|
+
if (typeof chainId !== 'undefined' && chainId <= 0)
|
42
|
+
throw new chain_js_1.InvalidChainIdError({ chainId });
|
43
|
+
if (maxPriorityFeePerGas || maxFeePerGas)
|
44
|
+
throw new base_js_1.BaseError('`maxFeePerGas`/`maxPriorityFeePerGas` is not a valid Legacy Transaction attribute.');
|
45
|
+
if (gasPrice && gasPrice > 2n ** 256n - 1n)
|
46
|
+
throw new node_js_1.FeeCapTooHighError({ maxFeePerGas: gasPrice });
|
47
|
+
if (accessList)
|
48
|
+
throw new base_js_1.BaseError('`accessList` is not a valid Legacy Transaction attribute.');
|
49
|
+
}
|
50
|
+
exports.assertTransactionLegacy = assertTransactionLegacy;
|
51
|
+
//# sourceMappingURL=assertTransaction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"assertTransaction.js","sourceRoot":"","sources":["../../../utils/transaction/assertTransaction.ts"],"names":[],"mappings":";;;AAAA,wDAGgC;AAChC,kDAAoE;AACpE,oDAG8B;AAC9B,kDAK6B;AAO7B,0DAA4E;AAW5E,SAAgB,wBAAwB,CACtC,WAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,GACjE,WAAW,CAAA;IACb,IAAI,OAAO,IAAI,CAAC;QAAE,MAAM,IAAI,8BAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5D,IAAI,EAAE,IAAI,CAAC,IAAA,wBAAS,EAAC,EAAE,CAAC;QAAE,MAAM,IAAI,gCAAmB,CAAC,EAAE,OAAO,EAAE,EAAE,EAAE,CAAC,CAAA;IACxE,IAAI,QAAQ;QACV,MAAM,IAAI,mBAAS,CACjB,2DAA2D,CAC5D,CAAA;IACH,IAAI,YAAY,IAAI,YAAY,GAAG,EAAE,IAAI,IAAI,GAAG,EAAE;QAChD,MAAM,IAAI,4BAAkB,CAAC,EAAE,YAAY,EAAE,CAAC,CAAA;IAChD,IACE,oBAAoB;QACpB,YAAY;QACZ,oBAAoB,GAAG,YAAY;QAEnC,MAAM,IAAI,6BAAmB,CAAC,EAAE,YAAY,EAAE,oBAAoB,EAAE,CAAC,CAAA;AACzE,CAAC;AAnBD,4DAmBC;AAUD,SAAgB,wBAAwB,CACtC,WAA2C;IAE3C,MAAM,EAAE,OAAO,EAAE,oBAAoB,EAAE,QAAQ,EAAE,YAAY,EAAE,EAAE,EAAE,GACjE,WAAW,CAAA;IACb,IAAI,OAAO,IAAI,CAAC;QAAE,MAAM,IAAI,8BAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;IAC5D,IA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
const transaction_js_1 = require("../../errors/transaction.js");
|
5
|
+
const slice_js_1 = require("../data/slice.js");
|
6
|
+
const fromHex_js_1 = require("../encoding/fromHex.js");
|
7
|
+
function getSerializedTransactionType(serializedTransaction) {
|
8
|
+
const serializedType = (0, slice_js_1.sliceHex)(serializedTransaction, 0, 1);
|
9
|
+
if (serializedType === '0x02')
|
10
|
+
return 'eip1559';
|
11
|
+
if (serializedType === '0x01')
|
12
|
+
return 'eip2930';
|
13
|
+
if (serializedType !== '0x' && (0, fromHex_js_1.hexToNumber)(serializedType) >= 0xc0)
|
14
|
+
return 'legacy';
|
15
|
+
throw new transaction_js_1.InvalidSerializedTransactionTypeError({ serializedType });
|
16
|
+
}
|
17
|
+
exports.getSerializedTransactionType = getSerializedTransactionType;
|
18
|
+
//# sourceMappingURL=getSerializedTransactionType.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getSerializedTransactionType.js","sourceRoot":"","sources":["../../../utils/transaction/getSerializedTransactionType.ts"],"names":[],"mappings":";;;AAAA,gEAGoC;AAOpC,+CAAmE;AACnE,uDAA+E;AAgB/E,SAAgB,4BAA4B,CAG1C,qBAAkC;IAElC,MAAM,cAAc,GAAG,IAAA,mBAAQ,EAAC,qBAAqB,EAAE,CAAC,EAAE,CAAC,CAAC,CAAA;IAE5D,IAAI,cAAc,KAAK,MAAM;QAC3B,OAAO,SAAsD,CAAA;IAE/D,IAAI,cAAc,KAAK,MAAM;QAC3B,OAAO,SAAsD,CAAA;IAE/D,IAAI,cAAc,KAAK,IAAI,IAAI,IAAA,wBAAW,EAAC,cAAc,CAAC,IAAI,IAAI;QAChE,OAAO,QAAqD,CAAA;IAE9D,MAAM,IAAI,sDAAqC,CAAC,EAAE,cAAc,EAAE,CAAC,CAAA;AACrE,CAAC;AAjBD,oEAiBC"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getTransactionType = void 0;
|
4
|
+
const transaction_js_1 = require("../../errors/transaction.js");
|
5
|
+
function getTransactionType(transaction) {
|
6
|
+
if (transaction.type)
|
7
|
+
return transaction.type;
|
8
|
+
if (typeof transaction.maxFeePerGas !== 'undefined' ||
|
9
|
+
typeof transaction.maxPriorityFeePerGas !== 'undefined')
|
10
|
+
return 'eip1559';
|
11
|
+
if (typeof transaction.gasPrice !== 'undefined') {
|
12
|
+
if (typeof transaction.accessList !== 'undefined')
|
13
|
+
return 'eip2930';
|
14
|
+
return 'legacy';
|
15
|
+
}
|
16
|
+
throw new transaction_js_1.InvalidSerializableTransactionError({ transaction });
|
17
|
+
}
|
18
|
+
exports.getTransactionType = getTransactionType;
|
19
|
+
//# sourceMappingURL=getTransactionType.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getTransactionType.js","sourceRoot":"","sources":["../../../utils/transaction/getTransactionType.ts"],"names":[],"mappings":";;;AAAA,gEAGoC;AA8BpC,SAAgB,kBAAkB,CAGhC,WAAqC;IAErC,IAAI,WAAW,CAAC,IAAI;QAClB,OAAO,WAAW,CAAC,IAAoD,CAAA;IAEzE,IACE,OAAO,WAAW,CAAC,YAAY,KAAK,WAAW;QAC/C,OAAO,WAAW,CAAC,oBAAoB,KAAK,WAAW;QAEvD,OAAO,SAAyD,CAAA;IAElE,IAAI,OAAO,WAAW,CAAC,QAAQ,KAAK,WAAW,EAAE;QAC/C,IAAI,OAAO,WAAW,CAAC,UAAU,KAAK,WAAW;YAC/C,OAAO,SAAyD,CAAA;QAClE,OAAO,QAAwD,CAAA;KAChE;IAED,MAAM,IAAI,oDAAmC,CAAC,EAAE,WAAW,EAAE,CAAC,CAAA;AAChE,CAAC;AArBD,gDAqBC"}
|
@@ -0,0 +1,213 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.parseAccessList = exports.toTransactionArray = exports.parseTransaction = void 0;
|
4
|
+
const address_js_1 = require("../../errors/address.js");
|
5
|
+
const transaction_js_1 = require("../../errors/transaction.js");
|
6
|
+
const isAddress_js_1 = require("../address/isAddress.js");
|
7
|
+
const isHex_js_1 = require("../data/isHex.js");
|
8
|
+
const pad_js_1 = require("../data/pad.js");
|
9
|
+
const trim_js_1 = require("../data/trim.js");
|
10
|
+
const fromHex_js_1 = require("../encoding/fromHex.js");
|
11
|
+
const fromRlp_js_1 = require("../encoding/fromRlp.js");
|
12
|
+
const isHash_js_1 = require("../hash/isHash.js");
|
13
|
+
const assertTransaction_js_1 = require("./assertTransaction.js");
|
14
|
+
const getSerializedTransactionType_js_1 = require("./getSerializedTransactionType.js");
|
15
|
+
function parseTransaction(serializedTransaction) {
|
16
|
+
const type = (0, getSerializedTransactionType_js_1.getSerializedTransactionType)(serializedTransaction);
|
17
|
+
if (type === 'eip1559')
|
18
|
+
return parseTransactionEIP1559(serializedTransaction);
|
19
|
+
if (type === 'eip2930')
|
20
|
+
return parseTransactionEIP2930(serializedTransaction);
|
21
|
+
return parseTransactionLegacy(serializedTransaction);
|
22
|
+
}
|
23
|
+
exports.parseTransaction = parseTransaction;
|
24
|
+
function parseTransactionEIP1559(serializedTransaction) {
|
25
|
+
const transactionArray = toTransactionArray(serializedTransaction);
|
26
|
+
const [chainId, nonce, maxPriorityFeePerGas, maxFeePerGas, gas, to, value, data, accessList, v, r, s,] = transactionArray;
|
27
|
+
if (!(transactionArray.length === 9 || transactionArray.length === 12))
|
28
|
+
throw new transaction_js_1.InvalidSerializedTransactionError({
|
29
|
+
attributes: {
|
30
|
+
chainId,
|
31
|
+
nonce,
|
32
|
+
maxPriorityFeePerGas,
|
33
|
+
maxFeePerGas,
|
34
|
+
gas,
|
35
|
+
to,
|
36
|
+
value,
|
37
|
+
data,
|
38
|
+
accessList,
|
39
|
+
...(transactionArray.length > 9
|
40
|
+
? {
|
41
|
+
v,
|
42
|
+
r,
|
43
|
+
s,
|
44
|
+
}
|
45
|
+
: {}),
|
46
|
+
},
|
47
|
+
serializedTransaction,
|
48
|
+
type: 'eip1559',
|
49
|
+
});
|
50
|
+
const transaction = {
|
51
|
+
chainId: (0, fromHex_js_1.hexToNumber)(chainId),
|
52
|
+
type: 'eip1559',
|
53
|
+
};
|
54
|
+
if ((0, isHex_js_1.isHex)(to) && to !== '0x')
|
55
|
+
transaction.to = to;
|
56
|
+
if ((0, isHex_js_1.isHex)(gas) && gas !== '0x')
|
57
|
+
transaction.gas = (0, fromHex_js_1.hexToBigInt)(gas);
|
58
|
+
if ((0, isHex_js_1.isHex)(data) && data !== '0x')
|
59
|
+
transaction.data = data;
|
60
|
+
if ((0, isHex_js_1.isHex)(nonce) && nonce !== '0x')
|
61
|
+
transaction.nonce = (0, fromHex_js_1.hexToNumber)(nonce);
|
62
|
+
if ((0, isHex_js_1.isHex)(value) && value !== '0x')
|
63
|
+
transaction.value = (0, fromHex_js_1.hexToBigInt)(value);
|
64
|
+
if ((0, isHex_js_1.isHex)(maxFeePerGas) && maxFeePerGas !== '0x')
|
65
|
+
transaction.maxFeePerGas = (0, fromHex_js_1.hexToBigInt)(maxFeePerGas);
|
66
|
+
if ((0, isHex_js_1.isHex)(maxPriorityFeePerGas) && maxPriorityFeePerGas !== '0x')
|
67
|
+
transaction.maxPriorityFeePerGas = (0, fromHex_js_1.hexToBigInt)(maxPriorityFeePerGas);
|
68
|
+
if (accessList.length !== 0 && accessList !== '0x')
|
69
|
+
transaction.accessList = parseAccessList(accessList);
|
70
|
+
(0, assertTransaction_js_1.assertTransactionEIP1559)(transaction);
|
71
|
+
const signature = transactionArray.length === 12
|
72
|
+
? parseEIP155Signature(transactionArray)
|
73
|
+
: undefined;
|
74
|
+
return { ...signature, ...transaction };
|
75
|
+
}
|
76
|
+
function parseTransactionEIP2930(serializedTransaction) {
|
77
|
+
const transactionArray = toTransactionArray(serializedTransaction);
|
78
|
+
const [chainId, nonce, gasPrice, gas, to, value, data, accessList, v, r, s] = transactionArray;
|
79
|
+
if (!(transactionArray.length === 8 || transactionArray.length === 11))
|
80
|
+
throw new transaction_js_1.InvalidSerializedTransactionError({
|
81
|
+
attributes: {
|
82
|
+
chainId,
|
83
|
+
nonce,
|
84
|
+
gasPrice,
|
85
|
+
gas,
|
86
|
+
to,
|
87
|
+
value,
|
88
|
+
data,
|
89
|
+
accessList,
|
90
|
+
...(transactionArray.length > 8
|
91
|
+
? {
|
92
|
+
v,
|
93
|
+
r,
|
94
|
+
s,
|
95
|
+
}
|
96
|
+
: {}),
|
97
|
+
},
|
98
|
+
serializedTransaction,
|
99
|
+
type: 'eip2930',
|
100
|
+
});
|
101
|
+
const transaction = {
|
102
|
+
chainId: (0, fromHex_js_1.hexToNumber)(chainId),
|
103
|
+
type: 'eip2930',
|
104
|
+
};
|
105
|
+
if ((0, isHex_js_1.isHex)(to) && to !== '0x')
|
106
|
+
transaction.to = to;
|
107
|
+
if ((0, isHex_js_1.isHex)(gas) && gas !== '0x')
|
108
|
+
transaction.gas = (0, fromHex_js_1.hexToBigInt)(gas);
|
109
|
+
if ((0, isHex_js_1.isHex)(data) && data !== '0x')
|
110
|
+
transaction.data = data;
|
111
|
+
if ((0, isHex_js_1.isHex)(nonce) && nonce !== '0x')
|
112
|
+
transaction.nonce = (0, fromHex_js_1.hexToNumber)(nonce);
|
113
|
+
if ((0, isHex_js_1.isHex)(value) && value !== '0x')
|
114
|
+
transaction.value = (0, fromHex_js_1.hexToBigInt)(value);
|
115
|
+
if ((0, isHex_js_1.isHex)(gasPrice) && gasPrice !== '0x')
|
116
|
+
transaction.gasPrice = (0, fromHex_js_1.hexToBigInt)(gasPrice);
|
117
|
+
if (accessList.length !== 0 && accessList !== '0x')
|
118
|
+
transaction.accessList = parseAccessList(accessList);
|
119
|
+
(0, assertTransaction_js_1.assertTransactionEIP2930)(transaction);
|
120
|
+
const signature = transactionArray.length === 11
|
121
|
+
? parseEIP155Signature(transactionArray)
|
122
|
+
: undefined;
|
123
|
+
return { ...signature, ...transaction };
|
124
|
+
}
|
125
|
+
function parseTransactionLegacy(serializedTransaction) {
|
126
|
+
const transactionArray = (0, fromRlp_js_1.fromRlp)(serializedTransaction, 'hex');
|
127
|
+
const [nonce, gasPrice, gas, to, value, data, chainIdOrV_, r, s] = transactionArray;
|
128
|
+
if (!(transactionArray.length === 6 || transactionArray.length === 9))
|
129
|
+
throw new transaction_js_1.InvalidSerializedTransactionError({
|
130
|
+
attributes: {
|
131
|
+
nonce,
|
132
|
+
gasPrice,
|
133
|
+
gas,
|
134
|
+
to,
|
135
|
+
value,
|
136
|
+
data,
|
137
|
+
...(transactionArray.length > 6
|
138
|
+
? {
|
139
|
+
v: chainIdOrV_,
|
140
|
+
r,
|
141
|
+
s,
|
142
|
+
}
|
143
|
+
: {}),
|
144
|
+
},
|
145
|
+
serializedTransaction,
|
146
|
+
type: 'legacy',
|
147
|
+
});
|
148
|
+
const transaction = {
|
149
|
+
type: 'legacy',
|
150
|
+
};
|
151
|
+
if ((0, isHex_js_1.isHex)(to) && to !== '0x')
|
152
|
+
transaction.to = to;
|
153
|
+
if ((0, isHex_js_1.isHex)(gas) && gas !== '0x')
|
154
|
+
transaction.gas = (0, fromHex_js_1.hexToBigInt)(gas);
|
155
|
+
if ((0, isHex_js_1.isHex)(data) && data !== '0x')
|
156
|
+
transaction.data = data;
|
157
|
+
if ((0, isHex_js_1.isHex)(nonce) && nonce !== '0x')
|
158
|
+
transaction.nonce = (0, fromHex_js_1.hexToNumber)(nonce);
|
159
|
+
if ((0, isHex_js_1.isHex)(value) && value !== '0x')
|
160
|
+
transaction.value = (0, fromHex_js_1.hexToBigInt)(value);
|
161
|
+
if ((0, isHex_js_1.isHex)(gasPrice) && gasPrice !== '0x')
|
162
|
+
transaction.gasPrice = (0, fromHex_js_1.hexToBigInt)(gasPrice);
|
163
|
+
(0, assertTransaction_js_1.assertTransactionLegacy)(transaction);
|
164
|
+
if (transactionArray.length === 6)
|
165
|
+
return transaction;
|
166
|
+
const chainIdOrV = (0, isHex_js_1.isHex)(chainIdOrV_) && chainIdOrV_ !== '0x'
|
167
|
+
? (0, fromHex_js_1.hexToBigInt)(chainIdOrV_)
|
168
|
+
: 0n;
|
169
|
+
if (s === '0x' && r === '0x') {
|
170
|
+
if (chainIdOrV > 0)
|
171
|
+
transaction.chainId = Number(chainIdOrV);
|
172
|
+
return transaction;
|
173
|
+
}
|
174
|
+
const v = chainIdOrV;
|
175
|
+
const chainId = Number((v - 35n) / 2n);
|
176
|
+
if (chainId > 0)
|
177
|
+
transaction.chainId = chainId;
|
178
|
+
else if (v !== 27n && v !== 28n)
|
179
|
+
throw new transaction_js_1.InvalidLegacyVError({ v });
|
180
|
+
transaction.v = v;
|
181
|
+
transaction.s = s;
|
182
|
+
transaction.r = r;
|
183
|
+
return transaction;
|
184
|
+
}
|
185
|
+
function toTransactionArray(serializedTransaction) {
|
186
|
+
return (0, fromRlp_js_1.fromRlp)(`0x${serializedTransaction.slice(4)}`, 'hex');
|
187
|
+
}
|
188
|
+
exports.toTransactionArray = toTransactionArray;
|
189
|
+
function parseAccessList(accessList_) {
|
190
|
+
const accessList = [];
|
191
|
+
for (let i = 0; i < accessList_.length; i++) {
|
192
|
+
const [address, storageKeys] = accessList_[i];
|
193
|
+
if (!(0, isAddress_js_1.isAddress)(address))
|
194
|
+
throw new address_js_1.InvalidAddressError({ address });
|
195
|
+
accessList.push({
|
196
|
+
address: address,
|
197
|
+
storageKeys: storageKeys.map((key) => ((0, isHash_js_1.isHash)(key) ? key : (0, trim_js_1.trim)(key))),
|
198
|
+
});
|
199
|
+
}
|
200
|
+
return accessList;
|
201
|
+
}
|
202
|
+
exports.parseAccessList = parseAccessList;
|
203
|
+
function parseEIP155Signature(transactionArray) {
|
204
|
+
const signature = transactionArray.slice(-3);
|
205
|
+
const v = signature[0] === '0x' || (0, fromHex_js_1.hexToBigInt)(signature[0]) === 0n ? 27n : 28n;
|
206
|
+
return {
|
207
|
+
r: (0, pad_js_1.padHex)(signature[1], { size: 32 }),
|
208
|
+
s: (0, pad_js_1.padHex)(signature[2], { size: 32 }),
|
209
|
+
v,
|
210
|
+
yParity: v === 27n ? 0 : 1,
|
211
|
+
};
|
212
|
+
}
|
213
|
+
//# sourceMappingURL=parseTransaction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"parseTransaction.js","sourceRoot":"","sources":["../../../utils/transaction/parseTransaction.ts"],"names":[],"mappings":";;;AAAA,wDAGgC;AAChC,gEAKoC;AAepC,0DAA4E;AAC5E,+CAA6D;AAC7D,2CAA6D;AAC7D,6CAAsC;AACtC,uDAK+B;AAC/B,uDAAuE;AAEvE,iDAA0C;AAE1C,iEAO+B;AAC/B,uFAI0C;AAgB1C,SAAgB,gBAAgB,CAC9B,qBAAkC;IAElC,MAAM,IAAI,GAAG,IAAA,8DAA4B,EAAC,qBAAqB,CAAC,CAAA;IAEhE,IAAI,IAAI,KAAK,SAAS;QACpB,OAAO,uBAAuB,CAC5B,qBAAqD,CACX,CAAA;IAE9C,IAAI,IAAI,KAAK,SAAS;QACpB,OAAO,uBAAuB,CAC5B,qBAAqD,CACX,CAAA;IAE9C,OAAO,sBAAsB,CAC3B,qBAAqB,CACqB,CAAA;AAC9C,CAAC;AAlBD,4CAkBC;AAaD,SAAS,uBAAuB,CAC9B,qBAAmD;IAEnD,MAAM,gBAAgB,GAAG,kBAAkB,CAAC,qBAAqB,CAAC,CAAA;IAElE,MAAM,CACJ,OAAO,EACP,KAAK,EACL,oBAAoB,EACpB,YAAY,EACZ,GAAG,EACH,EAAE,EACF,KAAK,EACL,IAAI,EACJ,UAAU,EACV,CAAC,EACD,CAAC,EACD,CAAC,EACF,GAAG,gBAAgB,CAAA;IAEpB,IAAI,CAAC,CAAC,gBAAgB,CAAC,MAAM,KAAK,CAAC,IAAI,gBAAgB,CAAC,MAAM,KAAK,EAAE,CAAC;QACpE,MAAM,IAAI,kDAAiC,CAAC;YAC1C,UAAU,EAAE;gBACV,OAAO;gBACP,KAAK;gBACL,oBAAoB;gBACpB,YAAY;gBACZ,GAAG;gBACH,EAAE;gBACF,KAAK;gB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Q,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC;QAC5C,CAAC;QACD,OAAO,EAAE,CAAC,KAAK,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;KAC3B,CAAA;AACH,CAAC"}
|
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.serializeAccessList = void 0;
|
4
|
+
const address_js_1 = require("../../errors/address.js");
|
5
|
+
const transaction_js_1 = require("../../errors/transaction.js");
|
6
|
+
const isAddress_js_1 = require("../address/isAddress.js");
|
7
|
+
function serializeAccessList(accessList) {
|
8
|
+
if (!accessList || accessList.length === 0)
|
9
|
+
return [];
|
10
|
+
const serializedAccessList = [];
|
11
|
+
for (let i = 0; i < accessList.length; i++) {
|
12
|
+
const { address, storageKeys } = accessList[i];
|
13
|
+
for (let j = 0; j < storageKeys.length; j++) {
|
14
|
+
if (storageKeys[j].length - 2 !== 64) {
|
15
|
+
throw new transaction_js_1.InvalidStorageKeySizeError({ storageKey: storageKeys[j] });
|
16
|
+
}
|
17
|
+
}
|
18
|
+
if (!(0, isAddress_js_1.isAddress)(address)) {
|
19
|
+
throw new address_js_1.InvalidAddressError({ address });
|
20
|
+
}
|
21
|
+
serializedAccessList.push([address, storageKeys]);
|
22
|
+
}
|
23
|
+
return serializedAccessList;
|
24
|
+
}
|
25
|
+
exports.serializeAccessList = serializeAccessList;
|
26
|
+
//# sourceMappingURL=serializeAccessList.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"serializeAccessList.js","sourceRoot":"","sources":["../../../utils/transaction/serializeAccessList.ts"],"names":[],"mappings":";;;AAAA,wDAGgC;AAChC,gEAGoC;AAIpC,0DAA4E;AAkB5E,SAAgB,mBAAmB,CACjC,UAAuB;IAEvB,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,EAAE,CAAA;IAErD,MAAM,oBAAoB,GAAwB,EAAE,CAAA;IACpD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,UAAU,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QAC1C,MAAM,EAAE,OAAO,EAAE,WAAW,EAAE,GAAG,UAAU,CAAC,CAAC,CAAC,CAAA;QAE9C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,WAAW,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YAC3C,IAAI,WAAW,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,KAAK,EAAE,EAAE;gBACpC,MAAM,IAAI,2CAA0B,CAAC,EAAE,UAAU,EAAE,WAAW,CAAC,CAAC,CAAC,EAAE,CAAC,CAAA;aACrE;SACF;QAED,IAAI,CAAC,IAAA,wBAAS,EAAC,OAAO,CAAC,EAAE;YACvB,MAAM,IAAI,gCAAmB,CAAC,EAAE,OAAO,EAAE,CAAC,CAAA;SAC3C;QAED,oBAAoB,CAAC,IAAI,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,CAAC,CAAA;KAClD;IACD,OAAO,oBAAoB,CAAA;AAC7B,CAAC;AAtBD,kDAsBC"}
|
@@ -0,0 +1,123 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.serializeTransaction = void 0;
|
4
|
+
const transaction_js_1 = require("../../errors/transaction.js");
|
5
|
+
const concat_js_1 = require("../data/concat.js");
|
6
|
+
const trim_js_1 = require("../data/trim.js");
|
7
|
+
const toHex_js_1 = require("../encoding/toHex.js");
|
8
|
+
const toRlp_js_1 = require("../encoding/toRlp.js");
|
9
|
+
const assertTransaction_js_1 = require("./assertTransaction.js");
|
10
|
+
const getTransactionType_js_1 = require("./getTransactionType.js");
|
11
|
+
const serializeAccessList_js_1 = require("./serializeAccessList.js");
|
12
|
+
function serializeTransaction(transaction, signature) {
|
13
|
+
const type = (0, getTransactionType_js_1.getTransactionType)(transaction);
|
14
|
+
if (type === 'eip1559')
|
15
|
+
return serializeTransactionEIP1559(transaction, signature);
|
16
|
+
if (type === 'eip2930')
|
17
|
+
return serializeTransactionEIP2930(transaction, signature);
|
18
|
+
return serializeTransactionLegacy(transaction, signature);
|
19
|
+
}
|
20
|
+
exports.serializeTransaction = serializeTransaction;
|
21
|
+
function serializeTransactionEIP1559(transaction, signature) {
|
22
|
+
const { chainId, gas, nonce, to, value, maxFeePerGas, maxPriorityFeePerGas, accessList, data, } = transaction;
|
23
|
+
(0, assertTransaction_js_1.assertTransactionEIP1559)(transaction);
|
24
|
+
const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
|
25
|
+
const serializedTransaction = [
|
26
|
+
(0, toHex_js_1.toHex)(chainId),
|
27
|
+
nonce ? (0, toHex_js_1.toHex)(nonce) : '0x',
|
28
|
+
maxPriorityFeePerGas ? (0, toHex_js_1.toHex)(maxPriorityFeePerGas) : '0x',
|
29
|
+
maxFeePerGas ? (0, toHex_js_1.toHex)(maxFeePerGas) : '0x',
|
30
|
+
gas ? (0, toHex_js_1.toHex)(gas) : '0x',
|
31
|
+
to ?? '0x',
|
32
|
+
value ? (0, toHex_js_1.toHex)(value) : '0x',
|
33
|
+
data ?? '0x',
|
34
|
+
serializedAccessList,
|
35
|
+
];
|
36
|
+
if (signature) {
|
37
|
+
const yParity = (() => {
|
38
|
+
if (signature.v === 0n)
|
39
|
+
return '0x';
|
40
|
+
if (signature.v === 1n)
|
41
|
+
return (0, toHex_js_1.toHex)(1);
|
42
|
+
return signature.v === 27n ? '0x' : (0, toHex_js_1.toHex)(1);
|
43
|
+
})();
|
44
|
+
serializedTransaction.push(yParity, (0, trim_js_1.trim)(signature.r), (0, trim_js_1.trim)(signature.s));
|
45
|
+
}
|
46
|
+
return (0, concat_js_1.concatHex)([
|
47
|
+
'0x02',
|
48
|
+
(0, toRlp_js_1.toRlp)(serializedTransaction),
|
49
|
+
]);
|
50
|
+
}
|
51
|
+
function serializeTransactionEIP2930(transaction, signature) {
|
52
|
+
const { chainId, gas, data, nonce, to, value, accessList, gasPrice } = transaction;
|
53
|
+
(0, assertTransaction_js_1.assertTransactionEIP2930)(transaction);
|
54
|
+
const serializedAccessList = (0, serializeAccessList_js_1.serializeAccessList)(accessList);
|
55
|
+
const serializedTransaction = [
|
56
|
+
(0, toHex_js_1.toHex)(chainId),
|
57
|
+
nonce ? (0, toHex_js_1.toHex)(nonce) : '0x',
|
58
|
+
gasPrice ? (0, toHex_js_1.toHex)(gasPrice) : '0x',
|
59
|
+
gas ? (0, toHex_js_1.toHex)(gas) : '0x',
|
60
|
+
to ?? '0x',
|
61
|
+
value ? (0, toHex_js_1.toHex)(value) : '0x',
|
62
|
+
data ?? '0x',
|
63
|
+
serializedAccessList,
|
64
|
+
];
|
65
|
+
if (signature) {
|
66
|
+
const yParity = (() => {
|
67
|
+
if (signature.v === 0n)
|
68
|
+
return '0x';
|
69
|
+
if (signature.v === 1n)
|
70
|
+
return (0, toHex_js_1.toHex)(1);
|
71
|
+
return signature.v === 27n ? '0x' : (0, toHex_js_1.toHex)(1);
|
72
|
+
})();
|
73
|
+
serializedTransaction.push(yParity, (0, trim_js_1.trim)(signature.r), (0, trim_js_1.trim)(signature.s));
|
74
|
+
}
|
75
|
+
return (0, concat_js_1.concatHex)([
|
76
|
+
'0x01',
|
77
|
+
(0, toRlp_js_1.toRlp)(serializedTransaction),
|
78
|
+
]);
|
79
|
+
}
|
80
|
+
function serializeTransactionLegacy(transaction, signature) {
|
81
|
+
const { chainId = 0, gas, data, nonce, to, value, gasPrice } = transaction;
|
82
|
+
(0, assertTransaction_js_1.assertTransactionLegacy)(transaction);
|
83
|
+
let serializedTransaction = [
|
84
|
+
nonce ? (0, toHex_js_1.toHex)(nonce) : '0x',
|
85
|
+
gasPrice ? (0, toHex_js_1.toHex)(gasPrice) : '0x',
|
86
|
+
gas ? (0, toHex_js_1.toHex)(gas) : '0x',
|
87
|
+
to ?? '0x',
|
88
|
+
value ? (0, toHex_js_1.toHex)(value) : '0x',
|
89
|
+
data ?? '0x',
|
90
|
+
];
|
91
|
+
if (signature) {
|
92
|
+
const v = (() => {
|
93
|
+
if (chainId > 0)
|
94
|
+
return BigInt(chainId * 2) + BigInt(35n + signature.v - 27n);
|
95
|
+
if (signature.v >= 35n) {
|
96
|
+
const inferredChainId = (signature.v - 35n) / 2n;
|
97
|
+
if (inferredChainId > 0)
|
98
|
+
return signature.v;
|
99
|
+
return 27n + (signature.v === 35n ? 0n : 1n);
|
100
|
+
}
|
101
|
+
const v = 27n + (signature.v === 27n ? 0n : 1n);
|
102
|
+
if (signature.v !== v)
|
103
|
+
throw new transaction_js_1.InvalidLegacyVError({ v: signature.v });
|
104
|
+
return v;
|
105
|
+
})();
|
106
|
+
serializedTransaction = [
|
107
|
+
...serializedTransaction,
|
108
|
+
(0, toHex_js_1.toHex)(v),
|
109
|
+
signature.r,
|
110
|
+
signature.s,
|
111
|
+
];
|
112
|
+
}
|
113
|
+
else if (chainId > 0) {
|
114
|
+
serializedTransaction = [
|
115
|
+
...serializedTransaction,
|
116
|
+
(0, toHex_js_1.toHex)(chainId),
|
117
|
+
'0x',
|
118
|
+
'0x',
|
119
|
+
];
|
120
|
+
}
|
121
|
+
return (0, toRlp_js_1.toRlp)(serializedTransaction);
|
122
|
+
}
|
123
|
+
//# sourceMappingURL=serializeTransaction.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"serializeTransaction.js","sourceRoot":"","sources":["../../../utils/transaction/serializeTransaction.ts"],"names":[],"mappings":";;;AAAA,gEAGoC;AAcpC,iDAAsE;AACtE,6CAAsC;AACtC,mDAAiE;AACjE,mDAAiE;AAEjE,iEAO+B;AAC/B,mEAIgC;AAChC,qEAGiC;AAkBjC,SAAgB,oBAAoB,CAGlC,WAAqC,EACrC,SAAqB;IAErB,MAAM,IAAI,GAAG,IAAA,0CAAkB,EAAC,WAAW,CAAuB,CAAA;IAElE,IAAI,IAAI,KAAK,S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,gBAAK,EAAC,OAAO,CAAC;YACd,IAAI;YACJ,IAAI;SACL,CAAA;KACF;IAED,OAAO,IAAA,gBAAK,EAAC,qBAAqB,CAAC,CAAA;AACrC,CAAC"}
|
@@ -0,0 +1,75 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.domainSeparator = exports.getTypesForEIP712Domain = exports.validateTypedData = void 0;
|
4
|
+
const abi_js_1 = require("../errors/abi.js");
|
5
|
+
const address_js_1 = require("../errors/address.js");
|
6
|
+
const isAddress_js_1 = require("./address/isAddress.js");
|
7
|
+
const size_js_1 = require("./data/size.js");
|
8
|
+
const toHex_js_1 = require("./encoding/toHex.js");
|
9
|
+
const regex_js_1 = require("./regex.js");
|
10
|
+
const hashTypedData_js_1 = require("./signature/hashTypedData.js");
|
11
|
+
function validateTypedData(parameters) {
|
12
|
+
const { domain, message, primaryType, types } = parameters;
|
13
|
+
const validateData = (struct, data) => {
|
14
|
+
for (const param of struct) {
|
15
|
+
const { name, type } = param;
|
16
|
+
const value = data[name];
|
17
|
+
const integerMatch = type.match(regex_js_1.integerRegex);
|
18
|
+
if (integerMatch &&
|
19
|
+
(typeof value === 'number' || typeof value === 'bigint')) {
|
20
|
+
const [_type, base, size_] = integerMatch;
|
21
|
+
(0, toHex_js_1.numberToHex)(value, {
|
22
|
+
signed: base === 'int',
|
23
|
+
size: parseInt(size_) / 8,
|
24
|
+
});
|
25
|
+
}
|
26
|
+
if (type === 'address' && typeof value === 'string' && !(0, isAddress_js_1.isAddress)(value))
|
27
|
+
throw new address_js_1.InvalidAddressError({ address: value });
|
28
|
+
const bytesMatch = type.match(regex_js_1.bytesRegex);
|
29
|
+
if (bytesMatch) {
|
30
|
+
const [_type, size_] = bytesMatch;
|
31
|
+
if (size_ && (0, size_js_1.size)(value) !== parseInt(size_))
|
32
|
+
throw new abi_js_1.BytesSizeMismatchError({
|
33
|
+
expectedSize: parseInt(size_),
|
34
|
+
givenSize: (0, size_js_1.size)(value),
|
35
|
+
});
|
36
|
+
}
|
37
|
+
const struct = types[type];
|
38
|
+
if (struct)
|
39
|
+
validateData(struct, value);
|
40
|
+
}
|
41
|
+
};
|
42
|
+
if (types.EIP712Domain && domain)
|
43
|
+
validateData(types.EIP712Domain, domain);
|
44
|
+
if (primaryType !== 'EIP712Domain') {
|
45
|
+
const type = types[primaryType];
|
46
|
+
validateData(type, message);
|
47
|
+
}
|
48
|
+
}
|
49
|
+
exports.validateTypedData = validateTypedData;
|
50
|
+
function getTypesForEIP712Domain({ domain, }) {
|
51
|
+
return [
|
52
|
+
typeof domain?.name === 'string' && { name: 'name', type: 'string' },
|
53
|
+
domain?.version && { name: 'version', type: 'string' },
|
54
|
+
typeof domain?.chainId === 'number' && {
|
55
|
+
name: 'chainId',
|
56
|
+
type: 'uint256',
|
57
|
+
},
|
58
|
+
domain?.verifyingContract && {
|
59
|
+
name: 'verifyingContract',
|
60
|
+
type: 'address',
|
61
|
+
},
|
62
|
+
domain?.salt && { name: 'salt', type: 'bytes32' },
|
63
|
+
].filter(Boolean);
|
64
|
+
}
|
65
|
+
exports.getTypesForEIP712Domain = getTypesForEIP712Domain;
|
66
|
+
function domainSeparator({ domain }) {
|
67
|
+
return (0, hashTypedData_js_1.hashDomain)({
|
68
|
+
domain,
|
69
|
+
types: {
|
70
|
+
EIP712Domain: getTypesForEIP712Domain({ domain }),
|
71
|
+
},
|
72
|
+
});
|
73
|
+
}
|
74
|
+
exports.domainSeparator = domainSeparator;
|
75
|
+
//# sourceMappingURL=typedData.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"typedData.js","sourceRoot":"","sources":["../../utils/typedData.ts"],"names":[],"mappings":";;;AAEA,6CAAyD;AACzD,qDAA0D;AAK1D,yDAA2E;AAC3E,4CAAyD;AACzD,kDAA4E;AAC5E,yCAAqD;AACrD,mEAGqC;AASrC,SAAgB,iBAAiB,CAG/B,UAAuD;IACvD,MAAM,EAAE,MAAM,EAAE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APD,0CAOC"}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.uid = void 0;
|
4
|
+
const size = 256;
|
5
|
+
let index = size;
|
6
|
+
let buffer;
|
7
|
+
function uid(length = 11) {
|
8
|
+
if (!buffer || index + length > size * 2) {
|
9
|
+
buffer = '';
|
10
|
+
index = 0;
|
11
|
+
for (let i = 0; i < size; i++) {
|
12
|
+
buffer += ((256 + Math.random() * 256) | 0).toString(16).substring(1);
|
13
|
+
}
|
14
|
+
}
|
15
|
+
return buffer.substring(index, index++ + length);
|
16
|
+
}
|
17
|
+
exports.uid = uid;
|
18
|
+
//# sourceMappingURL=uid.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"uid.js","sourceRoot":"","sources":["../../utils/uid.ts"],"names":[],"mappings":";;;AAAA,MAAM,IAAI,GAAG,GAAG,CAAA;AAChB,IAAI,KAAK,GAAG,IAAI,CAAA;AAChB,IAAI,MAAc,CAAA;AAElB,SAAgB,GAAG,CAAC,MAAM,GAAG,EAAE;IAC7B,IAAI,CAAC,MAAM,IAAI,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,CAAC,EAAE;QACxC,MAAM,GAAG,EAAE,CAAA;QACX,KAAK,GAAG,CAAC,CAAA;QACT,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,IAAI,EAAE,CAAC,EAAE,EAAE;YAC7B,MAAM,IAAI,CAAC,CAAC,GAAG,GAAG,IAAI,CAAC,MAAM,EAAE,GAAG,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;SACtE;KACF;IACD,OAAO,MAAM,CAAC,SAAS,CAAC,KAAK,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,CAAA;AAClD,CAAC;AATD,kBASC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.formatEther = void 0;
|
4
|
+
const unit_js_1 = require("../../constants/unit.js");
|
5
|
+
const formatUnits_js_1 = require("./formatUnits.js");
|
6
|
+
function formatEther(wei, unit = 'wei') {
|
7
|
+
return (0, formatUnits_js_1.formatUnits)(wei, unit_js_1.etherUnits[unit]);
|
8
|
+
}
|
9
|
+
exports.formatEther = formatEther;
|
10
|
+
//# sourceMappingURL=formatEther.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"formatEther.js","sourceRoot":"","sources":["../../../utils/unit/formatEther.ts"],"names":[],"mappings":";;;AAAA,qDAAoD;AAEpD,qDAAyE;AAIzE,SAAgB,WAAW,CAAC,GAAW,EAAE,OAAuB,KAAK;IACnE,OAAO,IAAA,4BAAW,EAAC,GAAG,EAAE,oBAAU,CAAC,IAAI,CAAC,CAAC,CAAA;AAC3C,CAAC;AAFD,kCAEC"}
|
@@ -0,0 +1,10 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.formatGwei = void 0;
|
4
|
+
const unit_js_1 = require("../../constants/unit.js");
|
5
|
+
const formatUnits_js_1 = require("./formatUnits.js");
|
6
|
+
function formatGwei(wei, unit = 'wei') {
|
7
|
+
return (0, formatUnits_js_1.formatUnits)(wei, unit_js_1.gweiUnits[unit]);
|
8
|
+
}
|
9
|
+
exports.formatGwei = formatGwei;
|
10
|
+
//# sourceMappingURL=formatGwei.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"formatGwei.js","sourceRoot":"","sources":["../../../utils/unit/formatGwei.ts"],"names":[],"mappings":";;;AAAA,qDAAmD;AAEnD,qDAAyE;AAIzE,SAAgB,UAAU,CAAC,GAAW,EAAE,OAAc,KAAK;IACzD,OAAO,IAAA,4BAAW,EAAC,GAAG,EAAE,mBAAS,CAAC,IAAI,CAAC,CAAC,CAAA;AAC1C,CAAC;AAFD,gCAEC"}
|