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
@@ -33,7 +33,7 @@ export type FromHexParameters<
|
|
33
33
|
| TTo
|
34
34
|
| {
|
35
35
|
/** Size (in bytes) of the hex value. */
|
36
|
-
size?: number
|
36
|
+
size?: number | undefined
|
37
37
|
/** Type to convert to. */
|
38
38
|
to: TTo
|
39
39
|
}
|
@@ -101,9 +101,9 @@ export function fromHex<
|
|
101
101
|
|
102
102
|
export type HexToBigIntOpts = {
|
103
103
|
/** Whether or not the number of a signed representation. */
|
104
|
-
signed?: boolean
|
104
|
+
signed?: boolean | undefined
|
105
105
|
/** Size (in bytes) of the hex value. */
|
106
|
-
size?: number
|
106
|
+
size?: number | undefined
|
107
107
|
}
|
108
108
|
|
109
109
|
export type HexToBigIntErrorType = AssertSizeErrorType | ErrorType
|
@@ -144,7 +144,7 @@ export function hexToBigInt(hex: Hex, opts: HexToBigIntOpts = {}): bigint {
|
|
144
144
|
|
145
145
|
export type HexToBoolOpts = {
|
146
146
|
/** Size (in bytes) of the hex value. */
|
147
|
-
size?: number
|
147
|
+
size?: number | undefined
|
148
148
|
}
|
149
149
|
|
150
150
|
export type HexToBoolErrorType =
|
@@ -212,7 +212,7 @@ export function hexToNumber(hex: Hex, opts: HexToNumberOpts = {}): number {
|
|
212
212
|
|
213
213
|
export type HexToStringOpts = {
|
214
214
|
/** Size (in bytes) of the hex value. */
|
215
|
-
size?: number
|
215
|
+
size?: number | undefined
|
216
216
|
}
|
217
217
|
|
218
218
|
export type HexToStringErrorType =
|
@@ -15,7 +15,7 @@ const encoder = /*#__PURE__*/ new TextEncoder()
|
|
15
15
|
|
16
16
|
export type ToBytesParameters = {
|
17
17
|
/** Size of the output bytes. */
|
18
|
-
size?: number
|
18
|
+
size?: number | undefined
|
19
19
|
}
|
20
20
|
|
21
21
|
export type ToBytesErrorType =
|
@@ -64,7 +64,7 @@ export function toBytes(
|
|
64
64
|
|
65
65
|
export type BoolToBytesOpts = {
|
66
66
|
/** Size of the output bytes. */
|
67
|
-
size?: number
|
67
|
+
size?: number | undefined
|
68
68
|
}
|
69
69
|
|
70
70
|
export type BoolToBytesErrorType =
|
@@ -123,7 +123,7 @@ function charCodeToBase16(char: number) {
|
|
123
123
|
|
124
124
|
export type HexToBytesOpts = {
|
125
125
|
/** Size of the output bytes. */
|
126
|
-
size?: number
|
126
|
+
size?: number | undefined
|
127
127
|
}
|
128
128
|
|
129
129
|
export type HexToBytesErrorType = AssertSizeErrorType | PadErrorType | ErrorType
|
@@ -198,14 +198,17 @@ export type NumberToBytesErrorType =
|
|
198
198
|
* const data = numberToBytes(420, { size: 4 })
|
199
199
|
* // Uint8Array([0, 0, 1, 164])
|
200
200
|
*/
|
201
|
-
export function numberToBytes(
|
201
|
+
export function numberToBytes(
|
202
|
+
value: bigint | number,
|
203
|
+
opts?: NumberToHexOpts | undefined,
|
204
|
+
) {
|
202
205
|
const hex = numberToHex(value, opts)
|
203
206
|
return hexToBytes(hex)
|
204
207
|
}
|
205
208
|
|
206
209
|
export type StringToBytesOpts = {
|
207
210
|
/** Size of the output bytes. */
|
208
|
-
size?: number
|
211
|
+
size?: number | undefined
|
209
212
|
}
|
210
213
|
|
211
214
|
export type StringToBytesErrorType =
|
package/utils/encoding/toHex.ts
CHANGED
@@ -14,7 +14,7 @@ const hexes = /*#__PURE__*/ Array.from({ length: 256 }, (_v, i) =>
|
|
14
14
|
|
15
15
|
export type ToHexParameters = {
|
16
16
|
/** The size (in bytes) of the output hex value. */
|
17
|
-
size?: number
|
17
|
+
size?: number | undefined
|
18
18
|
}
|
19
19
|
|
20
20
|
export type ToHexErrorType =
|
@@ -64,7 +64,7 @@ export function toHex(
|
|
64
64
|
|
65
65
|
export type BoolToHexOpts = {
|
66
66
|
/** The size (in bytes) of the output hex value. */
|
67
|
-
size?: number
|
67
|
+
size?: number | undefined
|
68
68
|
}
|
69
69
|
|
70
70
|
export type BoolToHexErrorType = AssertSizeErrorType | PadErrorType | ErrorType
|
@@ -104,7 +104,7 @@ export function boolToHex(value: boolean, opts: BoolToHexOpts = {}): Hex {
|
|
104
104
|
|
105
105
|
export type BytesToHexOpts = {
|
106
106
|
/** The size (in bytes) of the output hex value. */
|
107
|
-
size?: number
|
107
|
+
size?: number | undefined
|
108
108
|
}
|
109
109
|
|
110
110
|
export type BytesToHexErrorType = AssertSizeErrorType | PadErrorType | ErrorType
|
@@ -145,14 +145,14 @@ export function bytesToHex(value: ByteArray, opts: BytesToHexOpts = {}): Hex {
|
|
145
145
|
export type NumberToHexOpts =
|
146
146
|
| {
|
147
147
|
/** Whether or not the number of a signed representation. */
|
148
|
-
signed?: boolean
|
148
|
+
signed?: boolean | undefined
|
149
149
|
/** The size (in bytes) of the output hex value. */
|
150
150
|
size: number
|
151
151
|
}
|
152
152
|
| {
|
153
|
-
signed?: never
|
153
|
+
signed?: never | undefined
|
154
154
|
/** The size (in bytes) of the output hex value. */
|
155
|
-
size?: number
|
155
|
+
size?: number | undefined
|
156
156
|
}
|
157
157
|
|
158
158
|
export type NumberToHexErrorType =
|
@@ -218,7 +218,7 @@ export function numberToHex(
|
|
218
218
|
|
219
219
|
export type StringToHexOpts = {
|
220
220
|
/** The size (in bytes) of the output hex value. */
|
221
|
-
size?: number
|
221
|
+
size?: number | undefined
|
222
222
|
}
|
223
223
|
|
224
224
|
export type StringToHexErrorType = BytesToHexErrorType | ErrorType
|
@@ -30,7 +30,7 @@ export async function parseAvatarRecord<TChain extends Chain | undefined>(
|
|
30
30
|
gatewayUrls,
|
31
31
|
record,
|
32
32
|
}: {
|
33
|
-
gatewayUrls?: AssetGatewayUrls
|
33
|
+
gatewayUrls?: AssetGatewayUrls | undefined
|
34
34
|
record: string
|
35
35
|
},
|
36
36
|
): Promise<string> {
|
@@ -54,7 +54,7 @@ async function parseNftAvatarUri<TChain extends Chain | undefined>(
|
|
54
54
|
gatewayUrls,
|
55
55
|
record,
|
56
56
|
}: {
|
57
|
-
gatewayUrls?: AssetGatewayUrls
|
57
|
+
gatewayUrls?: AssetGatewayUrls | undefined
|
58
58
|
record: string
|
59
59
|
},
|
60
60
|
): Promise<string> {
|
@@ -27,8 +27,8 @@ export function getCallError<err extends ErrorType<string>>(
|
|
27
27
|
docsPath,
|
28
28
|
...args
|
29
29
|
}: CallParameters & {
|
30
|
-
chain?: Chain
|
31
|
-
docsPath?: string
|
30
|
+
chain?: Chain | undefined
|
31
|
+
docsPath?: string | undefined
|
32
32
|
},
|
33
33
|
): GetCallErrorReturnType<err> {
|
34
34
|
const cause = (() => {
|
@@ -38,10 +38,10 @@ export function getContractError<err extends ErrorType<string>>(
|
|
38
38
|
}: {
|
39
39
|
abi: Abi
|
40
40
|
args: any
|
41
|
-
address?: Address
|
42
|
-
docsPath?: string
|
41
|
+
address?: Address | undefined
|
42
|
+
docsPath?: string | undefined
|
43
43
|
functionName: string
|
44
|
-
sender?: Address
|
44
|
+
sender?: Address | undefined
|
45
45
|
},
|
46
46
|
): GetContractErrorReturnType {
|
47
47
|
const { code, data, message, shortMessage } = (
|
@@ -26,9 +26,9 @@ export function getEstimateGasError<err extends ErrorType<string>>(
|
|
26
26
|
docsPath,
|
27
27
|
...args
|
28
28
|
}: Omit<EstimateGasParameters, 'account'> & {
|
29
|
-
account?: Account
|
30
|
-
chain?: Chain
|
31
|
-
docsPath?: string
|
29
|
+
account?: Account | undefined
|
30
|
+
chain?: Chain | undefined
|
31
|
+
docsPath?: string | undefined
|
32
32
|
},
|
33
33
|
): GetEstimateGasErrorReturnType<err> {
|
34
34
|
const cause = (() => {
|
@@ -31,6 +31,7 @@ import {
|
|
31
31
|
InvalidInputRpcError,
|
32
32
|
TransactionRejectedRpcError,
|
33
33
|
} from '../../errors/rpc.js'
|
34
|
+
import type { ExactPartial } from '../../types/utils.js'
|
34
35
|
|
35
36
|
export function containsNodeError(err: BaseError) {
|
36
37
|
return (
|
@@ -40,7 +41,9 @@ export function containsNodeError(err: BaseError) {
|
|
40
41
|
)
|
41
42
|
}
|
42
43
|
|
43
|
-
export type GetNodeErrorParameters =
|
44
|
+
export type GetNodeErrorParameters = ExactPartial<
|
45
|
+
SendTransactionParameters<any>
|
46
|
+
>
|
44
47
|
|
45
48
|
export type GetNodeErrorReturnType =
|
46
49
|
| ExecutionRevertedErrorType
|
@@ -20,8 +20,8 @@ export type GetTransactionErrorParameters = Omit<
|
|
20
20
|
'account' | 'chain'
|
21
21
|
> & {
|
22
22
|
account: Account
|
23
|
-
chain?: Chain
|
24
|
-
docsPath?: string
|
23
|
+
chain?: Chain | undefined
|
24
|
+
docsPath?: string | undefined
|
25
25
|
}
|
26
26
|
|
27
27
|
export type GetTransactionErrorReturnType<cause = ErrorType> = Omit<
|
@@ -7,7 +7,7 @@ import type {
|
|
7
7
|
} from '../../types/chain.js'
|
8
8
|
import type { Hash } from '../../types/misc.js'
|
9
9
|
import type { RpcBlock } from '../../types/rpc.js'
|
10
|
-
import type { Prettify } from '../../types/utils.js'
|
10
|
+
import type { ExactPartial, Prettify } from '../../types/utils.js'
|
11
11
|
|
12
12
|
import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
|
13
13
|
import { type FormattedTransaction, formatTransaction } from './transaction.js'
|
@@ -40,7 +40,7 @@ export type FormattedBlock<
|
|
40
40
|
|
41
41
|
export type FormatBlockErrorType = ErrorType
|
42
42
|
|
43
|
-
export function formatBlock(block:
|
43
|
+
export function formatBlock(block: ExactPartial<RpcBlock>) {
|
44
44
|
const transactions = block.transactions?.map((transaction) => {
|
45
45
|
if (typeof transaction === 'string') return transaction
|
46
46
|
return formatTransaction(transaction)
|
@@ -8,7 +8,7 @@ export type ExtractErrorType = ErrorType
|
|
8
8
|
*/
|
9
9
|
export function extract(
|
10
10
|
value_: Record<string, unknown>,
|
11
|
-
{ format }: { format?: ChainFormatter['format'] },
|
11
|
+
{ format }: { format?: ChainFormatter['format'] | undefined },
|
12
12
|
) {
|
13
13
|
if (!format) return {}
|
14
14
|
|
@@ -15,7 +15,7 @@ export function defineFormatter<TType extends string, TParameters, TReturnType>(
|
|
15
15
|
exclude,
|
16
16
|
format: overrides,
|
17
17
|
}: {
|
18
|
-
exclude?: TExclude
|
18
|
+
exclude?: TExclude | undefined
|
19
19
|
format: (_: TOverrideParameters) => TOverrideReturnType
|
20
20
|
}) => {
|
21
21
|
return {
|
package/utils/formatters/log.ts
CHANGED
@@ -1,12 +1,16 @@
|
|
1
1
|
import type { ErrorType } from '../../errors/utils.js'
|
2
2
|
import type { Log } from '../../types/log.js'
|
3
3
|
import type { RpcLog } from '../../types/rpc.js'
|
4
|
+
import type { ExactPartial } from '../../types/utils.js'
|
4
5
|
|
5
6
|
export type FormatLogErrorType = ErrorType
|
6
7
|
|
7
8
|
export function formatLog(
|
8
|
-
log:
|
9
|
-
{
|
9
|
+
log: ExactPartial<RpcLog>,
|
10
|
+
{
|
11
|
+
args,
|
12
|
+
eventName,
|
13
|
+
}: { args?: unknown | undefined; eventName?: string | undefined } = {},
|
10
14
|
) {
|
11
15
|
return {
|
12
16
|
...log,
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import type { ErrorType } from '../../errors/utils.js'
|
2
2
|
import type { Proof } from '../../types/proof.js'
|
3
3
|
import type { RpcProof } from '../../types/rpc.js'
|
4
|
+
import type { ExactPartial } from '../../types/utils.js'
|
4
5
|
import { hexToNumber } from '../index.js'
|
5
6
|
|
6
7
|
export type FormatProofErrorType = ErrorType
|
@@ -12,7 +13,7 @@ function formatStorageProof(storageProof: RpcProof['storageProof']) {
|
|
12
13
|
}))
|
13
14
|
}
|
14
15
|
|
15
|
-
export function formatProof(proof:
|
16
|
+
export function formatProof(proof: ExactPartial<RpcProof>) {
|
16
17
|
return {
|
17
18
|
...proof,
|
18
19
|
balance: proof.balance ? BigInt(proof.balance) : undefined,
|
@@ -8,7 +8,7 @@ import type {
|
|
8
8
|
import type { Hex } from '../../types/misc.js'
|
9
9
|
import type { RpcTransaction } from '../../types/rpc.js'
|
10
10
|
import type { Transaction, TransactionType } from '../../types/transaction.js'
|
11
|
-
import type { UnionLooseOmit } from '../../types/utils.js'
|
11
|
+
import type { ExactPartial, UnionLooseOmit } from '../../types/utils.js'
|
12
12
|
import { hexToNumber } from '../encoding/fromHex.js'
|
13
13
|
import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
|
14
14
|
|
@@ -43,7 +43,7 @@ export const transactionType = {
|
|
43
43
|
|
44
44
|
export type FormatTransactionErrorType = ErrorType
|
45
45
|
|
46
|
-
export function formatTransaction(transaction:
|
46
|
+
export function formatTransaction(transaction: ExactPartial<RpcTransaction>) {
|
47
47
|
const transaction_ = {
|
48
48
|
...transaction,
|
49
49
|
blockHash: transaction.blockHash ? transaction.blockHash : null,
|
@@ -5,6 +5,7 @@ import type {
|
|
5
5
|
} from '../../types/chain.js'
|
6
6
|
import type { RpcTransactionReceipt } from '../../types/rpc.js'
|
7
7
|
import type { TransactionReceipt } from '../../types/transaction.js'
|
8
|
+
import type { ExactPartial } from '../../types/utils.js'
|
8
9
|
import { hexToNumber } from '../encoding/fromHex.js'
|
9
10
|
|
10
11
|
import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
|
@@ -27,7 +28,7 @@ const statuses = {
|
|
27
28
|
export type FormatTransactionReceiptErrorType = ErrorType
|
28
29
|
|
29
30
|
export function formatTransactionReceipt(
|
30
|
-
transactionReceipt:
|
31
|
+
transactionReceipt: ExactPartial<RpcTransactionReceipt>,
|
31
32
|
) {
|
32
33
|
const receipt = {
|
33
34
|
...transactionReceipt,
|
@@ -6,6 +6,7 @@ import type {
|
|
6
6
|
import type { ByteArray } from '../../types/misc.js'
|
7
7
|
import type { RpcTransactionRequest } from '../../types/rpc.js'
|
8
8
|
import type { TransactionRequest } from '../../types/transaction.js'
|
9
|
+
import type { ExactPartial } from '../../types/utils.js'
|
9
10
|
import { bytesToHex, numberToHex } from '../encoding/toHex.js'
|
10
11
|
import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
|
11
12
|
|
@@ -26,7 +27,9 @@ export const rpcTransactionType = {
|
|
26
27
|
|
27
28
|
export type FormatTransactionRequestErrorType = ErrorType
|
28
29
|
|
29
|
-
export function formatTransactionRequest(
|
30
|
+
export function formatTransactionRequest(
|
31
|
+
request: ExactPartial<TransactionRequest>,
|
32
|
+
) {
|
30
33
|
const rpcRequest = { ...request } as RpcTransactionRequest
|
31
34
|
|
32
35
|
if (
|
package/utils/hash/keccak256.ts
CHANGED
package/utils/hash/ripemd160.ts
CHANGED
package/utils/hash/sha256.ts
CHANGED
package/utils/poll.ts
CHANGED
@@ -3,9 +3,9 @@ import { wait } from './wait.js'
|
|
3
3
|
|
4
4
|
type PollOptions<TData> = {
|
5
5
|
// Whether or not to emit when the polling starts.
|
6
|
-
emitOnBegin?: boolean
|
6
|
+
emitOnBegin?: boolean | undefined
|
7
7
|
// The initial wait time (in ms) before polling.
|
8
|
-
initialWaitTime?: (data: TData | void) => Promise<number>
|
8
|
+
initialWaitTime?: ((data: TData | void) => Promise<number>) | undefined
|
9
9
|
// The interval (in ms).
|
10
10
|
interval: number
|
11
11
|
}
|
@@ -6,8 +6,8 @@ type Resolved<TReturnType extends readonly unknown[] = any> = [
|
|
6
6
|
]
|
7
7
|
|
8
8
|
type PendingPromise<TReturnType extends readonly unknown[] = any> = {
|
9
|
-
resolve?: (data: Resolved<TReturnType>) => void
|
10
|
-
reject?: (reason?: unknown) => void
|
9
|
+
resolve?: ((data: Resolved<TReturnType>) => void) | undefined
|
10
|
+
reject?: ((reason?: unknown) => void) | undefined
|
11
11
|
}
|
12
12
|
|
13
13
|
type SchedulerItem = { args: unknown; pendingPromise: PendingPromise }
|
@@ -23,9 +23,9 @@ export type CreateBatchSchedulerArguments<
|
|
23
23
|
> = {
|
24
24
|
fn: (args: TParameters[]) => Promise<TReturnType>
|
25
25
|
id: number | string
|
26
|
-
shouldSplitBatch?: (args: TParameters[]) => boolean
|
27
|
-
wait?: number
|
28
|
-
sort?: BatchResultsCompareFn<TReturnType[number]>
|
26
|
+
shouldSplitBatch?: ((args: TParameters[]) => boolean) | undefined
|
27
|
+
wait?: number | undefined
|
28
|
+
sort?: BatchResultsCompareFn<TReturnType[number]> | undefined
|
29
29
|
}
|
30
30
|
|
31
31
|
export type CreateBatchSchedulerReturnType<
|
@@ -34,7 +34,7 @@ export type CreateBatchSchedulerReturnType<
|
|
34
34
|
> = {
|
35
35
|
flush: () => void
|
36
36
|
schedule: TParameters extends undefined
|
37
|
-
? (args?: TParameters) => Promise<Resolved<TReturnType>>
|
37
|
+
? (args?: TParameters | undefined) => Promise<Resolved<TReturnType>>
|
38
38
|
: (args: TParameters) => Promise<Resolved<TReturnType>>
|
39
39
|
}
|
40
40
|
|
@@ -32,7 +32,7 @@ export type WithCacheParameters = {
|
|
32
32
|
/** The key to cache the data against. */
|
33
33
|
cacheKey: string
|
34
34
|
/** The time that cached data will remain in memory. Default: Infinity (no expiry) */
|
35
|
-
cacheTime?: number
|
35
|
+
cacheTime?: number | undefined
|
36
36
|
}
|
37
37
|
|
38
38
|
/**
|
@@ -3,17 +3,22 @@ import { wait } from '../wait.js'
|
|
3
3
|
|
4
4
|
export type WithRetryParameters = {
|
5
5
|
// The delay (in ms) between retries.
|
6
|
-
delay?:
|
6
|
+
delay?:
|
7
|
+
| ((config: { count: number; error: Error }) => number)
|
8
|
+
| number
|
9
|
+
| undefined
|
7
10
|
// The max number of times to retry.
|
8
|
-
retryCount?: number
|
11
|
+
retryCount?: number | undefined
|
9
12
|
// Whether or not to retry when an error is thrown.
|
10
|
-
shouldRetry?:
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
13
|
+
shouldRetry?:
|
14
|
+
| (({
|
15
|
+
count,
|
16
|
+
error,
|
17
|
+
}: {
|
18
|
+
count: number
|
19
|
+
error: Error
|
20
|
+
}) => Promise<boolean> | boolean)
|
21
|
+
| undefined
|
17
22
|
}
|
18
23
|
|
19
24
|
export type WithRetryErrorType = ErrorType
|
@@ -3,18 +3,20 @@ import type { ErrorType } from '../../errors/utils.js'
|
|
3
3
|
export type WithTimeoutErrorType = ErrorType
|
4
4
|
|
5
5
|
export function withTimeout<TData>(
|
6
|
-
fn: ({
|
6
|
+
fn: ({
|
7
|
+
signal,
|
8
|
+
}: { signal: AbortController['signal'] | null }) => Promise<TData>,
|
7
9
|
{
|
8
10
|
errorInstance = new Error('timed out'),
|
9
11
|
timeout,
|
10
12
|
signal,
|
11
13
|
}: {
|
12
14
|
// The error instance to throw when the timeout is reached.
|
13
|
-
errorInstance?: Error
|
15
|
+
errorInstance?: Error | undefined
|
14
16
|
// The timeout (in ms).
|
15
17
|
timeout: number
|
16
18
|
// Whether or not the timeout should use an abort signal.
|
17
|
-
signal?: boolean
|
19
|
+
signal?: boolean | undefined
|
18
20
|
},
|
19
21
|
): Promise<TData> {
|
20
22
|
return new Promise((resolve, reject) => {
|
@@ -31,7 +33,7 @@ export function withTimeout<TData>(
|
|
31
33
|
}
|
32
34
|
}, timeout)
|
33
35
|
}
|
34
|
-
resolve(await fn({ signal: controller?.signal }))
|
36
|
+
resolve(await fn({ signal: controller?.signal || null }))
|
35
37
|
} catch (err) {
|
36
38
|
if ((err as Error).name === 'AbortError') reject(errorInstance)
|
37
39
|
reject(err)
|
package/utils/rpc/http.ts
CHANGED
@@ -15,11 +15,11 @@ import { idCache } from './id.js'
|
|
15
15
|
|
16
16
|
export type HttpRpcClientOptions = {
|
17
17
|
// Request configuration to pass to `fetch`.
|
18
|
-
fetchOptions?: Omit<RequestInit, 'body'>
|
18
|
+
fetchOptions?: Omit<RequestInit, 'body'> | undefined
|
19
19
|
// A callback to handle the response.
|
20
|
-
onResponse?: (response: Response) => Promise<void> | void
|
20
|
+
onResponse?: ((response: Response) => Promise<void> | void) | undefined
|
21
21
|
// The timeout (in ms) for the request.
|
22
|
-
timeout?: number
|
22
|
+
timeout?: number | undefined
|
23
23
|
}
|
24
24
|
|
25
25
|
export type HttpRequestParameters<
|
@@ -28,11 +28,11 @@ export type HttpRequestParameters<
|
|
28
28
|
// The RPC request body.
|
29
29
|
body: TBody
|
30
30
|
// Request configuration to pass to `fetch`.
|
31
|
-
fetchOptions?: HttpRpcClientOptions['fetchOptions']
|
31
|
+
fetchOptions?: HttpRpcClientOptions['fetchOptions'] | undefined
|
32
32
|
// A callback to handle the response.
|
33
|
-
onResponse?: (response: Response) => Promise<void> | void
|
33
|
+
onResponse?: ((response: Response) => Promise<void> | void) | undefined
|
34
34
|
// The timeout (in ms) for the request.
|
35
|
-
timeout?: HttpRpcClientOptions['timeout']
|
35
|
+
timeout?: HttpRpcClientOptions['timeout'] | undefined
|
36
36
|
}
|
37
37
|
|
38
38
|
export type HttpRequestReturnType<
|
@@ -92,7 +92,7 @@ export function getHttpRpcClient(
|
|
92
92
|
'Content-Type': 'application/json',
|
93
93
|
},
|
94
94
|
method: method || 'POST',
|
95
|
-
signal: signal_ || (timeout > 0 ? signal :
|
95
|
+
signal: signal_ || (timeout > 0 ? signal : null),
|
96
96
|
})
|
97
97
|
return response
|
98
98
|
},
|
package/utils/rpc/socket.ts
CHANGED
@@ -28,12 +28,12 @@ export type SocketRpcClient<socket extends {}> = {
|
|
28
28
|
socket: Socket<socket>
|
29
29
|
request(params: {
|
30
30
|
body: RpcRequest
|
31
|
-
onError?: (error: Error) => void
|
31
|
+
onError?: ((error: Error) => void) | undefined
|
32
32
|
onResponse: (message: RpcResponse) => void
|
33
33
|
}): void
|
34
34
|
requestAsync(params: {
|
35
35
|
body: RpcRequest
|
36
|
-
timeout?: number
|
36
|
+
timeout?: number | undefined
|
37
37
|
}): Promise<RpcResponse>
|
38
38
|
requests: CallbackMap
|
39
39
|
subscriptions: CallbackMap
|
@@ -25,7 +25,7 @@ export type HashMessageErrorType =
|
|
25
25
|
|
26
26
|
export function hashMessage<TTo extends To = 'hex'>(
|
27
27
|
message: SignableMessage,
|
28
|
-
to_?: TTo,
|
28
|
+
to_?: TTo | undefined,
|
29
29
|
): HashMessage<TTo> {
|
30
30
|
const messageBytes = (() => {
|
31
31
|
if (typeof message === 'string') return stringToBytes(message)
|
@@ -19,9 +19,12 @@ import {
|
|
19
19
|
} from '../../errors/transaction.js'
|
20
20
|
import type { ErrorType } from '../../errors/utils.js'
|
21
21
|
import type { Chain } from '../../types/chain.js'
|
22
|
+
import type { ExactPartial } from '../../types/utils.js'
|
22
23
|
import { isAddress } from '../address/isAddress.js'
|
23
24
|
|
24
|
-
export type AssertRequestParameters =
|
25
|
+
export type AssertRequestParameters = ExactPartial<
|
26
|
+
SendTransactionParameters<Chain>
|
27
|
+
>
|
25
28
|
|
26
29
|
export type AssertRequestErrorType =
|
27
30
|
| InvalidAddressErrorType
|
@@ -20,7 +20,13 @@ import type {
|
|
20
20
|
TransactionSerializableGeneric,
|
21
21
|
TransactionSerializableLegacy,
|
22
22
|
} from '../../types/transaction.js'
|
23
|
-
import type {
|
23
|
+
import type {
|
24
|
+
Assign,
|
25
|
+
ExactPartial,
|
26
|
+
IsNever,
|
27
|
+
OneOf,
|
28
|
+
Opaque,
|
29
|
+
} from '../../types/utils.js'
|
24
30
|
|
25
31
|
type BaseProperties = {
|
26
32
|
accessList?: undefined
|
@@ -45,18 +51,18 @@ type EIP1559Properties = Assign<
|
|
45
51
|
},
|
46
52
|
FeeValuesEIP1559
|
47
53
|
> & {
|
48
|
-
accessList?: TransactionSerializableEIP2930['accessList']
|
54
|
+
accessList?: TransactionSerializableEIP2930['accessList'] | undefined
|
49
55
|
}
|
50
56
|
>
|
51
57
|
type EIP2930Properties = Assign<
|
52
58
|
BaseProperties,
|
53
|
-
|
59
|
+
ExactPartial<FeeValuesLegacy> & {
|
54
60
|
accessList: TransactionSerializableEIP2930['accessList']
|
55
61
|
}
|
56
62
|
>
|
57
63
|
type EIP4844Properties = Assign<
|
58
64
|
BaseProperties,
|
59
|
-
|
65
|
+
ExactPartial<FeeValuesEIP4844> &
|
60
66
|
OneOf<
|
61
67
|
| {
|
62
68
|
blobs: TransactionSerializableEIP4844['blobs']
|
@@ -364,7 +364,7 @@ type ParseTransactionLegacyErrorType =
|
|
364
364
|
function parseTransactionLegacy(
|
365
365
|
serializedTransaction: Hex,
|
366
366
|
): Omit<TransactionRequestLegacy, 'from'> &
|
367
|
-
({ chainId?: number } | ({ chainId: number } & Signature)) {
|
367
|
+
({ chainId?: number | undefined } | ({ chainId: number } & Signature)) {
|
368
368
|
const transactionArray = fromRlp(serializedTransaction, 'hex')
|
369
369
|
|
370
370
|
const [nonce, gasPrice, gas, to, value, data, chainIdOrV_, r, s] =
|
@@ -28,7 +28,7 @@ export type SerializeAccessListErrorType =
|
|
28
28
|
* @returns Array of hex strings
|
29
29
|
*/
|
30
30
|
export function serializeAccessList(
|
31
|
-
accessList?: AccessList,
|
31
|
+
accessList?: AccessList | undefined,
|
32
32
|
): RecursiveArray<Hex> {
|
33
33
|
if (!accessList || accessList.length === 0) return []
|
34
34
|
|