viem 2.17.2 → 2.17.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CHANGELOG.md +12 -0
- package/_cjs/accounts/toAccount.js.map +1 -1
- package/_cjs/actions/ens/getEnsAddress.js.map +1 -1
- package/_cjs/actions/ens/getEnsAvatar.js.map +1 -1
- package/_cjs/actions/ens/getEnsName.js.map +1 -1
- package/_cjs/actions/ens/getEnsResolver.js.map +1 -1
- package/_cjs/actions/ens/getEnsText.js.map +1 -1
- package/_cjs/actions/getContract.js.map +1 -1
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/createBlockFilter.js.map +1 -1
- package/_cjs/actions/public/createEventFilter.js.map +1 -1
- package/_cjs/actions/public/createPendingTransactionFilter.js.map +1 -1
- package/_cjs/actions/public/estimateGas.js.map +1 -1
- package/_cjs/actions/public/getBalance.js.map +1 -1
- package/_cjs/actions/public/getBlobBaseFee.js.map +1 -1
- package/_cjs/actions/public/getBlock.js.map +1 -1
- package/_cjs/actions/public/getBlockNumber.js.map +1 -1
- package/_cjs/actions/public/getBlockTransactionCount.js.map +1 -1
- package/_cjs/actions/public/getChainId.js.map +1 -1
- package/_cjs/actions/public/getCode.js.map +1 -1
- package/_cjs/actions/public/getFeeHistory.js.map +1 -1
- package/_cjs/actions/public/getFilterChanges.js.map +1 -1
- package/_cjs/actions/public/getFilterLogs.js.map +1 -1
- package/_cjs/actions/public/getGasPrice.js.map +1 -1
- package/_cjs/actions/public/getLogs.js.map +1 -1
- package/_cjs/actions/public/getProof.js.map +1 -1
- package/_cjs/actions/public/getStorageAt.js.map +1 -1
- package/_cjs/actions/public/getTransaction.js.map +1 -1
- package/_cjs/actions/public/getTransactionConfirmations.js.map +1 -1
- package/_cjs/actions/public/getTransactionCount.js.map +1 -1
- package/_cjs/actions/public/getTransactionReceipt.js.map +1 -1
- package/_cjs/actions/public/uninstallFilter.js.map +1 -1
- package/_cjs/actions/public/verifyHash.js +9 -0
- package/_cjs/actions/public/verifyHash.js.map +1 -1
- package/_cjs/actions/public/verifyMessage.js.map +1 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/actions/public/watchBlockNumber.js.map +1 -1
- package/_cjs/actions/public/watchBlocks.js.map +1 -1
- package/_cjs/actions/public/watchEvent.js.map +1 -1
- package/_cjs/actions/public/watchPendingTransactions.js.map +1 -1
- package/_cjs/actions/test/dropTransaction.js.map +1 -1
- package/_cjs/actions/test/dumpState.js.map +1 -1
- package/_cjs/actions/test/getAutomine.js.map +1 -1
- package/_cjs/actions/test/getTxpoolContent.js.map +1 -1
- package/_cjs/actions/test/getTxpoolStatus.js.map +1 -1
- package/_cjs/actions/test/impersonateAccount.js.map +1 -1
- package/_cjs/actions/test/increaseTime.js.map +1 -1
- package/_cjs/actions/test/inspectTxpool.js.map +1 -1
- package/_cjs/actions/test/loadState.js.map +1 -1
- package/_cjs/actions/test/mine.js.map +1 -1
- package/_cjs/actions/test/removeBlockTimestampInterval.js.map +1 -1
- package/_cjs/actions/test/reset.js.map +1 -1
- package/_cjs/actions/test/revert.js.map +1 -1
- package/_cjs/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/_cjs/actions/test/setAutomine.js.map +1 -1
- package/_cjs/actions/test/setBalance.js.map +1 -1
- package/_cjs/actions/test/setBlockGasLimit.js.map +1 -1
- package/_cjs/actions/test/setBlockTimestampInterval.js.map +1 -1
- package/_cjs/actions/test/setCode.js.map +1 -1
- package/_cjs/actions/test/setCoinbase.js.map +1 -1
- package/_cjs/actions/test/setIntervalMining.js.map +1 -1
- package/_cjs/actions/test/setLoggingEnabled.js.map +1 -1
- package/_cjs/actions/test/setMinGasPrice.js.map +1 -1
- package/_cjs/actions/test/setNextBlockBaseFeePerGas.js.map +1 -1
- package/_cjs/actions/test/setNextBlockTimestamp.js.map +1 -1
- package/_cjs/actions/test/setNonce.js.map +1 -1
- package/_cjs/actions/test/setRpcUrl.js.map +1 -1
- package/_cjs/actions/test/setStorageAt.js.map +1 -1
- package/_cjs/actions/test/snapshot.js.map +1 -1
- package/_cjs/actions/test/stopImpersonatingAccount.js.map +1 -1
- package/_cjs/actions/wallet/addChain.js.map +1 -1
- package/_cjs/actions/wallet/getAddresses.js.map +1 -1
- package/_cjs/actions/wallet/getPermissions.js.map +1 -1
- package/_cjs/actions/wallet/requestAddresses.js.map +1 -1
- package/_cjs/actions/wallet/requestPermissions.js.map +1 -1
- package/_cjs/actions/wallet/sendRawTransaction.js.map +1 -1
- package/_cjs/actions/wallet/signMessage.js.map +1 -1
- package/_cjs/actions/wallet/switchChain.js.map +1 -1
- package/_cjs/actions/wallet/watchAsset.js.map +1 -1
- package/_cjs/celo/parsers.js.map +1 -1
- package/_cjs/chains/definitions/dreyerxTestnet.js +26 -0
- package/_cjs/chains/definitions/dreyerxTestnet.js.map +1 -0
- package/_cjs/chains/index.js +8 -6
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/clients/decorators/test.js.map +1 -1
- package/_cjs/clients/decorators/wallet.js.map +1 -1
- package/_cjs/clients/transports/createTransport.js.map +1 -1
- package/_cjs/clients/transports/custom.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/op-stack/actions/estimateL1Gas.js.map +1 -1
- package/_cjs/op-stack/actions/estimateTotalFee.js.map +1 -1
- package/_cjs/op-stack/actions/estimateTotalGas.js.map +1 -1
- package/_cjs/op-stack/actions/getL1BaseFee.js.map +1 -1
- package/_cjs/op-stack/decorators/publicL1.js.map +1 -1
- package/_cjs/op-stack/decorators/publicL2.js.map +1 -1
- package/_cjs/op-stack/decorators/walletL1.js.map +1 -1
- package/_cjs/op-stack/decorators/walletL2.js.map +1 -1
- package/_cjs/op-stack/parsers.js.map +1 -1
- package/_cjs/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/decodeErrorResult.js.map +1 -1
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodePacked.js.map +1 -1
- package/_cjs/utils/ccip.js.map +1 -1
- package/_cjs/utils/data/concat.js.map +1 -1
- package/_cjs/utils/data/pad.js.map +1 -1
- package/_cjs/utils/data/slice.js.map +1 -1
- package/_cjs/utils/data/trim.js.map +1 -1
- package/_cjs/utils/encoding/fromBytes.js.map +1 -1
- package/_cjs/utils/encoding/fromHex.js.map +1 -1
- package/_cjs/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/_cjs/utils/ens/avatar/utils.js.map +1 -1
- package/_cjs/utils/filters/createFilterRequestScope.js.map +1 -1
- package/_cjs/utils/formatters/formatter.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/observe.js.map +1 -1
- package/_cjs/utils/poll.js.map +1 -1
- package/_cjs/utils/promise/createBatchScheduler.js.map +1 -1
- package/_cjs/utils/promise/withCache.js.map +1 -1
- package/_cjs/utils/promise/withRetry.js.map +1 -1
- package/_cjs/utils/promise/withTimeout.js.map +1 -1
- package/_cjs/utils/signature/hashMessage.js.map +1 -1
- package/_cjs/utils/transaction/parseTransaction.js.map +1 -1
- package/_cjs/zksync/actions/getAllBalances.js.map +1 -1
- package/_cjs/zksync/actions/getBaseTokenL1Address.js.map +1 -1
- package/_cjs/zksync/actions/getBlockDetails.js.map +1 -1
- package/_cjs/zksync/actions/getBridgehubContractAddress.js.map +1 -1
- package/_cjs/zksync/actions/getDefaultBridgeAddresses.js.map +1 -1
- package/_cjs/zksync/actions/getL1Allowance.js.map +1 -1
- package/_cjs/zksync/actions/getL1Balance.js.map +1 -1
- package/_cjs/zksync/actions/getL1BatchBlockRange.js.map +1 -1
- package/_cjs/zksync/actions/getL1BatchDetails.js.map +1 -1
- package/_cjs/zksync/actions/getL1BatchNumber.js.map +1 -1
- package/_cjs/zksync/actions/getL1ChainId.js.map +1 -1
- package/_cjs/zksync/actions/getL1TokenBalance.js.map +1 -1
- package/_cjs/zksync/actions/getLogProof.js.map +1 -1
- package/_cjs/zksync/actions/getMainContractAddress.js.map +1 -1
- package/_cjs/zksync/actions/getRawBlockTransactions.js.map +1 -1
- package/_cjs/zksync/actions/getTestnetPaymasterAddress.js.map +1 -1
- package/_cjs/zksync/actions/getTransactionDetails.js.map +1 -1
- package/_cjs/zksync/actions/signEip712Transaction.js.map +1 -1
- package/_cjs/zksync/actions/signTransaction.js.map +1 -1
- package/_cjs/zksync/decorators/publicL1.js.map +1 -1
- package/_cjs/zksync/decorators/publicL2.js.map +1 -1
- package/_esm/accounts/toAccount.js.map +1 -1
- package/_esm/actions/ens/getEnsAddress.js.map +1 -1
- package/_esm/actions/ens/getEnsAvatar.js.map +1 -1
- package/_esm/actions/ens/getEnsName.js.map +1 -1
- package/_esm/actions/ens/getEnsResolver.js.map +1 -1
- package/_esm/actions/ens/getEnsText.js.map +1 -1
- package/_esm/actions/getContract.js.map +1 -1
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/createBlockFilter.js.map +1 -1
- package/_esm/actions/public/createEventFilter.js.map +1 -1
- package/_esm/actions/public/createPendingTransactionFilter.js.map +1 -1
- package/_esm/actions/public/estimateGas.js.map +1 -1
- package/_esm/actions/public/getBalance.js.map +1 -1
- package/_esm/actions/public/getBlobBaseFee.js.map +1 -1
- package/_esm/actions/public/getBlock.js.map +1 -1
- package/_esm/actions/public/getBlockNumber.js.map +1 -1
- package/_esm/actions/public/getBlockTransactionCount.js.map +1 -1
- package/_esm/actions/public/getChainId.js.map +1 -1
- package/_esm/actions/public/getCode.js.map +1 -1
- package/_esm/actions/public/getFeeHistory.js.map +1 -1
- package/_esm/actions/public/getFilterChanges.js.map +1 -1
- package/_esm/actions/public/getFilterLogs.js.map +1 -1
- package/_esm/actions/public/getGasPrice.js.map +1 -1
- package/_esm/actions/public/getLogs.js.map +1 -1
- package/_esm/actions/public/getProof.js.map +1 -1
- package/_esm/actions/public/getStorageAt.js.map +1 -1
- package/_esm/actions/public/getTransaction.js.map +1 -1
- package/_esm/actions/public/getTransactionConfirmations.js.map +1 -1
- package/_esm/actions/public/getTransactionCount.js.map +1 -1
- package/_esm/actions/public/getTransactionReceipt.js.map +1 -1
- package/_esm/actions/public/uninstallFilter.js.map +1 -1
- package/_esm/actions/public/verifyHash.js +10 -0
- package/_esm/actions/public/verifyHash.js.map +1 -1
- package/_esm/actions/public/verifyMessage.js.map +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/actions/public/watchBlockNumber.js.map +1 -1
- package/_esm/actions/public/watchBlocks.js.map +1 -1
- package/_esm/actions/public/watchEvent.js.map +1 -1
- package/_esm/actions/public/watchPendingTransactions.js.map +1 -1
- package/_esm/actions/test/dropTransaction.js.map +1 -1
- package/_esm/actions/test/dumpState.js.map +1 -1
- package/_esm/actions/test/getAutomine.js.map +1 -1
- package/_esm/actions/test/getTxpoolContent.js.map +1 -1
- package/_esm/actions/test/getTxpoolStatus.js.map +1 -1
- package/_esm/actions/test/impersonateAccount.js.map +1 -1
- package/_esm/actions/test/increaseTime.js.map +1 -1
- package/_esm/actions/test/inspectTxpool.js.map +1 -1
- package/_esm/actions/test/loadState.js.map +1 -1
- package/_esm/actions/test/mine.js.map +1 -1
- package/_esm/actions/test/removeBlockTimestampInterval.js.map +1 -1
- package/_esm/actions/test/reset.js.map +1 -1
- package/_esm/actions/test/revert.js.map +1 -1
- package/_esm/actions/test/sendUnsignedTransaction.js.map +1 -1
- package/_esm/actions/test/setAutomine.js.map +1 -1
- package/_esm/actions/test/setBalance.js.map +1 -1
- package/_esm/actions/test/setBlockGasLimit.js.map +1 -1
- package/_esm/actions/test/setBlockTimestampInterval.js.map +1 -1
- package/_esm/actions/test/setCode.js.map +1 -1
- package/_esm/actions/test/setCoinbase.js.map +1 -1
- package/_esm/actions/test/setIntervalMining.js.map +1 -1
- package/_esm/actions/test/setLoggingEnabled.js.map +1 -1
- package/_esm/actions/test/setMinGasPrice.js.map +1 -1
- package/_esm/actions/test/setNextBlockBaseFeePerGas.js.map +1 -1
- package/_esm/actions/test/setNextBlockTimestamp.js.map +1 -1
- package/_esm/actions/test/setNonce.js.map +1 -1
- package/_esm/actions/test/setRpcUrl.js.map +1 -1
- package/_esm/actions/test/setStorageAt.js.map +1 -1
- package/_esm/actions/test/snapshot.js.map +1 -1
- package/_esm/actions/test/stopImpersonatingAccount.js.map +1 -1
- package/_esm/actions/wallet/addChain.js.map +1 -1
- package/_esm/actions/wallet/getAddresses.js.map +1 -1
- package/_esm/actions/wallet/getPermissions.js.map +1 -1
- package/_esm/actions/wallet/requestAddresses.js.map +1 -1
- package/_esm/actions/wallet/requestPermissions.js.map +1 -1
- package/_esm/actions/wallet/sendRawTransaction.js.map +1 -1
- package/_esm/actions/wallet/signMessage.js.map +1 -1
- package/_esm/actions/wallet/switchChain.js.map +1 -1
- package/_esm/actions/wallet/watchAsset.js.map +1 -1
- package/_esm/celo/parsers.js.map +1 -1
- package/_esm/chains/definitions/dreyerxTestnet.js +23 -0
- package/_esm/chains/definitions/dreyerxTestnet.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/clients/decorators/test.js.map +1 -1
- package/_esm/clients/decorators/wallet.js.map +1 -1
- package/_esm/clients/transports/createTransport.js.map +1 -1
- package/_esm/clients/transports/custom.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/op-stack/actions/estimateL1Gas.js.map +1 -1
- package/_esm/op-stack/actions/estimateTotalFee.js.map +1 -1
- package/_esm/op-stack/actions/estimateTotalGas.js.map +1 -1
- package/_esm/op-stack/actions/getL1BaseFee.js.map +1 -1
- package/_esm/op-stack/decorators/publicL1.js.map +1 -1
- package/_esm/op-stack/decorators/publicL2.js.map +1 -1
- package/_esm/op-stack/decorators/walletL1.js.map +1 -1
- package/_esm/op-stack/decorators/walletL2.js.map +1 -1
- package/_esm/op-stack/parsers.js.map +1 -1
- package/_esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/decodeErrorResult.js.map +1 -1
- package/_esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodePacked.js.map +1 -1
- package/_esm/utils/ccip.js.map +1 -1
- package/_esm/utils/data/concat.js.map +1 -1
- package/_esm/utils/data/pad.js.map +1 -1
- package/_esm/utils/data/slice.js.map +1 -1
- package/_esm/utils/data/trim.js.map +1 -1
- package/_esm/utils/encoding/fromBytes.js.map +1 -1
- package/_esm/utils/encoding/fromHex.js.map +1 -1
- package/_esm/utils/ens/avatar/parseAvatarRecord.js.map +1 -1
- package/_esm/utils/ens/avatar/utils.js.map +1 -1
- package/_esm/utils/filters/createFilterRequestScope.js.map +1 -1
- package/_esm/utils/formatters/formatter.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/observe.js.map +1 -1
- package/_esm/utils/poll.js.map +1 -1
- package/_esm/utils/promise/createBatchScheduler.js.map +1 -1
- package/_esm/utils/promise/withCache.js.map +1 -1
- package/_esm/utils/promise/withRetry.js.map +1 -1
- package/_esm/utils/promise/withTimeout.js.map +1 -1
- package/_esm/utils/signature/hashMessage.js.map +1 -1
- package/_esm/utils/transaction/parseTransaction.js.map +1 -1
- package/_esm/zksync/actions/getAllBalances.js.map +1 -1
- package/_esm/zksync/actions/getBaseTokenL1Address.js.map +1 -1
- package/_esm/zksync/actions/getBlockDetails.js.map +1 -1
- package/_esm/zksync/actions/getBridgehubContractAddress.js.map +1 -1
- package/_esm/zksync/actions/getDefaultBridgeAddresses.js.map +1 -1
- package/_esm/zksync/actions/getL1Allowance.js.map +1 -1
- package/_esm/zksync/actions/getL1Balance.js.map +1 -1
- package/_esm/zksync/actions/getL1BatchBlockRange.js.map +1 -1
- package/_esm/zksync/actions/getL1BatchDetails.js.map +1 -1
- package/_esm/zksync/actions/getL1BatchNumber.js.map +1 -1
- package/_esm/zksync/actions/getL1ChainId.js.map +1 -1
- package/_esm/zksync/actions/getL1TokenBalance.js.map +1 -1
- package/_esm/zksync/actions/getLogProof.js.map +1 -1
- package/_esm/zksync/actions/getMainContractAddress.js.map +1 -1
- package/_esm/zksync/actions/getRawBlockTransactions.js.map +1 -1
- package/_esm/zksync/actions/getTestnetPaymasterAddress.js.map +1 -1
- package/_esm/zksync/actions/getTransactionDetails.js.map +1 -1
- package/_esm/zksync/actions/signEip712Transaction.js.map +1 -1
- package/_esm/zksync/actions/signTransaction.js.map +1 -1
- package/_esm/zksync/decorators/publicL1.js.map +1 -1
- package/_esm/zksync/decorators/publicL2.js.map +1 -1
- package/_types/accounts/toAccount.d.ts +2 -2
- package/_types/accounts/toAccount.d.ts.map +1 -1
- package/_types/accounts/types.d.ts +6 -6
- package/_types/accounts/types.d.ts.map +1 -1
- package/_types/actions/ens/getEnsAddress.d.ts +1 -1
- 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 +1 -1
- 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 +1 -1
- package/_types/actions/ens/getEnsText.d.ts.map +1 -1
- package/_types/actions/getContract.d.ts +60 -60
- package/_types/actions/getContract.d.ts.map +1 -1
- package/_types/actions/public/call.d.ts +3 -3
- package/_types/actions/public/call.d.ts.map +1 -1
- package/_types/actions/public/createBlockFilter.d.ts +1 -1
- package/_types/actions/public/createBlockFilter.d.ts.map +1 -1
- package/_types/actions/public/createContractEventFilter.d.ts +2 -2
- package/_types/actions/public/createContractEventFilter.d.ts.map +1 -1
- package/_types/actions/public/createEventFilter.d.ts +13 -13
- package/_types/actions/public/createEventFilter.d.ts.map +1 -1
- package/_types/actions/public/createPendingTransactionFilter.d.ts +1 -1
- package/_types/actions/public/createPendingTransactionFilter.d.ts.map +1 -1
- package/_types/actions/public/estimateGas.d.ts +3 -3
- package/_types/actions/public/estimateGas.d.ts.map +1 -1
- package/_types/actions/public/getBalance.d.ts +1 -1
- package/_types/actions/public/getBalance.d.ts.map +1 -1
- package/_types/actions/public/getBlobBaseFee.d.ts +1 -1
- package/_types/actions/public/getBlobBaseFee.d.ts.map +1 -1
- package/_types/actions/public/getBlock.d.ts +5 -5
- 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 +1 -1
- package/_types/actions/public/getBlockTransactionCount.d.ts.map +1 -1
- package/_types/actions/public/getChainId.d.ts +1 -1
- package/_types/actions/public/getChainId.d.ts.map +1 -1
- package/_types/actions/public/getCode.d.ts +1 -1
- package/_types/actions/public/getCode.d.ts.map +1 -1
- package/_types/actions/public/getContractEvents.d.ts +1 -1
- package/_types/actions/public/getContractEvents.d.ts.map +1 -1
- package/_types/actions/public/getFeeHistory.d.ts +1 -1
- package/_types/actions/public/getFeeHistory.d.ts.map +1 -1
- package/_types/actions/public/getFilterChanges.d.ts +4 -4
- package/_types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/_types/actions/public/getFilterLogs.d.ts +4 -4
- package/_types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/_types/actions/public/getGasPrice.d.ts +1 -1
- package/_types/actions/public/getGasPrice.d.ts.map +1 -1
- package/_types/actions/public/getLogs.d.ts +10 -10
- package/_types/actions/public/getLogs.d.ts.map +1 -1
- package/_types/actions/public/getProof.d.ts +1 -1
- package/_types/actions/public/getProof.d.ts.map +1 -1
- package/_types/actions/public/getStorageAt.d.ts +1 -1
- package/_types/actions/public/getStorageAt.d.ts.map +1 -1
- package/_types/actions/public/getTransaction.d.ts +4 -4
- package/_types/actions/public/getTransaction.d.ts.map +1 -1
- package/_types/actions/public/getTransactionConfirmations.d.ts +3 -3
- package/_types/actions/public/getTransactionConfirmations.d.ts.map +1 -1
- package/_types/actions/public/getTransactionCount.d.ts +1 -1
- package/_types/actions/public/getTransactionCount.d.ts.map +1 -1
- package/_types/actions/public/getTransactionReceipt.d.ts +2 -2
- package/_types/actions/public/getTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/public/uninstallFilter.d.ts +1 -1
- package/_types/actions/public/uninstallFilter.d.ts.map +1 -1
- package/_types/actions/public/verifyHash.d.ts +1 -1
- package/_types/actions/public/verifyHash.d.ts.map +1 -1
- package/_types/actions/public/verifyMessage.d.ts +1 -1
- package/_types/actions/public/verifyMessage.d.ts.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts +7 -7
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/public/watchBlockNumber.d.ts +3 -3
- package/_types/actions/public/watchBlockNumber.d.ts.map +1 -1
- package/_types/actions/public/watchBlocks.d.ts +8 -8
- package/_types/actions/public/watchBlocks.d.ts.map +1 -1
- package/_types/actions/public/watchEvent.d.ts +11 -11
- package/_types/actions/public/watchEvent.d.ts.map +1 -1
- package/_types/actions/public/watchPendingTransactions.d.ts +3 -3
- package/_types/actions/public/watchPendingTransactions.d.ts.map +1 -1
- package/_types/actions/test/dropTransaction.d.ts +1 -1
- package/_types/actions/test/dropTransaction.d.ts.map +1 -1
- package/_types/actions/test/dumpState.d.ts +1 -1
- package/_types/actions/test/dumpState.d.ts.map +1 -1
- package/_types/actions/test/getAutomine.d.ts +1 -1
- package/_types/actions/test/getAutomine.d.ts.map +1 -1
- package/_types/actions/test/getTxpoolContent.d.ts +1 -1
- package/_types/actions/test/getTxpoolContent.d.ts.map +1 -1
- package/_types/actions/test/getTxpoolStatus.d.ts +1 -1
- package/_types/actions/test/getTxpoolStatus.d.ts.map +1 -1
- package/_types/actions/test/impersonateAccount.d.ts +1 -1
- package/_types/actions/test/impersonateAccount.d.ts.map +1 -1
- package/_types/actions/test/increaseTime.d.ts +1 -1
- package/_types/actions/test/increaseTime.d.ts.map +1 -1
- package/_types/actions/test/inspectTxpool.d.ts +1 -1
- package/_types/actions/test/inspectTxpool.d.ts.map +1 -1
- package/_types/actions/test/loadState.d.ts +1 -1
- package/_types/actions/test/loadState.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/removeBlockTimestampInterval.d.ts +1 -1
- package/_types/actions/test/removeBlockTimestampInterval.d.ts.map +1 -1
- package/_types/actions/test/reset.d.ts +1 -1
- package/_types/actions/test/reset.d.ts.map +1 -1
- package/_types/actions/test/revert.d.ts +1 -1
- package/_types/actions/test/revert.d.ts.map +1 -1
- package/_types/actions/test/sendUnsignedTransaction.d.ts +2 -2
- package/_types/actions/test/sendUnsignedTransaction.d.ts.map +1 -1
- package/_types/actions/test/setAutomine.d.ts +1 -1
- package/_types/actions/test/setAutomine.d.ts.map +1 -1
- package/_types/actions/test/setBalance.d.ts +1 -1
- package/_types/actions/test/setBalance.d.ts.map +1 -1
- package/_types/actions/test/setBlockGasLimit.d.ts +1 -1
- package/_types/actions/test/setBlockGasLimit.d.ts.map +1 -1
- package/_types/actions/test/setBlockTimestampInterval.d.ts +1 -1
- package/_types/actions/test/setBlockTimestampInterval.d.ts.map +1 -1
- package/_types/actions/test/setCode.d.ts +1 -1
- package/_types/actions/test/setCode.d.ts.map +1 -1
- package/_types/actions/test/setCoinbase.d.ts +1 -1
- package/_types/actions/test/setCoinbase.d.ts.map +1 -1
- package/_types/actions/test/setIntervalMining.d.ts +1 -1
- package/_types/actions/test/setIntervalMining.d.ts.map +1 -1
- package/_types/actions/test/setLoggingEnabled.d.ts +1 -1
- package/_types/actions/test/setLoggingEnabled.d.ts.map +1 -1
- package/_types/actions/test/setMinGasPrice.d.ts +1 -1
- package/_types/actions/test/setMinGasPrice.d.ts.map +1 -1
- package/_types/actions/test/setNextBlockBaseFeePerGas.d.ts +1 -1
- package/_types/actions/test/setNextBlockBaseFeePerGas.d.ts.map +1 -1
- package/_types/actions/test/setNextBlockTimestamp.d.ts +1 -1
- package/_types/actions/test/setNextBlockTimestamp.d.ts.map +1 -1
- package/_types/actions/test/setNonce.d.ts +1 -1
- package/_types/actions/test/setNonce.d.ts.map +1 -1
- package/_types/actions/test/setRpcUrl.d.ts +1 -1
- package/_types/actions/test/setRpcUrl.d.ts.map +1 -1
- package/_types/actions/test/setStorageAt.d.ts +1 -1
- package/_types/actions/test/setStorageAt.d.ts.map +1 -1
- package/_types/actions/test/snapshot.d.ts +1 -1
- package/_types/actions/test/snapshot.d.ts.map +1 -1
- package/_types/actions/test/stopImpersonatingAccount.d.ts +1 -1
- package/_types/actions/test/stopImpersonatingAccount.d.ts.map +1 -1
- package/_types/actions/wallet/addChain.d.ts +1 -1
- package/_types/actions/wallet/addChain.d.ts.map +1 -1
- package/_types/actions/wallet/getAddresses.d.ts +1 -1
- package/_types/actions/wallet/getAddresses.d.ts.map +1 -1
- package/_types/actions/wallet/getPermissions.d.ts +1 -1
- package/_types/actions/wallet/getPermissions.d.ts.map +1 -1
- package/_types/actions/wallet/requestAddresses.d.ts +1 -1
- package/_types/actions/wallet/requestAddresses.d.ts.map +1 -1
- package/_types/actions/wallet/requestPermissions.d.ts +1 -1
- package/_types/actions/wallet/requestPermissions.d.ts.map +1 -1
- package/_types/actions/wallet/sendRawTransaction.d.ts +1 -1
- package/_types/actions/wallet/sendRawTransaction.d.ts.map +1 -1
- package/_types/actions/wallet/signMessage.d.ts +2 -2
- package/_types/actions/wallet/signMessage.d.ts.map +1 -1
- package/_types/actions/wallet/switchChain.d.ts +1 -1
- package/_types/actions/wallet/switchChain.d.ts.map +1 -1
- package/_types/actions/wallet/watchAsset.d.ts +1 -1
- package/_types/actions/wallet/watchAsset.d.ts.map +1 -1
- package/_types/celo/parsers.d.ts +2 -2
- package/_types/celo/parsers.d.ts.map +1 -1
- package/_types/celo/types.d.ts +1 -1
- package/_types/celo/types.d.ts.map +1 -1
- package/_types/chains/definitions/dreyerxTestnet.d.ts +35 -0
- package/_types/chains/definitions/dreyerxTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +23 -23
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/clients/decorators/test.d.ts +4 -4
- package/_types/clients/decorators/test.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +10 -10
- package/_types/clients/decorators/wallet.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 +1 -1
- package/_types/clients/transports/custom.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/version.d.ts +1 -1
- package/_types/op-stack/actions/estimateL1Gas.d.ts +2 -2
- package/_types/op-stack/actions/estimateL1Gas.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateTotalFee.d.ts +2 -2
- package/_types/op-stack/actions/estimateTotalFee.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateTotalGas.d.ts +2 -2
- package/_types/op-stack/actions/estimateTotalGas.d.ts.map +1 -1
- package/_types/op-stack/actions/getL1BaseFee.d.ts +2 -2
- package/_types/op-stack/actions/getL1BaseFee.d.ts.map +1 -1
- package/_types/op-stack/decorators/publicL1.d.ts +1 -1
- package/_types/op-stack/decorators/publicL1.d.ts.map +1 -1
- package/_types/op-stack/decorators/publicL2.d.ts +1 -1
- package/_types/op-stack/decorators/publicL2.d.ts.map +1 -1
- package/_types/op-stack/decorators/walletL1.d.ts +1 -1
- package/_types/op-stack/decorators/walletL1.d.ts.map +1 -1
- package/_types/op-stack/decorators/walletL2.d.ts +1 -1
- package/_types/op-stack/decorators/walletL2.d.ts.map +1 -1
- package/_types/op-stack/parsers.d.ts +2 -2
- package/_types/op-stack/parsers.d.ts.map +1 -1
- package/_types/op-stack/types/block.d.ts +2 -2
- package/_types/op-stack/types/block.d.ts.map +1 -1
- package/_types/op-stack/types/transaction.d.ts +8 -8
- package/_types/op-stack/types/transaction.d.ts.map +1 -1
- package/_types/types/account.d.ts +5 -5
- package/_types/types/account.d.ts.map +1 -1
- package/_types/types/block.d.ts +7 -7
- package/_types/types/block.d.ts.map +1 -1
- package/_types/types/contract.d.ts +20 -20
- package/_types/types/contract.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +35 -35
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/types/filter.d.ts +16 -16
- package/_types/types/filter.d.ts.map +1 -1
- package/_types/types/log.d.ts +20 -20
- package/_types/types/log.d.ts.map +1 -1
- package/_types/types/proof.d.ts +6 -6
- package/_types/types/proof.d.ts.map +1 -1
- package/_types/types/rpc.d.ts +2 -2
- package/_types/types/rpc.d.ts.map +1 -1
- package/_types/types/transport.d.ts +1 -1
- package/_types/types/transport.d.ts.map +1 -1
- package/_types/types/utils.d.ts +2 -2
- package/_types/types/utils.d.ts.map +1 -1
- package/_types/utils/abi/decodeAbiParameters.d.ts +2 -2
- package/_types/utils/abi/decodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/abi/decodeErrorResult.d.ts +1 -1
- package/_types/utils/abi/decodeErrorResult.d.ts.map +1 -1
- package/_types/utils/abi/encodeAbiParameters.d.ts +1 -1
- package/_types/utils/abi/encodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/abi/encodePacked.d.ts +4 -4
- package/_types/utils/abi/encodePacked.d.ts.map +1 -1
- package/_types/utils/ccip.d.ts +1 -1
- package/_types/utils/ccip.d.ts.map +1 -1
- package/_types/utils/data/concat.d.ts +2 -2
- package/_types/utils/data/concat.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 +3 -3
- package/_types/utils/data/slice.d.ts.map +1 -1
- package/_types/utils/data/trim.d.ts +2 -2
- package/_types/utils/data/trim.d.ts.map +1 -1
- package/_types/utils/encoding/fromBytes.d.ts +4 -4
- package/_types/utils/encoding/fromBytes.d.ts.map +1 -1
- package/_types/utils/encoding/fromHex.d.ts +4 -4
- package/_types/utils/encoding/fromHex.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/ens/avatar/utils.d.ts +1 -1
- package/_types/utils/ens/avatar/utils.d.ts.map +1 -1
- package/_types/utils/filters/createFilterRequestScope.d.ts +1 -1
- package/_types/utils/filters/createFilterRequestScope.d.ts.map +1 -1
- package/_types/utils/formatters/block.d.ts +7 -7
- package/_types/utils/formatters/block.d.ts.map +1 -1
- package/_types/utils/formatters/formatter.d.ts +6 -6
- package/_types/utils/formatters/formatter.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +7 -7
- package/_types/utils/formatters/transaction.d.ts.map +1 -1
- package/_types/utils/formatters/transactionReceipt.d.ts +6 -6
- package/_types/utils/formatters/transactionReceipt.d.ts.map +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +6 -6
- package/_types/utils/formatters/transactionRequest.d.ts.map +1 -1
- package/_types/utils/hash/keccak256.d.ts +2 -2
- package/_types/utils/hash/keccak256.d.ts.map +1 -1
- package/_types/utils/hash/ripemd160.d.ts +2 -2
- package/_types/utils/hash/ripemd160.d.ts.map +1 -1
- package/_types/utils/hash/sha256.d.ts +2 -2
- package/_types/utils/hash/sha256.d.ts.map +1 -1
- package/_types/utils/observe.d.ts +2 -2
- package/_types/utils/observe.d.ts.map +1 -1
- package/_types/utils/poll.d.ts +4 -4
- package/_types/utils/poll.d.ts.map +1 -1
- package/_types/utils/promise/createBatchScheduler.d.ts +11 -11
- package/_types/utils/promise/createBatchScheduler.d.ts.map +1 -1
- package/_types/utils/promise/withCache.d.ts +7 -7
- package/_types/utils/promise/withCache.d.ts.map +1 -1
- package/_types/utils/promise/withRetry.d.ts +1 -1
- package/_types/utils/promise/withRetry.d.ts.map +1 -1
- package/_types/utils/promise/withTimeout.d.ts +3 -3
- package/_types/utils/promise/withTimeout.d.ts.map +1 -1
- package/_types/utils/rpc/http.d.ts +4 -4
- package/_types/utils/rpc/http.d.ts.map +1 -1
- package/_types/utils/signature/hashMessage.d.ts +2 -2
- package/_types/utils/signature/hashMessage.d.ts.map +1 -1
- package/_types/utils/transaction/parseTransaction.d.ts +2 -2
- package/_types/utils/transaction/parseTransaction.d.ts.map +1 -1
- package/_types/zksync/actions/getAllBalances.d.ts +2 -2
- package/_types/zksync/actions/getAllBalances.d.ts.map +1 -1
- package/_types/zksync/actions/getBaseTokenL1Address.d.ts +1 -1
- package/_types/zksync/actions/getBaseTokenL1Address.d.ts.map +1 -1
- package/_types/zksync/actions/getBlockDetails.d.ts +1 -1
- package/_types/zksync/actions/getBlockDetails.d.ts.map +1 -1
- package/_types/zksync/actions/getBridgehubContractAddress.d.ts +1 -1
- package/_types/zksync/actions/getBridgehubContractAddress.d.ts.map +1 -1
- package/_types/zksync/actions/getDefaultBridgeAddresses.d.ts +1 -1
- package/_types/zksync/actions/getDefaultBridgeAddresses.d.ts.map +1 -1
- package/_types/zksync/actions/getL1Allowance.d.ts +2 -2
- package/_types/zksync/actions/getL1Allowance.d.ts.map +1 -1
- package/_types/zksync/actions/getL1Balance.d.ts +2 -2
- package/_types/zksync/actions/getL1Balance.d.ts.map +1 -1
- package/_types/zksync/actions/getL1BatchBlockRange.d.ts +1 -1
- package/_types/zksync/actions/getL1BatchBlockRange.d.ts.map +1 -1
- package/_types/zksync/actions/getL1BatchDetails.d.ts +1 -1
- package/_types/zksync/actions/getL1BatchDetails.d.ts.map +1 -1
- package/_types/zksync/actions/getL1BatchNumber.d.ts +1 -1
- package/_types/zksync/actions/getL1BatchNumber.d.ts.map +1 -1
- package/_types/zksync/actions/getL1ChainId.d.ts +1 -1
- package/_types/zksync/actions/getL1ChainId.d.ts.map +1 -1
- package/_types/zksync/actions/getL1TokenBalance.d.ts +2 -2
- package/_types/zksync/actions/getL1TokenBalance.d.ts.map +1 -1
- package/_types/zksync/actions/getLogProof.d.ts +1 -1
- package/_types/zksync/actions/getLogProof.d.ts.map +1 -1
- package/_types/zksync/actions/getMainContractAddress.d.ts +1 -1
- package/_types/zksync/actions/getMainContractAddress.d.ts.map +1 -1
- package/_types/zksync/actions/getRawBlockTransactions.d.ts +1 -1
- package/_types/zksync/actions/getRawBlockTransactions.d.ts.map +1 -1
- package/_types/zksync/actions/getTestnetPaymasterAddress.d.ts +1 -1
- package/_types/zksync/actions/getTestnetPaymasterAddress.d.ts.map +1 -1
- package/_types/zksync/actions/getTransactionDetails.d.ts +1 -1
- package/_types/zksync/actions/getTransactionDetails.d.ts.map +1 -1
- package/_types/zksync/actions/signEip712Transaction.d.ts +3 -3
- package/_types/zksync/actions/signEip712Transaction.d.ts.map +1 -1
- package/_types/zksync/actions/signTransaction.d.ts +3 -3
- package/_types/zksync/actions/signTransaction.d.ts.map +1 -1
- package/_types/zksync/decorators/publicL1.d.ts +5 -5
- package/_types/zksync/decorators/publicL1.d.ts.map +1 -1
- package/_types/zksync/decorators/publicL2.d.ts +4 -4
- package/_types/zksync/decorators/publicL2.d.ts.map +1 -1
- package/_types/zksync/types/block.d.ts +2 -2
- package/_types/zksync/types/block.d.ts.map +1 -1
- package/_types/zksync/types/eip712.d.ts +3 -3
- package/_types/zksync/types/eip712.d.ts.map +1 -1
- package/_types/zksync/types/fee.d.ts +9 -9
- package/_types/zksync/types/fee.d.ts.map +1 -1
- package/_types/zksync/types/log.d.ts +3 -3
- package/_types/zksync/types/log.d.ts.map +1 -1
- package/_types/zksync/types/transaction.d.ts +18 -18
- package/_types/zksync/types/transaction.d.ts.map +1 -1
- package/accounts/toAccount.ts +8 -8
- package/accounts/types.ts +8 -8
- package/actions/ens/getEnsAddress.ts +2 -2
- package/actions/ens/getEnsAvatar.ts +2 -2
- package/actions/ens/getEnsName.ts +2 -2
- package/actions/ens/getEnsResolver.ts +2 -2
- package/actions/ens/getEnsText.ts +2 -2
- package/actions/getContract.ts +302 -300
- package/actions/public/call.ts +12 -12
- package/actions/public/createBlockFilter.ts +2 -2
- package/actions/public/createContractEventFilter.ts +3 -3
- package/actions/public/createEventFilter.ts +65 -64
- package/actions/public/createPendingTransactionFilter.ts +3 -3
- package/actions/public/estimateGas.ts +8 -9
- package/actions/public/getBalance.ts +2 -2
- package/actions/public/getBlobBaseFee.ts +3 -3
- package/actions/public/getBlock.ts +15 -15
- package/actions/public/getBlockNumber.ts +2 -2
- package/actions/public/getBlockTransactionCount.ts +2 -4
- package/actions/public/getChainId.ts +3 -3
- package/actions/public/getCode.ts +2 -2
- package/actions/public/getContractEvents.ts +10 -10
- package/actions/public/getFeeHistory.ts +2 -2
- package/actions/public/getFilterChanges.ts +59 -67
- package/actions/public/getFilterLogs.ts +36 -36
- package/actions/public/getGasPrice.ts +3 -3
- package/actions/public/getLogs.ts +47 -53
- package/actions/public/getProof.ts +2 -2
- package/actions/public/getStorageAt.ts +2 -2
- package/actions/public/getTransaction.ts +10 -10
- package/actions/public/getTransactionConfirmations.ts +5 -5
- package/actions/public/getTransactionCount.ts +3 -3
- package/actions/public/getTransactionReceipt.ts +5 -5
- package/actions/public/uninstallFilter.ts +3 -3
- package/actions/public/verifyHash.ts +14 -2
- package/actions/public/verifyMessage.ts +2 -2
- package/actions/public/waitForTransactionReceipt.ts +14 -14
- package/actions/public/watchBlockNumber.ts +6 -6
- package/actions/public/watchBlocks.ts +25 -27
- package/actions/public/watchEvent.ts +39 -37
- package/actions/public/watchPendingTransactions.ts +6 -6
- package/actions/test/dropTransaction.ts +3 -3
- package/actions/test/dumpState.ts +3 -3
- package/actions/test/getAutomine.ts +3 -3
- package/actions/test/getTxpoolContent.ts +3 -3
- package/actions/test/getTxpoolStatus.ts +3 -3
- package/actions/test/impersonateAccount.ts +3 -3
- package/actions/test/increaseTime.ts +3 -3
- package/actions/test/inspectTxpool.ts +3 -3
- package/actions/test/loadState.ts +3 -3
- package/actions/test/mine.ts +3 -3
- package/actions/test/removeBlockTimestampInterval.ts +3 -3
- package/actions/test/reset.ts +3 -3
- package/actions/test/revert.ts +3 -3
- package/actions/test/sendUnsignedTransaction.ts +6 -6
- package/actions/test/setAutomine.ts +3 -3
- package/actions/test/setBalance.ts +3 -3
- package/actions/test/setBlockGasLimit.ts +3 -3
- package/actions/test/setBlockTimestampInterval.ts +3 -3
- package/actions/test/setCode.ts +3 -3
- package/actions/test/setCoinbase.ts +3 -3
- package/actions/test/setIntervalMining.ts +3 -3
- package/actions/test/setLoggingEnabled.ts +3 -3
- package/actions/test/setMinGasPrice.ts +3 -3
- package/actions/test/setNextBlockBaseFeePerGas.ts +3 -3
- package/actions/test/setNextBlockTimestamp.ts +3 -3
- package/actions/test/setNonce.ts +3 -3
- package/actions/test/setRpcUrl.ts +3 -3
- package/actions/test/setStorageAt.ts +3 -3
- package/actions/test/snapshot.ts +3 -3
- package/actions/test/stopImpersonatingAccount.ts +3 -3
- package/actions/wallet/addChain.ts +3 -3
- package/actions/wallet/getAddresses.ts +3 -5
- package/actions/wallet/getPermissions.ts +3 -3
- package/actions/wallet/requestAddresses.ts +3 -3
- package/actions/wallet/requestPermissions.ts +3 -3
- package/actions/wallet/sendRawTransaction.ts +2 -2
- package/actions/wallet/signMessage.ts +6 -6
- package/actions/wallet/switchChain.ts +3 -3
- package/actions/wallet/watchAsset.ts +3 -3
- package/celo/parsers.ts +10 -10
- package/celo/types.ts +2 -2
- package/chains/definitions/dreyerxTestnet.ts +23 -0
- package/chains/index.ts +1 -0
- package/clients/decorators/public.ts +130 -138
- package/clients/decorators/test.ts +12 -12
- package/clients/decorators/wallet.ts +34 -36
- package/clients/transports/createTransport.ts +17 -17
- package/clients/transports/custom.ts +2 -2
- package/errors/rpc.ts +6 -6
- package/errors/version.ts +1 -1
- package/op-stack/actions/estimateL1Gas.ts +10 -10
- package/op-stack/actions/estimateTotalFee.ts +9 -9
- package/op-stack/actions/estimateTotalGas.ts +9 -9
- package/op-stack/actions/getL1BaseFee.ts +7 -7
- package/op-stack/decorators/publicL1.ts +5 -5
- package/op-stack/decorators/publicL2.ts +5 -5
- package/op-stack/decorators/walletL1.ts +5 -5
- package/op-stack/decorators/walletL2.ts +5 -5
- package/op-stack/parsers.ts +9 -9
- package/op-stack/types/block.ts +10 -10
- package/op-stack/types/transaction.ts +19 -19
- package/package.json +1 -1
- package/types/account.ts +12 -12
- package/types/block.ts +14 -14
- package/types/contract.ts +60 -56
- package/types/eip1193.ts +52 -55
- package/types/filter.ts +25 -25
- package/types/log.ts +50 -50
- package/types/proof.ts +6 -6
- package/types/rpc.ts +9 -9
- package/types/transport.ts +2 -2
- package/types/utils.ts +2 -2
- package/utils/abi/decodeAbiParameters.ts +6 -6
- package/utils/abi/decodeErrorResult.ts +4 -4
- package/utils/abi/encodeAbiParameters.ts +18 -18
- package/utils/abi/encodePacked.ts +8 -8
- package/utils/ccip.ts +2 -2
- package/utils/data/concat.ts +8 -7
- package/utils/data/pad.ts +6 -6
- package/utils/data/slice.ts +6 -6
- package/utils/data/trim.ts +6 -6
- package/utils/encoding/fromBytes.ts +16 -16
- package/utils/encoding/fromHex.ts +15 -15
- package/utils/ens/avatar/parseAvatarRecord.ts +4 -4
- package/utils/ens/avatar/utils.ts +2 -2
- package/utils/filters/createFilterRequestScope.ts +2 -2
- package/utils/formatters/block.ts +9 -9
- package/utils/formatters/formatter.ts +11 -11
- package/utils/formatters/transaction.ts +5 -5
- package/utils/formatters/transactionReceipt.ts +2 -2
- package/utils/formatters/transactionRequest.ts +2 -2
- package/utils/hash/keccak256.ts +8 -8
- package/utils/hash/ripemd160.ts +8 -8
- package/utils/hash/sha256.ts +8 -8
- package/utils/observe.ts +8 -8
- package/utils/poll.ts +6 -6
- package/utils/promise/createBatchScheduler.ts +27 -30
- package/utils/promise/withCache.ts +8 -8
- package/utils/promise/withRetry.ts +3 -3
- package/utils/promise/withTimeout.ts +3 -3
- package/utils/rpc/http.ts +7 -7
- package/utils/signature/hashMessage.ts +6 -6
- package/utils/transaction/parseTransaction.ts +13 -13
- package/zksync/actions/getAllBalances.ts +6 -6
- package/zksync/actions/getBaseTokenL1Address.ts +3 -3
- package/zksync/actions/getBlockDetails.ts +3 -3
- package/zksync/actions/getBridgehubContractAddress.ts +3 -3
- package/zksync/actions/getDefaultBridgeAddresses.ts +3 -3
- package/zksync/actions/getL1Allowance.ts +6 -6
- package/zksync/actions/getL1Balance.ts +9 -9
- package/zksync/actions/getL1BatchBlockRange.ts +3 -3
- package/zksync/actions/getL1BatchDetails.ts +3 -3
- package/zksync/actions/getL1BatchNumber.ts +3 -3
- package/zksync/actions/getL1ChainId.ts +3 -3
- package/zksync/actions/getL1TokenBalance.ts +6 -6
- package/zksync/actions/getLogProof.ts +3 -3
- package/zksync/actions/getMainContractAddress.ts +3 -3
- package/zksync/actions/getRawBlockTransactions.ts +3 -3
- package/zksync/actions/getTestnetPaymasterAddress.ts +3 -3
- package/zksync/actions/getTransactionDetails.ts +3 -3
- package/zksync/actions/signEip712Transaction.ts +13 -13
- package/zksync/actions/signTransaction.ts +13 -13
- package/zksync/decorators/publicL1.ts +10 -10
- package/zksync/decorators/publicL2.ts +9 -9
- package/zksync/types/block.ts +10 -10
- package/zksync/types/eip712.ts +5 -5
- package/zksync/types/fee.ts +9 -9
- package/zksync/types/log.ts +12 -12
- package/zksync/types/transaction.ts +52 -53
@@ -28,25 +28,25 @@ export function assertSize(
|
|
28
28
|
}
|
29
29
|
|
30
30
|
export type FromHexParameters<
|
31
|
-
|
31
|
+
to extends 'string' | 'bigint' | 'number' | 'bytes' | 'boolean',
|
32
32
|
> =
|
33
|
-
|
|
33
|
+
| to
|
34
34
|
| {
|
35
35
|
/** Size (in bytes) of the hex value. */
|
36
36
|
size?: number | undefined
|
37
37
|
/** Type to convert to. */
|
38
|
-
to:
|
38
|
+
to: to
|
39
39
|
}
|
40
40
|
|
41
|
-
export type FromHexReturnType<
|
41
|
+
export type FromHexReturnType<to> = to extends 'string'
|
42
42
|
? string
|
43
|
-
:
|
43
|
+
: to extends 'bigint'
|
44
44
|
? bigint
|
45
|
-
:
|
45
|
+
: to extends 'number'
|
46
46
|
? number
|
47
|
-
:
|
47
|
+
: to extends 'bytes'
|
48
48
|
? ByteArray
|
49
|
-
:
|
49
|
+
: to extends 'boolean'
|
50
50
|
? boolean
|
51
51
|
: never
|
52
52
|
|
@@ -87,16 +87,16 @@ export type FromHexErrorType =
|
|
87
87
|
* // 'Hello world'
|
88
88
|
*/
|
89
89
|
export function fromHex<
|
90
|
-
|
91
|
-
>(hex: Hex, toOrOpts: FromHexParameters<
|
90
|
+
to extends 'string' | 'bigint' | 'number' | 'bytes' | 'boolean',
|
91
|
+
>(hex: Hex, toOrOpts: FromHexParameters<to>): FromHexReturnType<to> {
|
92
92
|
const opts = typeof toOrOpts === 'string' ? { to: toOrOpts } : toOrOpts
|
93
93
|
const to = opts.to
|
94
94
|
|
95
|
-
if (to === 'number') return hexToNumber(hex, opts) as FromHexReturnType<
|
96
|
-
if (to === 'bigint') return hexToBigInt(hex, opts) as FromHexReturnType<
|
97
|
-
if (to === 'string') return hexToString(hex, opts) as FromHexReturnType<
|
98
|
-
if (to === 'boolean') return hexToBool(hex, opts) as FromHexReturnType<
|
99
|
-
return hexToBytes(hex, opts) as FromHexReturnType<
|
95
|
+
if (to === 'number') return hexToNumber(hex, opts) as FromHexReturnType<to>
|
96
|
+
if (to === 'bigint') return hexToBigInt(hex, opts) as FromHexReturnType<to>
|
97
|
+
if (to === 'string') return hexToString(hex, opts) as FromHexReturnType<to>
|
98
|
+
if (to === 'boolean') return hexToBool(hex, opts) as FromHexReturnType<to>
|
99
|
+
return hexToBytes(hex, opts) as FromHexReturnType<to>
|
100
100
|
}
|
101
101
|
|
102
102
|
export type HexToBigIntOpts = {
|
@@ -34,8 +34,8 @@ export type ParseAvatarRecordErrorType =
|
|
34
34
|
* @see https://docs.ens.domains/web/avatars
|
35
35
|
*
|
36
36
|
*/
|
37
|
-
export async function parseAvatarRecord<
|
38
|
-
client: Client<Transport,
|
37
|
+
export async function parseAvatarRecord<chain extends Chain | undefined>(
|
38
|
+
client: Client<Transport, chain>,
|
39
39
|
{
|
40
40
|
gatewayUrls,
|
41
41
|
record,
|
@@ -58,8 +58,8 @@ type ParseNftAvatarUriErrorType =
|
|
58
58
|
| GetMetadataAvatarUriErrorType
|
59
59
|
| ErrorType
|
60
60
|
|
61
|
-
async function parseNftAvatarUri<
|
62
|
-
client: Client<Transport,
|
61
|
+
async function parseNftAvatarUri<chain extends Chain | undefined>(
|
62
|
+
client: Client<Transport, chain>,
|
63
63
|
{
|
64
64
|
gatewayUrls,
|
65
65
|
record,
|
@@ -258,8 +258,8 @@ export type GetNftTokenUriErrorType =
|
|
258
258
|
| EnsAvatarUnsupportedNamespaceErrorType
|
259
259
|
| ErrorType
|
260
260
|
|
261
|
-
export async function getNftTokenUri<
|
262
|
-
client: Client<Transport,
|
261
|
+
export async function getNftTokenUri<chain extends Chain | undefined>(
|
262
|
+
client: Client<Transport, chain>,
|
263
263
|
{ nft }: { nft: ParsedNft },
|
264
264
|
) {
|
265
265
|
if (nft.namespace === 'erc721') {
|
@@ -28,8 +28,8 @@ type CreateFilterRequestScopeReturnType = (
|
|
28
28
|
* listen for responses and scope the child transport `request` function
|
29
29
|
* to the successful filter ID.
|
30
30
|
*/
|
31
|
-
export function createFilterRequestScope<
|
32
|
-
client: Client<Transport,
|
31
|
+
export function createFilterRequestScope<chain extends Chain | undefined>(
|
32
|
+
client: Client<Transport, chain>,
|
33
33
|
{ method }: CreateFilterRequestScopeParameters,
|
34
34
|
): CreateFilterRequestScopeReturnType {
|
35
35
|
const requestMap: Record<Hex, EIP1193RequestFn> = {}
|
@@ -15,24 +15,24 @@ import { type FormattedTransaction, formatTransaction } from './transaction.js'
|
|
15
15
|
type BlockPendingDependencies = 'hash' | 'logsBloom' | 'nonce' | 'number'
|
16
16
|
|
17
17
|
export type FormattedBlock<
|
18
|
-
|
19
|
-
|
20
|
-
|
18
|
+
chain extends Chain | undefined = undefined,
|
19
|
+
includeTransactions extends boolean = boolean,
|
20
|
+
blockTag extends BlockTag = BlockTag,
|
21
21
|
_FormatterReturnType = ExtractChainFormatterReturnType<
|
22
|
-
|
22
|
+
chain,
|
23
23
|
'block',
|
24
|
-
Block<bigint,
|
24
|
+
Block<bigint, includeTransactions>
|
25
25
|
>,
|
26
26
|
_ExcludedPendingDependencies extends string = BlockPendingDependencies &
|
27
|
-
ExtractChainFormatterExclude<
|
27
|
+
ExtractChainFormatterExclude<chain, 'block'>,
|
28
28
|
_Formatted = Omit<_FormatterReturnType, BlockPendingDependencies> & {
|
29
29
|
[_key in _ExcludedPendingDependencies]: never
|
30
30
|
} & Pick<
|
31
|
-
Block<bigint,
|
31
|
+
Block<bigint, includeTransactions, blockTag>,
|
32
32
|
BlockPendingDependencies
|
33
33
|
>,
|
34
|
-
_Transactions =
|
35
|
-
? Prettify<FormattedTransaction<
|
34
|
+
_Transactions = includeTransactions extends true
|
35
|
+
? Prettify<FormattedTransaction<chain, blockTag>>[]
|
36
36
|
: Hash[],
|
37
37
|
> = Omit<_Formatted, 'transactions'> & {
|
38
38
|
transactions: _Transactions
|
@@ -3,24 +3,24 @@ import type { Prettify } from '../../types/utils.js'
|
|
3
3
|
|
4
4
|
export type DefineFormatterErrorType = ErrorType
|
5
5
|
|
6
|
-
export function defineFormatter<
|
7
|
-
type:
|
8
|
-
format: (_:
|
6
|
+
export function defineFormatter<type extends string, parameters, returnType>(
|
7
|
+
type: type,
|
8
|
+
format: (_: parameters) => returnType,
|
9
9
|
) {
|
10
10
|
return <
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
parametersOverride,
|
12
|
+
returnTypeOverride,
|
13
|
+
exclude extends (keyof parameters | keyof parametersOverride)[] = [],
|
14
14
|
>({
|
15
15
|
exclude,
|
16
16
|
format: overrides,
|
17
17
|
}: {
|
18
|
-
exclude?:
|
19
|
-
format: (_:
|
18
|
+
exclude?: exclude | undefined
|
19
|
+
format: (_: parametersOverride) => returnTypeOverride
|
20
20
|
}) => {
|
21
21
|
return {
|
22
22
|
exclude,
|
23
|
-
format: (args:
|
23
|
+
format: (args: parametersOverride) => {
|
24
24
|
const formatted = format(args as any)
|
25
25
|
if (exclude) {
|
26
26
|
for (const key of exclude) {
|
@@ -30,8 +30,8 @@ export function defineFormatter<TType extends string, TParameters, TReturnType>(
|
|
30
30
|
return {
|
31
31
|
...formatted,
|
32
32
|
...overrides(args),
|
33
|
-
} as Prettify<
|
34
|
-
[_key in
|
33
|
+
} as Prettify<returnTypeOverride> & {
|
34
|
+
[_key in exclude[number]]: never
|
35
35
|
}
|
36
36
|
},
|
37
37
|
type,
|
@@ -18,19 +18,19 @@ type TransactionPendingDependencies =
|
|
18
18
|
| 'transactionIndex'
|
19
19
|
|
20
20
|
export type FormattedTransaction<
|
21
|
-
|
22
|
-
|
21
|
+
chain extends Chain | undefined = undefined,
|
22
|
+
blockTag extends BlockTag = BlockTag,
|
23
23
|
_FormatterReturnType = ExtractChainFormatterReturnType<
|
24
|
-
|
24
|
+
chain,
|
25
25
|
'transaction',
|
26
26
|
Transaction
|
27
27
|
>,
|
28
28
|
_ExcludedPendingDependencies extends string = TransactionPendingDependencies &
|
29
|
-
ExtractChainFormatterExclude<
|
29
|
+
ExtractChainFormatterExclude<chain, 'transaction'>,
|
30
30
|
> = UnionLooseOmit<_FormatterReturnType, TransactionPendingDependencies> & {
|
31
31
|
[_K in _ExcludedPendingDependencies]: never
|
32
32
|
} & Pick<
|
33
|
-
Transaction<bigint, number,
|
33
|
+
Transaction<bigint, number, blockTag extends 'pending' ? true : false>,
|
34
34
|
TransactionPendingDependencies
|
35
35
|
>
|
36
36
|
|
@@ -13,9 +13,9 @@ import { formatLog } from './log.js'
|
|
13
13
|
import { transactionType } from './transaction.js'
|
14
14
|
|
15
15
|
export type FormattedTransactionReceipt<
|
16
|
-
|
16
|
+
chain extends Chain | undefined = undefined,
|
17
17
|
> = ExtractChainFormatterReturnType<
|
18
|
-
|
18
|
+
chain,
|
19
19
|
'transactionReceipt',
|
20
20
|
TransactionReceipt
|
21
21
|
>
|
@@ -11,9 +11,9 @@ import { bytesToHex, numberToHex } from '../encoding/toHex.js'
|
|
11
11
|
import { type DefineFormatterErrorType, defineFormatter } from './formatter.js'
|
12
12
|
|
13
13
|
export type FormattedTransactionRequest<
|
14
|
-
|
14
|
+
chain extends Chain | undefined = Chain | undefined,
|
15
15
|
> = ExtractChainFormatterParameters<
|
16
|
-
|
16
|
+
chain,
|
17
17
|
'transactionRequest',
|
18
18
|
TransactionRequest
|
19
19
|
>
|
package/utils/hash/keccak256.ts
CHANGED
@@ -8,9 +8,9 @@ import { type ToHexErrorType, toHex } from '../encoding/toHex.js'
|
|
8
8
|
|
9
9
|
type To = 'hex' | 'bytes'
|
10
10
|
|
11
|
-
export type Keccak256Hash<
|
12
|
-
| (
|
13
|
-
| (
|
11
|
+
export type Keccak256Hash<to extends To> =
|
12
|
+
| (to extends 'bytes' ? ByteArray : never)
|
13
|
+
| (to extends 'hex' ? Hex : never)
|
14
14
|
|
15
15
|
export type Keccak256ErrorType =
|
16
16
|
| IsHexErrorType
|
@@ -18,14 +18,14 @@ export type Keccak256ErrorType =
|
|
18
18
|
| ToHexErrorType
|
19
19
|
| ErrorType
|
20
20
|
|
21
|
-
export function keccak256<
|
21
|
+
export function keccak256<to extends To = 'hex'>(
|
22
22
|
value: Hex | ByteArray,
|
23
|
-
to_?:
|
24
|
-
): Keccak256Hash<
|
23
|
+
to_?: to | undefined,
|
24
|
+
): Keccak256Hash<to> {
|
25
25
|
const to = to_ || 'hex'
|
26
26
|
const bytes = keccak_256(
|
27
27
|
isHex(value, { strict: false }) ? toBytes(value) : value,
|
28
28
|
)
|
29
|
-
if (to === 'bytes') return bytes as Keccak256Hash<
|
30
|
-
return toHex(bytes) as Keccak256Hash<
|
29
|
+
if (to === 'bytes') return bytes as Keccak256Hash<to>
|
30
|
+
return toHex(bytes) as Keccak256Hash<to>
|
31
31
|
}
|
package/utils/hash/ripemd160.ts
CHANGED
@@ -8,9 +8,9 @@ import { type ToHexErrorType, toHex } from '../encoding/toHex.js'
|
|
8
8
|
|
9
9
|
type To = 'hex' | 'bytes'
|
10
10
|
|
11
|
-
export type Ripemd160Hash<
|
12
|
-
| (
|
13
|
-
| (
|
11
|
+
export type Ripemd160Hash<to extends To> =
|
12
|
+
| (to extends 'bytes' ? ByteArray : never)
|
13
|
+
| (to extends 'hex' ? Hex : never)
|
14
14
|
|
15
15
|
export type Ripemd160ErrorType =
|
16
16
|
| IsHexErrorType
|
@@ -18,14 +18,14 @@ export type Ripemd160ErrorType =
|
|
18
18
|
| ToHexErrorType
|
19
19
|
| ErrorType
|
20
20
|
|
21
|
-
export function ripemd160<
|
21
|
+
export function ripemd160<to extends To = 'hex'>(
|
22
22
|
value: Hex | ByteArray,
|
23
|
-
to_?:
|
24
|
-
): Ripemd160Hash<
|
23
|
+
to_?: to | undefined,
|
24
|
+
): Ripemd160Hash<to> {
|
25
25
|
const to = to_ || 'hex'
|
26
26
|
const bytes = noble_ripemd160(
|
27
27
|
isHex(value, { strict: false }) ? toBytes(value) : value,
|
28
28
|
)
|
29
|
-
if (to === 'bytes') return bytes as Ripemd160Hash<
|
30
|
-
return toHex(bytes) as Ripemd160Hash<
|
29
|
+
if (to === 'bytes') return bytes as Ripemd160Hash<to>
|
30
|
+
return toHex(bytes) as Ripemd160Hash<to>
|
31
31
|
}
|
package/utils/hash/sha256.ts
CHANGED
@@ -8,9 +8,9 @@ import { type ToHexErrorType, toHex } from '../encoding/toHex.js'
|
|
8
8
|
|
9
9
|
type To = 'hex' | 'bytes'
|
10
10
|
|
11
|
-
export type Sha256Hash<
|
12
|
-
| (
|
13
|
-
| (
|
11
|
+
export type Sha256Hash<to extends To> =
|
12
|
+
| (to extends 'bytes' ? ByteArray : never)
|
13
|
+
| (to extends 'hex' ? Hex : never)
|
14
14
|
|
15
15
|
export type Sha256ErrorType =
|
16
16
|
| IsHexErrorType
|
@@ -18,14 +18,14 @@ export type Sha256ErrorType =
|
|
18
18
|
| ToHexErrorType
|
19
19
|
| ErrorType
|
20
20
|
|
21
|
-
export function sha256<
|
21
|
+
export function sha256<to extends To = 'hex'>(
|
22
22
|
value: Hex | ByteArray,
|
23
|
-
to_?:
|
24
|
-
): Sha256Hash<
|
23
|
+
to_?: to | undefined,
|
24
|
+
): Sha256Hash<to> {
|
25
25
|
const to = to_ || 'hex'
|
26
26
|
const bytes = noble_sha256(
|
27
27
|
isHex(value, { strict: false }) ? toBytes(value) : value,
|
28
28
|
)
|
29
|
-
if (to === 'bytes') return bytes as Sha256Hash<
|
30
|
-
return toHex(bytes) as Sha256Hash<
|
29
|
+
if (to === 'bytes') return bytes as Sha256Hash<to>
|
30
|
+
return toHex(bytes) as Sha256Hash<to>
|
31
31
|
}
|
package/utils/observe.ts
CHANGED
@@ -14,8 +14,8 @@ export const listenersCache = /*#__PURE__*/ new Map<
|
|
14
14
|
/** @internal */
|
15
15
|
export const cleanupCache = /*#__PURE__*/ new Map<string, () => void>()
|
16
16
|
|
17
|
-
type EmitFunction<
|
18
|
-
emit:
|
17
|
+
type EmitFunction<callbacks extends Callbacks> = (
|
18
|
+
emit: callbacks,
|
19
19
|
) => MaybePromise<void | (() => void)>
|
20
20
|
|
21
21
|
let callbackCount = 0
|
@@ -25,10 +25,10 @@ let callbackCount = 0
|
|
25
25
|
* is set up under the same observer id, the function will only be called once
|
26
26
|
* for both instances of the observer.
|
27
27
|
*/
|
28
|
-
export function observe<
|
28
|
+
export function observe<callbacks extends Callbacks>(
|
29
29
|
observerId: string,
|
30
|
-
callbacks:
|
31
|
-
fn: EmitFunction<
|
30
|
+
callbacks: callbacks,
|
31
|
+
fn: EmitFunction<callbacks>,
|
32
32
|
) {
|
33
33
|
const callbackId = ++callbackCount
|
34
34
|
|
@@ -56,15 +56,15 @@ export function observe<TCallbacks extends Callbacks>(
|
|
56
56
|
|
57
57
|
if (listeners && listeners.length > 0) return unwatch
|
58
58
|
|
59
|
-
const emit:
|
59
|
+
const emit: callbacks = {} as callbacks
|
60
60
|
for (const key in callbacks) {
|
61
61
|
emit[key] = ((
|
62
|
-
...args: Parameters<NonNullable<
|
62
|
+
...args: Parameters<NonNullable<callbacks[keyof callbacks]>>
|
63
63
|
) => {
|
64
64
|
const listeners = getListeners()
|
65
65
|
if (listeners.length === 0) return
|
66
66
|
for (const listener of listeners) listener.fns[key]?.(...args)
|
67
|
-
}) as
|
67
|
+
}) as callbacks[Extract<keyof callbacks, string>]
|
68
68
|
}
|
69
69
|
|
70
70
|
const cleanup = fn(emit)
|
package/utils/poll.ts
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
import type { ErrorType } from '../errors/utils.js'
|
2
2
|
import { wait } from './wait.js'
|
3
3
|
|
4
|
-
type PollOptions<
|
4
|
+
type PollOptions<data> = {
|
5
5
|
// Whether or not to emit when the polling starts.
|
6
6
|
emitOnBegin?: boolean | undefined
|
7
7
|
// The initial wait time (in ms) before polling.
|
8
|
-
initialWaitTime?: ((data:
|
8
|
+
initialWaitTime?: ((data: data | void) => Promise<number>) | undefined
|
9
9
|
// The interval (in ms).
|
10
10
|
interval: number
|
11
11
|
}
|
@@ -15,16 +15,16 @@ export type PollErrorType = ErrorType
|
|
15
15
|
/**
|
16
16
|
* @description Polls a function at a specified interval.
|
17
17
|
*/
|
18
|
-
export function poll<
|
19
|
-
fn: ({ unpoll }: { unpoll: () => void }) => Promise<
|
20
|
-
{ emitOnBegin, initialWaitTime, interval }: PollOptions<
|
18
|
+
export function poll<data>(
|
19
|
+
fn: ({ unpoll }: { unpoll: () => void }) => Promise<data | void>,
|
20
|
+
{ emitOnBegin, initialWaitTime, interval }: PollOptions<data>,
|
21
21
|
) {
|
22
22
|
let active = true
|
23
23
|
|
24
24
|
const unwatch = () => (active = false)
|
25
25
|
|
26
26
|
const watch = async () => {
|
27
|
-
let data:
|
27
|
+
let data: data | void = undefined
|
28
28
|
if (emitOnBegin) data = await fn({ unpoll: unwatch })
|
29
29
|
|
30
30
|
const initialWait = (await initialWaitTime?.(data)) ?? interval
|
@@ -1,41 +1,38 @@
|
|
1
1
|
import type { ErrorType } from '../../errors/utils.js'
|
2
2
|
|
3
|
-
type Resolved<
|
4
|
-
result:
|
5
|
-
results:
|
3
|
+
type Resolved<returnType extends readonly unknown[] = any> = [
|
4
|
+
result: returnType[number],
|
5
|
+
results: returnType,
|
6
6
|
]
|
7
7
|
|
8
|
-
type PendingPromise<
|
9
|
-
resolve?: ((data: Resolved<
|
8
|
+
type PendingPromise<returnType extends readonly unknown[] = any> = {
|
9
|
+
resolve?: ((data: Resolved<returnType>) => void) | undefined
|
10
10
|
reject?: ((reason?: unknown) => void) | undefined
|
11
11
|
}
|
12
12
|
|
13
13
|
type SchedulerItem = { args: unknown; pendingPromise: PendingPromise }
|
14
14
|
|
15
|
-
type BatchResultsCompareFn<
|
16
|
-
a: TResult,
|
17
|
-
b: TResult,
|
18
|
-
) => number
|
15
|
+
type BatchResultsCompareFn<result = unknown> = (a: result, b: result) => number
|
19
16
|
|
20
17
|
type CreateBatchSchedulerArguments<
|
21
|
-
|
22
|
-
|
18
|
+
parameters = unknown,
|
19
|
+
returnType extends readonly unknown[] = readonly unknown[],
|
23
20
|
> = {
|
24
|
-
fn: (args:
|
21
|
+
fn: (args: parameters[]) => Promise<returnType>
|
25
22
|
id: number | string
|
26
|
-
shouldSplitBatch?: ((args:
|
23
|
+
shouldSplitBatch?: ((args: parameters[]) => boolean) | undefined
|
27
24
|
wait?: number | undefined
|
28
|
-
sort?: BatchResultsCompareFn<
|
25
|
+
sort?: BatchResultsCompareFn<returnType[number]> | undefined
|
29
26
|
}
|
30
27
|
|
31
28
|
type CreateBatchSchedulerReturnType<
|
32
|
-
|
33
|
-
|
29
|
+
parameters = unknown,
|
30
|
+
returnType extends readonly unknown[] = readonly unknown[],
|
34
31
|
> = {
|
35
32
|
flush: () => void
|
36
|
-
schedule:
|
37
|
-
? (args?:
|
38
|
-
: (args:
|
33
|
+
schedule: parameters extends undefined
|
34
|
+
? (args?: parameters | undefined) => Promise<Resolved<returnType>>
|
35
|
+
: (args: parameters) => Promise<Resolved<returnType>>
|
39
36
|
}
|
40
37
|
|
41
38
|
export type CreateBatchSchedulerErrorType = ErrorType
|
@@ -44,8 +41,8 @@ const schedulerCache = /*#__PURE__*/ new Map<number | string, SchedulerItem[]>()
|
|
44
41
|
|
45
42
|
/** @internal */
|
46
43
|
export function createBatchScheduler<
|
47
|
-
|
48
|
-
|
44
|
+
parameters,
|
45
|
+
returnType extends readonly unknown[],
|
49
46
|
>({
|
50
47
|
fn,
|
51
48
|
id,
|
@@ -53,9 +50,9 @@ export function createBatchScheduler<
|
|
53
50
|
wait = 0,
|
54
51
|
sort,
|
55
52
|
}: CreateBatchSchedulerArguments<
|
56
|
-
|
57
|
-
|
58
|
-
>): CreateBatchSchedulerReturnType<
|
53
|
+
parameters,
|
54
|
+
returnType
|
55
|
+
>): CreateBatchSchedulerReturnType<parameters, returnType> {
|
59
56
|
const exec = async () => {
|
60
57
|
const scheduler = getScheduler()
|
61
58
|
flush()
|
@@ -64,7 +61,7 @@ export function createBatchScheduler<
|
|
64
61
|
|
65
62
|
if (args.length === 0) return
|
66
63
|
|
67
|
-
fn(args as
|
64
|
+
fn(args as parameters[])
|
68
65
|
.then((data) => {
|
69
66
|
if (sort && Array.isArray(data)) data.sort(sort)
|
70
67
|
for (let i = 0; i < scheduler.length; i++) {
|
@@ -83,7 +80,7 @@ export function createBatchScheduler<
|
|
83
80
|
const flush = () => schedulerCache.delete(id)
|
84
81
|
|
85
82
|
const getBatchedArgs = () =>
|
86
|
-
getScheduler().map(({ args }) => args) as
|
83
|
+
getScheduler().map(({ args }) => args) as parameters[]
|
87
84
|
|
88
85
|
const getScheduler = () => schedulerCache.get(id) || []
|
89
86
|
|
@@ -92,9 +89,9 @@ export function createBatchScheduler<
|
|
92
89
|
|
93
90
|
return {
|
94
91
|
flush,
|
95
|
-
async schedule(args:
|
96
|
-
const pendingPromise: PendingPromise<
|
97
|
-
const promise = new Promise<Resolved<
|
92
|
+
async schedule(args: parameters) {
|
93
|
+
const pendingPromise: PendingPromise<returnType> = {}
|
94
|
+
const promise = new Promise<Resolved<returnType>>((resolve, reject) => {
|
98
95
|
pendingPromise.resolve = resolve
|
99
96
|
pendingPromise.reject = reject
|
100
97
|
})
|
@@ -113,5 +110,5 @@ export function createBatchScheduler<
|
|
113
110
|
setTimeout(exec, wait)
|
114
111
|
return promise
|
115
112
|
},
|
116
|
-
} as unknown as CreateBatchSchedulerReturnType<
|
113
|
+
} as unknown as CreateBatchSchedulerReturnType<parameters, returnType>
|
117
114
|
}
|
@@ -7,15 +7,15 @@ export const responseCache = /*#__PURE__*/ new Map()
|
|
7
7
|
|
8
8
|
export type GetCacheErrorType = ErrorType
|
9
9
|
|
10
|
-
export function getCache<
|
11
|
-
const buildCache = <
|
10
|
+
export function getCache<data>(cacheKey: string) {
|
11
|
+
const buildCache = <data>(cacheKey: string, cache: Map<string, data>) => ({
|
12
12
|
clear: () => cache.delete(cacheKey),
|
13
13
|
get: () => cache.get(cacheKey),
|
14
|
-
set: (data:
|
14
|
+
set: (data: data) => cache.set(cacheKey, data),
|
15
15
|
})
|
16
16
|
|
17
|
-
const promise = buildCache<Promise<
|
18
|
-
const response = buildCache<{ created: Date; data:
|
17
|
+
const promise = buildCache<Promise<data>>(cacheKey, promiseCache)
|
18
|
+
const response = buildCache<{ created: Date; data: data }>(
|
19
19
|
cacheKey,
|
20
20
|
responseCache,
|
21
21
|
)
|
@@ -41,11 +41,11 @@ type WithCacheParameters = {
|
|
41
41
|
* @description Returns the result of a given promise, and caches the result for
|
42
42
|
* subsequent invocations against a provided cache key.
|
43
43
|
*/
|
44
|
-
export async function withCache<
|
45
|
-
fn: () => Promise<
|
44
|
+
export async function withCache<data>(
|
45
|
+
fn: () => Promise<data>,
|
46
46
|
{ cacheKey, cacheTime = Number.POSITIVE_INFINITY }: WithCacheParameters,
|
47
47
|
) {
|
48
|
-
const cache = getCache<
|
48
|
+
const cache = getCache<data>(cacheKey)
|
49
49
|
|
50
50
|
// If a response exists in the cache, and it's not expired, return it
|
51
51
|
// and do not invoke the promise.
|
@@ -23,15 +23,15 @@ export type WithRetryParameters = {
|
|
23
23
|
|
24
24
|
export type WithRetryErrorType = ErrorType
|
25
25
|
|
26
|
-
export function withRetry<
|
27
|
-
fn: () => Promise<
|
26
|
+
export function withRetry<data>(
|
27
|
+
fn: () => Promise<data>,
|
28
28
|
{
|
29
29
|
delay: delay_ = 100,
|
30
30
|
retryCount = 2,
|
31
31
|
shouldRetry = () => true,
|
32
32
|
}: WithRetryParameters = {},
|
33
33
|
) {
|
34
|
-
return new Promise<
|
34
|
+
return new Promise<data>((resolve, reject) => {
|
35
35
|
const attemptRetry = async ({ count = 0 } = {}) => {
|
36
36
|
const retry = async ({ error }: { error: Error }) => {
|
37
37
|
const delay =
|
@@ -2,10 +2,10 @@ import type { ErrorType } from '../../errors/utils.js'
|
|
2
2
|
|
3
3
|
export type WithTimeoutErrorType = ErrorType
|
4
4
|
|
5
|
-
export function withTimeout<
|
5
|
+
export function withTimeout<data>(
|
6
6
|
fn: ({
|
7
7
|
signal,
|
8
|
-
}: { signal: AbortController['signal'] | null }) => Promise<
|
8
|
+
}: { signal: AbortController['signal'] | null }) => Promise<data>,
|
9
9
|
{
|
10
10
|
errorInstance = new Error('timed out'),
|
11
11
|
timeout,
|
@@ -18,7 +18,7 @@ export function withTimeout<TData>(
|
|
18
18
|
// Whether or not the timeout should use an abort signal.
|
19
19
|
signal?: boolean | undefined
|
20
20
|
},
|
21
|
-
): Promise<
|
21
|
+
): Promise<data> {
|
22
22
|
return new Promise((resolve, reject) => {
|
23
23
|
;(async () => {
|
24
24
|
let timeoutId!: NodeJS.Timeout
|
package/utils/rpc/http.ts
CHANGED
@@ -25,10 +25,10 @@ export type HttpRpcClientOptions = {
|
|
25
25
|
}
|
26
26
|
|
27
27
|
export type HttpRequestParameters<
|
28
|
-
|
28
|
+
body extends RpcRequest | RpcRequest[] = RpcRequest,
|
29
29
|
> = {
|
30
30
|
/** The RPC request body. */
|
31
|
-
body:
|
31
|
+
body: body
|
32
32
|
/** Request configuration to pass to `fetch`. */
|
33
33
|
fetchOptions?: HttpRpcClientOptions['fetchOptions'] | undefined
|
34
34
|
/** A callback to handle the response. */
|
@@ -40,8 +40,8 @@ export type HttpRequestParameters<
|
|
40
40
|
}
|
41
41
|
|
42
42
|
export type HttpRequestReturnType<
|
43
|
-
|
44
|
-
> =
|
43
|
+
body extends RpcRequest | RpcRequest[] = RpcRequest,
|
44
|
+
> = body extends RpcRequest[] ? RpcResponse[] : RpcResponse
|
45
45
|
|
46
46
|
export type HttpRequestErrorType =
|
47
47
|
| HttpRequestErrorType_
|
@@ -50,9 +50,9 @@ export type HttpRequestErrorType =
|
|
50
50
|
| ErrorType
|
51
51
|
|
52
52
|
export type HttpRpcClient = {
|
53
|
-
request<
|
54
|
-
params: HttpRequestParameters<
|
55
|
-
): Promise<HttpRequestReturnType<
|
53
|
+
request<body extends RpcRequest | RpcRequest[]>(
|
54
|
+
params: HttpRequestParameters<body>,
|
55
|
+
): Promise<HttpRequestReturnType<body>>
|
56
56
|
}
|
57
57
|
|
58
58
|
export function getHttpRpcClient(
|