viem 0.0.0-main.20240316T233602 → 0.0.0-main.20240317T053608
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/_cjs/accounts/generateMnemonic.js.map +1 -1
- package/_cjs/actions/getContract.js.map +1 -1
- package/_cjs/actions/public/call.js +5 -1
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/createContractEventFilter.js.map +1 -1
- package/_cjs/actions/public/estimateFeesPerGas.js.map +1 -1
- package/_cjs/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/chains/celo/parsers.js.map +1 -1
- package/_cjs/chains/celo/serializers.js.map +1 -1
- package/_cjs/chains/opStack/actions/getL1BaseFee.js.map +1 -1
- package/_cjs/chains/opStack/actions/getTimeToProve.js.map +1 -1
- package/_cjs/chains/opStack/actions/waitForNextL2Output.js.map +1 -1
- package/_cjs/chains/zksync/formatters.js.map +1 -1
- package/_cjs/chains/zksync/serializers.js.map +1 -1
- package/_cjs/chains/zksync/utils/assertEip712Request.js.map +1 -1
- package/_cjs/chains/zksync/utils/assertEip712Transaction.js.map +1 -1
- package/_cjs/chains/zksync/utils/isEip712Transaction.js.map +1 -1
- package/_cjs/clients/createClient.js.map +1 -1
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/clients/transports/createTransport.js.map +1 -1
- package/_cjs/clients/transports/fallback.js.map +1 -1
- package/_cjs/clients/transports/http.js.map +1 -1
- package/_cjs/errors/abi.js.map +1 -1
- package/_cjs/errors/account.js.map +1 -1
- package/_cjs/errors/base.js.map +1 -1
- package/_cjs/errors/chain.js.map +1 -1
- package/_cjs/errors/contract.js.map +1 -1
- package/_cjs/errors/node.js +5 -5
- package/_cjs/errors/node.js.map +1 -1
- package/_cjs/errors/request.js.map +1 -1
- package/_cjs/errors/rpc.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/utils/abi/formatAbiItem.js.map +1 -1
- package/_cjs/utils/address/getAddress.js.map +1 -1
- package/_cjs/utils/data/isHex.js.map +1 -1
- package/_cjs/utils/data/slice.js.map +1 -1
- package/_cjs/utils/encoding/toBytes.js.map +1 -1
- package/_cjs/utils/errors/getNodeError.js.map +1 -1
- package/_cjs/utils/formatters/block.js.map +1 -1
- package/_cjs/utils/formatters/extract.js.map +1 -1
- package/_cjs/utils/formatters/log.js +1 -1
- package/_cjs/utils/formatters/log.js.map +1 -1
- package/_cjs/utils/formatters/proof.js.map +1 -1
- package/_cjs/utils/formatters/transaction.js.map +1 -1
- package/_cjs/utils/formatters/transactionReceipt.js.map +1 -1
- package/_cjs/utils/formatters/transactionRequest.js.map +1 -1
- package/_cjs/utils/hash/keccak256.js.map +1 -1
- package/_cjs/utils/hash/ripemd160.js.map +1 -1
- package/_cjs/utils/hash/sha256.js.map +1 -1
- package/_cjs/utils/promise/withRetry.js.map +1 -1
- package/_cjs/utils/promise/withTimeout.js +1 -1
- package/_cjs/utils/promise/withTimeout.js.map +1 -1
- package/_cjs/utils/rpc/http.js +1 -1
- package/_cjs/utils/rpc/http.js.map +1 -1
- package/_cjs/utils/signature/hashMessage.js.map +1 -1
- package/_cjs/utils/transaction/assertRequest.js.map +1 -1
- package/_cjs/utils/transaction/getTransactionType.js.map +1 -1
- package/_cjs/utils/transaction/serializeAccessList.js.map +1 -1
- package/_cjs/utils/transaction/serializeTransaction.js.map +1 -1
- package/_cjs/utils/typedData.js.map +1 -1
- package/_esm/accounts/generateMnemonic.js.map +1 -1
- package/_esm/actions/getContract.js.map +1 -1
- package/_esm/actions/public/call.js +5 -1
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/createContractEventFilter.js.map +1 -1
- package/_esm/actions/public/estimateFeesPerGas.js.map +1 -1
- package/_esm/actions/public/estimateMaxPriorityFeePerGas.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/chains/celo/parsers.js.map +1 -1
- package/_esm/chains/celo/serializers.js.map +1 -1
- package/_esm/chains/opStack/actions/getL1BaseFee.js.map +1 -1
- package/_esm/chains/opStack/actions/getTimeToProve.js.map +1 -1
- package/_esm/chains/opStack/actions/waitForNextL2Output.js.map +1 -1
- package/_esm/chains/zksync/formatters.js.map +1 -1
- package/_esm/chains/zksync/serializers.js.map +1 -1
- package/_esm/chains/zksync/utils/assertEip712Request.js.map +1 -1
- package/_esm/chains/zksync/utils/assertEip712Transaction.js.map +1 -1
- package/_esm/chains/zksync/utils/isEip712Transaction.js.map +1 -1
- package/_esm/clients/createClient.js.map +1 -1
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/clients/transports/createTransport.js.map +1 -1
- package/_esm/clients/transports/fallback.js.map +1 -1
- package/_esm/clients/transports/http.js.map +1 -1
- package/_esm/errors/abi.js.map +1 -1
- package/_esm/errors/account.js.map +1 -1
- package/_esm/errors/base.js.map +1 -1
- package/_esm/errors/chain.js.map +1 -1
- package/_esm/errors/contract.js.map +1 -1
- package/_esm/errors/node.js +5 -5
- package/_esm/errors/node.js.map +1 -1
- package/_esm/errors/request.js.map +1 -1
- package/_esm/errors/rpc.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/utils/abi/formatAbiItem.js.map +1 -1
- package/_esm/utils/address/getAddress.js.map +1 -1
- package/_esm/utils/data/isHex.js.map +1 -1
- package/_esm/utils/data/slice.js.map +1 -1
- package/_esm/utils/encoding/toBytes.js.map +1 -1
- package/_esm/utils/errors/getNodeError.js.map +1 -1
- package/_esm/utils/formatters/block.js.map +1 -1
- package/_esm/utils/formatters/extract.js.map +1 -1
- package/_esm/utils/formatters/log.js +1 -1
- package/_esm/utils/formatters/log.js.map +1 -1
- package/_esm/utils/formatters/proof.js.map +1 -1
- package/_esm/utils/formatters/transaction.js.map +1 -1
- package/_esm/utils/formatters/transactionReceipt.js.map +1 -1
- package/_esm/utils/formatters/transactionRequest.js.map +1 -1
- package/_esm/utils/hash/keccak256.js.map +1 -1
- package/_esm/utils/hash/ripemd160.js.map +1 -1
- package/_esm/utils/hash/sha256.js.map +1 -1
- package/_esm/utils/promise/withRetry.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/http.js +1 -1
- package/_esm/utils/rpc/http.js.map +1 -1
- package/_esm/utils/signature/hashMessage.js.map +1 -1
- package/_esm/utils/transaction/assertRequest.js.map +1 -1
- package/_esm/utils/transaction/getTransactionType.js.map +1 -1
- package/_esm/utils/transaction/serializeAccessList.js.map +1 -1
- package/_esm/utils/transaction/serializeTransaction.js.map +1 -1
- package/_esm/utils/typedData.js.map +1 -1
- package/_types/accounts/generateMnemonic.d.ts +1 -1
- package/_types/accounts/generateMnemonic.d.ts.map +1 -1
- package/_types/accounts/types.d.ts +9 -9
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/accounts/utils/signTransaction.d.ts +1 -1
- package/_types/accounts/utils/signTransaction.d.ts.map +1 -1
- package/_types/actions/ens/getEnsAddress.d.ts +4 -4
- package/_types/actions/ens/getEnsAddress.d.ts.map +1 -1
- package/_types/actions/ens/getEnsAvatar.d.ts +1 -1
- package/_types/actions/ens/getEnsAvatar.d.ts.map +1 -1
- package/_types/actions/ens/getEnsName.d.ts +3 -3
- package/_types/actions/ens/getEnsName.d.ts.map +1 -1
- package/_types/actions/ens/getEnsResolver.d.ts +1 -1
- package/_types/actions/ens/getEnsResolver.d.ts.map +1 -1
- package/_types/actions/ens/getEnsText.d.ts +3 -3
- package/_types/actions/ens/getEnsText.d.ts.map +1 -1
- package/_types/actions/getContract.d.ts +3 -3
- package/_types/actions/getContract.d.ts.map +1 -1
- package/_types/actions/public/call.d.ts +8 -8
- package/_types/actions/public/call.d.ts.map +1 -1
- package/_types/actions/public/createContractEventFilter.d.ts +6 -6
- package/_types/actions/public/createContractEventFilter.d.ts.map +1 -1
- package/_types/actions/public/createEventFilter.d.ts +21 -21
- package/_types/actions/public/createEventFilter.d.ts.map +1 -1
- package/_types/actions/public/estimateFeesPerGas.d.ts +4 -4
- package/_types/actions/public/estimateFeesPerGas.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts +5 -5
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts +3 -3
- package/_types/actions/public/estimateMaxPriorityFeePerGas.d.ts.map +1 -1
- package/_types/actions/public/getBalance.d.ts +4 -4
- package/_types/actions/public/getBalance.d.ts.map +1 -1
- package/_types/actions/public/getBlock.d.ts +10 -10
- package/_types/actions/public/getBlock.d.ts.map +1 -1
- package/_types/actions/public/getBlockNumber.d.ts +1 -1
- package/_types/actions/public/getBlockNumber.d.ts.map +1 -1
- package/_types/actions/public/getBlockTransactionCount.d.ts +9 -9
- package/_types/actions/public/getBlockTransactionCount.d.ts.map +1 -1
- package/_types/actions/public/getBytecode.d.ts +4 -4
- package/_types/actions/public/getBytecode.d.ts.map +1 -1
- package/_types/actions/public/getContractEvents.d.ts +4 -4
- package/_types/actions/public/getContractEvents.d.ts.map +1 -1
- package/_types/actions/public/getFeeHistory.d.ts +4 -4
- package/_types/actions/public/getFeeHistory.d.ts.map +1 -1
- package/_types/actions/public/getLogs.d.ts +17 -17
- package/_types/actions/public/getLogs.d.ts.map +1 -1
- package/_types/actions/public/getProof.d.ts +4 -4
- package/_types/actions/public/getProof.d.ts.map +1 -1
- package/_types/actions/public/getStorageAt.d.ts +4 -4
- package/_types/actions/public/getStorageAt.d.ts.map +1 -1
- package/_types/actions/public/getTransaction.d.ts +13 -13
- package/_types/actions/public/getTransaction.d.ts.map +1 -1
- package/_types/actions/public/getTransactionConfirmations.d.ts +2 -2
- package/_types/actions/public/getTransactionConfirmations.d.ts.map +1 -1
- package/_types/actions/public/getTransactionCount.d.ts +4 -4
- package/_types/actions/public/getTransactionCount.d.ts.map +1 -1
- package/_types/actions/public/simulateContract.d.ts +3 -3
- package/_types/actions/public/simulateContract.d.ts.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts +6 -6
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/public/watchBlockNumber.d.ts +1 -1
- package/_types/actions/public/watchBlockNumber.d.ts.map +1 -1
- package/_types/actions/public/watchEvent.d.ts +13 -13
- package/_types/actions/public/watchEvent.d.ts.map +1 -1
- package/_types/actions/public/watchPendingTransactions.d.ts +1 -1
- package/_types/actions/public/watchPendingTransactions.d.ts.map +1 -1
- package/_types/actions/test/mine.d.ts +1 -1
- package/_types/actions/test/mine.d.ts.map +1 -1
- package/_types/actions/test/reset.d.ts +2 -2
- package/_types/actions/test/reset.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +5 -5
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/actions/wallet/writeContract.d.ts +1 -1
- package/_types/actions/wallet/writeContract.d.ts.map +1 -1
- package/_types/chains/celo/chainConfig.d.ts +312 -312
- package/_types/chains/celo/formatters.d.ts +312 -312
- package/_types/chains/celo/parsers.d.ts.map +1 -1
- package/_types/chains/celo/serializers.d.ts +1 -1
- package/_types/chains/celo/serializers.d.ts.map +1 -1
- package/_types/chains/celo/types.d.ts +39 -39
- package/_types/chains/celo/types.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8.d.ts +217 -217
- package/_types/chains/definitions/ancient8Sepolia.d.ts +217 -217
- package/_types/chains/definitions/base.d.ts +217 -217
- package/_types/chains/definitions/baseGoerli.d.ts +217 -217
- package/_types/chains/definitions/baseSepolia.d.ts +217 -217
- package/_types/chains/definitions/celo.d.ts +312 -312
- package/_types/chains/definitions/celoAlfajores.d.ts +312 -312
- package/_types/chains/definitions/fraxtal.d.ts +217 -217
- package/_types/chains/definitions/fraxtalTestnet.d.ts +217 -217
- package/_types/chains/definitions/liskSepolia.d.ts +217 -217
- package/_types/chains/definitions/optimism.d.ts +217 -217
- package/_types/chains/definitions/optimismGoerli.d.ts +217 -217
- package/_types/chains/definitions/optimismSepolia.d.ts +217 -217
- package/_types/chains/definitions/pgn.d.ts +217 -217
- package/_types/chains/definitions/pgnTestnet.d.ts +217 -217
- package/_types/chains/definitions/rss3.d.ts +217 -217
- package/_types/chains/definitions/rss3Sepolia.d.ts +217 -217
- package/_types/chains/definitions/zkSync.d.ts +33 -33
- package/_types/chains/definitions/zkSyncSepoliaTestnet.d.ts +33 -33
- package/_types/chains/definitions/zkSyncTestnet.d.ts +33 -33
- package/_types/chains/definitions/zora.d.ts +217 -217
- package/_types/chains/definitions/zoraSepolia.d.ts +217 -217
- package/_types/chains/definitions/zoraTestnet.d.ts +217 -217
- package/_types/chains/opStack/actions/buildDepositTransaction.d.ts +7 -7
- package/_types/chains/opStack/actions/buildDepositTransaction.d.ts.map +1 -1
- package/_types/chains/opStack/actions/buildInitiateWithdrawal.d.ts +3 -3
- package/_types/chains/opStack/actions/buildInitiateWithdrawal.d.ts.map +1 -1
- package/_types/chains/opStack/actions/depositTransaction.d.ts +1 -1
- package/_types/chains/opStack/actions/depositTransaction.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateDepositTransactionGas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateDepositTransactionGas.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateFinalizeWithdrawalGas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateFinalizeWithdrawalGas.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateInitiateWithdrawalGas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateInitiateWithdrawalGas.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateL1Fee.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateL1Fee.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateL1Gas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateL1Gas.d.ts.map +1 -1
- package/_types/chains/opStack/actions/estimateProveWithdrawalGas.d.ts +1 -1
- package/_types/chains/opStack/actions/estimateProveWithdrawalGas.d.ts.map +1 -1
- package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts +1 -1
- package/_types/chains/opStack/actions/finalizeWithdrawal.d.ts.map +1 -1
- package/_types/chains/opStack/actions/getL1BaseFee.d.ts +2 -2
- package/_types/chains/opStack/actions/getL1BaseFee.d.ts.map +1 -1
- package/_types/chains/opStack/actions/getTimeToNextL2Output.d.ts +2 -2
- package/_types/chains/opStack/actions/getTimeToNextL2Output.d.ts.map +1 -1
- package/_types/chains/opStack/actions/getTimeToProve.d.ts +1 -1
- package/_types/chains/opStack/actions/getTimeToProve.d.ts.map +1 -1
- package/_types/chains/opStack/actions/proveWithdrawal.d.ts +1 -1
- package/_types/chains/opStack/actions/proveWithdrawal.d.ts.map +1 -1
- package/_types/chains/opStack/actions/waitForNextL2Output.d.ts +2 -2
- package/_types/chains/opStack/actions/waitForNextL2Output.d.ts.map +1 -1
- package/_types/chains/opStack/actions/waitToProve.d.ts +1 -1
- package/_types/chains/opStack/actions/waitToProve.d.ts.map +1 -1
- package/_types/chains/opStack/chainConfig.d.ts +217 -217
- package/_types/chains/opStack/decorators/publicL2.d.ts +1 -1
- package/_types/chains/opStack/decorators/publicL2.d.ts.map +1 -1
- package/_types/chains/opStack/formatters.d.ts +217 -217
- package/_types/chains/opStack/types/deposit.d.ts +6 -6
- package/_types/chains/opStack/types/deposit.d.ts.map +1 -1
- package/_types/chains/opStack/types/transaction.d.ts +4 -4
- package/_types/chains/opStack/types/transaction.d.ts.map +1 -1
- package/_types/chains/opStack/types/withdrawal.d.ts +2 -2
- package/_types/chains/opStack/types/withdrawal.d.ts.map +1 -1
- package/_types/chains/zksync/chainConfig.d.ts +33 -33
- package/_types/chains/zksync/formatters.d.ts +33 -33
- package/_types/chains/zksync/serializers.d.ts +1 -1
- package/_types/chains/zksync/serializers.d.ts.map +1 -1
- package/_types/chains/zksync/types/eip712.d.ts +4 -4
- package/_types/chains/zksync/types/eip712.d.ts.map +1 -1
- package/_types/chains/zksync/types/transaction.d.ts +21 -21
- package/_types/chains/zksync/types/transaction.d.ts.map +1 -1
- package/_types/chains/zksync/utils/assertEip712Request.d.ts +2 -1
- package/_types/chains/zksync/utils/assertEip712Request.d.ts.map +1 -1
- package/_types/chains/zksync/utils/assertEip712Transaction.d.ts +2 -1
- package/_types/chains/zksync/utils/assertEip712Transaction.d.ts.map +1 -1
- package/_types/chains/zksync/utils/isEip712Transaction.d.ts +2 -1
- package/_types/chains/zksync/utils/isEip712Transaction.d.ts.map +1 -1
- package/_types/clients/createClient.d.ts +2 -2
- package/_types/clients/createClient.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +7 -7
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/clients/decorators/test.d.ts +1 -1
- package/_types/clients/decorators/test.d.ts.map +1 -1
- package/_types/clients/transports/createTransport.d.ts +9 -9
- package/_types/clients/transports/createTransport.d.ts.map +1 -1
- package/_types/clients/transports/custom.d.ts +4 -4
- package/_types/clients/transports/custom.d.ts.map +1 -1
- package/_types/clients/transports/fallback.d.ts +17 -17
- package/_types/clients/transports/fallback.d.ts.map +1 -1
- package/_types/clients/transports/http.d.ts +13 -13
- package/_types/clients/transports/http.d.ts.map +1 -1
- package/_types/clients/transports/ipc.d.ts +6 -6
- package/_types/clients/transports/ipc.d.ts.map +1 -1
- package/_types/clients/transports/webSocket.d.ts +6 -6
- package/_types/clients/transports/webSocket.d.ts.map +1 -1
- package/_types/errors/abi.d.ts +6 -6
- package/_types/errors/abi.d.ts.map +1 -1
- package/_types/errors/account.d.ts +1 -1
- package/_types/errors/account.d.ts.map +1 -1
- package/_types/errors/base.d.ts +9 -9
- package/_types/errors/base.d.ts.map +1 -1
- package/_types/errors/block.d.ts +2 -2
- package/_types/errors/block.d.ts.map +1 -1
- package/_types/errors/chain.d.ts +3 -3
- package/_types/errors/chain.d.ts.map +1 -1
- package/_types/errors/contract.d.ts +20 -20
- package/_types/errors/contract.d.ts.map +1 -1
- package/_types/errors/encoding.d.ts +3 -3
- package/_types/errors/encoding.d.ts.map +1 -1
- package/_types/errors/estimateGas.d.ts +3 -3
- package/_types/errors/estimateGas.d.ts.map +1 -1
- package/_types/errors/node.d.ts +27 -27
- package/_types/errors/node.d.ts.map +1 -1
- package/_types/errors/request.d.ts +7 -7
- package/_types/errors/request.d.ts.map +1 -1
- package/_types/errors/rpc.d.ts +5 -5
- package/_types/errors/rpc.d.ts.map +1 -1
- package/_types/errors/transaction.d.ts +7 -7
- package/_types/errors/transaction.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/types/block.d.ts +3 -3
- package/_types/types/block.d.ts.map +1 -1
- package/_types/types/chain.d.ts +1 -1
- package/_types/types/chain.d.ts.map +1 -1
- package/_types/types/contract.d.ts +5 -5
- package/_types/types/contract.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +29 -29
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/ens.d.ts +1 -1
- package/_types/types/ens.d.ts.map +1 -1
- package/_types/types/fee.d.ts +6 -6
- package/_types/types/fee.d.ts.map +1 -1
- package/_types/types/filter.d.ts +9 -9
- package/_types/types/filter.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/misc.d.ts +2 -2
- package/_types/types/misc.d.ts.map +1 -1
- package/_types/types/rpc.d.ts +16 -16
- package/_types/types/rpc.d.ts.map +1 -1
- package/_types/types/stateOverride.d.ts +5 -5
- package/_types/types/stateOverride.d.ts.map +1 -1
- package/_types/types/transaction.d.ts +56 -56
- package/_types/types/transaction.d.ts.map +1 -1
- package/_types/types/typedData.d.ts +1 -1
- package/_types/types/typedData.d.ts.map +1 -1
- package/_types/types/utils.d.ts +6 -3
- package/_types/types/utils.d.ts.map +1 -1
- package/_types/types/window.d.ts +1 -1
- package/_types/types/window.d.ts.map +1 -1
- package/_types/utils/abi/decodeEventLog.d.ts +1 -1
- package/_types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/_types/utils/abi/decodeFunctionResult.d.ts +2 -2
- package/_types/utils/abi/decodeFunctionResult.d.ts.map +1 -1
- package/_types/utils/abi/encodeErrorResult.d.ts +2 -2
- package/_types/utils/abi/encodeErrorResult.d.ts.map +1 -1
- package/_types/utils/abi/encodeEventTopics.d.ts +2 -2
- package/_types/utils/abi/encodeEventTopics.d.ts.map +1 -1
- package/_types/utils/abi/encodeFunctionData.d.ts +2 -2
- package/_types/utils/abi/encodeFunctionData.d.ts.map +1 -1
- package/_types/utils/abi/encodeFunctionResult.d.ts +2 -2
- package/_types/utils/abi/encodeFunctionResult.d.ts.map +1 -1
- package/_types/utils/abi/formatAbiItem.d.ts +2 -2
- package/_types/utils/abi/formatAbiItem.d.ts.map +1 -1
- package/_types/utils/abi/formatAbiItemWithArgs.d.ts +2 -2
- package/_types/utils/abi/formatAbiItemWithArgs.d.ts.map +1 -1
- package/_types/utils/address/getAddress.d.ts +1 -1
- package/_types/utils/address/getAddress.d.ts.map +1 -1
- package/_types/utils/address/getContractAddress.d.ts +1 -1
- package/_types/utils/address/getContractAddress.d.ts.map +1 -1
- package/_types/utils/address/isAddress.d.ts +1 -1
- package/_types/utils/address/isAddress.d.ts.map +1 -1
- package/_types/utils/blob/commitmentToVersionedHash.d.ts +1 -1
- package/_types/utils/blob/commitmentToVersionedHash.d.ts.map +1 -1
- package/_types/utils/blob/commitmentsToVersionedHashes.d.ts +1 -1
- package/_types/utils/blob/commitmentsToVersionedHashes.d.ts.map +1 -1
- package/_types/utils/blob/sidecarsToVersionedHashes.d.ts +1 -1
- package/_types/utils/blob/sidecarsToVersionedHashes.d.ts.map +1 -1
- package/_types/utils/chain/assertCurrentChain.d.ts +1 -1
- package/_types/utils/chain/assertCurrentChain.d.ts.map +1 -1
- package/_types/utils/chain/getChainContractAddress.d.ts +1 -1
- package/_types/utils/chain/getChainContractAddress.d.ts.map +1 -1
- package/_types/utils/cursor.d.ts +1 -1
- package/_types/utils/cursor.d.ts.map +1 -1
- package/_types/utils/data/isHex.d.ts +1 -1
- package/_types/utils/data/isHex.d.ts.map +1 -1
- package/_types/utils/data/pad.d.ts +2 -2
- package/_types/utils/data/pad.d.ts.map +1 -1
- package/_types/utils/data/slice.d.ts +6 -6
- package/_types/utils/data/slice.d.ts.map +1 -1
- package/_types/utils/data/trim.d.ts +1 -1
- package/_types/utils/data/trim.d.ts.map +1 -1
- package/_types/utils/encoding/fromBytes.d.ts +5 -5
- package/_types/utils/encoding/fromBytes.d.ts.map +1 -1
- package/_types/utils/encoding/fromHex.d.ts +5 -5
- package/_types/utils/encoding/fromHex.d.ts.map +1 -1
- package/_types/utils/encoding/toBytes.d.ts +5 -5
- package/_types/utils/encoding/toBytes.d.ts.map +1 -1
- package/_types/utils/encoding/toHex.d.ts +7 -7
- package/_types/utils/encoding/toHex.d.ts.map +1 -1
- package/_types/utils/ens/avatar/parseAvatarRecord.d.ts +1 -1
- package/_types/utils/ens/avatar/parseAvatarRecord.d.ts.map +1 -1
- package/_types/utils/errors/getCallError.d.ts +2 -2
- package/_types/utils/errors/getCallError.d.ts.map +1 -1
- package/_types/utils/errors/getContractError.d.ts +3 -3
- package/_types/utils/errors/getContractError.d.ts.map +1 -1
- package/_types/utils/errors/getEstimateGasError.d.ts +3 -3
- package/_types/utils/errors/getEstimateGasError.d.ts.map +1 -1
- package/_types/utils/errors/getNodeError.d.ts +2 -1
- package/_types/utils/errors/getNodeError.d.ts.map +1 -1
- package/_types/utils/errors/getTransactionError.d.ts +2 -2
- package/_types/utils/errors/getTransactionError.d.ts.map +1 -1
- package/_types/utils/formatters/block.d.ts +3 -3
- package/_types/utils/formatters/block.d.ts.map +1 -1
- package/_types/utils/formatters/extract.d.ts +1 -1
- package/_types/utils/formatters/extract.d.ts.map +1 -1
- package/_types/utils/formatters/formatter.d.ts.map +1 -1
- package/_types/utils/formatters/log.d.ts +4 -3
- package/_types/utils/formatters/log.d.ts.map +1 -1
- package/_types/utils/formatters/proof.d.ts +2 -1
- package/_types/utils/formatters/proof.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +3 -3
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/transactionReceipt.d.ts +3 -2
- package/_types/utils/formatters/transactionReceipt.d.ts.map +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +3 -2
- package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
- package/_types/utils/hash/keccak256.d.ts +1 -1
- package/_types/utils/hash/keccak256.d.ts.map +1 -1
- package/_types/utils/hash/ripemd160.d.ts +1 -1
- package/_types/utils/hash/ripemd160.d.ts.map +1 -1
- package/_types/utils/hash/sha256.d.ts +1 -1
- package/_types/utils/hash/sha256.d.ts.map +1 -1
- package/_types/utils/poll.d.ts +2 -2
- package/_types/utils/poll.d.ts.map +1 -1
- package/_types/utils/promise/createBatchScheduler.d.ts +4 -4
- package/_types/utils/promise/createBatchScheduler.d.ts.map +1 -1
- package/_types/utils/promise/withCache.d.ts +1 -1
- package/_types/utils/promise/withCache.d.ts.map +1 -1
- package/_types/utils/promise/withRetry.d.ts +4 -4
- package/_types/utils/promise/withRetry.d.ts.map +1 -1
- package/_types/utils/promise/withTimeout.d.ts +4 -4
- package/_types/utils/promise/withTimeout.d.ts.map +1 -1
- package/_types/utils/rpc/http.d.ts +6 -6
- package/_types/utils/rpc/http.d.ts.map +1 -1
- package/_types/utils/rpc/socket.d.ts +2 -2
- package/_types/utils/rpc/socket.d.ts.map +1 -1
- package/_types/utils/signature/hashMessage.d.ts +1 -1
- package/_types/utils/signature/hashMessage.d.ts.map +1 -1
- package/_types/utils/transaction/assertRequest.d.ts +2 -1
- package/_types/utils/transaction/assertRequest.d.ts.map +1 -1
- package/_types/utils/transaction/getTransactionType.d.ts +4 -4
- package/_types/utils/transaction/getTransactionType.d.ts.map +1 -1
- package/_types/utils/transaction/serializeAccessList.d.ts +1 -1
- package/_types/utils/transaction/serializeAccessList.d.ts.map +1 -1
- package/_types/utils/transaction/serializeTransaction.d.ts +2 -2
- package/_types/utils/transaction/serializeTransaction.d.ts.map +1 -1
- package/_types/utils/typedData.d.ts +1 -1
- package/_types/utils/typedData.d.ts.map +1 -1
- package/accounts/generateMnemonic.ts +1 -1
- package/accounts/types.ts +12 -10
- package/accounts/utils/signTransaction.ts +1 -1
- package/actions/ens/getEnsAddress.ts +4 -4
- package/actions/ens/getEnsAvatar.ts +1 -1
- package/actions/ens/getEnsName.ts +3 -3
- package/actions/ens/getEnsResolver.ts +1 -1
- package/actions/ens/getEnsText.ts +3 -3
- package/actions/getContract.ts +3 -3
- package/actions/public/call.ts +16 -12
- package/actions/public/createContractEventFilter.ts +9 -6
- package/actions/public/createEventFilter.ts +21 -21
- package/actions/public/estimateFeesPerGas.ts +4 -4
- package/actions/public/estimateGas.ts +5 -5
- package/actions/public/estimateMaxPriorityFeePerGas.ts +11 -7
- package/actions/public/getBalance.ts +4 -4
- package/actions/public/getBlock.ts +10 -10
- package/actions/public/getBlockNumber.ts +1 -1
- package/actions/public/getBlockTransactionCount.ts +9 -9
- package/actions/public/getBytecode.ts +4 -4
- package/actions/public/getContractEvents.ts +4 -4
- package/actions/public/getFeeHistory.ts +4 -4
- package/actions/public/getLogs.ts +17 -17
- package/actions/public/getProof.ts +4 -4
- package/actions/public/getStorageAt.ts +4 -4
- package/actions/public/getTransaction.ts +13 -13
- package/actions/public/getTransactionConfirmations.ts +2 -2
- package/actions/public/getTransactionCount.ts +4 -4
- package/actions/public/simulateContract.ts +3 -3
- package/actions/public/waitForTransactionReceipt.ts +6 -6
- package/actions/public/watchBlockNumber.ts +1 -1
- package/actions/public/watchEvent.ts +13 -13
- package/actions/public/watchPendingTransactions.ts +1 -1
- package/actions/test/mine.ts +1 -1
- package/actions/test/reset.ts +2 -2
- package/actions/wallet/prepareTransactionRequest.ts +5 -4
- package/actions/wallet/writeContract.ts +1 -1
- package/chains/celo/parsers.ts +3 -2
- package/chains/celo/serializers.ts +3 -3
- package/chains/celo/types.ts +37 -37
- package/chains/opStack/actions/buildDepositTransaction.ts +7 -7
- package/chains/opStack/actions/buildInitiateWithdrawal.ts +3 -3
- package/chains/opStack/actions/depositTransaction.ts +1 -1
- package/chains/opStack/actions/estimateDepositTransactionGas.ts +1 -1
- package/chains/opStack/actions/estimateFinalizeWithdrawalGas.ts +1 -1
- package/chains/opStack/actions/estimateInitiateWithdrawalGas.ts +1 -1
- package/chains/opStack/actions/estimateL1Fee.ts +1 -1
- package/chains/opStack/actions/estimateL1Gas.ts +1 -1
- package/chains/opStack/actions/estimateProveWithdrawalGas.ts +1 -1
- package/chains/opStack/actions/finalizeWithdrawal.ts +1 -1
- package/chains/opStack/actions/getL1BaseFee.ts +2 -2
- package/chains/opStack/actions/getTimeToNextL2Output.ts +2 -2
- package/chains/opStack/actions/getTimeToProve.ts +3 -1
- package/chains/opStack/actions/proveWithdrawal.ts +1 -1
- package/chains/opStack/actions/waitForNextL2Output.ts +4 -2
- package/chains/opStack/actions/waitToProve.ts +1 -1
- package/chains/opStack/decorators/publicL2.ts +1 -1
- package/chains/opStack/types/deposit.ts +6 -6
- package/chains/opStack/types/transaction.ts +4 -4
- package/chains/opStack/types/withdrawal.ts +2 -2
- package/chains/zksync/formatters.ts +1 -1
- package/chains/zksync/serializers.ts +1 -1
- package/chains/zksync/types/eip712.ts +4 -4
- package/chains/zksync/types/transaction.ts +21 -21
- package/chains/zksync/utils/assertEip712Request.ts +2 -1
- package/chains/zksync/utils/assertEip712Transaction.ts +2 -1
- package/chains/zksync/utils/isEip712Transaction.ts +2 -1
- package/clients/createClient.ts +3 -3
- package/clients/decorators/public.ts +23 -21
- package/clients/decorators/test.ts +1 -1
- package/clients/transports/createTransport.ts +9 -9
- package/clients/transports/custom.ts +4 -4
- package/clients/transports/fallback.ts +28 -26
- package/clients/transports/http.ts +13 -13
- package/clients/transports/ipc.ts +6 -6
- package/clients/transports/webSocket.ts +6 -6
- package/errors/abi.ts +12 -3
- package/errors/account.ts +1 -1
- package/errors/base.ts +13 -10
- package/errors/block.ts +2 -2
- package/errors/chain.ts +3 -3
- package/errors/contract.ts +26 -15
- package/errors/encoding.ts +3 -3
- package/errors/estimateGas.ts +3 -3
- package/errors/node.ts +35 -14
- package/errors/request.ts +7 -7
- package/errors/rpc.ts +5 -5
- package/errors/transaction.ts +7 -7
- package/errors/version.ts +1 -1
- package/package.json +1 -1
- package/types/block.ts +3 -3
- package/types/chain.ts +1 -1
- package/types/contract.ts +7 -5
- package/types/eip1193.ts +42 -38
- package/types/ens.ts +1 -1
- package/types/fee.ts +6 -6
- package/types/filter.ts +9 -9
- package/types/kzg.ts +1 -1
- package/types/misc.ts +2 -2
- package/types/rpc.ts +16 -16
- package/types/stateOverride.ts +5 -5
- package/types/transaction.ts +63 -56
- package/types/typedData.ts +1 -1
- package/types/utils.ts +9 -3
- package/types/window.ts +1 -1
- package/utils/abi/decodeEventLog.ts +1 -1
- package/utils/abi/decodeFunctionResult.ts +2 -2
- package/utils/abi/encodeErrorResult.ts +2 -2
- package/utils/abi/encodeEventTopics.ts +2 -2
- package/utils/abi/encodeFunctionData.ts +2 -2
- package/utils/abi/encodeFunctionResult.ts +2 -2
- package/utils/abi/formatAbiItem.ts +2 -2
- package/utils/abi/formatAbiItemWithArgs.ts +2 -2
- package/utils/address/getAddress.ts +4 -1
- package/utils/address/getContractAddress.ts +1 -1
- package/utils/address/isAddress.ts +1 -1
- package/utils/blob/commitmentToVersionedHash.ts +1 -1
- package/utils/blob/commitmentsToVersionedHashes.ts +1 -1
- package/utils/blob/sidecarsToVersionedHashes.ts +1 -1
- package/utils/chain/assertCurrentChain.ts +1 -1
- package/utils/chain/getChainContractAddress.ts +1 -1
- package/utils/cursor.ts +1 -1
- package/utils/data/isHex.ts +1 -1
- package/utils/data/pad.ts +2 -2
- package/utils/data/slice.ts +15 -11
- package/utils/data/trim.ts +1 -1
- package/utils/encoding/fromBytes.ts +5 -5
- package/utils/encoding/fromHex.ts +5 -5
- package/utils/encoding/toBytes.ts +8 -5
- package/utils/encoding/toHex.ts +7 -7
- package/utils/ens/avatar/parseAvatarRecord.ts +2 -2
- package/utils/errors/getCallError.ts +2 -2
- package/utils/errors/getContractError.ts +3 -3
- package/utils/errors/getEstimateGasError.ts +3 -3
- package/utils/errors/getNodeError.ts +4 -1
- package/utils/errors/getTransactionError.ts +2 -2
- package/utils/formatters/block.ts +2 -2
- package/utils/formatters/extract.ts +1 -1
- package/utils/formatters/formatter.ts +1 -1
- package/utils/formatters/log.ts +6 -2
- package/utils/formatters/proof.ts +2 -1
- package/utils/formatters/transaction.ts +2 -2
- package/utils/formatters/transactionReceipt.ts +2 -1
- package/utils/formatters/transactionRequest.ts +4 -1
- package/utils/hash/keccak256.ts +1 -1
- package/utils/hash/ripemd160.ts +1 -1
- package/utils/hash/sha256.ts +1 -1
- package/utils/poll.ts +2 -2
- package/utils/promise/createBatchScheduler.ts +6 -6
- package/utils/promise/withCache.ts +1 -1
- package/utils/promise/withRetry.ts +14 -9
- package/utils/promise/withTimeout.ts +6 -4
- package/utils/rpc/http.ts +7 -7
- package/utils/rpc/socket.ts +2 -2
- package/utils/signature/hashMessage.ts +1 -1
- package/utils/transaction/assertRequest.ts +4 -1
- package/utils/transaction/getTransactionType.ts +10 -4
- package/utils/transaction/parseTransaction.ts +1 -1
- package/utils/transaction/serializeAccessList.ts +1 -1
- package/utils/transaction/serializeTransaction.ts +6 -6
- package/utils/typedData.ts +1 -1
@@ -20,13 +20,13 @@ export type OnResponseFn = (
|
|
20
20
|
transport: ReturnType<Transport>
|
21
21
|
} & (
|
22
22
|
| {
|
23
|
-
error?: never
|
23
|
+
error?: never | undefined
|
24
24
|
response: unknown
|
25
25
|
status: 'success'
|
26
26
|
}
|
27
27
|
| {
|
28
28
|
error: Error
|
29
|
-
response?: never
|
29
|
+
response?: never | undefined
|
30
30
|
status: 'error'
|
31
31
|
}
|
32
32
|
),
|
@@ -37,45 +37,47 @@ type RankOptions = {
|
|
37
37
|
* The polling interval (in ms) at which the ranker should ping the RPC URL.
|
38
38
|
* @default client.pollingInterval
|
39
39
|
*/
|
40
|
-
interval?: number
|
40
|
+
interval?: number | undefined
|
41
41
|
/**
|
42
42
|
* The number of previous samples to perform ranking on.
|
43
43
|
* @default 10
|
44
44
|
*/
|
45
|
-
sampleCount?: number
|
45
|
+
sampleCount?: number | undefined
|
46
46
|
/**
|
47
47
|
* Timeout when sampling transports.
|
48
48
|
* @default 1_000
|
49
49
|
*/
|
50
|
-
timeout?: number
|
50
|
+
timeout?: number | undefined
|
51
51
|
/**
|
52
52
|
* Weights to apply to the scores. Weight values are proportional.
|
53
53
|
*/
|
54
|
-
weights?:
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
54
|
+
weights?:
|
55
|
+
| {
|
56
|
+
/**
|
57
|
+
* The weight to apply to the latency score.
|
58
|
+
* @default 0.3
|
59
|
+
*/
|
60
|
+
latency?: number | undefined
|
61
|
+
/**
|
62
|
+
* The weight to apply to the stability score.
|
63
|
+
* @default 0.7
|
64
|
+
*/
|
65
|
+
stability?: number | undefined
|
66
|
+
}
|
67
|
+
| undefined
|
66
68
|
}
|
67
69
|
|
68
70
|
export type FallbackTransportConfig = {
|
69
71
|
/** The key of the Fallback transport. */
|
70
|
-
key?: TransportConfig['key']
|
72
|
+
key?: TransportConfig['key'] | undefined
|
71
73
|
/** The name of the Fallback transport. */
|
72
|
-
name?: TransportConfig['name']
|
74
|
+
name?: TransportConfig['name'] | undefined
|
73
75
|
/** Toggle to enable ranking, or rank options. */
|
74
|
-
rank?: boolean | RankOptions
|
76
|
+
rank?: boolean | RankOptions | undefined
|
75
77
|
/** The max number of times to retry. */
|
76
|
-
retryCount?: TransportConfig['retryCount']
|
78
|
+
retryCount?: TransportConfig['retryCount'] | undefined
|
77
79
|
/** The base delay (in ms) between retries. */
|
78
|
-
retryDelay?: TransportConfig['retryDelay']
|
80
|
+
retryDelay?: TransportConfig['retryDelay'] | undefined
|
79
81
|
}
|
80
82
|
|
81
83
|
export type FallbackTransport = Transport<
|
@@ -198,13 +200,13 @@ export function rankTransports({
|
|
198
200
|
transports,
|
199
201
|
weights = {},
|
200
202
|
}: {
|
201
|
-
chain?: Chain
|
203
|
+
chain?: Chain | undefined
|
202
204
|
interval: RankOptions['interval']
|
203
205
|
onTransports: (transports: Transport[]) => void
|
204
|
-
sampleCount?: RankOptions['sampleCount']
|
205
|
-
timeout?: RankOptions['timeout']
|
206
|
+
sampleCount?: RankOptions['sampleCount'] | undefined
|
207
|
+
timeout?: RankOptions['timeout'] | undefined
|
206
208
|
transports: Transport[]
|
207
|
-
weights?: RankOptions['weights']
|
209
|
+
weights?: RankOptions['weights'] | undefined
|
208
210
|
}) {
|
209
211
|
const { stability: stabilityWeight = 0.7, latency: latencyWeight = 0.3 } =
|
210
212
|
weights
|
@@ -20,9 +20,9 @@ import {
|
|
20
20
|
|
21
21
|
export type BatchOptions = {
|
22
22
|
/** The maximum number of JSON-RPC requests to send in a batch. @default 1_000 */
|
23
|
-
batchSize?: number
|
23
|
+
batchSize?: number | undefined
|
24
24
|
/** The maximum number of milliseconds to wait before sending a batch. @default 0 */
|
25
|
-
wait?: number
|
25
|
+
wait?: number | undefined
|
26
26
|
}
|
27
27
|
|
28
28
|
export type HttpTransportConfig = {
|
@@ -30,33 +30,33 @@ export type HttpTransportConfig = {
|
|
30
30
|
* Whether to enable Batch JSON-RPC.
|
31
31
|
* @link https://www.jsonrpc.org/specification#batch
|
32
32
|
*/
|
33
|
-
batch?: boolean | BatchOptions
|
33
|
+
batch?: boolean | BatchOptions | undefined
|
34
34
|
/**
|
35
35
|
* Request configuration to pass to `fetch`.
|
36
36
|
* @link https://developer.mozilla.org/en-US/docs/Web/API/fetch
|
37
37
|
*/
|
38
|
-
fetchOptions?: HttpRpcClientOptions['fetchOptions']
|
38
|
+
fetchOptions?: HttpRpcClientOptions['fetchOptions'] | undefined
|
39
39
|
/**
|
40
40
|
* A callback to handle the response from `fetch`.
|
41
41
|
*/
|
42
|
-
onFetchResponse?: HttpRpcClientOptions['onResponse']
|
42
|
+
onFetchResponse?: HttpRpcClientOptions['onResponse'] | undefined
|
43
43
|
/** The key of the HTTP transport. */
|
44
|
-
key?: TransportConfig['key']
|
44
|
+
key?: TransportConfig['key'] | undefined
|
45
45
|
/** The name of the HTTP transport. */
|
46
|
-
name?: TransportConfig['name']
|
46
|
+
name?: TransportConfig['name'] | undefined
|
47
47
|
/** The max number of times to retry. */
|
48
|
-
retryCount?: TransportConfig['retryCount']
|
48
|
+
retryCount?: TransportConfig['retryCount'] | undefined
|
49
49
|
/** The base delay (in ms) between retries. */
|
50
|
-
retryDelay?: TransportConfig['retryDelay']
|
50
|
+
retryDelay?: TransportConfig['retryDelay'] | undefined
|
51
51
|
/** The timeout (in ms) for the HTTP request. Default: 10_000 */
|
52
|
-
timeout?: TransportConfig['timeout']
|
52
|
+
timeout?: TransportConfig['timeout'] | undefined
|
53
53
|
}
|
54
54
|
|
55
55
|
export type HttpTransport = Transport<
|
56
56
|
'http',
|
57
57
|
{
|
58
|
-
fetchOptions?: HttpTransportConfig['fetchOptions']
|
59
|
-
url?: string
|
58
|
+
fetchOptions?: HttpTransportConfig['fetchOptions'] | undefined
|
59
|
+
url?: string | undefined
|
60
60
|
}
|
61
61
|
>
|
62
62
|
|
@@ -70,7 +70,7 @@ export type HttpTransportErrorType =
|
|
70
70
|
*/
|
71
71
|
export function http(
|
72
72
|
/** URL of the JSON-RPC API. Defaults to the chain's public RPC URL. */
|
73
|
-
url?: string,
|
73
|
+
url?: string | undefined,
|
74
74
|
config: HttpTransportConfig = {},
|
75
75
|
): HttpTransport {
|
76
76
|
const {
|
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
|
14
14
|
type IpcTransportSubscribeParameters = {
|
15
15
|
onData: (data: RpcResponse) => void
|
16
|
-
onError?: (error: any) => void
|
16
|
+
onError?: ((error: any) => void) | undefined
|
17
17
|
}
|
18
18
|
|
19
19
|
type IpcTransportSubscribeReturnType = {
|
@@ -35,15 +35,15 @@ type IpcTransportSubscribe = {
|
|
35
35
|
|
36
36
|
export type IpcTransportConfig = {
|
37
37
|
/** The key of the Ipc transport. */
|
38
|
-
key?: TransportConfig['key']
|
38
|
+
key?: TransportConfig['key'] | undefined
|
39
39
|
/** The name of the Ipc transport. */
|
40
|
-
name?: TransportConfig['name']
|
40
|
+
name?: TransportConfig['name'] | undefined
|
41
41
|
/** The max number of times to retry. */
|
42
|
-
retryCount?: TransportConfig['retryCount']
|
42
|
+
retryCount?: TransportConfig['retryCount'] | undefined
|
43
43
|
/** The base delay (in ms) between retries. */
|
44
|
-
retryDelay?: TransportConfig['retryDelay']
|
44
|
+
retryDelay?: TransportConfig['retryDelay'] | undefined
|
45
45
|
/** The timeout (in ms) for async Ipc requests. Default: 10_000 */
|
46
|
-
timeout?: TransportConfig['timeout']
|
46
|
+
timeout?: TransportConfig['timeout'] | undefined
|
47
47
|
}
|
48
48
|
|
49
49
|
export type IpcTransport = Transport<
|
@@ -18,7 +18,7 @@ import {
|
|
18
18
|
|
19
19
|
type WebSocketTransportSubscribeParameters = {
|
20
20
|
onData: (data: RpcResponse) => void
|
21
|
-
onError?: (error: any) => void
|
21
|
+
onError?: ((error: any) => void) | undefined
|
22
22
|
}
|
23
23
|
|
24
24
|
type WebSocketTransportSubscribeReturnType = {
|
@@ -40,15 +40,15 @@ type WebSocketTransportSubscribe = {
|
|
40
40
|
|
41
41
|
export type WebSocketTransportConfig = {
|
42
42
|
/** The key of the WebSocket transport. */
|
43
|
-
key?: TransportConfig['key']
|
43
|
+
key?: TransportConfig['key'] | undefined
|
44
44
|
/** The name of the WebSocket transport. */
|
45
|
-
name?: TransportConfig['name']
|
45
|
+
name?: TransportConfig['name'] | undefined
|
46
46
|
/** The max number of times to retry. */
|
47
|
-
retryCount?: TransportConfig['retryCount']
|
47
|
+
retryCount?: TransportConfig['retryCount'] | undefined
|
48
48
|
/** The base delay (in ms) between retries. */
|
49
|
-
retryDelay?: TransportConfig['retryDelay']
|
49
|
+
retryDelay?: TransportConfig['retryDelay'] | undefined
|
50
50
|
/** The timeout (in ms) for async WebSocket requests. Default: 10_000 */
|
51
|
-
timeout?: TransportConfig['timeout']
|
51
|
+
timeout?: TransportConfig['timeout'] | undefined
|
52
52
|
}
|
53
53
|
|
54
54
|
export type WebSocketTransport = Transport<
|
package/errors/abi.ts
CHANGED
@@ -198,7 +198,10 @@ export type AbiErrorNotFoundErrorType = AbiErrorNotFoundError & {
|
|
198
198
|
}
|
199
199
|
export class AbiErrorNotFoundError extends BaseError {
|
200
200
|
override name = 'AbiErrorNotFoundError'
|
201
|
-
constructor(
|
201
|
+
constructor(
|
202
|
+
errorName?: string | undefined,
|
203
|
+
{ docsPath }: { docsPath?: string | undefined } = {},
|
204
|
+
) {
|
202
205
|
super(
|
203
206
|
[
|
204
207
|
`Error ${errorName ? `"${errorName}" ` : ''}not found on ABI.`,
|
@@ -273,7 +276,10 @@ export type AbiEventNotFoundErrorType = AbiEventNotFoundError & {
|
|
273
276
|
}
|
274
277
|
export class AbiEventNotFoundError extends BaseError {
|
275
278
|
override name = 'AbiEventNotFoundError'
|
276
|
-
constructor(
|
279
|
+
constructor(
|
280
|
+
eventName?: string | undefined,
|
281
|
+
{ docsPath }: { docsPath?: string | undefined } = {},
|
282
|
+
) {
|
277
283
|
super(
|
278
284
|
[
|
279
285
|
`Event ${eventName ? `"${eventName}" ` : ''}not found on ABI.`,
|
@@ -291,7 +297,10 @@ export type AbiFunctionNotFoundErrorType = AbiFunctionNotFoundError & {
|
|
291
297
|
}
|
292
298
|
export class AbiFunctionNotFoundError extends BaseError {
|
293
299
|
override name = 'AbiFunctionNotFoundError'
|
294
|
-
constructor(
|
300
|
+
constructor(
|
301
|
+
functionName?: string | undefined,
|
302
|
+
{ docsPath }: { docsPath?: string | undefined } = {},
|
303
|
+
) {
|
295
304
|
super(
|
296
305
|
[
|
297
306
|
`Function ${functionName ? `"${functionName}" ` : ''}not found on ABI.`,
|
package/errors/account.ts
CHANGED
@@ -5,7 +5,7 @@ export type AccountNotFoundErrorType = AccountNotFoundError & {
|
|
5
5
|
}
|
6
6
|
export class AccountNotFoundError extends BaseError {
|
7
7
|
override name = 'AccountNotFoundError'
|
8
|
-
constructor({ docsPath }: { docsPath?: string } = {}) {
|
8
|
+
constructor({ docsPath }: { docsPath?: string | undefined } = {}) {
|
9
9
|
super(
|
10
10
|
[
|
11
11
|
'Could not find an Account to execute with this Action.',
|
package/errors/base.ts
CHANGED
@@ -1,25 +1,25 @@
|
|
1
1
|
import { getVersion } from './utils.js'
|
2
2
|
|
3
3
|
type BaseErrorParameters = {
|
4
|
-
docsPath?: string
|
5
|
-
docsSlug?: string
|
6
|
-
metaMessages?: string[]
|
4
|
+
docsPath?: string | undefined
|
5
|
+
docsSlug?: string | undefined
|
6
|
+
metaMessages?: string[] | undefined
|
7
7
|
} & (
|
8
8
|
| {
|
9
|
-
cause?: never
|
10
|
-
details?: string
|
9
|
+
cause?: never | undefined
|
10
|
+
details?: string | undefined
|
11
11
|
}
|
12
12
|
| {
|
13
|
-
cause: BaseError | Error
|
14
|
-
details?: never
|
13
|
+
cause: BaseError | Error | undefined
|
14
|
+
details?: never | undefined
|
15
15
|
}
|
16
16
|
)
|
17
17
|
|
18
18
|
export type BaseErrorType = BaseError & { name: 'ViemError' }
|
19
19
|
export class BaseError extends Error {
|
20
20
|
details: string
|
21
|
-
docsPath?: string
|
22
|
-
metaMessages?: string[]
|
21
|
+
docsPath?: string | undefined
|
22
|
+
metaMessages?: string[] | undefined
|
23
23
|
shortMessage: string
|
24
24
|
|
25
25
|
override name = 'ViemError'
|
@@ -68,7 +68,10 @@ export class BaseError extends Error {
|
|
68
68
|
}
|
69
69
|
}
|
70
70
|
|
71
|
-
function walk(
|
71
|
+
function walk(
|
72
|
+
err: unknown,
|
73
|
+
fn?: ((err: unknown) => boolean) | undefined,
|
74
|
+
): unknown {
|
72
75
|
if (fn?.(err)) return err
|
73
76
|
if (err && typeof err === 'object' && 'cause' in err)
|
74
77
|
return walk(err.cause, fn)
|
package/errors/block.ts
CHANGED
@@ -11,8 +11,8 @@ export class BlockNotFoundError extends BaseError {
|
|
11
11
|
blockHash,
|
12
12
|
blockNumber,
|
13
13
|
}: {
|
14
|
-
blockHash?: Hash
|
15
|
-
blockNumber?: bigint
|
14
|
+
blockHash?: Hash | undefined
|
15
|
+
blockNumber?: bigint | undefined
|
16
16
|
}) {
|
17
17
|
let identifier = 'Block'
|
18
18
|
if (blockHash) identifier = `Block at hash "${blockHash}"`
|
package/errors/chain.ts
CHANGED
@@ -13,9 +13,9 @@ export class ChainDoesNotSupportContract extends BaseError {
|
|
13
13
|
chain,
|
14
14
|
contract,
|
15
15
|
}: {
|
16
|
-
blockNumber?: bigint
|
16
|
+
blockNumber?: bigint | undefined
|
17
17
|
chain: Chain
|
18
|
-
contract: { name: string; blockCreated?: number }
|
18
|
+
contract: { name: string; blockCreated?: number | undefined }
|
19
19
|
}) {
|
20
20
|
super(
|
21
21
|
`Chain "${chain.name}" does not support contract "${contract.name}".`,
|
@@ -96,7 +96,7 @@ export type InvalidChainIdErrorType = InvalidChainIdError & {
|
|
96
96
|
export class InvalidChainIdError extends BaseError {
|
97
97
|
override name = 'InvalidChainIdError'
|
98
98
|
|
99
|
-
constructor({ chainId }: { chainId?: number }) {
|
99
|
+
constructor({ chainId }: { chainId?: number | undefined }) {
|
100
100
|
super(
|
101
101
|
typeof chainId === 'number'
|
102
102
|
? `Chain ID "${chainId}" is invalid.`
|
package/errors/contract.ts
CHANGED
@@ -44,7 +44,10 @@ export class CallExecutionError extends BaseError {
|
|
44
44
|
to,
|
45
45
|
value,
|
46
46
|
stateOverride,
|
47
|
-
}: CallParameters & {
|
47
|
+
}: CallParameters & {
|
48
|
+
chain?: Chain | undefined
|
49
|
+
docsPath?: string | undefined
|
50
|
+
},
|
48
51
|
) {
|
49
52
|
const account = account_ ? parseAccount(account_) : undefined
|
50
53
|
let prettyArgs = prettyPrint({
|
@@ -89,12 +92,12 @@ export type ContractFunctionExecutionErrorType =
|
|
89
92
|
}
|
90
93
|
export class ContractFunctionExecutionError extends BaseError {
|
91
94
|
abi: Abi
|
92
|
-
args?: unknown[]
|
95
|
+
args?: unknown[] | undefined
|
93
96
|
override cause: BaseError
|
94
|
-
contractAddress?: Address
|
95
|
-
formattedArgs?: string
|
97
|
+
contractAddress?: Address | undefined
|
98
|
+
formattedArgs?: string | undefined
|
96
99
|
functionName: string
|
97
|
-
sender?: Address
|
100
|
+
sender?: Address | undefined
|
98
101
|
|
99
102
|
override name = 'ContractFunctionExecutionError'
|
100
103
|
|
@@ -109,11 +112,11 @@ export class ContractFunctionExecutionError extends BaseError {
|
|
109
112
|
sender,
|
110
113
|
}: {
|
111
114
|
abi: Abi
|
112
|
-
args?: any
|
113
|
-
contractAddress?: Address
|
114
|
-
docsPath?: string
|
115
|
+
args?: any | undefined
|
116
|
+
contractAddress?: Address | undefined
|
117
|
+
docsPath?: string | undefined
|
115
118
|
functionName: string
|
116
|
-
sender?: Address
|
119
|
+
sender?: Address | undefined
|
117
120
|
},
|
118
121
|
) {
|
119
122
|
const abiItem = getAbiItem({ abi, args, name: functionName })
|
@@ -170,16 +173,21 @@ export type ContractFunctionRevertedErrorType =
|
|
170
173
|
export class ContractFunctionRevertedError extends BaseError {
|
171
174
|
override name = 'ContractFunctionRevertedError'
|
172
175
|
|
173
|
-
data?: DecodeErrorResultReturnType
|
174
|
-
reason?: string
|
175
|
-
signature?: Hex
|
176
|
+
data?: DecodeErrorResultReturnType | undefined
|
177
|
+
reason?: string | undefined
|
178
|
+
signature?: Hex | undefined
|
176
179
|
|
177
180
|
constructor({
|
178
181
|
abi,
|
179
182
|
data,
|
180
183
|
functionName,
|
181
184
|
message,
|
182
|
-
}: {
|
185
|
+
}: {
|
186
|
+
abi: Abi
|
187
|
+
data?: Hex | undefined
|
188
|
+
functionName: string
|
189
|
+
message?: string | undefined
|
190
|
+
}) {
|
183
191
|
let cause: Error | undefined
|
184
192
|
let decodedData: DecodeErrorResultReturnType | undefined = undefined
|
185
193
|
let metaMessages: string[] | undefined
|
@@ -277,12 +285,15 @@ export class RawContractError extends BaseError {
|
|
277
285
|
code = 3
|
278
286
|
override name = 'RawContractError'
|
279
287
|
|
280
|
-
data?: Hex | { data?: Hex }
|
288
|
+
data?: Hex | { data?: Hex | undefined } | undefined
|
281
289
|
|
282
290
|
constructor({
|
283
291
|
data,
|
284
292
|
message,
|
285
|
-
}: {
|
293
|
+
}: {
|
294
|
+
data?: Hex | { data?: Hex | undefined } | undefined
|
295
|
+
message?: string | undefined
|
296
|
+
}) {
|
286
297
|
super(message || '')
|
287
298
|
this.data = data
|
288
299
|
}
|
package/errors/encoding.ts
CHANGED
@@ -14,10 +14,10 @@ export class IntegerOutOfRangeError extends BaseError {
|
|
14
14
|
size,
|
15
15
|
value,
|
16
16
|
}: {
|
17
|
-
max?: string
|
17
|
+
max?: string | undefined
|
18
18
|
min: string
|
19
|
-
signed?: boolean
|
20
|
-
size?: number
|
19
|
+
signed?: boolean | undefined
|
20
|
+
size?: number | undefined
|
21
21
|
value: string
|
22
22
|
}) {
|
23
23
|
super(
|
package/errors/estimateGas.ts
CHANGED
@@ -30,9 +30,9 @@ export class EstimateGasExecutionError extends BaseError {
|
|
30
30
|
to,
|
31
31
|
value,
|
32
32
|
}: Omit<EstimateGasParameters<any>, 'account'> & {
|
33
|
-
account?: Account
|
34
|
-
chain?: Chain
|
35
|
-
docsPath?: string
|
33
|
+
account?: Account | undefined
|
34
|
+
chain?: Chain | undefined
|
35
|
+
docsPath?: string | undefined
|
36
36
|
},
|
37
37
|
) {
|
38
38
|
const prettyArgs = prettyPrint({
|
package/errors/node.ts
CHANGED
@@ -24,7 +24,7 @@ export class ExecutionRevertedError extends BaseError {
|
|
24
24
|
constructor({
|
25
25
|
cause,
|
26
26
|
message,
|
27
|
-
}: { cause?: BaseError; message?: string } = {}) {
|
27
|
+
}: { cause?: BaseError | undefined; message?: string | undefined } = {}) {
|
28
28
|
const reason = message
|
29
29
|
?.replace('execution reverted: ', '')
|
30
30
|
?.replace('execution reverted', '')
|
@@ -49,7 +49,10 @@ export class FeeCapTooHighError extends BaseError {
|
|
49
49
|
constructor({
|
50
50
|
cause,
|
51
51
|
maxFeePerGas,
|
52
|
-
}: {
|
52
|
+
}: {
|
53
|
+
cause?: BaseError | undefined
|
54
|
+
maxFeePerGas?: bigint | undefined
|
55
|
+
} = {}) {
|
53
56
|
super(
|
54
57
|
`The fee cap (\`maxFeePerGas\`${
|
55
58
|
maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)} gwei` : ''
|
@@ -71,7 +74,10 @@ export class FeeCapTooLowError extends BaseError {
|
|
71
74
|
constructor({
|
72
75
|
cause,
|
73
76
|
maxFeePerGas,
|
74
|
-
}: {
|
77
|
+
}: {
|
78
|
+
cause?: BaseError | undefined
|
79
|
+
maxFeePerGas?: bigint | undefined
|
80
|
+
} = {}) {
|
75
81
|
super(
|
76
82
|
`The fee cap (\`maxFeePerGas\`${
|
77
83
|
maxFeePerGas ? ` = ${formatGwei(maxFeePerGas)}` : ''
|
@@ -89,7 +95,10 @@ export type NonceTooHighErrorType = NonceTooHighError & {
|
|
89
95
|
export class NonceTooHighError extends BaseError {
|
90
96
|
static nodeMessage = /nonce too high/
|
91
97
|
override name = 'NonceTooHighError'
|
92
|
-
constructor({
|
98
|
+
constructor({
|
99
|
+
cause,
|
100
|
+
nonce,
|
101
|
+
}: { cause?: BaseError | undefined; nonce?: number | undefined } = {}) {
|
93
102
|
super(
|
94
103
|
`Nonce provided for the transaction ${
|
95
104
|
nonce ? `(${nonce}) ` : ''
|
@@ -106,7 +115,10 @@ export class NonceTooLowError extends BaseError {
|
|
106
115
|
static nodeMessage =
|
107
116
|
/nonce too low|transaction already imported|already known/
|
108
117
|
override name = 'NonceTooLowError'
|
109
|
-
constructor({
|
118
|
+
constructor({
|
119
|
+
cause,
|
120
|
+
nonce,
|
121
|
+
}: { cause?: BaseError | undefined; nonce?: number | undefined } = {}) {
|
110
122
|
super(
|
111
123
|
[
|
112
124
|
`Nonce provided for the transaction ${
|
@@ -125,7 +137,10 @@ export type NonceMaxValueErrorType = NonceMaxValueError & {
|
|
125
137
|
export class NonceMaxValueError extends BaseError {
|
126
138
|
static nodeMessage = /nonce has max value/
|
127
139
|
override name = 'NonceMaxValueError'
|
128
|
-
constructor({
|
140
|
+
constructor({
|
141
|
+
cause,
|
142
|
+
nonce,
|
143
|
+
}: { cause?: BaseError | undefined; nonce?: number | undefined } = {}) {
|
129
144
|
super(
|
130
145
|
`Nonce provided for the transaction ${
|
131
146
|
nonce ? `(${nonce}) ` : ''
|
@@ -141,7 +156,7 @@ export type InsufficientFundsErrorType = InsufficientFundsError & {
|
|
141
156
|
export class InsufficientFundsError extends BaseError {
|
142
157
|
static nodeMessage = /insufficient funds/
|
143
158
|
override name = 'InsufficientFundsError'
|
144
|
-
constructor({ cause }: { cause?: BaseError } = {}) {
|
159
|
+
constructor({ cause }: { cause?: BaseError | undefined } = {}) {
|
145
160
|
super(
|
146
161
|
[
|
147
162
|
'The total cost (gas * gas fee + value) of executing this transaction exceeds the balance of the account.',
|
@@ -169,7 +184,10 @@ export type IntrinsicGasTooHighErrorType = IntrinsicGasTooHighError & {
|
|
169
184
|
export class IntrinsicGasTooHighError extends BaseError {
|
170
185
|
static nodeMessage = /intrinsic gas too high|gas limit reached/
|
171
186
|
override name = 'IntrinsicGasTooHighError'
|
172
|
-
constructor({
|
187
|
+
constructor({
|
188
|
+
cause,
|
189
|
+
gas,
|
190
|
+
}: { cause?: BaseError | undefined; gas?: bigint | undefined } = {}) {
|
173
191
|
super(
|
174
192
|
`The amount of gas ${
|
175
193
|
gas ? `(${gas}) ` : ''
|
@@ -187,7 +205,10 @@ export type IntrinsicGasTooLowErrorType = IntrinsicGasTooLowError & {
|
|
187
205
|
export class IntrinsicGasTooLowError extends BaseError {
|
188
206
|
static nodeMessage = /intrinsic gas too low/
|
189
207
|
override name = 'IntrinsicGasTooLowError'
|
190
|
-
constructor({
|
208
|
+
constructor({
|
209
|
+
cause,
|
210
|
+
gas,
|
211
|
+
}: { cause?: BaseError | undefined; gas?: bigint | undefined } = {}) {
|
191
212
|
super(
|
192
213
|
`The amount of gas ${
|
193
214
|
gas ? `(${gas}) ` : ''
|
@@ -206,7 +227,7 @@ export type TransactionTypeNotSupportedErrorType =
|
|
206
227
|
export class TransactionTypeNotSupportedError extends BaseError {
|
207
228
|
static nodeMessage = /transaction type not valid/
|
208
229
|
override name = 'TransactionTypeNotSupportedError'
|
209
|
-
constructor({ cause }: { cause?: BaseError }) {
|
230
|
+
constructor({ cause }: { cause?: BaseError | undefined }) {
|
210
231
|
super('The transaction type is not supported for this chain.', {
|
211
232
|
cause,
|
212
233
|
})
|
@@ -225,9 +246,9 @@ export class TipAboveFeeCapError extends BaseError {
|
|
225
246
|
maxPriorityFeePerGas,
|
226
247
|
maxFeePerGas,
|
227
248
|
}: {
|
228
|
-
cause?: BaseError
|
229
|
-
maxPriorityFeePerGas?: bigint
|
230
|
-
maxFeePerGas?: bigint
|
249
|
+
cause?: BaseError | undefined
|
250
|
+
maxPriorityFeePerGas?: bigint | undefined
|
251
|
+
maxFeePerGas?: bigint | undefined
|
231
252
|
} = {}) {
|
232
253
|
super(
|
233
254
|
[
|
@@ -252,7 +273,7 @@ export type UnknownNodeErrorType = UnknownNodeError & {
|
|
252
273
|
export class UnknownNodeError extends BaseError {
|
253
274
|
override name = 'UnknownNodeError'
|
254
275
|
|
255
|
-
constructor({ cause }: { cause?: BaseError }) {
|
276
|
+
constructor({ cause }: { cause?: BaseError | undefined }) {
|
256
277
|
super(`An error occurred while executing: ${cause?.shortMessage}`, {
|
257
278
|
cause,
|
258
279
|
})
|
package/errors/request.ts
CHANGED
@@ -9,9 +9,9 @@ export type HttpRequestErrorType = HttpRequestError & {
|
|
9
9
|
export class HttpRequestError extends BaseError {
|
10
10
|
override name = 'HttpRequestError'
|
11
11
|
|
12
|
-
body?: { [x: string]: unknown } | { [y: string]: unknown }[]
|
13
|
-
headers?: Headers
|
14
|
-
status?: number
|
12
|
+
body?: { [x: string]: unknown } | { [y: string]: unknown }[] | undefined
|
13
|
+
headers?: Headers | undefined
|
14
|
+
status?: number | undefined
|
15
15
|
url: string
|
16
16
|
|
17
17
|
constructor({
|
@@ -21,10 +21,10 @@ export class HttpRequestError extends BaseError {
|
|
21
21
|
status,
|
22
22
|
url,
|
23
23
|
}: {
|
24
|
-
body?: { [x: string]: unknown } | { [y: string]: unknown }[]
|
25
|
-
details?: string
|
26
|
-
headers?: Headers
|
27
|
-
status?: number
|
24
|
+
body?: { [x: string]: unknown } | { [y: string]: unknown }[] | undefined
|
25
|
+
details?: string | undefined
|
26
|
+
headers?: Headers | undefined
|
27
|
+
status?: number | undefined
|
28
28
|
url: string
|
29
29
|
}) {
|
30
30
|
super('HTTP request failed.', {
|
package/errors/rpc.ts
CHANGED
@@ -21,9 +21,9 @@ export type RpcErrorCode =
|
|
21
21
|
| -32042 // Method not found
|
22
22
|
|
23
23
|
type RpcErrorOptions<TCode extends number = RpcErrorCode> = {
|
24
|
-
code?: TCode | (number & {})
|
25
|
-
docsPath?: string
|
26
|
-
metaMessages?: string[]
|
24
|
+
code?: TCode | (number & {}) | undefined
|
25
|
+
docsPath?: string | undefined
|
26
|
+
metaMessages?: string[] | undefined
|
27
27
|
shortMessage: string
|
28
28
|
}
|
29
29
|
|
@@ -76,13 +76,13 @@ export class ProviderRpcError<
|
|
76
76
|
> extends RpcError<ProviderRpcErrorCode> {
|
77
77
|
override name = 'ProviderRpcError'
|
78
78
|
|
79
|
-
data?: T
|
79
|
+
data?: T | undefined
|
80
80
|
|
81
81
|
constructor(
|
82
82
|
cause: Error,
|
83
83
|
options: Prettify<
|
84
84
|
RpcErrorOptions<ProviderRpcErrorCode> & {
|
85
|
-
data?: T
|
85
|
+
data?: T | undefined
|
86
86
|
}
|
87
87
|
>,
|
88
88
|
) {
|