viem 2.57.17 → 2.57.19
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +100 -0
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js +4 -2
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -1
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterStubData.js +6 -2
- package/_cjs/account-abstraction/actions/paymaster/getPaymasterStubData.js.map +1 -1
- package/_cjs/actions/ens/getEnsAddress.js +11 -1
- package/_cjs/actions/ens/getEnsAddress.js.map +1 -1
- package/_cjs/actions/ens/getEnsText.js.map +1 -1
- package/_cjs/actions/index.js +5 -3
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/public/call.js +13 -2
- package/_cjs/actions/public/call.js.map +1 -1
- package/_cjs/actions/public/getDelegation.js +2 -1
- package/_cjs/actions/public/getDelegation.js.map +1 -1
- package/_cjs/actions/public/getFeeHistory.js.map +1 -1
- package/_cjs/actions/public/getLogs.js +18 -1
- package/_cjs/actions/public/getLogs.js.map +1 -1
- package/_cjs/actions/public/internal/isRangeError.js +18 -0
- package/_cjs/actions/public/internal/isRangeError.js.map +1 -0
- package/_cjs/actions/public/internal/watchTransport.js +24 -0
- package/_cjs/actions/public/internal/watchTransport.js.map +1 -0
- package/_cjs/actions/public/iterateLogs.js +48 -0
- package/_cjs/actions/public/iterateLogs.js.map +1 -0
- package/_cjs/actions/public/simulateContract.js +4 -4
- package/_cjs/actions/public/simulateContract.js.map +1 -1
- package/_cjs/actions/public/verifyHash.js +72 -39
- package/_cjs/actions/public/verifyHash.js.map +1 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js +18 -1
- package/_cjs/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_cjs/actions/public/watchBlockHeaders.js +2 -10
- package/_cjs/actions/public/watchBlockHeaders.js.map +1 -1
- package/_cjs/actions/public/watchBlockNumber.js +3 -18
- package/_cjs/actions/public/watchBlockNumber.js.map +1 -1
- package/_cjs/actions/public/watchBlocks.js +3 -18
- package/_cjs/actions/public/watchBlocks.js.map +1 -1
- package/_cjs/actions/public/watchContractEvent.js +5 -33
- package/_cjs/actions/public/watchContractEvent.js.map +1 -1
- package/_cjs/actions/public/watchEvent.js +5 -33
- package/_cjs/actions/public/watchEvent.js.map +1 -1
- package/_cjs/actions/token/internal.js +2 -10
- package/_cjs/actions/token/internal.js.map +1 -1
- package/_cjs/actions/wallet/deployContract.js +2 -1
- package/_cjs/actions/wallet/deployContract.js.map +1 -1
- package/_cjs/actions/wallet/prepareTransactionRequest.js +16 -3
- package/_cjs/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_cjs/actions/wallet/sendCalls.js +2 -1
- package/_cjs/actions/wallet/sendCalls.js.map +1 -1
- package/_cjs/actions/wallet/signAuthorization.js +2 -1
- package/_cjs/actions/wallet/signAuthorization.js.map +1 -1
- package/_cjs/celo/serializers.js +1 -1
- package/_cjs/celo/serializers.js.map +1 -1
- package/_cjs/chains/definitions/kinetiqElysium.js +30 -0
- package/_cjs/chains/definitions/kinetiqElysium.js.map +1 -0
- package/_cjs/chains/definitions/kinetiqElysiumTestnet.js +31 -0
- package/_cjs/chains/definitions/kinetiqElysiumTestnet.js.map +1 -0
- package/_cjs/chains/index.js +14 -9
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/decorators/public.js +2 -0
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/constants/contracts.js +1 -1
- package/_cjs/constants/contracts.js.map +1 -1
- package/_cjs/errors/chain.js +2 -2
- package/_cjs/errors/chain.js.map +1 -1
- package/_cjs/errors/typedData.js +2 -0
- package/_cjs/errors/typedData.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js +5 -4
- package/_cjs/index.js.map +1 -1
- package/_cjs/op-stack/actions/buildProveWithdrawal.js +5 -5
- package/_cjs/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_cjs/op-stack/actions/getL2Output.js +13 -9
- package/_cjs/op-stack/actions/getL2Output.js.map +1 -1
- package/_cjs/op-stack/actions/waitToProve.js +1 -0
- package/_cjs/op-stack/actions/waitToProve.js.map +1 -1
- package/_cjs/tempo/Account.js +30 -0
- package/_cjs/tempo/Account.js.map +1 -1
- package/_cjs/tempo/actions/accessKey.js +1 -1
- package/_cjs/tempo/actions/accessKey.js.map +1 -1
- package/_cjs/tempo/actions/accounts.js +19 -9
- package/_cjs/tempo/actions/accounts.js.map +1 -1
- package/_cjs/tempo/actions/earn/deployment.js +1 -1
- package/_cjs/tempo/actions/earn/deployment.js.map +1 -1
- package/_cjs/tempo/actions/earn.js +3 -3
- package/_cjs/tempo/actions/earn.js.map +1 -1
- package/_cjs/tempo/actions/propAmm.js +1 -1
- package/_cjs/tempo/actions/propAmm.js.map +1 -1
- package/_cjs/tempo/actions/token.js +10 -2
- package/_cjs/tempo/actions/token.js.map +1 -1
- package/_cjs/tempo/chainConfig.js +37 -1
- package/_cjs/tempo/chainConfig.js.map +1 -1
- package/_cjs/tempo/internal/preAuthorized.js +214 -0
- package/_cjs/tempo/internal/preAuthorized.js.map +1 -0
- package/_cjs/tempo/internal/relay/feePayer.js +25 -7
- package/_cjs/tempo/internal/relay/feePayer.js.map +1 -1
- package/_cjs/tempo/internal/relay.js +2 -2
- package/_cjs/tempo/internal/relay.js.map +1 -1
- package/_cjs/tempo/internal/utils.js +2 -10
- package/_cjs/tempo/internal/utils.js.map +1 -1
- package/_cjs/tokens/defineToken.js +1 -1
- package/_cjs/tokens/defineToken.js.map +1 -1
- package/_cjs/tokens/definitions/ousd.js +1 -0
- package/_cjs/tokens/definitions/ousd.js.map +1 -1
- package/_cjs/utils/abi/decodeAbiParameters.js +33 -9
- package/_cjs/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodeAbiParameters.js +5 -4
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodePacked.js +4 -2
- package/_cjs/utils/abi/encodePacked.js.map +1 -1
- package/_cjs/utils/ccip.js +5 -1
- package/_cjs/utils/ccip.js.map +1 -1
- package/_cjs/utils/chain/getChainContractAddress.js +2 -2
- package/_cjs/utils/chain/getChainContractAddress.js.map +1 -1
- package/_cjs/utils/encoding/toBytes.js +5 -6
- package/_cjs/utils/encoding/toBytes.js.map +1 -1
- package/_cjs/utils/ens/avatar/utils.js +25 -5
- package/_cjs/utils/ens/avatar/utils.js.map +1 -1
- package/_cjs/utils/ens/localBatchGatewayRequest.js +13 -1
- package/_cjs/utils/ens/localBatchGatewayRequest.js.map +1 -1
- package/_cjs/utils/promise/createBatchScheduler.js +1 -1
- package/_cjs/utils/promise/createBatchScheduler.js.map +1 -1
- package/_cjs/utils/siwe/validateSiweMessage.js +5 -0
- package/_cjs/utils/siwe/validateSiweMessage.js.map +1 -1
- package/_cjs/zksync/actions/estimateFee.js +1 -1
- package/_cjs/zksync/actions/estimateFee.js.map +1 -1
- package/_cjs/zksync/actions/estimateGasL1ToL2.js +1 -1
- package/_cjs/zksync/actions/estimateGasL1ToL2.js.map +1 -1
- package/_cjs/zksync/actions/finalizeWithdrawal.js +3 -3
- package/_cjs/zksync/actions/finalizeWithdrawal.js.map +1 -1
- package/_cjs/zksync/actions/sendEip712Transaction.js +10 -2
- package/_cjs/zksync/actions/sendEip712Transaction.js.map +1 -1
- package/_cjs/zksync/actions/signEip712Transaction.js +2 -2
- package/_cjs/zksync/actions/signEip712Transaction.js.map +1 -1
- package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js +4 -2
- package/_esm/account-abstraction/actions/paymaster/getPaymasterData.js.map +1 -1
- package/_esm/account-abstraction/actions/paymaster/getPaymasterStubData.js +6 -2
- package/_esm/account-abstraction/actions/paymaster/getPaymasterStubData.js.map +1 -1
- package/_esm/actions/ens/getEnsAddress.js +12 -1
- package/_esm/actions/ens/getEnsAddress.js.map +1 -1
- package/_esm/actions/ens/getEnsText.js.map +1 -1
- package/_esm/actions/index.js +1 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/public/call.js +13 -2
- package/_esm/actions/public/call.js.map +1 -1
- package/_esm/actions/public/getDelegation.js +2 -1
- package/_esm/actions/public/getDelegation.js.map +1 -1
- package/_esm/actions/public/getFeeHistory.js.map +1 -1
- package/_esm/actions/public/getLogs.js +18 -1
- package/_esm/actions/public/getLogs.js.map +1 -1
- package/_esm/actions/public/internal/isRangeError.js +19 -0
- package/_esm/actions/public/internal/isRangeError.js.map +1 -0
- package/_esm/actions/public/internal/watchTransport.js +22 -0
- package/_esm/actions/public/internal/watchTransport.js.map +1 -0
- package/_esm/actions/public/iterateLogs.js +84 -0
- package/_esm/actions/public/iterateLogs.js.map +1 -0
- package/_esm/actions/public/simulateContract.js +5 -4
- package/_esm/actions/public/simulateContract.js.map +1 -1
- package/_esm/actions/public/verifyHash.js +77 -40
- package/_esm/actions/public/verifyHash.js.map +1 -1
- package/_esm/actions/public/waitForTransactionReceipt.js +20 -1
- package/_esm/actions/public/waitForTransactionReceipt.js.map +1 -1
- package/_esm/actions/public/watchBlockHeaders.js +2 -10
- package/_esm/actions/public/watchBlockHeaders.js.map +1 -1
- package/_esm/actions/public/watchBlockNumber.js +3 -18
- package/_esm/actions/public/watchBlockNumber.js.map +1 -1
- package/_esm/actions/public/watchBlocks.js +3 -18
- package/_esm/actions/public/watchBlocks.js.map +1 -1
- package/_esm/actions/public/watchContractEvent.js +4 -36
- package/_esm/actions/public/watchContractEvent.js.map +1 -1
- package/_esm/actions/public/watchEvent.js +4 -36
- package/_esm/actions/public/watchEvent.js.map +1 -1
- package/_esm/actions/token/internal.js +2 -10
- package/_esm/actions/token/internal.js.map +1 -1
- package/_esm/actions/wallet/deployContract.js +2 -1
- package/_esm/actions/wallet/deployContract.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +17 -3
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/actions/wallet/sendCalls.js +2 -1
- package/_esm/actions/wallet/sendCalls.js.map +1 -1
- package/_esm/actions/wallet/signAuthorization.js +2 -1
- package/_esm/actions/wallet/signAuthorization.js.map +1 -1
- package/_esm/celo/serializers.js +1 -1
- package/_esm/celo/serializers.js.map +1 -1
- package/_esm/chains/definitions/kinetiqElysium.js +27 -0
- package/_esm/chains/definitions/kinetiqElysium.js.map +1 -0
- package/_esm/chains/definitions/kinetiqElysiumTestnet.js +28 -0
- package/_esm/chains/definitions/kinetiqElysiumTestnet.js.map +1 -0
- package/_esm/chains/index.js +2 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/decorators/public.js +2 -0
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/constants/contracts.js +1 -1
- package/_esm/constants/contracts.js.map +1 -1
- package/_esm/errors/chain.js +2 -2
- package/_esm/errors/chain.js.map +1 -1
- package/_esm/errors/typedData.js +2 -0
- package/_esm/errors/typedData.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/op-stack/actions/buildProveWithdrawal.js +5 -5
- package/_esm/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_esm/op-stack/actions/getL2Output.js +14 -9
- package/_esm/op-stack/actions/getL2Output.js.map +1 -1
- package/_esm/op-stack/actions/waitToProve.js +1 -0
- package/_esm/op-stack/actions/waitToProve.js.map +1 -1
- package/_esm/tempo/Account.js +33 -1
- package/_esm/tempo/Account.js.map +1 -1
- package/_esm/tempo/actions/accessKey.js +1 -1
- package/_esm/tempo/actions/accessKey.js.map +1 -1
- package/_esm/tempo/actions/accounts.js +24 -10
- package/_esm/tempo/actions/accounts.js.map +1 -1
- package/_esm/tempo/actions/earn/deployment.js +1 -1
- package/_esm/tempo/actions/earn/deployment.js.map +1 -1
- package/_esm/tempo/actions/earn.js +3 -3
- package/_esm/tempo/actions/earn.js.map +1 -1
- package/_esm/tempo/actions/propAmm.js +1 -1
- package/_esm/tempo/actions/propAmm.js.map +1 -1
- package/_esm/tempo/actions/token.js +10 -2
- package/_esm/tempo/actions/token.js.map +1 -1
- package/_esm/tempo/chainConfig.js +41 -1
- package/_esm/tempo/chainConfig.js.map +1 -1
- package/_esm/tempo/internal/preAuthorized.js +244 -0
- package/_esm/tempo/internal/preAuthorized.js.map +1 -0
- package/_esm/tempo/internal/relay/feePayer.js +26 -7
- package/_esm/tempo/internal/relay/feePayer.js.map +1 -1
- package/_esm/tempo/internal/relay.js +8 -3
- package/_esm/tempo/internal/relay.js.map +1 -1
- package/_esm/tempo/internal/utils.js +2 -10
- package/_esm/tempo/internal/utils.js.map +1 -1
- package/_esm/tokens/defineToken.js +2 -1
- package/_esm/tokens/defineToken.js.map +1 -1
- package/_esm/tokens/definitions/ousd.js +2 -1
- package/_esm/tokens/definitions/ousd.js.map +1 -1
- package/_esm/utils/abi/decodeAbiParameters.js +37 -9
- package/_esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodeAbiParameters.js +6 -4
- package/_esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodePacked.js +5 -2
- package/_esm/utils/abi/encodePacked.js.map +1 -1
- package/_esm/utils/ccip.js +8 -3
- package/_esm/utils/ccip.js.map +1 -1
- package/_esm/utils/chain/getChainContractAddress.js +2 -2
- package/_esm/utils/chain/getChainContractAddress.js.map +1 -1
- package/_esm/utils/encoding/toBytes.js +5 -6
- package/_esm/utils/encoding/toBytes.js.map +1 -1
- package/_esm/utils/ens/avatar/utils.js +26 -5
- package/_esm/utils/ens/avatar/utils.js.map +1 -1
- package/_esm/utils/ens/localBatchGatewayRequest.js +17 -1
- package/_esm/utils/ens/localBatchGatewayRequest.js.map +1 -1
- package/_esm/utils/promise/createBatchScheduler.js +2 -1
- package/_esm/utils/promise/createBatchScheduler.js.map +1 -1
- package/_esm/utils/siwe/validateSiweMessage.js +6 -0
- package/_esm/utils/siwe/validateSiweMessage.js.map +1 -1
- package/_esm/zksync/actions/estimateFee.js +1 -1
- package/_esm/zksync/actions/estimateFee.js.map +1 -1
- package/_esm/zksync/actions/estimateGasL1ToL2.js +1 -1
- package/_esm/zksync/actions/estimateGasL1ToL2.js.map +1 -1
- package/_esm/zksync/actions/finalizeWithdrawal.js +3 -3
- package/_esm/zksync/actions/finalizeWithdrawal.js.map +1 -1
- package/_esm/zksync/actions/sendEip712Transaction.js +12 -2
- package/_esm/zksync/actions/sendEip712Transaction.js.map +1 -1
- package/_esm/zksync/actions/signEip712Transaction.js +2 -2
- package/_esm/zksync/actions/signEip712Transaction.js.map +1 -1
- package/_types/account-abstraction/actions/paymaster/getPaymasterData.d.ts.map +1 -1
- package/_types/account-abstraction/actions/paymaster/getPaymasterStubData.d.ts.map +1 -1
- package/_types/actions/ens/getEnsAddress.d.ts +2 -1
- package/_types/actions/ens/getEnsAddress.d.ts.map +1 -1
- package/_types/actions/ens/getEnsText.d.ts +2 -1
- package/_types/actions/ens/getEnsText.d.ts.map +1 -1
- package/_types/actions/index.d.ts +1 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/call.d.ts.map +1 -1
- package/_types/actions/public/getDelegation.d.ts.map +1 -1
- package/_types/actions/public/getFeeHistory.d.ts +2 -1
- package/_types/actions/public/getFeeHistory.d.ts.map +1 -1
- package/_types/actions/public/getLogs.d.ts +20 -2
- package/_types/actions/public/getLogs.d.ts.map +1 -1
- package/_types/actions/public/internal/isRangeError.d.ts +3 -0
- package/_types/actions/public/internal/isRangeError.d.ts.map +1 -0
- package/_types/actions/public/internal/watchTransport.d.ts +6 -0
- package/_types/actions/public/internal/watchTransport.d.ts.map +1 -0
- package/_types/actions/public/iterateLogs.d.ts +94 -0
- package/_types/actions/public/iterateLogs.d.ts.map +1 -0
- package/_types/actions/public/simulateContract.d.ts.map +1 -1
- package/_types/actions/public/verifyHash.d.ts +2 -1
- package/_types/actions/public/verifyHash.d.ts.map +1 -1
- package/_types/actions/public/waitForTransactionReceipt.d.ts +7 -2
- package/_types/actions/public/waitForTransactionReceipt.d.ts.map +1 -1
- package/_types/actions/public/watchBlockHeaders.d.ts.map +1 -1
- package/_types/actions/public/watchBlockNumber.d.ts.map +1 -1
- package/_types/actions/public/watchBlocks.d.ts.map +1 -1
- package/_types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/_types/actions/public/watchEvent.d.ts.map +1 -1
- package/_types/actions/token/internal.d.ts.map +1 -1
- package/_types/actions/wallet/deployContract.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +3 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/actions/wallet/sendCalls.d.ts.map +1 -1
- package/_types/actions/wallet/signAuthorization.d.ts.map +1 -1
- package/_types/celo/serializers.d.ts.map +1 -1
- package/_types/chains/definitions/kinetiqElysium.d.ts +52 -0
- package/_types/chains/definitions/kinetiqElysium.d.ts.map +1 -0
- package/_types/chains/definitions/kinetiqElysiumTestnet.d.ts +52 -0
- package/_types/chains/definitions/kinetiqElysiumTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +2 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +33 -0
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/constants/contracts.d.ts +1 -1
- package/_types/constants/contracts.d.ts.map +1 -1
- package/_types/errors/typedData.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +2 -1
- package/_types/index.d.ts.map +1 -1
- package/_types/op-stack/actions/getL2Output.d.ts +6 -0
- package/_types/op-stack/actions/getL2Output.d.ts.map +1 -1
- package/_types/op-stack/actions/waitToProve.d.ts.map +1 -1
- package/_types/tempo/Account.d.ts +5 -1
- package/_types/tempo/Account.d.ts.map +1 -1
- package/_types/tempo/actions/accounts.d.ts +4 -1
- package/_types/tempo/actions/accounts.d.ts.map +1 -1
- package/_types/tempo/actions/earn/deployment.d.ts.map +1 -1
- package/_types/tempo/actions/propAmm.d.ts.map +1 -1
- package/_types/tempo/actions/token.d.ts.map +1 -1
- package/_types/tempo/chainConfig.d.ts.map +1 -1
- package/_types/tempo/internal/preAuthorized.d.ts +41 -0
- package/_types/tempo/internal/preAuthorized.d.ts.map +1 -0
- package/_types/tempo/internal/relay/feePayer.d.ts.map +1 -1
- package/_types/tempo/internal/utils.d.ts.map +1 -1
- package/_types/tokens/defineToken.d.ts +5 -1
- package/_types/tokens/defineToken.d.ts.map +1 -1
- package/_types/tokens/definitions/ousd.d.ts +2 -1
- package/_types/tokens/definitions/ousd.d.ts.map +1 -1
- package/_types/tokens/sets.d.ts +3 -0
- package/_types/tokens/sets.d.ts.map +1 -1
- package/_types/utils/abi/decodeAbiParameters.d.ts +15 -1
- package/_types/utils/abi/decodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/abi/encodeAbiParameters.d.ts.map +1 -1
- package/_types/utils/ccip.d.ts +4 -3
- package/_types/utils/ccip.d.ts.map +1 -1
- package/_types/utils/encoding/toBytes.d.ts +1 -1
- package/_types/utils/encoding/toBytes.d.ts.map +1 -1
- package/_types/utils/ens/avatar/utils.d.ts +6 -2
- package/_types/utils/ens/avatar/utils.d.ts.map +1 -1
- package/_types/utils/ens/localBatchGatewayRequest.d.ts +6 -1
- package/_types/utils/ens/localBatchGatewayRequest.d.ts.map +1 -1
- package/_types/utils/promise/createBatchScheduler.d.ts.map +1 -1
- package/_types/utils/siwe/validateSiweMessage.d.ts.map +1 -1
- package/_types/zksync/actions/estimateFee.d.ts.map +1 -1
- package/_types/zksync/actions/estimateGasL1ToL2.d.ts.map +1 -1
- package/_types/zksync/actions/finalizeWithdrawal.d.ts.map +1 -1
- package/_types/zksync/actions/sendEip712Transaction.d.ts +1 -1
- package/_types/zksync/actions/sendEip712Transaction.d.ts.map +1 -1
- package/_types/zksync/errors/bridge.d.ts +1 -1
- package/_types/zksync/errors/bridge.d.ts.map +1 -1
- package/account-abstraction/actions/paymaster/getPaymasterData.ts +23 -16
- package/account-abstraction/actions/paymaster/getPaymasterStubData.ts +27 -16
- package/actions/ens/getEnsAddress.ts +15 -1
- package/actions/ens/getEnsText.ts +2 -0
- package/actions/index.ts +6 -0
- package/actions/public/call.ts +15 -2
- package/actions/public/getDelegation.ts +6 -1
- package/actions/public/getFeeHistory.ts +2 -0
- package/actions/public/getLogs.ts +44 -0
- package/actions/public/internal/isRangeError.ts +18 -0
- package/actions/public/internal/watchTransport.ts +29 -0
- package/actions/public/iterateLogs.ts +209 -0
- package/actions/public/simulateContract.ts +6 -4
- package/actions/public/verifyHash.ts +87 -60
- package/actions/public/waitForTransactionReceipt.ts +31 -1
- package/actions/public/watchBlockHeaders.ts +2 -12
- package/actions/public/watchBlockNumber.ts +6 -24
- package/actions/public/watchBlocks.ts +6 -24
- package/actions/public/watchContractEvent.ts +7 -42
- package/actions/public/watchEvent.ts +7 -42
- package/actions/token/internal.ts +2 -10
- package/actions/wallet/deployContract.ts +6 -1
- package/actions/wallet/prepareTransactionRequest.ts +25 -3
- package/actions/wallet/sendCalls.ts +6 -1
- package/actions/wallet/signAuthorization.ts +6 -1
- package/celo/serializers.ts +5 -2
- package/chains/definitions/kinetiqElysium.ts +27 -0
- package/chains/definitions/kinetiqElysiumTestnet.ts +28 -0
- package/chains/index.ts +2 -0
- package/clients/decorators/public.ts +47 -0
- package/constants/contracts.ts +1 -1
- package/errors/chain.ts +2 -2
- package/errors/typedData.ts +2 -0
- package/errors/version.ts +1 -1
- package/index.ts +7 -0
- package/op-stack/actions/buildProveWithdrawal.ts +5 -5
- package/op-stack/actions/getL2Output.ts +24 -11
- package/op-stack/actions/waitToProve.ts +1 -0
- package/package.json +2 -2
- package/tempo/Account.ts +38 -1
- package/tempo/actions/accessKey.ts +1 -1
- package/tempo/actions/accounts.ts +29 -11
- package/tempo/actions/earn/deployment.ts +2 -1
- package/tempo/actions/earn.ts +2 -2
- package/tempo/actions/propAmm.ts +2 -1
- package/tempo/actions/token.ts +10 -2
- package/tempo/chainConfig.ts +53 -5
- package/tempo/internal/preAuthorized.ts +309 -0
- package/tempo/internal/relay/feePayer.ts +33 -11
- package/tempo/internal/relay.ts +8 -3
- package/tempo/internal/utils.ts +2 -10
- package/tokens/defineToken.ts +6 -2
- package/tokens/definitions/ousd.ts +2 -1
- package/utils/abi/decodeAbiParameters.ts +60 -9
- package/utils/abi/encodeAbiParameters.ts +6 -4
- package/utils/abi/encodePacked.ts +5 -1
- package/utils/ccip.ts +17 -3
- package/utils/chain/getChainContractAddress.ts +2 -2
- package/utils/encoding/toBytes.ts +4 -6
- package/utils/ens/avatar/utils.ts +38 -4
- package/utils/ens/localBatchGatewayRequest.ts +21 -2
- package/utils/promise/createBatchScheduler.ts +2 -1
- package/utils/siwe/validateSiweMessage.ts +7 -0
- package/zksync/actions/estimateFee.ts +2 -1
- package/zksync/actions/estimateGasL1ToL2.ts +2 -1
- package/zksync/actions/finalizeWithdrawal.ts +4 -3
- package/zksync/actions/sendEip712Transaction.ts +21 -8
- package/zksync/actions/signEip712Transaction.ts +3 -3
- package/zksync/errors/bridge.ts +1 -1
|
@@ -13,7 +13,11 @@ import {
|
|
|
13
13
|
WaitForTransactionReceiptTimeoutError,
|
|
14
14
|
type WaitForTransactionReceiptTimeoutErrorType,
|
|
15
15
|
} from '../../errors/transaction.js'
|
|
16
|
-
import
|
|
16
|
+
import {
|
|
17
|
+
type AbortErrorType,
|
|
18
|
+
type ErrorType,
|
|
19
|
+
getAbortError,
|
|
20
|
+
} from '../../errors/utils.js'
|
|
17
21
|
import type { Chain } from '../../types/chain.js'
|
|
18
22
|
import type { Hash, Hex } from '../../types/misc.js'
|
|
19
23
|
import type { Transaction } from '../../types/transaction.js'
|
|
@@ -26,6 +30,7 @@ import {
|
|
|
26
30
|
withRetry,
|
|
27
31
|
} from '../../utils/promise/withRetry.js'
|
|
28
32
|
import { stringify } from '../../utils/stringify.js'
|
|
33
|
+
import { uid } from '../../utils/uid.js'
|
|
29
34
|
|
|
30
35
|
import { type GetBlockErrorType, getBlock } from './getBlock.js'
|
|
31
36
|
import {
|
|
@@ -117,6 +122,11 @@ export type WaitForTransactionReceiptParameters<
|
|
|
117
122
|
* @default `({ count }) => ~~(1 << count) * 200` (exponential backoff)
|
|
118
123
|
*/
|
|
119
124
|
retryDelay?: WithRetryParameters['delay'] | undefined
|
|
125
|
+
/**
|
|
126
|
+
* Signal that stops the wait. Aborting rejects with the signal's reason and
|
|
127
|
+
* stops polling and retries. It does not cancel the transaction.
|
|
128
|
+
*/
|
|
129
|
+
signal?: AbortSignal | undefined
|
|
120
130
|
/**
|
|
121
131
|
* Optional timeout (in milliseconds) to wait before stopping polling.
|
|
122
132
|
* @default 180_000
|
|
@@ -125,6 +135,7 @@ export type WaitForTransactionReceiptParameters<
|
|
|
125
135
|
}
|
|
126
136
|
|
|
127
137
|
export type WaitForTransactionReceiptErrorType =
|
|
138
|
+
| AbortErrorType
|
|
128
139
|
| ObserveErrorType
|
|
129
140
|
| GetBlockErrorType
|
|
130
141
|
| GetTransactionErrorType
|
|
@@ -188,9 +199,12 @@ export async function waitForTransactionReceipt<
|
|
|
188
199
|
onReplaced,
|
|
189
200
|
retryCount = 6,
|
|
190
201
|
retryDelay = ({ count }) => ~~(1 << count) * 200, // exponential backoff
|
|
202
|
+
signal,
|
|
191
203
|
timeout = 180_000,
|
|
192
204
|
} = parameters
|
|
193
205
|
|
|
206
|
+
if (signal?.aborted) throw getAbortError(signal)
|
|
207
|
+
|
|
194
208
|
// On chains with their own replacement keys, a sender and nonce do not
|
|
195
209
|
// identify a nonce slot.
|
|
196
210
|
const replacement = client.chain?.transactionReplacement?.getKey
|
|
@@ -221,6 +235,9 @@ export async function waitForTransactionReceipt<
|
|
|
221
235
|
pollingInterval,
|
|
222
236
|
replacement,
|
|
223
237
|
retryCount,
|
|
238
|
+
// A cancellable wait polls on its own, so aborting it cannot stop
|
|
239
|
+
// polling for another caller.
|
|
240
|
+
signal: signal ? uid() : undefined,
|
|
224
241
|
timeout,
|
|
225
242
|
},
|
|
226
243
|
])
|
|
@@ -249,6 +266,14 @@ export async function waitForTransactionReceipt<
|
|
|
249
266
|
}, timeout)
|
|
250
267
|
: undefined
|
|
251
268
|
|
|
269
|
+
const onAbort = () => {
|
|
270
|
+
clearTimeout(timer)
|
|
271
|
+
_unwatch?.()
|
|
272
|
+
_unobserve?.()
|
|
273
|
+
reject(getAbortError(signal))
|
|
274
|
+
}
|
|
275
|
+
signal?.addEventListener('abort', onAbort, { once: true })
|
|
276
|
+
|
|
252
277
|
_unobserve = observe(
|
|
253
278
|
observerId,
|
|
254
279
|
{ onReplaced, resolve, reject },
|
|
@@ -259,6 +284,8 @@ export async function waitForTransactionReceipt<
|
|
|
259
284
|
'getTransactionReceipt',
|
|
260
285
|
)({ hash }).catch(() => undefined)
|
|
261
286
|
|
|
287
|
+
if (signal?.aborted) return
|
|
288
|
+
|
|
262
289
|
if (receipt && confirmations <= 1) {
|
|
263
290
|
clearTimeout(timer)
|
|
264
291
|
emit.resolve(receipt)
|
|
@@ -350,6 +377,7 @@ export async function waitForTransactionReceipt<
|
|
|
350
377
|
{
|
|
351
378
|
delay: retryDelay,
|
|
352
379
|
retryCount,
|
|
380
|
+
signal,
|
|
353
381
|
// A dropped transaction does not reappear, so a known
|
|
354
382
|
// sender and nonce are looked up without the retries.
|
|
355
383
|
shouldRetry: ({ error }) =>
|
|
@@ -498,6 +526,7 @@ export async function waitForTransactionReceipt<
|
|
|
498
526
|
{
|
|
499
527
|
delay: retryDelay,
|
|
500
528
|
retryCount,
|
|
529
|
+
signal,
|
|
501
530
|
shouldRetry: ({ error }) =>
|
|
502
531
|
error instanceof BlockNotFoundError,
|
|
503
532
|
},
|
|
@@ -589,6 +618,7 @@ export async function waitForTransactionReceipt<
|
|
|
589
618
|
// never start polling again. The timer is cleared here as well, since a
|
|
590
619
|
// caller that resolves through another caller's poll never reaches `done`.
|
|
591
620
|
return promise.finally(() => {
|
|
621
|
+
signal?.removeEventListener('abort', onAbort)
|
|
592
622
|
clearTimeout(timer)
|
|
593
623
|
_unobserve?.()
|
|
594
624
|
})
|
|
@@ -8,6 +8,7 @@ import { observe } from '../../utils/observe.js'
|
|
|
8
8
|
import { type StringifyErrorType, stringify } from '../../utils/stringify.js'
|
|
9
9
|
|
|
10
10
|
import type { GetBlockReturnType } from './getBlock.js'
|
|
11
|
+
import { getSubscriptionTransport } from './internal/watchTransport.js'
|
|
11
12
|
|
|
12
13
|
const blockFields = [
|
|
13
14
|
'size',
|
|
@@ -88,18 +89,7 @@ export function watchBlockHeaders<
|
|
|
88
89
|
let unsubscribe = () => (active = false)
|
|
89
90
|
;(async () => {
|
|
90
91
|
try {
|
|
91
|
-
const transport = (
|
|
92
|
-
if (client.transport.type === 'fallback') {
|
|
93
|
-
const transport = client.transport.transports.find(
|
|
94
|
-
(transport: ReturnType<Transport>) =>
|
|
95
|
-
transport.config.type === 'webSocket' ||
|
|
96
|
-
transport.config.type === 'ipc',
|
|
97
|
-
)
|
|
98
|
-
if (!transport) return client.transport
|
|
99
|
-
return transport.value
|
|
100
|
-
}
|
|
101
|
-
return client.transport
|
|
102
|
-
})()
|
|
92
|
+
const transport = getSubscriptionTransport(client)
|
|
103
93
|
|
|
104
94
|
const { unsubscribe: unsubscribe_ } = await transport.subscribe({
|
|
105
95
|
params: ['newHeads'],
|
|
@@ -13,6 +13,10 @@ import {
|
|
|
13
13
|
type GetBlockNumberReturnType,
|
|
14
14
|
getBlockNumber,
|
|
15
15
|
} from './getBlockNumber.js'
|
|
16
|
+
import {
|
|
17
|
+
getSubscriptionTransport,
|
|
18
|
+
shouldPoll,
|
|
19
|
+
} from './internal/watchTransport.js'
|
|
16
20
|
|
|
17
21
|
export type OnBlockNumberParameter = GetBlockNumberReturnType
|
|
18
22
|
export type OnBlockNumberFn = (
|
|
@@ -97,18 +101,7 @@ export function watchBlockNumber<
|
|
|
97
101
|
): WatchBlockNumberReturnType {
|
|
98
102
|
const enablePolling = (() => {
|
|
99
103
|
if (typeof poll_ !== 'undefined') return poll_
|
|
100
|
-
|
|
101
|
-
client.transport.type === 'webSocket' ||
|
|
102
|
-
client.transport.type === 'ipc'
|
|
103
|
-
)
|
|
104
|
-
return false
|
|
105
|
-
if (
|
|
106
|
-
client.transport.type === 'fallback' &&
|
|
107
|
-
(client.transport.transports[0].config.type === 'webSocket' ||
|
|
108
|
-
client.transport.transports[0].config.type === 'ipc')
|
|
109
|
-
)
|
|
110
|
-
return false
|
|
111
|
-
return true
|
|
104
|
+
return shouldPoll(client)
|
|
112
105
|
})()
|
|
113
106
|
// Polling less than twice per block skips blocks, so emit the missed
|
|
114
107
|
// ones unless told otherwise.
|
|
@@ -186,18 +179,7 @@ export function watchBlockNumber<
|
|
|
186
179
|
let unsubscribe = () => (active = false)
|
|
187
180
|
;(async () => {
|
|
188
181
|
try {
|
|
189
|
-
const transport = (
|
|
190
|
-
if (client.transport.type === 'fallback') {
|
|
191
|
-
const transport = client.transport.transports.find(
|
|
192
|
-
(transport: ReturnType<Transport>) =>
|
|
193
|
-
transport.config.type === 'webSocket' ||
|
|
194
|
-
transport.config.type === 'ipc',
|
|
195
|
-
)
|
|
196
|
-
if (!transport) return client.transport
|
|
197
|
-
return transport.value
|
|
198
|
-
}
|
|
199
|
-
return client.transport
|
|
200
|
-
})()
|
|
182
|
+
const transport = getSubscriptionTransport(client)
|
|
201
183
|
|
|
202
184
|
const { unsubscribe: unsubscribe_ } = await transport.subscribe({
|
|
203
185
|
params: ['newHeads'],
|
|
@@ -10,6 +10,10 @@ import { type PollErrorType, poll } from '../../utils/poll.js'
|
|
|
10
10
|
import { type StringifyErrorType, stringify } from '../../utils/stringify.js'
|
|
11
11
|
|
|
12
12
|
import { type GetBlockReturnType, getBlock } from './getBlock.js'
|
|
13
|
+
import {
|
|
14
|
+
getSubscriptionTransport,
|
|
15
|
+
shouldPoll,
|
|
16
|
+
} from './internal/watchTransport.js'
|
|
13
17
|
|
|
14
18
|
export type OnBlockParameter<
|
|
15
19
|
chain extends Chain | undefined = Chain,
|
|
@@ -120,18 +124,7 @@ export function watchBlocks<
|
|
|
120
124
|
): WatchBlocksReturnType {
|
|
121
125
|
const enablePolling = (() => {
|
|
122
126
|
if (typeof poll_ !== 'undefined') return poll_
|
|
123
|
-
|
|
124
|
-
client.transport.type === 'webSocket' ||
|
|
125
|
-
client.transport.type === 'ipc'
|
|
126
|
-
)
|
|
127
|
-
return false
|
|
128
|
-
if (
|
|
129
|
-
client.transport.type === 'fallback' &&
|
|
130
|
-
(client.transport.transports[0].config.type === 'webSocket' ||
|
|
131
|
-
client.transport.transports[0].config.type === 'ipc')
|
|
132
|
-
)
|
|
133
|
-
return false
|
|
134
|
-
return true
|
|
127
|
+
return shouldPoll(client)
|
|
135
128
|
})()
|
|
136
129
|
const includeTransactions = includeTransactions_ ?? false
|
|
137
130
|
// Polling less than twice per block skips blocks, so emit the missed
|
|
@@ -260,18 +253,7 @@ export function watchBlocks<
|
|
|
260
253
|
.catch(onError)
|
|
261
254
|
}
|
|
262
255
|
|
|
263
|
-
const transport = (
|
|
264
|
-
if (client.transport.type === 'fallback') {
|
|
265
|
-
const transport = client.transport.transports.find(
|
|
266
|
-
(transport: ReturnType<Transport>) =>
|
|
267
|
-
transport.config.type === 'webSocket' ||
|
|
268
|
-
transport.config.type === 'ipc',
|
|
269
|
-
)
|
|
270
|
-
if (!transport) return client.transport
|
|
271
|
-
return transport.value
|
|
272
|
-
}
|
|
273
|
-
return client.transport
|
|
274
|
-
})()
|
|
256
|
+
const transport = getSubscriptionTransport(client)
|
|
275
257
|
|
|
276
258
|
const { unsubscribe: unsubscribe_ } = await transport.subscribe({
|
|
277
259
|
params: ['newHeads'],
|
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
DecodeLogDataMismatch,
|
|
9
9
|
DecodeLogTopicsMismatch,
|
|
10
10
|
} from '../../errors/abi.js'
|
|
11
|
-
import { BaseError } from '../../errors/base.js'
|
|
12
|
-
import { HttpRequestError, RpcRequestError } from '../../errors/request.js'
|
|
13
11
|
import { InvalidInputRpcError } from '../../errors/rpc.js'
|
|
14
12
|
import type { ErrorType } from '../../errors/utils.js'
|
|
15
13
|
import type { BlockNumber } from '../../types/block.js'
|
|
@@ -42,6 +40,11 @@ import {
|
|
|
42
40
|
getContractEvents,
|
|
43
41
|
} from './getContractEvents.js'
|
|
44
42
|
import { getFilterChanges } from './getFilterChanges.js'
|
|
43
|
+
import { isRangeError } from './internal/isRangeError.js'
|
|
44
|
+
import {
|
|
45
|
+
getSubscriptionTransport,
|
|
46
|
+
shouldPoll,
|
|
47
|
+
} from './internal/watchTransport.js'
|
|
45
48
|
import { uninstallFilter } from './uninstallFilter.js'
|
|
46
49
|
|
|
47
50
|
export type WatchContractEventOnLogsParameter<
|
|
@@ -163,18 +166,7 @@ export function watchContractEvent<
|
|
|
163
166
|
const enablePolling = (() => {
|
|
164
167
|
if (typeof poll_ !== 'undefined') return poll_
|
|
165
168
|
if (typeof fromBlock === 'bigint') return true
|
|
166
|
-
|
|
167
|
-
client.transport.type === 'webSocket' ||
|
|
168
|
-
client.transport.type === 'ipc'
|
|
169
|
-
)
|
|
170
|
-
return false
|
|
171
|
-
if (
|
|
172
|
-
client.transport.type === 'fallback' &&
|
|
173
|
-
(client.transport.transports[0].config.type === 'webSocket' ||
|
|
174
|
-
client.transport.transports[0].config.type === 'ipc')
|
|
175
|
-
)
|
|
176
|
-
return false
|
|
177
|
-
return true
|
|
169
|
+
return shouldPoll(client)
|
|
178
170
|
})()
|
|
179
171
|
|
|
180
172
|
const pollContractEvent = () => {
|
|
@@ -332,18 +324,7 @@ export function watchContractEvent<
|
|
|
332
324
|
return observe(observerId, { onLogs, onError }, (emit) => {
|
|
333
325
|
;(async () => {
|
|
334
326
|
try {
|
|
335
|
-
const transport = (
|
|
336
|
-
if (client.transport.type === 'fallback') {
|
|
337
|
-
const transport = client.transport.transports.find(
|
|
338
|
-
(transport: ReturnType<Transport>) =>
|
|
339
|
-
transport.config.type === 'webSocket' ||
|
|
340
|
-
transport.config.type === 'ipc',
|
|
341
|
-
)
|
|
342
|
-
if (!transport) return client.transport
|
|
343
|
-
return transport.value
|
|
344
|
-
}
|
|
345
|
-
return client.transport
|
|
346
|
-
})()
|
|
327
|
+
const transport = getSubscriptionTransport(client)
|
|
347
328
|
|
|
348
329
|
// A topic filter cannot select an anonymous event, so the
|
|
349
330
|
// subscription can deliver logs that match no requested event. Skip
|
|
@@ -422,19 +403,3 @@ export function watchContractEvent<
|
|
|
422
403
|
|
|
423
404
|
return enablePolling ? pollContractEvent() : subscribeContractEvent()
|
|
424
405
|
}
|
|
425
|
-
|
|
426
|
-
/** Returns whether a failed `eth_getLogs` request may succeed with a smaller block range. */
|
|
427
|
-
function isRangeError(error: unknown) {
|
|
428
|
-
if (!(error instanceof BaseError)) return true
|
|
429
|
-
const cause = error.walk(
|
|
430
|
-
(err) => err instanceof HttpRequestError || err instanceof RpcRequestError,
|
|
431
|
-
) as HttpRequestError | RpcRequestError | null
|
|
432
|
-
if (!cause) return true
|
|
433
|
-
// Rate limited.
|
|
434
|
-
if (cause instanceof RpcRequestError && cause.code === 429) return false
|
|
435
|
-
// Unreachable.
|
|
436
|
-
if (cause instanceof HttpRequestError && cause.status === undefined)
|
|
437
|
-
return false
|
|
438
|
-
// Unauthorized, forbidden or rate limited.
|
|
439
|
-
return cause.status !== 401 && cause.status !== 403 && cause.status !== 429
|
|
440
|
-
}
|
|
@@ -8,8 +8,6 @@ import {
|
|
|
8
8
|
DecodeLogDataMismatch,
|
|
9
9
|
DecodeLogTopicsMismatch,
|
|
10
10
|
} from '../../errors/abi.js'
|
|
11
|
-
import { BaseError } from '../../errors/base.js'
|
|
12
|
-
import { HttpRequestError, RpcRequestError } from '../../errors/request.js'
|
|
13
11
|
import { InvalidInputRpcError } from '../../errors/rpc.js'
|
|
14
12
|
import type { ErrorType } from '../../errors/utils.js'
|
|
15
13
|
import type { BlockNumber } from '../../types/block.js'
|
|
@@ -42,6 +40,11 @@ import {
|
|
|
42
40
|
import { getBlockNumber } from './getBlockNumber.js'
|
|
43
41
|
import { getFilterChanges } from './getFilterChanges.js'
|
|
44
42
|
import { type GetLogsParameters, getLogs } from './getLogs.js'
|
|
43
|
+
import { isRangeError } from './internal/isRangeError.js'
|
|
44
|
+
import {
|
|
45
|
+
getSubscriptionTransport,
|
|
46
|
+
shouldPoll,
|
|
47
|
+
} from './internal/watchTransport.js'
|
|
45
48
|
import { uninstallFilter } from './uninstallFilter.js'
|
|
46
49
|
|
|
47
50
|
export type WatchEventOnLogsParameter<
|
|
@@ -183,18 +186,7 @@ export function watchEvent<
|
|
|
183
186
|
const enablePolling = (() => {
|
|
184
187
|
if (typeof poll_ !== 'undefined') return poll_
|
|
185
188
|
if (typeof fromBlock === 'bigint') return true
|
|
186
|
-
|
|
187
|
-
client.transport.type === 'webSocket' ||
|
|
188
|
-
client.transport.type === 'ipc'
|
|
189
|
-
)
|
|
190
|
-
return false
|
|
191
|
-
if (
|
|
192
|
-
client.transport.type === 'fallback' &&
|
|
193
|
-
(client.transport.transports[0].config.type === 'webSocket' ||
|
|
194
|
-
client.transport.transports[0].config.type === 'ipc')
|
|
195
|
-
)
|
|
196
|
-
return false
|
|
197
|
-
return true
|
|
189
|
+
return shouldPoll(client)
|
|
198
190
|
})()
|
|
199
191
|
const strict = strict_ ?? false
|
|
200
192
|
|
|
@@ -344,18 +336,7 @@ export function watchEvent<
|
|
|
344
336
|
let unsubscribe = () => (active = false)
|
|
345
337
|
;(async () => {
|
|
346
338
|
try {
|
|
347
|
-
const transport = (
|
|
348
|
-
if (client.transport.type === 'fallback') {
|
|
349
|
-
const transport = client.transport.transports.find(
|
|
350
|
-
(transport: ReturnType<Transport>) =>
|
|
351
|
-
transport.config.type === 'webSocket' ||
|
|
352
|
-
transport.config.type === 'ipc',
|
|
353
|
-
)
|
|
354
|
-
if (!transport) return client.transport
|
|
355
|
-
return transport.value
|
|
356
|
-
}
|
|
357
|
-
return client.transport
|
|
358
|
-
})()
|
|
339
|
+
const transport = getSubscriptionTransport(client)
|
|
359
340
|
|
|
360
341
|
const events_ = events ?? (event ? [event] : undefined)
|
|
361
342
|
let topics: LogTopic[] = []
|
|
@@ -435,19 +416,3 @@ export function watchEvent<
|
|
|
435
416
|
|
|
436
417
|
return enablePolling ? pollEvent() : subscribeEvent()
|
|
437
418
|
}
|
|
438
|
-
|
|
439
|
-
/** Returns whether a failed `eth_getLogs` request may succeed with a smaller block range. */
|
|
440
|
-
function isRangeError(error: unknown) {
|
|
441
|
-
if (!(error instanceof BaseError)) return true
|
|
442
|
-
const cause = error.walk(
|
|
443
|
-
(err) => err instanceof HttpRequestError || err instanceof RpcRequestError,
|
|
444
|
-
) as HttpRequestError | RpcRequestError | null
|
|
445
|
-
if (!cause) return true
|
|
446
|
-
// Rate limited.
|
|
447
|
-
if (cause instanceof RpcRequestError && cause.code === 429) return false
|
|
448
|
-
// Unreachable.
|
|
449
|
-
if (cause instanceof HttpRequestError && cause.status === undefined)
|
|
450
|
-
return false
|
|
451
|
-
// Unauthorized, forbidden or rate limited.
|
|
452
|
-
return cause.status !== 401 && cause.status !== 403 && cause.status !== 429
|
|
453
|
-
}
|
|
@@ -247,16 +247,8 @@ function resolveTokenForChain(
|
|
|
247
247
|
token: Token,
|
|
248
248
|
chainId: number,
|
|
249
249
|
): ResolvedToken | undefined {
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
return {
|
|
253
|
-
address,
|
|
254
|
-
currency: token.currency,
|
|
255
|
-
decimals: token.decimals,
|
|
256
|
-
name: token.name,
|
|
257
|
-
popular: token.popular,
|
|
258
|
-
symbol: token.symbol,
|
|
259
|
-
}
|
|
250
|
+
if (!(token.addresses as Record<number, Address>)[chainId]) return undefined
|
|
251
|
+
return token(chainId as never)
|
|
260
252
|
}
|
|
261
253
|
|
|
262
254
|
/** Finds a {@link Token} by symbol (case-insensitively) on a `tokens` array. @internal */
|
|
@@ -9,6 +9,7 @@ import type { ContractConstructorArgs } from '../../types/contract.js'
|
|
|
9
9
|
import type { Hex } from '../../types/misc.js'
|
|
10
10
|
import type { UnionEvaluate, UnionOmit } from '../../types/utils.js'
|
|
11
11
|
import { encodeDeployData } from '../../utils/abi/encodeDeployData.js'
|
|
12
|
+
import { getAction } from '../../utils/getAction.js'
|
|
12
13
|
import {
|
|
13
14
|
type SendTransactionErrorType,
|
|
14
15
|
type SendTransactionParameters,
|
|
@@ -80,7 +81,11 @@ export function deployContract<
|
|
|
80
81
|
const { abi, args, bytecode, ...request } =
|
|
81
82
|
parameters as DeployContractParameters
|
|
82
83
|
const calldata = encodeDeployData({ abi, args, bytecode })
|
|
83
|
-
return
|
|
84
|
+
return getAction(
|
|
85
|
+
walletClient,
|
|
86
|
+
sendTransaction,
|
|
87
|
+
'sendTransaction',
|
|
88
|
+
)({
|
|
84
89
|
...request,
|
|
85
90
|
...(request.authorizationList ? { to: null } : {}),
|
|
86
91
|
data: calldata,
|
|
@@ -25,11 +25,16 @@ import type { Client } from '../../clients/createClient.js'
|
|
|
25
25
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
|
26
26
|
import type { AccountNotFoundErrorType } from '../../errors/account.js'
|
|
27
27
|
import type { BaseError } from '../../errors/base.js'
|
|
28
|
+
import {
|
|
29
|
+
ChainMismatchError,
|
|
30
|
+
type ChainMismatchErrorType,
|
|
31
|
+
} from '../../errors/chain.js'
|
|
28
32
|
import {
|
|
29
33
|
Eip1559FeesNotSupportedError,
|
|
30
34
|
MaxFeePerGasTooLowError,
|
|
31
35
|
} from '../../errors/fee.js'
|
|
32
36
|
import { FeePayerNonceMismatchError } from '../../errors/transaction.js'
|
|
37
|
+
import type { ErrorType } from '../../errors/utils.js'
|
|
33
38
|
import type { DeriveAccount, GetAccountParameter } from '../../types/account.js'
|
|
34
39
|
import type { Block } from '../../types/block.js'
|
|
35
40
|
import type { ExtractCapabilities } from '../../types/capabilities.js'
|
|
@@ -232,11 +237,13 @@ export type PrepareTransactionRequestReturnType<
|
|
|
232
237
|
export type PrepareTransactionRequestErrorType =
|
|
233
238
|
| AccountNotFoundErrorType
|
|
234
239
|
| AssertRequestErrorType
|
|
240
|
+
| ChainMismatchErrorType
|
|
235
241
|
| ParseAccountErrorType
|
|
236
242
|
| GetBlockErrorType
|
|
237
243
|
| GetTransactionCountErrorType
|
|
238
244
|
| EstimateGasErrorType
|
|
239
245
|
| EstimateFeesPerGasErrorType
|
|
246
|
+
| ErrorType
|
|
240
247
|
|
|
241
248
|
/**
|
|
242
249
|
* Prepares a transaction request for signing.
|
|
@@ -302,9 +309,9 @@ export async function prepareTransactionRequest<
|
|
|
302
309
|
request
|
|
303
310
|
>
|
|
304
311
|
> {
|
|
305
|
-
let request = args as PrepareTransactionRequestParameters
|
|
312
|
+
let request = { ...args } as PrepareTransactionRequestParameters
|
|
306
313
|
|
|
307
|
-
request.account
|
|
314
|
+
if (typeof request.account === 'undefined') request.account = client.account
|
|
308
315
|
request.parameters ??= defaultParameters
|
|
309
316
|
|
|
310
317
|
const {
|
|
@@ -434,6 +441,7 @@ export async function prepareTransactionRequest<
|
|
|
434
441
|
return false
|
|
435
442
|
})()
|
|
436
443
|
|
|
444
|
+
let filledChainId: number | undefined
|
|
437
445
|
const fill = (request: PrepareTransactionRequestParameters) =>
|
|
438
446
|
getAction(
|
|
439
447
|
client,
|
|
@@ -462,6 +470,7 @@ export async function prepareTransactionRequest<
|
|
|
462
470
|
feeToken !== null &&
|
|
463
471
|
(!('feeToken' in request) || hasFilledFeePayerSignature)
|
|
464
472
|
supportsFillTransaction.set(client.uid, true)
|
|
473
|
+
filledChainId = chainId
|
|
465
474
|
// The fee payer signs over the filled fee token, so a requested one must not replace or outlive it.
|
|
466
475
|
type WithFeeToken = { feeToken?: unknown }
|
|
467
476
|
const { feeToken: _feeToken, ...unsponsored } = request as WithFeeToken
|
|
@@ -469,7 +478,6 @@ export async function prepareTransactionRequest<
|
|
|
469
478
|
...(hasFilledFeePayerSignature ? unsponsored : request),
|
|
470
479
|
...(from ? { from } : {}),
|
|
471
480
|
...(type && !request.type ? { type } : {}),
|
|
472
|
-
...(typeof chainId !== 'undefined' ? { chainId } : {}),
|
|
473
481
|
...(typeof gas !== 'undefined' ? { gas } : {}),
|
|
474
482
|
...(typeof gasPrice !== 'undefined' ? { gasPrice } : {}),
|
|
475
483
|
...(typeof nonce !== 'undefined' ? { nonce } : {}),
|
|
@@ -572,6 +580,20 @@ export async function prepareTransactionRequest<
|
|
|
572
580
|
...(account ? { from: account?.address } : {}),
|
|
573
581
|
...(typeof nonce !== 'undefined' ? { nonce } : {}),
|
|
574
582
|
}
|
|
583
|
+
|
|
584
|
+
// The filled chain id only applies when neither the request nor the chain provides one.
|
|
585
|
+
if (typeof filledChainId !== 'undefined') {
|
|
586
|
+
request.chainId ??= chain?.id ?? filledChainId
|
|
587
|
+
if (request.chainId !== filledChainId)
|
|
588
|
+
throw new ChainMismatchError({
|
|
589
|
+
chain:
|
|
590
|
+
chain?.id === request.chainId
|
|
591
|
+
? chain
|
|
592
|
+
: ({ id: request.chainId, name: 'Unknown' } as Chain),
|
|
593
|
+
currentChainId: filledChainId,
|
|
594
|
+
})
|
|
595
|
+
}
|
|
596
|
+
|
|
575
597
|
const { blobs, gas, kzg, type } = request
|
|
576
598
|
|
|
577
599
|
if (
|
|
@@ -21,6 +21,7 @@ import { concat } from '../../utils/data/concat.js'
|
|
|
21
21
|
import { hexToBigInt } from '../../utils/encoding/fromHex.js'
|
|
22
22
|
import { numberToHex } from '../../utils/encoding/toHex.js'
|
|
23
23
|
import { getTransactionError } from '../../utils/errors/getTransactionError.js'
|
|
24
|
+
import { getAction } from '../../utils/getAction.js'
|
|
24
25
|
import { sendTransaction } from './sendTransaction.js'
|
|
25
26
|
|
|
26
27
|
export const fallbackMagicIdentifier =
|
|
@@ -225,7 +226,11 @@ export async function sendCalls<
|
|
|
225
226
|
const results: PromiseSettledResult<Hex>[] = []
|
|
226
227
|
for (const call of calls) {
|
|
227
228
|
try {
|
|
228
|
-
const value = await
|
|
229
|
+
const value = await getAction(
|
|
230
|
+
client,
|
|
231
|
+
sendTransaction,
|
|
232
|
+
'sendTransaction',
|
|
233
|
+
)({
|
|
229
234
|
account,
|
|
230
235
|
chain,
|
|
231
236
|
data: call.data,
|
|
@@ -17,6 +17,7 @@ import {
|
|
|
17
17
|
} from '../../errors/account.js'
|
|
18
18
|
import type { ErrorType } from '../../errors/utils.js'
|
|
19
19
|
import type { Chain } from '../../types/chain.js'
|
|
20
|
+
import { getAction } from '../../utils/getAction.js'
|
|
20
21
|
import {
|
|
21
22
|
type PrepareAuthorizationErrorType,
|
|
22
23
|
type PrepareAuthorizationParameters,
|
|
@@ -103,6 +104,10 @@ export async function signAuthorization<
|
|
|
103
104
|
type: account.type,
|
|
104
105
|
})
|
|
105
106
|
|
|
106
|
-
const authorization = await
|
|
107
|
+
const authorization = await getAction(
|
|
108
|
+
client,
|
|
109
|
+
prepareAuthorization,
|
|
110
|
+
'prepareAuthorization',
|
|
111
|
+
)(parameters)
|
|
107
112
|
return account.signAuthorization(authorization)
|
|
108
113
|
}
|
package/celo/serializers.ts
CHANGED
|
@@ -24,8 +24,11 @@ export function serializeTransaction(
|
|
|
24
24
|
transaction: CeloTransactionSerializable,
|
|
25
25
|
signature?: Signature | undefined,
|
|
26
26
|
) {
|
|
27
|
-
if (isCIP64(transaction))
|
|
28
|
-
return serializeTransactionCIP64(
|
|
27
|
+
if (isCIP64(transaction) || isPresent(transaction.feeCurrency))
|
|
28
|
+
return serializeTransactionCIP64(
|
|
29
|
+
transaction as TransactionSerializableCIP64,
|
|
30
|
+
signature,
|
|
31
|
+
)
|
|
29
32
|
return serializeTransaction_op(transaction, signature)
|
|
30
33
|
}
|
|
31
34
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const kinetiqElysium = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 99_901,
|
|
5
|
+
name: 'Elysium',
|
|
6
|
+
blockTime: 100,
|
|
7
|
+
nativeCurrency: { name: 'HYPE', symbol: 'HYPE', decimals: 18 },
|
|
8
|
+
rpcUrls: {
|
|
9
|
+
default: {
|
|
10
|
+
http: ['https://rpc.elysium.kinetiq.xyz'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
blockExplorers: {
|
|
14
|
+
default: {
|
|
15
|
+
name: 'Elysium Explorer',
|
|
16
|
+
url: 'https://elysium.kinetiq.xyz',
|
|
17
|
+
apiUrl: 'https://elysium.kinetiq.xyz/api',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
contracts: {
|
|
21
|
+
multicall3: {
|
|
22
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
23
|
+
blockCreated: 1343,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
sourceId: 999,
|
|
27
|
+
})
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { defineChain } from '../../utils/chain/defineChain.js'
|
|
2
|
+
|
|
3
|
+
export const kinetiqElysiumTestnet = /*#__PURE__*/ defineChain({
|
|
4
|
+
id: 99_801,
|
|
5
|
+
name: 'Kinetiq Elysium Testnet',
|
|
6
|
+
blockTime: 100,
|
|
7
|
+
nativeCurrency: { name: 'HYPE', symbol: 'HYPE', decimals: 18 },
|
|
8
|
+
rpcUrls: {
|
|
9
|
+
default: {
|
|
10
|
+
http: ['https://testnet-rpc.elysium.kinetiq.xyz'],
|
|
11
|
+
},
|
|
12
|
+
},
|
|
13
|
+
blockExplorers: {
|
|
14
|
+
default: {
|
|
15
|
+
name: 'Elysium Testnet Explorer',
|
|
16
|
+
url: 'https://testnet.elysium.kinetiq.xyz',
|
|
17
|
+
apiUrl: 'https://testnet.elysium.kinetiq.xyz/api',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
contracts: {
|
|
21
|
+
multicall3: {
|
|
22
|
+
address: '0xcA11bde05977b3631167028862bE2a173976CA11',
|
|
23
|
+
blockCreated: 91163,
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
sourceId: 998,
|
|
27
|
+
testnet: true,
|
|
28
|
+
})
|
package/chains/index.ts
CHANGED
|
@@ -351,6 +351,8 @@ export { kavaTestnet } from './definitions/kavaTestnet.js'
|
|
|
351
351
|
export { kcc } from './definitions/kcc.js'
|
|
352
352
|
export { kii } from './definitions/kii.js'
|
|
353
353
|
export { kiiTestnetOro } from './definitions/kiiTestnet.js'
|
|
354
|
+
export { kinetiqElysium } from './definitions/kinetiqElysium.js'
|
|
355
|
+
export { kinetiqElysiumTestnet } from './definitions/kinetiqElysiumTestnet.js'
|
|
354
356
|
export { kinto } from './definitions/kinto.js'
|
|
355
357
|
/** @deprecated Use `kaia` instead. */
|
|
356
358
|
export { klaytn } from './definitions/klaytn.js'
|