viem 2.13.7 → 2.13.9
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +26 -0
- package/_cjs/accounts/hdKeyToAccount.js.map +1 -1
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/actions/public/getBlockNumber.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/actions/wallet/signTypedData.js.map +1 -1
- package/_cjs/celo/formatters.js +1 -2
- package/_cjs/celo/formatters.js.map +1 -1
- package/_cjs/celo/index.js.map +1 -1
- package/_cjs/celo/utils.js.map +1 -1
- package/_cjs/chains/definitions/ham.js +27 -0
- package/_cjs/chains/definitions/ham.js.map +1 -0
- package/_cjs/chains/definitions/kakarotSepolia.js +1 -1
- package/_cjs/chains/definitions/kakarotSepolia.js.map +1 -1
- package/_cjs/chains/definitions/optimism.js +5 -0
- package/_cjs/chains/definitions/optimism.js.map +1 -1
- package/_cjs/chains/definitions/redbellyTestnet.js +27 -0
- package/_cjs/chains/definitions/redbellyTestnet.js.map +1 -0
- package/_cjs/chains/definitions/sei.js +1 -0
- package/_cjs/chains/definitions/sei.js.map +1 -1
- package/_cjs/chains/definitions/xai.js +28 -0
- package/_cjs/chains/definitions/xai.js.map +1 -0
- package/_cjs/chains/definitions/xaiTestnet.js +22 -0
- package/_cjs/chains/definitions/xaiTestnet.js.map +1 -0
- package/_cjs/chains/index.js +12 -4
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/createClient.js +2 -2
- package/_cjs/clients/createClient.js.map +1 -1
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/clients/decorators/wallet.js.map +1 -1
- package/_cjs/clients/transports/fallback.js.map +1 -1
- package/_cjs/clients/transports/http.js.map +1 -1
- package/_cjs/constants/abis.js.map +1 -1
- package/_cjs/constants/blob.js +4 -4
- package/_cjs/constants/blob.js.map +1 -1
- package/_cjs/constants/kzg.js +1 -3
- package/_cjs/constants/kzg.js.map +1 -1
- package/_cjs/errors/abi.js +1 -13
- package/_cjs/errors/abi.js.map +1 -1
- package/_cjs/errors/base.js +1 -1
- package/_cjs/errors/base.js.map +1 -1
- package/_cjs/errors/ccip.js.map +1 -1
- package/_cjs/errors/stateOverride.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/experimental/eip5792/actions/getCapabilities.js +2 -2
- package/_cjs/experimental/eip5792/actions/getCapabilities.js.map +1 -1
- package/_cjs/experimental/eip5792/actions/sendCalls.js +2 -2
- package/_cjs/experimental/eip5792/actions/sendCalls.js.map +1 -1
- package/_cjs/index.js +6 -4
- package/_cjs/index.js.map +1 -1
- package/_cjs/node/trustedSetups.js +1 -2
- package/_cjs/node/trustedSetups.js.map +1 -1
- package/_cjs/op-stack/abis.js +1 -458
- package/_cjs/op-stack/abis.js.map +1 -1
- package/_cjs/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_cjs/op-stack/actions/estimateDepositTransactionGas.js +4 -3
- package/_cjs/op-stack/actions/estimateDepositTransactionGas.js.map +1 -1
- package/_cjs/op-stack/actions/estimateFinalizeWithdrawalGas.js +4 -3
- package/_cjs/op-stack/actions/estimateFinalizeWithdrawalGas.js.map +1 -1
- package/_cjs/op-stack/actions/estimateInitiateWithdrawalGas.js +4 -3
- package/_cjs/op-stack/actions/estimateInitiateWithdrawalGas.js.map +1 -1
- package/_cjs/op-stack/actions/estimateProveWithdrawalGas.js +4 -3
- package/_cjs/op-stack/actions/estimateProveWithdrawalGas.js.map +1 -1
- package/_cjs/op-stack/actions/getWithdrawalStatus.js.map +1 -1
- package/_cjs/op-stack/index.js +15 -2
- package/_cjs/op-stack/index.js.map +1 -1
- package/_cjs/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodeDeployData.js.map +1 -1
- package/_cjs/utils/abi/getAbiItem.js.map +1 -1
- package/_cjs/utils/address/getAddress.js +5 -5
- package/_cjs/utils/address/getAddress.js.map +1 -1
- package/_cjs/utils/address/isAddress.js.map +1 -1
- package/_cjs/utils/blob/toBlobs.js.map +1 -1
- package/_cjs/utils/buildRequest.js.map +1 -1
- package/_cjs/utils/ccip.js.map +1 -1
- package/_cjs/utils/cursor.js.map +1 -1
- package/_cjs/utils/encoding/fromRlp.js +1 -9
- package/_cjs/utils/encoding/fromRlp.js.map +1 -1
- package/_cjs/utils/ens/avatar/utils.js.map +1 -1
- package/_cjs/utils/ens/errors.js.map +1 -1
- package/_cjs/utils/observe.js.map +1 -1
- package/_cjs/utils/promise/createBatchScheduler.js.map +1 -1
- package/_cjs/utils/promise/withCache.js.map +1 -1
- package/_cjs/utils/promise/withTimeout.js.map +1 -1
- package/_cjs/utils/rpc/id.js +1 -2
- package/_cjs/utils/rpc/id.js.map +1 -1
- package/_cjs/utils/rpc/ipc.js.map +1 -1
- package/_cjs/utils/stateOverride.js.map +1 -1
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/_cjs/utils/transaction/serializeTransaction.js +8 -5
- package/_cjs/utils/transaction/serializeTransaction.js.map +1 -1
- package/_cjs/zksync/actions/deployContract.js.map +1 -1
- package/_cjs/zksync/actions/estimateGasL1ToL2.js +2 -2
- package/_cjs/zksync/actions/estimateGasL1ToL2.js.map +1 -1
- package/_cjs/zksync/actions/getAllBalances.js +2 -2
- package/_cjs/zksync/actions/getAllBalances.js.map +1 -1
- package/_cjs/zksync/actions/getL1Allowance.js +2 -2
- package/_cjs/zksync/actions/getL1Allowance.js.map +1 -1
- package/_cjs/zksync/actions/getL1Balance.js +2 -2
- package/_cjs/zksync/actions/getL1Balance.js.map +1 -1
- package/_cjs/zksync/actions/getL1TokenBalance.js +2 -2
- package/_cjs/zksync/actions/getL1TokenBalance.js.map +1 -1
- package/_cjs/zksync/actions/sendEip712Transaction.js +7 -7
- package/_cjs/zksync/actions/sendEip712Transaction.js.map +1 -1
- package/_cjs/zksync/actions/sendTransaction.js +4 -4
- package/_cjs/zksync/actions/sendTransaction.js.map +1 -1
- package/_cjs/zksync/constants/contract.js +1 -2
- package/_cjs/zksync/constants/contract.js.map +1 -1
- package/_cjs/zksync/decorators/eip712.js.map +1 -1
- package/_cjs/zksync/index.js.map +1 -1
- package/_cjs/zksync/serializers.js.map +1 -1
- package/_cjs/zksync/utils/abi/encodeDeployData.js.map +1 -1
- package/_cjs/zksync/utils/assertEip712Request.js.map +1 -1
- package/_cjs/zksync/utils/hashBytecode.js.map +1 -1
- package/_esm/accounts/hdKeyToAccount.js.map +1 -1
- package/_esm/actions/public/call.js +1 -0
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/actions/public/getBlockNumber.js +2 -1
- package/_esm/actions/public/getBlockNumber.js.map +1 -1
- package/_esm/actions/test/sendUnsignedTransaction.js +2 -2
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/actions/wallet/signTypedData.js.map +1 -1
- package/_esm/celo/formatters.js +1 -2
- package/_esm/celo/formatters.js.map +1 -1
- package/_esm/celo/index.js +1 -1
- package/_esm/celo/index.js.map +1 -1
- package/_esm/celo/utils.js +1 -0
- package/_esm/celo/utils.js.map +1 -1
- package/_esm/chains/definitions/ham.js +24 -0
- package/_esm/chains/definitions/ham.js.map +1 -0
- package/_esm/chains/definitions/kakarotSepolia.js +1 -1
- package/_esm/chains/definitions/kakarotSepolia.js.map +1 -1
- package/_esm/chains/definitions/optimism.js +5 -0
- package/_esm/chains/definitions/optimism.js.map +1 -1
- package/_esm/chains/definitions/redbellyTestnet.js +24 -0
- package/_esm/chains/definitions/redbellyTestnet.js.map +1 -0
- package/_esm/chains/definitions/sei.js +1 -0
- package/_esm/chains/definitions/sei.js.map +1 -1
- package/_esm/chains/definitions/xai.js +25 -0
- package/_esm/chains/definitions/xai.js.map +1 -0
- package/_esm/chains/definitions/xaiTestnet.js +19 -0
- package/_esm/chains/definitions/xaiTestnet.js.map +1 -0
- package/_esm/chains/index.js +4 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/createClient.js +1 -1
- package/_esm/clients/createClient.js.map +1 -1
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/clients/decorators/wallet.js.map +1 -1
- package/_esm/clients/transports/fallback.js +1 -0
- package/_esm/clients/transports/fallback.js.map +1 -1
- package/_esm/clients/transports/http.js.map +1 -1
- package/_esm/constants/abis.js +1 -0
- package/_esm/constants/abis.js.map +1 -1
- package/_esm/constants/blob.js +1 -1
- package/_esm/constants/blob.js.map +1 -1
- package/_esm/constants/kzg.js +0 -4
- package/_esm/constants/kzg.js.map +1 -1
- package/_esm/errors/abi.js +0 -11
- package/_esm/errors/abi.js.map +1 -1
- package/_esm/errors/base.js +1 -1
- package/_esm/errors/base.js.map +1 -1
- package/_esm/errors/ccip.js.map +1 -1
- package/_esm/errors/stateOverride.js +1 -0
- package/_esm/errors/stateOverride.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/experimental/eip5792/actions/getCapabilities.js +1 -1
- package/_esm/experimental/eip5792/actions/getCapabilities.js.map +1 -1
- package/_esm/experimental/eip5792/actions/sendCalls.js +1 -1
- package/_esm/experimental/eip5792/actions/sendCalls.js.map +1 -1
- package/_esm/index.js +4 -3
- package/_esm/index.js.map +1 -1
- package/_esm/node/trustedSetups.js +0 -1
- package/_esm/node/trustedSetups.js.map +1 -1
- package/_esm/node/trustedSetups_cjs.js +0 -1
- package/_esm/node/trustedSetups_cjs.js.map +1 -1
- package/_esm/op-stack/abis.js +0 -457
- package/_esm/op-stack/abis.js.map +1 -1
- package/_esm/op-stack/actions/buildProveWithdrawal.js +1 -0
- package/_esm/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_esm/op-stack/actions/estimateDepositTransactionGas.js +7 -3
- package/_esm/op-stack/actions/estimateDepositTransactionGas.js.map +1 -1
- package/_esm/op-stack/actions/estimateFinalizeWithdrawalGas.js +7 -3
- package/_esm/op-stack/actions/estimateFinalizeWithdrawalGas.js.map +1 -1
- package/_esm/op-stack/actions/estimateInitiateWithdrawalGas.js +7 -3
- package/_esm/op-stack/actions/estimateInitiateWithdrawalGas.js.map +1 -1
- package/_esm/op-stack/actions/estimateProveWithdrawalGas.js +7 -3
- package/_esm/op-stack/actions/estimateProveWithdrawalGas.js.map +1 -1
- package/_esm/op-stack/actions/getWithdrawalStatus.js +1 -1
- package/_esm/op-stack/actions/getWithdrawalStatus.js.map +1 -1
- package/_esm/op-stack/index.js +0 -1
- package/_esm/op-stack/index.js.map +1 -1
- package/_esm/utils/abi/decodeAbiParameters.js +1 -1
- package/_esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodeDeployData.js.map +1 -1
- package/_esm/utils/abi/getAbiItem.js +3 -1
- package/_esm/utils/abi/getAbiItem.js.map +1 -1
- package/_esm/utils/address/getAddress.js +1 -1
- package/_esm/utils/address/getAddress.js.map +1 -1
- package/_esm/utils/address/isAddress.js +1 -0
- package/_esm/utils/address/isAddress.js.map +1 -1
- package/_esm/utils/blob/toBlobs.js.map +1 -1
- package/_esm/utils/buildRequest.js +1 -0
- package/_esm/utils/buildRequest.js.map +1 -1
- package/_esm/utils/ccip.js +1 -1
- package/_esm/utils/ccip.js.map +1 -1
- package/_esm/utils/cursor.js.map +1 -1
- package/_esm/utils/encoding/fromRlp.js +0 -6
- package/_esm/utils/encoding/fromRlp.js.map +1 -1
- package/_esm/utils/ens/avatar/utils.js +2 -0
- package/_esm/utils/ens/avatar/utils.js.map +1 -1
- package/_esm/utils/ens/errors.js.map +1 -1
- package/_esm/utils/observe.js +2 -0
- package/_esm/utils/observe.js.map +1 -1
- package/_esm/utils/promise/createBatchScheduler.js +1 -0
- package/_esm/utils/promise/createBatchScheduler.js.map +1 -1
- package/_esm/utils/promise/withCache.js +2 -0
- package/_esm/utils/promise/withCache.js.map +1 -1
- package/_esm/utils/promise/withTimeout.js +1 -1
- package/_esm/utils/promise/withTimeout.js.map +1 -1
- package/_esm/utils/rpc/id.js +1 -1
- package/_esm/utils/rpc/id.js.map +1 -1
- package/_esm/utils/rpc/ipc.js +1 -0
- package/_esm/utils/rpc/ipc.js.map +1 -1
- package/_esm/utils/stateOverride.js +3 -0
- package/_esm/utils/stateOverride.js.map +1 -1
- package/_esm/utils/transaction/parseTransaction.js.map +1 -1
- package/_esm/utils/transaction/serializeTransaction.js +8 -5
- package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/_esm/utils/unit/parseUnits.js +1 -1
- package/_esm/utils/unit/parseUnits.js.map +1 -1
- package/_esm/zksync/actions/deployContract.js +1 -1
- package/_esm/zksync/actions/deployContract.js.map +1 -1
- package/_esm/zksync/actions/estimateGasL1ToL2.js +1 -1
- package/_esm/zksync/actions/estimateGasL1ToL2.js.map +1 -1
- package/_esm/zksync/actions/getAllBalances.js +1 -1
- package/_esm/zksync/actions/getAllBalances.js.map +1 -1
- package/_esm/zksync/actions/getL1Allowance.js +1 -1
- package/_esm/zksync/actions/getL1Allowance.js.map +1 -1
- package/_esm/zksync/actions/getL1Balance.js +1 -1
- package/_esm/zksync/actions/getL1Balance.js.map +1 -1
- package/_esm/zksync/actions/getL1TokenBalance.js +2 -2
- package/_esm/zksync/actions/getL1TokenBalance.js.map +1 -1
- package/_esm/zksync/actions/sendEip712Transaction.js +7 -7
- package/_esm/zksync/actions/sendEip712Transaction.js.map +1 -1
- package/_esm/zksync/actions/sendTransaction.js +6 -6
- package/_esm/zksync/actions/sendTransaction.js.map +1 -1
- package/_esm/zksync/constants/contract.js +0 -1
- package/_esm/zksync/constants/contract.js.map +1 -1
- package/_esm/zksync/decorators/eip712.js.map +1 -1
- package/_esm/zksync/index.js.map +1 -1
- package/_esm/zksync/serializers.js.map +1 -1
- package/_esm/zksync/utils/abi/encodeDeployData.js +1 -1
- package/_esm/zksync/utils/abi/encodeDeployData.js.map +1 -1
- package/_esm/zksync/utils/assertEip712Request.js +1 -1
- package/_esm/zksync/utils/assertEip712Request.js.map +1 -1
- package/_esm/zksync/utils/hashBytecode.js.map +1 -1
- package/_types/accounts/hdKeyToAccount.d.ts +1 -1
- package/_types/accounts/hdKeyToAccount.d.ts.map +1 -1
- package/_types/accounts/types.d.ts +1 -1
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/public/call.d.ts +5 -2
- package/_types/actions/public/call.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts +2 -1
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/actions/public/getBlockNumber.d.ts +4 -0
- package/_types/actions/public/getBlockNumber.d.ts.map +1 -1
- package/_types/actions/test/sendUnsignedTransaction.d.ts +2 -2
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +0 -7
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/actions/wallet/signTypedData.d.ts +2 -2
- package/_types/actions/wallet/signTypedData.d.ts.map +1 -1
- package/_types/celo/chainConfig.d.ts +60 -60
- package/_types/celo/formatters.d.ts +30 -30
- package/_types/celo/formatters.d.ts.map +1 -1
- package/_types/celo/index.d.ts +2 -2
- package/_types/celo/index.d.ts.map +1 -1
- package/_types/celo/utils.d.ts +1 -0
- package/_types/celo/utils.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8.d.ts +26 -26
- package/_types/chains/definitions/ancient8Sepolia.d.ts +26 -26
- package/_types/chains/definitions/base.d.ts +26 -26
- package/_types/chains/definitions/baseGoerli.d.ts +26 -26
- package/_types/chains/definitions/baseSepolia.d.ts +26 -26
- package/_types/chains/definitions/celo.d.ts +60 -60
- package/_types/chains/definitions/celoAlfajores.d.ts +60 -60
- package/_types/chains/definitions/fraxtal.d.ts +26 -26
- package/_types/chains/definitions/fraxtalTestnet.d.ts +26 -26
- package/_types/chains/definitions/funkiSepolia.d.ts +26 -26
- package/_types/chains/definitions/ham.d.ts +37 -0
- package/_types/chains/definitions/ham.d.ts.map +1 -0
- package/_types/chains/definitions/kakarotSepolia.d.ts +1 -1
- package/_types/chains/definitions/liskSepolia.d.ts +26 -26
- package/_types/chains/definitions/metalL2.d.ts +26 -26
- package/_types/chains/definitions/optimism.d.ts +31 -26
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +26 -26
- package/_types/chains/definitions/optimismSepolia.d.ts +26 -26
- package/_types/chains/definitions/pgn.d.ts +26 -26
- package/_types/chains/definitions/pgnTestnet.d.ts +26 -26
- package/_types/chains/definitions/redbellyTestnet.d.ts +36 -0
- package/_types/chains/definitions/redbellyTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/rss3.d.ts +26 -26
- package/_types/chains/definitions/rss3Sepolia.d.ts +26 -26
- package/_types/chains/definitions/sei.d.ts +1 -0
- package/_types/chains/definitions/sei.d.ts.map +1 -1
- package/_types/chains/definitions/xai.d.ts +33 -0
- package/_types/chains/definitions/xai.d.ts.map +1 -0
- package/_types/chains/definitions/xaiTestnet.d.ts +35 -0
- package/_types/chains/definitions/xaiTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/zora.d.ts +26 -26
- package/_types/chains/definitions/zoraSepolia.d.ts +26 -26
- package/_types/chains/definitions/zoraTestnet.d.ts +26 -26
- package/_types/chains/index.d.ts +4 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/createClient.d.ts +1 -1
- package/_types/clients/createClient.d.ts.map +1 -1
- package/_types/clients/transports/fallback.d.ts +1 -0
- package/_types/clients/transports/fallback.d.ts.map +1 -1
- package/_types/clients/transports/http.d.ts +6 -7
- package/_types/clients/transports/http.d.ts.map +1 -1
- package/_types/constants/abis.d.ts +1 -0
- package/_types/constants/abis.d.ts.map +1 -1
- package/_types/constants/blob.d.ts +0 -2
- package/_types/constants/blob.d.ts.map +1 -1
- package/_types/constants/kzg.d.ts +0 -4
- package/_types/constants/kzg.d.ts.map +1 -1
- package/_types/errors/abi.d.ts +0 -10
- package/_types/errors/abi.d.ts.map +1 -1
- package/_types/errors/base.d.ts +1 -0
- package/_types/errors/base.d.ts.map +1 -1
- package/_types/errors/ccip.d.ts +1 -0
- package/_types/errors/ccip.d.ts.map +1 -1
- package/_types/errors/stateOverride.d.ts +1 -0
- package/_types/errors/stateOverride.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/experimental/eip5792/actions/getCapabilities.d.ts.map +1 -1
- package/_types/experimental/eip5792/actions/sendCalls.d.ts.map +1 -1
- package/_types/experimental/erc7715/types/permission.d.ts +5 -0
- package/_types/experimental/erc7715/types/permission.d.ts.map +1 -1
- package/_types/experimental/erc7715/types/signer.d.ts +3 -0
- package/_types/experimental/erc7715/types/signer.d.ts.map +1 -1
- package/_types/index.d.ts +9 -9
- package/_types/index.d.ts.map +1 -1
- package/_types/node/trustedSetups.d.ts +0 -1
- package/_types/node/trustedSetups.d.ts.map +1 -1
- package/_types/node/trustedSetups_cjs.d.ts +0 -1
- package/_types/node/trustedSetups_cjs.d.ts.map +1 -1
- package/_types/op-stack/abis.d.ts +0 -626
- package/_types/op-stack/abis.d.ts.map +1 -1
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts +1 -0
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateDepositTransactionGas.d.ts +2 -2
- package/_types/op-stack/actions/estimateDepositTransactionGas.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateFinalizeWithdrawalGas.d.ts +1 -1
- package/_types/op-stack/actions/estimateFinalizeWithdrawalGas.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateInitiateWithdrawalGas.d.ts +1 -1
- package/_types/op-stack/actions/estimateInitiateWithdrawalGas.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateProveWithdrawalGas.d.ts +1 -1
- package/_types/op-stack/actions/estimateProveWithdrawalGas.d.ts.map +1 -1
- package/_types/op-stack/actions/getWithdrawalStatus.d.ts +2 -1
- package/_types/op-stack/actions/getWithdrawalStatus.d.ts.map +1 -1
- package/_types/op-stack/chainConfig.d.ts +26 -26
- package/_types/op-stack/formatters.d.ts +26 -26
- package/_types/op-stack/index.d.ts.map +1 -1
- package/_types/types/account.d.ts +1 -1
- package/_types/types/account.d.ts.map +1 -1
- package/_types/types/chain.d.ts +7 -7
- package/_types/types/chain.d.ts.map +1 -1
- package/_types/types/kzg.d.ts +1 -1
- package/_types/types/kzg.d.ts.map +1 -1
- package/_types/types/proof.d.ts +3 -2
- package/_types/types/proof.d.ts.map +1 -1
- package/_types/types/utils.d.ts +11 -3
- package/_types/types/utils.d.ts.map +1 -1
- package/_types/utils/abi/decodeAbiParameters.d.ts +2 -1
- package/_types/utils/abi/decodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/abi/encodeAbiParameters.d.ts +12 -11
- package/_types/utils/abi/encodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/abi/encodeDeployData.d.ts +4 -2
- package/_types/utils/abi/encodeDeployData.d.ts.map +1 -1
- package/_types/utils/abi/getAbiItem.d.ts +6 -2
- package/_types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/_types/utils/address/getAddress.d.ts +0 -2
- package/_types/utils/address/getAddress.d.ts.map +1 -1
- package/_types/utils/address/isAddress.d.ts +1 -0
- package/_types/utils/address/isAddress.d.ts.map +1 -1
- package/_types/utils/blob/toBlobs.d.ts +2 -1
- package/_types/utils/blob/toBlobs.d.ts.map +1 -1
- package/_types/utils/buildRequest.d.ts +1 -0
- package/_types/utils/buildRequest.d.ts.map +1 -1
- package/_types/utils/ccip.d.ts +4 -2
- package/_types/utils/ccip.d.ts.map +1 -1
- package/_types/utils/cursor.d.ts +7 -6
- package/_types/utils/cursor.d.ts.map +1 -1
- package/_types/utils/encoding/fromRlp.d.ts +3 -7
- package/_types/utils/encoding/fromRlp.d.ts.map +1 -1
- package/_types/utils/ens/avatar/parseAvatarRecord.d.ts +2 -1
- package/_types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -1
- package/_types/utils/ens/avatar/utils.d.ts +4 -2
- package/_types/utils/ens/avatar/utils.d.ts.map +1 -1
- package/_types/utils/ens/errors.d.ts +1 -0
- package/_types/utils/ens/errors.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +1 -1
- package/_types/utils/hash/normalizeSignature.d.ts +3 -2
- package/_types/utils/hash/normalizeSignature.d.ts.map +1 -1
- package/_types/utils/observe.d.ts +2 -0
- package/_types/utils/observe.d.ts.map +1 -1
- package/_types/utils/promise/createBatchScheduler.d.ts +3 -2
- package/_types/utils/promise/createBatchScheduler.d.ts.map +1 -1
- package/_types/utils/promise/withCache.d.ts +4 -1
- package/_types/utils/promise/withCache.d.ts.map +1 -1
- package/_types/utils/rpc/id.d.ts +0 -5
- package/_types/utils/rpc/id.d.ts.map +1 -1
- package/_types/utils/rpc/ipc.d.ts +1 -0
- package/_types/utils/rpc/ipc.d.ts.map +1 -1
- package/_types/utils/stateOverride.d.ts +9 -5
- package/_types/utils/stateOverride.d.ts.map +1 -1
- package/_types/utils/transaction/parseTransaction.d.ts +5 -5
- package/_types/utils/transaction/parseTransaction.d.ts.map +1 -1
- package/_types/utils/transaction/serializeTransaction.d.ts +1 -1
- package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
- package/_types/zksync/actions/deployContract.d.ts +2 -1
- package/_types/zksync/actions/deployContract.d.ts.map +1 -1
- package/_types/zksync/actions/estimateGasL1ToL2.d.ts.map +1 -1
- package/_types/zksync/actions/getAllBalances.d.ts.map +1 -1
- package/_types/zksync/actions/getL1Allowance.d.ts.map +1 -1
- package/_types/zksync/actions/getL1Balance.d.ts.map +1 -1
- package/_types/zksync/actions/getL1TokenBalance.d.ts +4 -4
- package/_types/zksync/actions/getL1TokenBalance.d.ts.map +1 -1
- package/_types/zksync/actions/sendEip712Transaction.d.ts +3 -3
- package/_types/zksync/actions/sendEip712Transaction.d.ts.map +1 -1
- package/_types/zksync/actions/sendTransaction.d.ts +5 -5
- package/_types/zksync/actions/sendTransaction.d.ts.map +1 -1
- package/_types/zksync/constants/contract.d.ts +0 -1
- package/_types/zksync/constants/contract.d.ts.map +1 -1
- package/_types/zksync/decorators/eip712.d.ts +2 -1
- package/_types/zksync/decorators/eip712.d.ts.map +1 -1
- package/_types/zksync/index.d.ts +1 -0
- package/_types/zksync/index.d.ts.map +1 -1
- package/_types/zksync/serializers.d.ts +1 -2
- package/_types/zksync/serializers.d.ts.map +1 -1
- package/_types/zksync/types/chain.d.ts +2 -2
- package/_types/zksync/types/chain.d.ts.map +1 -1
- package/_types/zksync/types/eip1193.d.ts +5 -5
- package/_types/zksync/types/eip1193.d.ts.map +1 -1
- package/_types/zksync/utils/abi/encodeDeployData.d.ts +5 -0
- package/_types/zksync/utils/abi/encodeDeployData.d.ts.map +1 -1
- package/_types/zksync/utils/assertEip712Request.d.ts +3 -1
- package/_types/zksync/utils/assertEip712Request.d.ts.map +1 -1
- package/_types/zksync/utils/hashBytecode.d.ts +5 -0
- package/_types/zksync/utils/hashBytecode.d.ts.map +1 -1
- package/accounts/hdKeyToAccount.ts +1 -2
- package/accounts/types.ts +1 -1
- package/actions/public/call.ts +5 -5
- package/actions/public/estimateGas.ts +3 -4
- package/actions/public/getBlockNumber.ts +9 -1
- package/actions/test/sendUnsignedTransaction.ts +2 -2
- package/actions/wallet/prepareTransactionRequest.ts +0 -20
- package/actions/wallet/signTypedData.ts +2 -0
- package/celo/formatters.ts +1 -3
- package/celo/index.ts +5 -2
- package/celo/utils.ts +1 -0
- package/chains/definitions/ham.ts +24 -0
- package/chains/definitions/kakarotSepolia.ts +1 -1
- package/chains/definitions/optimism.ts +5 -0
- package/chains/definitions/redbellyTestnet.ts +24 -0
- package/chains/definitions/sei.ts +1 -0
- package/chains/definitions/xai.ts +25 -0
- package/chains/definitions/xaiTestnet.ts +19 -0
- package/chains/index.ts +4 -0
- package/clients/createClient.ts +4 -2
- package/clients/decorators/public.ts +1 -1
- package/clients/decorators/wallet.ts +1 -1
- package/clients/transports/fallback.ts +1 -0
- package/clients/transports/http.ts +9 -8
- package/constants/abis.ts +1 -0
- package/constants/blob.ts +1 -1
- package/constants/kzg.ts +0 -6
- package/errors/abi.ts +0 -13
- package/errors/base.ts +2 -1
- package/errors/ccip.ts +1 -0
- package/errors/stateOverride.ts +1 -0
- package/errors/version.ts +1 -1
- package/experimental/eip5792/actions/getCapabilities.ts +1 -1
- package/experimental/eip5792/actions/sendCalls.ts +1 -1
- package/experimental/erc7715/types/permission.ts +5 -0
- package/experimental/erc7715/types/signer.ts +3 -0
- package/index.ts +21 -5
- package/node/trustedSetups.ts +0 -5
- package/node/trustedSetups_cjs.ts +0 -5
- package/op-stack/abis.ts +0 -458
- package/op-stack/actions/buildProveWithdrawal.ts +1 -0
- package/op-stack/actions/estimateDepositTransactionGas.ts +18 -7
- package/op-stack/actions/estimateFinalizeWithdrawalGas.ts +11 -4
- package/op-stack/actions/estimateInitiateWithdrawalGas.ts +11 -4
- package/op-stack/actions/estimateProveWithdrawalGas.ts +11 -4
- package/op-stack/actions/getWithdrawalStatus.ts +6 -1
- package/op-stack/index.ts +0 -1
- package/package.json +1 -1
- package/types/account.ts +1 -11
- package/types/chain.ts +7 -7
- package/types/kzg.ts +2 -1
- package/types/proof.ts +2 -2
- package/types/utils.ts +11 -3
- package/utils/abi/decodeAbiParameters.ts +6 -1
- package/utils/abi/encodeAbiParameters.ts +22 -19
- package/utils/abi/encodeDeployData.ts +6 -5
- package/utils/abi/getAbiItem.ts +8 -2
- package/utils/address/getAddress.ts +1 -1
- package/utils/address/isAddress.ts +1 -0
- package/utils/blob/toBlobs.ts +2 -1
- package/utils/buildRequest.ts +1 -0
- package/utils/ccip.ts +11 -3
- package/utils/cursor.ts +16 -6
- package/utils/encoding/fromRlp.ts +3 -21
- package/utils/ens/avatar/parseAvatarRecord.ts +1 -1
- package/utils/ens/avatar/utils.ts +4 -2
- package/utils/ens/errors.ts +1 -0
- package/utils/hash/normalizeSignature.ts +2 -2
- package/utils/observe.ts +2 -0
- package/utils/promise/createBatchScheduler.ts +3 -2
- package/utils/promise/withCache.ts +3 -1
- package/utils/promise/withTimeout.ts +2 -2
- package/utils/rpc/id.ts +1 -1
- package/utils/rpc/ipc.ts +1 -0
- package/utils/stateOverride.ts +8 -5
- package/utils/transaction/parseTransaction.ts +7 -2
- package/utils/transaction/serializeTransaction.ts +11 -5
- package/utils/unit/parseUnits.ts +1 -1
- package/zksync/actions/deployContract.ts +8 -2
- package/zksync/actions/estimateGasL1ToL2.ts +1 -1
- package/zksync/actions/getAllBalances.ts +1 -1
- package/zksync/actions/getL1Allowance.ts +1 -1
- package/zksync/actions/getL1Balance.ts +1 -1
- package/zksync/actions/getL1TokenBalance.ts +10 -7
- package/zksync/actions/sendEip712Transaction.ts +27 -16
- package/zksync/actions/sendTransaction.ts +34 -18
- package/zksync/constants/contract.ts +0 -1
- package/zksync/decorators/eip712.ts +7 -2
- package/zksync/index.ts +5 -0
- package/zksync/serializers.ts +1 -2
- package/zksync/types/chain.ts +9 -9
- package/zksync/types/eip1193.ts +32 -26
- package/zksync/utils/abi/encodeDeployData.ts +12 -2
- package/zksync/utils/assertEip712Request.ts +9 -2
- package/zksync/utils/hashBytecode.ts +14 -2
- package/_cjs/utils/accounts.js +0 -8
- package/_cjs/utils/accounts.js.map +0 -1
- package/_esm/utils/accounts.js +0 -7
- package/_esm/utils/accounts.js.map +0 -1
- package/_types/utils/accounts.d.ts +0 -3
- package/_types/utils/accounts.d.ts.map +0 -1
- package/utils/accounts.ts +0 -7
package/types/account.ts
CHANGED
@@ -1,7 +1,6 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Account, JsonRpcAccount } from '../accounts/types.js'
|
4
|
-
|
5
4
|
import type { IsUndefined, Prettify } from './utils.js'
|
6
5
|
|
7
6
|
export type DeriveAccount<
|
@@ -28,14 +27,5 @@ export type ParseAccount<
|
|
28
27
|
? Prettify<JsonRpcAccount<TAccountOrAddress>>
|
29
28
|
: TAccountOrAddress
|
30
29
|
|
31
|
-
export type {
|
32
|
-
Account,
|
33
|
-
AccountSource,
|
34
|
-
CustomSource,
|
35
|
-
HDAccount,
|
36
|
-
HDOptions,
|
37
|
-
JsonRpcAccount,
|
38
|
-
LocalAccount,
|
39
|
-
PrivateKeyAccount,
|
40
|
-
} from '../accounts/types.js'
|
30
|
+
export type { Account } from '../accounts/types.js'
|
41
31
|
export type { HDKey } from '@scure/bip32'
|
package/types/chain.ts
CHANGED
@@ -169,7 +169,7 @@ export type ChainEstimateFeesPerGasFnParameters<
|
|
169
169
|
formatters extends ChainFormatters | undefined = ChainFormatters | undefined,
|
170
170
|
> = {
|
171
171
|
/** A function to multiply the base fee based on the `baseFeeMultiplier` value. */
|
172
|
-
multiply(x: bigint)
|
172
|
+
multiply: (x: bigint) => bigint
|
173
173
|
/** The type of fees to return. */
|
174
174
|
type: FeeValuesType
|
175
175
|
} & ChainFeesFnParameters<formatters>
|
@@ -180,9 +180,9 @@ export type ChainEstimateFeesPerGasFnParameters<
|
|
180
180
|
export type ExtractChainFormatterExclude<
|
181
181
|
chain extends Chain | undefined,
|
182
182
|
type extends keyof ChainFormatters,
|
183
|
-
> = chain extends { formatters?: infer
|
184
|
-
?
|
185
|
-
? Extract<
|
183
|
+
> = chain extends { formatters?: infer formatters extends ChainFormatters }
|
184
|
+
? formatters[type] extends { exclude: infer exclude }
|
185
|
+
? Extract<exclude, readonly string[]>[number]
|
186
186
|
: ''
|
187
187
|
: ''
|
188
188
|
|
@@ -190,9 +190,9 @@ export type ExtractChainFormatterParameters<
|
|
190
190
|
chain extends Chain | undefined,
|
191
191
|
type extends keyof ChainFormatters,
|
192
192
|
fallback,
|
193
|
-
> = chain extends { formatters?: infer
|
194
|
-
?
|
195
|
-
? Parameters<
|
193
|
+
> = chain extends { formatters?: infer formatters extends ChainFormatters }
|
194
|
+
? formatters[type] extends ChainFormatter
|
195
|
+
? Parameters<formatters[type]['format']>[0]
|
196
196
|
: fallback
|
197
197
|
: fallback
|
198
198
|
|
package/types/kzg.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
|
-
|
2
|
+
|
3
|
+
import type { LocalAccount } from '../accounts/types.js'
|
3
4
|
import type { ByteArray } from './misc.js'
|
4
5
|
import type { TransactionRequestEIP4844 } from './transaction.js'
|
5
6
|
import type { MaybeRequired } from './utils.js'
|
package/types/proof.ts
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
import type { Address } from 'abitype'
|
2
2
|
import type { Hash } from './misc.js'
|
3
3
|
|
4
|
-
|
4
|
+
type AccountProof = Hash
|
5
5
|
|
6
|
-
|
6
|
+
type StorageProof<TQuantity = bigint> = {
|
7
7
|
key: Hash
|
8
8
|
proof: Hash[]
|
9
9
|
value: TQuantity
|
package/types/utils.ts
CHANGED
@@ -159,6 +159,8 @@ export type NoInfer<type> = [type][type extends any ? 0 : never]
|
|
159
159
|
* @example
|
160
160
|
* NoUndefined<string | undefined>
|
161
161
|
* => string
|
162
|
+
*
|
163
|
+
* @internal
|
162
164
|
*/
|
163
165
|
export type NoUndefined<T> = T extends undefined ? never : T
|
164
166
|
|
@@ -190,8 +192,9 @@ export type Prettify<T> = {
|
|
190
192
|
[K in keyof T]: T[K]
|
191
193
|
} & {}
|
192
194
|
|
193
|
-
|
194
|
-
|
195
|
+
/** @internal */
|
196
|
+
export type Evaluate<type> = {
|
197
|
+
[key in keyof type]: type[key]
|
195
198
|
} & {}
|
196
199
|
|
197
200
|
/**
|
@@ -226,6 +229,8 @@ export type Some<
|
|
226
229
|
* @example
|
227
230
|
* ValueOf<{ a: string, b: number }>
|
228
231
|
* => string | number
|
232
|
+
*
|
233
|
+
* @internal
|
229
234
|
*/
|
230
235
|
export type ValueOf<T> = T[keyof T]
|
231
236
|
|
@@ -286,7 +291,10 @@ type KeyofUnion<type> = type extends type ? keyof type : never
|
|
286
291
|
///////////////////////////////////////////////////////////////////////////
|
287
292
|
// Loose types
|
288
293
|
|
289
|
-
/**
|
294
|
+
/**
|
295
|
+
* Loose version of {@link Omit}
|
296
|
+
* @internal
|
297
|
+
*/
|
290
298
|
export type LooseOmit<type, keys extends string> = Pick<
|
291
299
|
type,
|
292
300
|
Exclude<keyof type, keys>
|
@@ -13,7 +13,11 @@ import {
|
|
13
13
|
type ChecksumAddressErrorType,
|
14
14
|
checksumAddress,
|
15
15
|
} from '../address/getAddress.js'
|
16
|
-
import {
|
16
|
+
import {
|
17
|
+
type CreateCursorErrorType,
|
18
|
+
type Cursor,
|
19
|
+
createCursor,
|
20
|
+
} from '../cursor.js'
|
17
21
|
import { type SizeErrorType, size } from '../data/size.js'
|
18
22
|
import { type SliceBytesErrorType, sliceBytes } from '../data/slice.js'
|
19
23
|
import { type TrimErrorType, trim } from '../data/trim.js'
|
@@ -42,6 +46,7 @@ export type DecodeAbiParametersErrorType =
|
|
42
46
|
| BytesToHexErrorType
|
43
47
|
| DecodeParameterErrorType
|
44
48
|
| SizeErrorType
|
49
|
+
| CreateCursorErrorType
|
45
50
|
| ErrorType
|
46
51
|
|
47
52
|
export function decodeAbiParameters<
|
@@ -110,7 +110,7 @@ type PreparedParam = { dynamic: boolean; encoded: Hex }
|
|
110
110
|
type TupleAbiParameter = AbiParameter & { components: readonly AbiParameter[] }
|
111
111
|
type Tuple = AbiParameterToPrimitiveType<TupleAbiParameter>
|
112
112
|
|
113
|
-
|
113
|
+
type PrepareParamsErrorType = PrepareParamErrorType | ErrorType
|
114
114
|
|
115
115
|
function prepareParams<const TParams extends readonly AbiParameter[]>({
|
116
116
|
params,
|
@@ -126,7 +126,14 @@ function prepareParams<const TParams extends readonly AbiParameter[]>({
|
|
126
126
|
return preparedParams
|
127
127
|
}
|
128
128
|
|
129
|
-
|
129
|
+
type PrepareParamErrorType =
|
130
|
+
| EncodeAddressErrorType
|
131
|
+
| EncodeArrayErrorType
|
132
|
+
| EncodeBytesErrorType
|
133
|
+
| EncodeBoolErrorType
|
134
|
+
| EncodeNumberErrorType
|
135
|
+
| EncodeStringErrorType
|
136
|
+
| EncodeTupleErrorType
|
130
137
|
| GetArrayComponentsErrorType
|
131
138
|
| InvalidAbiEncodingTypeErrorType
|
132
139
|
| ErrorType
|
@@ -171,10 +178,7 @@ function prepareParam<const TParam extends AbiParameter>({
|
|
171
178
|
|
172
179
|
/////////////////////////////////////////////////////////////////
|
173
180
|
|
174
|
-
|
175
|
-
| NumberToHexErrorType
|
176
|
-
| SizeErrorType
|
177
|
-
| ErrorType
|
181
|
+
type EncodeParamsErrorType = NumberToHexErrorType | SizeErrorType | ErrorType
|
178
182
|
|
179
183
|
function encodeParams(preparedParams: PreparedParam[]): Hex {
|
180
184
|
// 1. Compute the size of the static part of the parameters.
|
@@ -206,7 +210,7 @@ function encodeParams(preparedParams: PreparedParam[]): Hex {
|
|
206
210
|
|
207
211
|
/////////////////////////////////////////////////////////////////
|
208
212
|
|
209
|
-
|
213
|
+
type EncodeAddressErrorType =
|
210
214
|
| InvalidAddressErrorType
|
211
215
|
| IsAddressErrorType
|
212
216
|
| ErrorType
|
@@ -216,13 +220,14 @@ function encodeAddress(value: Hex): PreparedParam {
|
|
216
220
|
return { dynamic: false, encoded: padHex(value.toLowerCase() as Hex) }
|
217
221
|
}
|
218
222
|
|
219
|
-
|
223
|
+
type EncodeArrayErrorType =
|
220
224
|
| AbiEncodingArrayLengthMismatchErrorType
|
221
225
|
| ConcatErrorType
|
222
226
|
| EncodeParamsErrorType
|
223
227
|
| InvalidArrayErrorType
|
224
228
|
| NumberToHexErrorType
|
225
|
-
|
229
|
+
// TODO: Add back once circular type reference is resolved
|
230
|
+
// | PrepareParamErrorType
|
226
231
|
| ErrorType
|
227
232
|
|
228
233
|
function encodeArray<const TParam extends AbiParameter>(
|
@@ -270,7 +275,7 @@ function encodeArray<const TParam extends AbiParameter>(
|
|
270
275
|
}
|
271
276
|
}
|
272
277
|
|
273
|
-
|
278
|
+
type EncodeBytesErrorType =
|
274
279
|
| AbiEncodingBytesSizeMismatchErrorType
|
275
280
|
| ConcatErrorType
|
276
281
|
| PadHexErrorType
|
@@ -306,10 +311,7 @@ function encodeBytes<const TParam extends AbiParameter>(
|
|
306
311
|
return { dynamic: false, encoded: padHex(value, { dir: 'right' }) }
|
307
312
|
}
|
308
313
|
|
309
|
-
|
310
|
-
| PadHexErrorType
|
311
|
-
| BoolToHexErrorType
|
312
|
-
| ErrorType
|
314
|
+
type EncodeBoolErrorType = PadHexErrorType | BoolToHexErrorType | ErrorType
|
313
315
|
|
314
316
|
function encodeBool(value: boolean): PreparedParam {
|
315
317
|
if (typeof value !== 'boolean')
|
@@ -319,7 +321,7 @@ function encodeBool(value: boolean): PreparedParam {
|
|
319
321
|
return { dynamic: false, encoded: padHex(boolToHex(value)) }
|
320
322
|
}
|
321
323
|
|
322
|
-
|
324
|
+
type EncodeNumberErrorType = NumberToHexErrorType | ErrorType
|
323
325
|
|
324
326
|
function encodeNumber(
|
325
327
|
value: number,
|
@@ -334,7 +336,7 @@ function encodeNumber(
|
|
334
336
|
}
|
335
337
|
}
|
336
338
|
|
337
|
-
|
339
|
+
type EncodeStringErrorType =
|
338
340
|
| ConcatErrorType
|
339
341
|
| NumberToHexErrorType
|
340
342
|
| PadHexErrorType
|
@@ -363,10 +365,11 @@ function encodeString(value: string): PreparedParam {
|
|
363
365
|
}
|
364
366
|
}
|
365
367
|
|
366
|
-
|
368
|
+
type EncodeTupleErrorType =
|
367
369
|
| ConcatErrorType
|
368
370
|
| EncodeParamsErrorType
|
369
|
-
|
371
|
+
// TODO: Add back once circular type reference is resolved
|
372
|
+
// | PrepareParamErrorType
|
370
373
|
| ErrorType
|
371
374
|
|
372
375
|
function encodeTuple<
|
@@ -395,7 +398,7 @@ function encodeTuple<
|
|
395
398
|
}
|
396
399
|
}
|
397
400
|
|
398
|
-
|
401
|
+
type GetArrayComponentsErrorType = ErrorType
|
399
402
|
|
400
403
|
export function getArrayComponents(
|
401
404
|
type: string,
|
@@ -32,11 +32,12 @@ export type EncodeDeployDataParameters<
|
|
32
32
|
abi: abi
|
33
33
|
bytecode: Hex
|
34
34
|
} & UnionEvaluate<
|
35
|
-
|
36
|
-
? { args?:
|
37
|
-
:
|
38
|
-
|
39
|
-
|
35
|
+
hasConstructor extends false
|
36
|
+
? { args?: undefined }
|
37
|
+
: readonly [] extends allArgs
|
38
|
+
? { args?: allArgs | undefined }
|
39
|
+
: { args: allArgs }
|
40
|
+
>
|
40
41
|
|
41
42
|
export type EncodeDeployDataReturnType = Hex
|
42
43
|
|
package/utils/abi/getAbiItem.ts
CHANGED
@@ -1,6 +1,9 @@
|
|
1
1
|
import type { Abi, AbiParameter, Address } from 'abitype'
|
2
2
|
|
3
|
-
import {
|
3
|
+
import {
|
4
|
+
AbiItemAmbiguityError,
|
5
|
+
type AbiItemAmbiguityErrorType,
|
6
|
+
} from '../../errors/abi.js'
|
4
7
|
import type { ErrorType } from '../../errors/utils.js'
|
5
8
|
import type {
|
6
9
|
AbiItem,
|
@@ -57,6 +60,7 @@ export type GetAbiItemErrorType =
|
|
57
60
|
| IsArgOfTypeErrorType
|
58
61
|
| IsHexErrorType
|
59
62
|
| ToFunctionSelectorErrorType
|
63
|
+
| AbiItemAmbiguityErrorType
|
60
64
|
| ErrorType
|
61
65
|
|
62
66
|
export type GetAbiItemReturnType<
|
@@ -148,8 +152,9 @@ export function getAbiItem<
|
|
148
152
|
return abiItems[0] as GetAbiItemReturnType<abi, name, args>
|
149
153
|
}
|
150
154
|
|
151
|
-
|
155
|
+
type IsArgOfTypeErrorType = IsAddressErrorType | ErrorType
|
152
156
|
|
157
|
+
/** @internal */
|
153
158
|
export function isArgOfType(arg: unknown, abiParameter: AbiParameter): boolean {
|
154
159
|
const argType = typeof arg
|
155
160
|
const abiParameterType = abiParameter.type
|
@@ -207,6 +212,7 @@ export function isArgOfType(arg: unknown, abiParameter: AbiParameter): boolean {
|
|
207
212
|
}
|
208
213
|
}
|
209
214
|
|
215
|
+
/** @internal */
|
210
216
|
export function getAmbiguousTypes(
|
211
217
|
sourceParameters: readonly AbiParameter[],
|
212
218
|
targetParameters: readonly AbiParameter[],
|
@@ -10,7 +10,7 @@ import { type Keccak256ErrorType, keccak256 } from '../hash/keccak256.js'
|
|
10
10
|
import { LruMap } from '../lru.js'
|
11
11
|
import { type IsAddressErrorType, isAddress } from './isAddress.js'
|
12
12
|
|
13
|
-
|
13
|
+
const checksumAddressCache = /*#__PURE__*/ new LruMap<Address>(8192)
|
14
14
|
|
15
15
|
export type ChecksumAddressErrorType =
|
16
16
|
| Keccak256ErrorType
|
package/utils/blob/toBlobs.ts
CHANGED
@@ -12,7 +12,7 @@ import {
|
|
12
12
|
} from '../../errors/blob.js'
|
13
13
|
import type { ErrorType } from '../../errors/utils.js'
|
14
14
|
import type { ByteArray, Hex } from '../../types/misc.js'
|
15
|
-
import { createCursor } from '../cursor.js'
|
15
|
+
import { type CreateCursorErrorType, createCursor } from '../cursor.js'
|
16
16
|
import { type SizeErrorType, size } from '../data/size.js'
|
17
17
|
import { type HexToBytesErrorType, hexToBytes } from '../encoding/toBytes.js'
|
18
18
|
import { type BytesToHexErrorType, bytesToHex } from '../encoding/toHex.js'
|
@@ -36,6 +36,7 @@ export type ToBlobsReturnType<to extends To> =
|
|
36
36
|
export type ToBlobsErrorType =
|
37
37
|
| BlobSizeTooLargeErrorType
|
38
38
|
| BytesToHexErrorType
|
39
|
+
| CreateCursorErrorType
|
39
40
|
| EmptyBlobErrorType
|
40
41
|
| HexToBytesErrorType
|
41
42
|
| SizeErrorType
|
package/utils/buildRequest.ts
CHANGED
@@ -190,6 +190,7 @@ export function buildRequest<request extends (args: any) => Promise<any>>(
|
|
190
190
|
}
|
191
191
|
}
|
192
192
|
|
193
|
+
/** @internal */
|
193
194
|
export function shouldRetry(error: Error) {
|
194
195
|
if ('code' in error && typeof error.code === 'number') {
|
195
196
|
if (error.code === -1) return true // Unknown error
|
package/utils/ccip.ts
CHANGED
@@ -5,10 +5,15 @@ import type { Transport } from '../clients/transports/createTransport.js'
|
|
5
5
|
import type { BaseError } from '../errors/base.js'
|
6
6
|
import {
|
7
7
|
OffchainLookupError,
|
8
|
+
type OffchainLookupErrorType as OffchainLookupErrorType_,
|
8
9
|
OffchainLookupResponseMalformedError,
|
10
|
+
type OffchainLookupResponseMalformedErrorType,
|
9
11
|
OffchainLookupSenderMismatchError,
|
10
12
|
} from '../errors/ccip.js'
|
11
|
-
import {
|
13
|
+
import {
|
14
|
+
HttpRequestError,
|
15
|
+
type HttpRequestErrorType,
|
16
|
+
} from '../errors/request.js'
|
12
17
|
import type { Chain } from '../types/chain.js'
|
13
18
|
import type { Hex } from '../types/misc.js'
|
14
19
|
|
@@ -49,7 +54,7 @@ export const offchainLookupAbiItem = {
|
|
49
54
|
],
|
50
55
|
} as const satisfies Abi[number]
|
51
56
|
|
52
|
-
export type OffchainLookupErrorType = ErrorType
|
57
|
+
export type OffchainLookupErrorType = OffchainLookupErrorType_ | ErrorType
|
53
58
|
|
54
59
|
export async function offchainLookup<TChain extends Chain | undefined>(
|
55
60
|
client: Client<Transport, TChain>,
|
@@ -115,7 +120,10 @@ export type CcipRequestParameters = {
|
|
115
120
|
|
116
121
|
export type CcipRequestReturnType = Hex
|
117
122
|
|
118
|
-
export type CcipRequestErrorType =
|
123
|
+
export type CcipRequestErrorType =
|
124
|
+
| HttpRequestErrorType
|
125
|
+
| OffchainLookupResponseMalformedErrorType
|
126
|
+
| ErrorType
|
119
127
|
|
120
128
|
export async function ccipRequest({
|
121
129
|
data,
|
package/utils/cursor.ts
CHANGED
@@ -1,7 +1,10 @@
|
|
1
1
|
import {
|
2
2
|
NegativeOffsetError,
|
3
|
+
type NegativeOffsetErrorType,
|
3
4
|
PositionOutOfBoundsError,
|
5
|
+
type PositionOutOfBoundsErrorType,
|
4
6
|
RecursiveReadLimitExceededError,
|
7
|
+
type RecursiveReadLimitExceededErrorType,
|
5
8
|
} from '../errors/cursor.js'
|
6
9
|
import type { ErrorType } from '../errors/utils.js'
|
7
10
|
import type { ByteArray } from '../types/misc.js'
|
@@ -41,19 +44,21 @@ export type Cursor = {
|
|
41
44
|
_touch(): void
|
42
45
|
}
|
43
46
|
|
44
|
-
|
45
|
-
|
46
|
-
export type CursorErrorType =
|
47
|
+
type CursorErrorType =
|
47
48
|
| CursorAssertPositionErrorType
|
48
49
|
| CursorDecrementPositionErrorType
|
49
50
|
| CursorIncrementPositionErrorType
|
50
51
|
| ErrorType
|
51
52
|
|
52
|
-
|
53
|
+
type CursorAssertPositionErrorType = PositionOutOfBoundsErrorType | ErrorType
|
54
|
+
|
55
|
+
type CursorDecrementPositionErrorType = NegativeOffsetError | ErrorType
|
53
56
|
|
54
|
-
|
57
|
+
type CursorIncrementPositionErrorType = NegativeOffsetError | ErrorType
|
55
58
|
|
56
|
-
|
59
|
+
type StaticCursorErrorType =
|
60
|
+
| NegativeOffsetErrorType
|
61
|
+
| RecursiveReadLimitExceededErrorType
|
57
62
|
|
58
63
|
const staticCursor: Cursor = {
|
59
64
|
bytes: new Uint8Array(),
|
@@ -216,6 +221,11 @@ const staticCursor: Cursor = {
|
|
216
221
|
|
217
222
|
type CursorConfig = { recursiveReadLimit?: number | undefined }
|
218
223
|
|
224
|
+
export type CreateCursorErrorType =
|
225
|
+
| CursorErrorType
|
226
|
+
| StaticCursorErrorType
|
227
|
+
| ErrorType
|
228
|
+
|
219
229
|
export function createCursor(
|
220
230
|
bytes: ByteArray,
|
221
231
|
{ recursiveReadLimit = 8_192 }: CursorConfig = {},
|
@@ -49,25 +49,7 @@ export function fromRlp<to extends To = 'hex'>(
|
|
49
49
|
return result as FromRlpReturnType<to>
|
50
50
|
}
|
51
51
|
|
52
|
-
|
53
|
-
|
54
|
-
export function rlpToBytes<to extends To = 'bytes'>(
|
55
|
-
bytes: ByteArray,
|
56
|
-
to: to | To | undefined = 'bytes',
|
57
|
-
): FromRlpReturnType<to> {
|
58
|
-
return fromRlp(bytes, to)
|
59
|
-
}
|
60
|
-
|
61
|
-
export type RlpToHexErrorType = FromRlpErrorType | ErrorType
|
62
|
-
|
63
|
-
export function rlpToHex<to extends To = 'hex'>(
|
64
|
-
hex: Hex,
|
65
|
-
to: to | To | undefined = 'hex',
|
66
|
-
): FromRlpReturnType<to> {
|
67
|
-
return fromRlp(hex, to)
|
68
|
-
}
|
69
|
-
|
70
|
-
export type FromRlpCursorErrorType =
|
52
|
+
type FromRlpCursorErrorType =
|
71
53
|
| BytesToHexErrorType
|
72
54
|
| ReadLengthErrorType
|
73
55
|
| ReadListErrorType
|
@@ -97,7 +79,7 @@ function fromRlpCursor<to extends To = 'hex'>(
|
|
97
79
|
return readList(cursor, length, to) as {} as FromRlpReturnType<to>
|
98
80
|
}
|
99
81
|
|
100
|
-
|
82
|
+
type ReadLengthErrorType = BaseErrorType | ErrorType
|
101
83
|
|
102
84
|
function readLength(cursor: Cursor, prefix: number, offset: number) {
|
103
85
|
if (offset === 0x80 && prefix < 0x80) return 1
|
@@ -109,7 +91,7 @@ function readLength(cursor: Cursor, prefix: number, offset: number) {
|
|
109
91
|
throw new BaseError('Invalid RLP prefix')
|
110
92
|
}
|
111
93
|
|
112
|
-
|
94
|
+
type ReadListErrorType = ErrorType
|
113
95
|
|
114
96
|
function readList<to extends To>(cursor: Cursor, length: number, to: to | To) {
|
115
97
|
const position = cursor.position
|
@@ -49,7 +49,7 @@ export async function parseAvatarRecord<TChain extends Chain | undefined>(
|
|
49
49
|
return parseAvatarUri({ uri: record, gatewayUrls })
|
50
50
|
}
|
51
51
|
|
52
|
-
|
52
|
+
type ParseNftAvatarUriErrorType =
|
53
53
|
| ParseNftUriErrorType
|
54
54
|
| GetNftTokenUriErrorType
|
55
55
|
| ResolveAvatarUriErrorType
|
@@ -33,8 +33,9 @@ const ipfsHashRegex =
|
|
33
33
|
const base64Regex = /^data:([a-zA-Z\-/+]*);base64,([^"].*)/
|
34
34
|
const dataURIRegex = /^data:([a-zA-Z\-/+]*)?(;[a-zA-Z0-9].*?)?(,)/
|
35
35
|
|
36
|
-
|
36
|
+
type IsImageUriErrorType = ErrorType
|
37
37
|
|
38
|
+
/** @internal */
|
38
39
|
export async function isImageUri(uri: string) {
|
39
40
|
try {
|
40
41
|
const res = await fetch(uri, { method: 'HEAD' })
|
@@ -66,8 +67,9 @@ export async function isImageUri(uri: string) {
|
|
66
67
|
}
|
67
68
|
}
|
68
69
|
|
69
|
-
|
70
|
+
type GetGatewayErrorType = ErrorType
|
70
71
|
|
72
|
+
/** @internal */
|
71
73
|
export function getGateway(custom: string | undefined, defaultGateway: string) {
|
72
74
|
if (!custom) return defaultGateway
|
73
75
|
if (custom.endsWith('/')) return custom.slice(0, -1)
|
package/utils/ens/errors.ts
CHANGED
@@ -3,6 +3,7 @@ import { BaseError } from '../../errors/base.js'
|
|
3
3
|
import { ContractFunctionRevertedError } from '../../errors/contract.js'
|
4
4
|
import type { ErrorType } from '../../errors/utils.js'
|
5
5
|
|
6
|
+
/** @internal */
|
6
7
|
export type IsNullUniversalResolverErrorErrorType = ErrorType
|
7
8
|
|
8
9
|
/*
|
@@ -1,8 +1,8 @@
|
|
1
1
|
import { BaseError } from '../../errors/base.js'
|
2
2
|
import type { ErrorType } from '../../errors/utils.js'
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
type NormalizeSignatureParameters = string
|
5
|
+
type NormalizeSignatureReturnType = string
|
6
6
|
export type NormalizeSignatureErrorType = ErrorType
|
7
7
|
|
8
8
|
export function normalizeSignature(
|
package/utils/observe.ts
CHANGED
@@ -6,10 +6,12 @@ type Callbacks = Record<string, Callback>
|
|
6
6
|
|
7
7
|
export type ObserveErrorType = ErrorType
|
8
8
|
|
9
|
+
/** @internal */
|
9
10
|
export const listenersCache = /*#__PURE__*/ new Map<
|
10
11
|
string,
|
11
12
|
{ id: number; fns: Callbacks }[]
|
12
13
|
>()
|
14
|
+
/** @internal */
|
13
15
|
export const cleanupCache = /*#__PURE__*/ new Map<string, () => void>()
|
14
16
|
|
15
17
|
type EmitFunction<TCallbacks extends Callbacks> = (
|
@@ -17,7 +17,7 @@ type BatchResultsCompareFn<TResult = unknown> = (
|
|
17
17
|
b: TResult,
|
18
18
|
) => number
|
19
19
|
|
20
|
-
|
20
|
+
type CreateBatchSchedulerArguments<
|
21
21
|
TParameters = unknown,
|
22
22
|
TReturnType extends readonly unknown[] = readonly unknown[],
|
23
23
|
> = {
|
@@ -28,7 +28,7 @@ export type CreateBatchSchedulerArguments<
|
|
28
28
|
sort?: BatchResultsCompareFn<TReturnType[number]> | undefined
|
29
29
|
}
|
30
30
|
|
31
|
-
|
31
|
+
type CreateBatchSchedulerReturnType<
|
32
32
|
TParameters = unknown,
|
33
33
|
TReturnType extends readonly unknown[] = readonly unknown[],
|
34
34
|
> = {
|
@@ -42,6 +42,7 @@ export type CreateBatchSchedulerErrorType = ErrorType
|
|
42
42
|
|
43
43
|
const schedulerCache = /*#__PURE__*/ new Map<number | string, SchedulerItem[]>()
|
44
44
|
|
45
|
+
/** @internal */
|
45
46
|
export function createBatchScheduler<
|
46
47
|
TParameters,
|
47
48
|
TReturnType extends readonly unknown[],
|
@@ -1,6 +1,8 @@
|
|
1
1
|
import type { ErrorType } from '../../errors/utils.js'
|
2
2
|
|
3
|
+
/** @internal */
|
3
4
|
export const promiseCache = /*#__PURE__*/ new Map()
|
5
|
+
/** @internal */
|
4
6
|
export const responseCache = /*#__PURE__*/ new Map()
|
5
7
|
|
6
8
|
export type GetCacheErrorType = ErrorType
|
@@ -28,7 +30,7 @@ export function getCache<TData>(cacheKey: string) {
|
|
28
30
|
}
|
29
31
|
}
|
30
32
|
|
31
|
-
|
33
|
+
type WithCacheParameters = {
|
32
34
|
/** The key to cache the data against. */
|
33
35
|
cacheKey: string
|
34
36
|
/** The time that cached data will remain in memory. Default: Infinity (no expiry) */
|
@@ -21,7 +21,7 @@ export function withTimeout<TData>(
|
|
21
21
|
): Promise<TData> {
|
22
22
|
return new Promise((resolve, reject) => {
|
23
23
|
;(async () => {
|
24
|
-
let timeoutId!:
|
24
|
+
let timeoutId!: NodeJS.Timeout
|
25
25
|
try {
|
26
26
|
const controller = new AbortController()
|
27
27
|
if (timeout > 0) {
|
@@ -31,7 +31,7 @@ export function withTimeout<TData>(
|
|
31
31
|
} else {
|
32
32
|
reject(errorInstance)
|
33
33
|
}
|
34
|
-
}, timeout)
|
34
|
+
}, timeout) as NodeJS.Timeout // need to cast because bun globals.d.ts overrides @types/node
|
35
35
|
}
|
36
36
|
resolve(await fn({ signal: controller?.signal || null }))
|
37
37
|
} catch (err) {
|
package/utils/rpc/id.ts
CHANGED
package/utils/rpc/ipc.ts
CHANGED