viem 2.10.5 → 2.10.9
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 +26 -0
- package/_cjs/chains/definitions/btr.js +31 -0
- package/_cjs/chains/definitions/btr.js.map +1 -0
- package/_cjs/chains/definitions/btrTestnet.js +30 -0
- package/_cjs/chains/definitions/btrTestnet.js.map +1 -0
- package/_cjs/chains/definitions/nautilus.js +21 -0
- package/_cjs/chains/definitions/nautilus.js.map +1 -0
- package/_cjs/chains/definitions/rootstockTestnet.js +24 -0
- package/_cjs/chains/definitions/rootstockTestnet.js.map +1 -0
- package/_cjs/chains/index.js +14 -6
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/transports/http.js +1 -1
- package/_cjs/clients/transports/http.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/utils/abi/decodeAbiParameters.js +2 -2
- package/_cjs/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodeAbiParameters.js +2 -2
- package/_cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_cjs/utils/abi/encodePacked.js +3 -3
- package/_cjs/utils/abi/encodePacked.js.map +1 -1
- package/_cjs/utils/buildRequest.js +1 -1
- package/_cjs/utils/buildRequest.js.map +1 -1
- package/_cjs/utils/cursor.js +2 -2
- package/_cjs/utils/cursor.js.map +1 -1
- package/_cjs/utils/encoding/fromRlp.js +3 -1
- package/_cjs/utils/encoding/fromRlp.js.map +1 -1
- package/_cjs/utils/ens/avatar/utils.js +1 -1
- package/_cjs/utils/ens/avatar/utils.js.map +1 -1
- package/_cjs/utils/promise/withCache.js +1 -1
- package/_cjs/utils/promise/withCache.js.map +1 -1
- package/_cjs/utils/typedData.js +3 -3
- package/_cjs/utils/typedData.js.map +1 -1
- package/_esm/actions/public/getFilterChanges.js +0 -1
- package/_esm/actions/public/getFilterChanges.js.map +1 -1
- package/_esm/actions/public/getFilterLogs.js +0 -1
- package/_esm/actions/public/getFilterLogs.js.map +1 -1
- package/_esm/actions/public/getLogs.js +0 -1
- package/_esm/actions/public/getLogs.js.map +1 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js +0 -1
- package/_esm/actions/wallet/prepareTransactionRequest.js.map +1 -1
- package/_esm/actions/wallet/signTransaction.js +0 -1
- package/_esm/actions/wallet/signTransaction.js.map +1 -1
- package/_esm/celo/fees.js +0 -1
- package/_esm/celo/fees.js.map +1 -1
- package/_esm/celo/formatters.js +0 -1
- package/_esm/celo/formatters.js.map +1 -1
- package/_esm/chains/definitions/btr.js +28 -0
- package/_esm/chains/definitions/btr.js.map +1 -0
- package/_esm/chains/definitions/btrTestnet.js +27 -0
- package/_esm/chains/definitions/btrTestnet.js.map +1 -0
- package/_esm/chains/definitions/nautilus.js +18 -0
- package/_esm/chains/definitions/nautilus.js.map +1 -0
- package/_esm/chains/definitions/rootstockTestnet.js +21 -0
- package/_esm/chains/definitions/rootstockTestnet.js.map +1 -0
- package/_esm/chains/index.js +4 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/decorators/wallet.js +0 -1
- package/_esm/clients/decorators/wallet.js.map +1 -1
- package/_esm/clients/transports/http.js +1 -1
- package/_esm/clients/transports/http.js.map +1 -1
- package/_esm/clients/transports/ipc.js +0 -1
- package/_esm/clients/transports/ipc.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/experimental/eip3074/utils/toAuthMessage.js +0 -1
- package/_esm/experimental/eip3074/utils/toAuthMessage.js.map +1 -1
- package/_esm/op-stack/actions/buildProveWithdrawal.js +0 -2
- package/_esm/op-stack/actions/buildProveWithdrawal.js.map +1 -1
- package/_esm/op-stack/actions/estimateL1Fee.js +0 -2
- package/_esm/op-stack/actions/estimateL1Fee.js.map +1 -1
- package/_esm/op-stack/actions/estimateL1Gas.js +0 -2
- package/_esm/op-stack/actions/estimateL1Gas.js.map +1 -1
- package/_esm/op-stack/actions/estimateTotalFee.js +0 -1
- package/_esm/op-stack/actions/estimateTotalFee.js.map +1 -1
- package/_esm/op-stack/actions/estimateTotalGas.js +0 -1
- package/_esm/op-stack/actions/estimateTotalGas.js.map +1 -1
- package/_esm/op-stack/actions/getL1BaseFee.js +0 -3
- package/_esm/op-stack/actions/getL1BaseFee.js.map +1 -1
- package/_esm/op-stack/formatters.js +0 -2
- package/_esm/op-stack/formatters.js.map +1 -1
- package/_esm/types/contract.js +1 -1
- package/_esm/types/contract.js.map +1 -1
- package/_esm/utils/abi/decodeAbiParameters.js +2 -2
- package/_esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodeAbiParameters.js +2 -2
- package/_esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/_esm/utils/abi/encodePacked.js +3 -3
- package/_esm/utils/abi/encodePacked.js.map +1 -1
- package/_esm/utils/abi/getAbiItem.js +0 -1
- package/_esm/utils/abi/getAbiItem.js.map +1 -1
- package/_esm/utils/abi/prepareEncodeFunctionData.js +0 -1
- package/_esm/utils/abi/prepareEncodeFunctionData.js.map +1 -1
- package/_esm/utils/buildRequest.js +1 -1
- package/_esm/utils/buildRequest.js.map +1 -1
- package/_esm/utils/ccip.js +0 -1
- package/_esm/utils/ccip.js.map +1 -1
- package/_esm/utils/cursor.js +2 -2
- package/_esm/utils/cursor.js.map +1 -1
- package/_esm/utils/encoding/fromRlp.js +3 -1
- package/_esm/utils/encoding/fromRlp.js.map +1 -1
- package/_esm/utils/ens/avatar/utils.js +1 -1
- package/_esm/utils/ens/avatar/utils.js.map +1 -1
- package/_esm/utils/promise/withCache.js +1 -1
- package/_esm/utils/promise/withCache.js.map +1 -1
- package/_esm/utils/rpc/compat.js +0 -4
- package/_esm/utils/rpc/compat.js.map +1 -1
- package/_esm/utils/transaction/serializeAccessList.js +0 -1
- package/_esm/utils/transaction/serializeAccessList.js.map +1 -1
- package/_esm/utils/typedData.js +3 -3
- package/_esm/utils/typedData.js.map +1 -1
- package/_esm/zksync/actions/sendEip712Transaction.js +0 -2
- package/_esm/zksync/actions/sendEip712Transaction.js.map +1 -1
- package/_esm/zksync/actions/sendTransaction.js +0 -1
- package/_esm/zksync/actions/sendTransaction.js.map +1 -1
- package/_esm/zksync/formatters.js +0 -1
- package/_esm/zksync/formatters.js.map +1 -1
- package/_esm/zksync/utils/abi/encodeDeployData.js +0 -1
- package/_esm/zksync/utils/abi/encodeDeployData.js.map +1 -1
- package/_esm/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js +0 -1
- package/_esm/zksync/utils/paymaster/getApprovalBasedPaymasterInput.js.map +1 -1
- package/_types/actions/public/getFilterChanges.d.ts +1 -1
- package/_types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/_types/actions/public/getFilterLogs.d.ts +1 -1
- package/_types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/_types/actions/public/getLogs.d.ts +1 -1
- package/_types/actions/public/getLogs.d.ts.map +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts +1 -1
- package/_types/actions/wallet/prepareTransactionRequest.d.ts.map +1 -1
- package/_types/celo/fees.d.ts +1 -1
- package/_types/celo/fees.d.ts.map +1 -1
- package/_types/chains/definitions/btr.d.ts +37 -0
- package/_types/chains/definitions/btr.d.ts.map +1 -0
- package/_types/chains/definitions/btrTestnet.d.ts +37 -0
- package/_types/chains/definitions/btrTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/nautilus.d.ts +35 -0
- package/_types/chains/definitions/nautilus.d.ts.map +1 -0
- package/_types/chains/definitions/rootstockTestnet.d.ts +36 -0
- package/_types/chains/definitions/rootstockTestnet.d.ts.map +1 -0
- package/_types/chains/index.d.ts +4 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/wallet.d.ts +1 -1
- package/_types/clients/decorators/wallet.d.ts.map +1 -1
- package/_types/clients/transports/ipc.d.ts +1 -1
- package/_types/clients/transports/ipc.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/experimental/eip3074/utils/toAuthMessage.d.ts +1 -1
- package/_types/experimental/eip3074/utils/toAuthMessage.d.ts.map +1 -1
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts +2 -2
- package/_types/op-stack/actions/buildProveWithdrawal.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateL1Fee.d.ts +2 -2
- package/_types/op-stack/actions/estimateL1Fee.d.ts.map +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 +1 -1
- package/_types/op-stack/actions/estimateTotalFee.d.ts.map +1 -1
- package/_types/op-stack/actions/estimateTotalGas.d.ts +1 -1
- package/_types/op-stack/actions/estimateTotalGas.d.ts.map +1 -1
- package/_types/op-stack/actions/getL1BaseFee.d.ts +3 -3
- package/_types/op-stack/actions/getL1BaseFee.d.ts.map +1 -1
- package/_types/types/contract.d.ts +1 -1
- package/_types/types/contract.d.ts.map +1 -1
- package/_types/utils/abi/getAbiItem.d.ts +1 -1
- package/_types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/_types/utils/abi/prepareEncodeFunctionData.d.ts +1 -1
- package/_types/utils/abi/prepareEncodeFunctionData.d.ts.map +1 -1
- package/_types/utils/buildRequest.d.ts.map +1 -1
- package/_types/utils/encoding/fromRlp.d.ts.map +1 -1
- package/_types/utils/promise/withCache.d.ts.map +1 -1
- package/_types/utils/rpc/compat.d.ts +3 -3
- package/_types/utils/rpc/compat.d.ts.map +1 -1
- package/_types/utils/transaction/serializeAccessList.d.ts +1 -1
- package/_types/utils/transaction/serializeAccessList.d.ts.map +1 -1
- package/_types/zksync/actions/sendEip712Transaction.d.ts +1 -1
- package/_types/zksync/actions/sendEip712Transaction.d.ts.map +1 -1
- package/_types/zksync/actions/sendTransaction.d.ts +1 -1
- package/_types/zksync/actions/sendTransaction.d.ts.map +1 -1
- package/_types/zksync/utils/abi/encodeDeployData.d.ts +1 -1
- package/_types/zksync/utils/abi/encodeDeployData.d.ts.map +1 -1
- package/_types/zksync/utils/paymaster/getApprovalBasedPaymasterInput.d.ts +1 -1
- package/_types/zksync/utils/paymaster/getApprovalBasedPaymasterInput.d.ts.map +1 -1
- package/actions/public/getFilterChanges.ts +1 -1
- package/actions/public/getFilterLogs.ts +1 -1
- package/actions/public/getLogs.ts +1 -1
- package/actions/wallet/prepareTransactionRequest.ts +1 -1
- package/actions/wallet/signTransaction.ts +1 -1
- package/celo/fees.ts +1 -1
- package/celo/formatters.ts +1 -1
- package/chains/definitions/btr.ts +28 -0
- package/chains/definitions/btrTestnet.ts +27 -0
- package/chains/definitions/nautilus.ts +18 -0
- package/chains/definitions/rootstockTestnet.ts +21 -0
- package/chains/index.ts +4 -0
- package/clients/decorators/wallet.ts +3 -3
- package/clients/transports/http.ts +1 -1
- package/clients/transports/ipc.ts +1 -1
- package/errors/version.ts +1 -1
- package/experimental/eip3074/utils/toAuthMessage.ts +1 -1
- package/op-stack/actions/buildProveWithdrawal.ts +2 -2
- package/op-stack/actions/estimateL1Fee.ts +2 -2
- package/op-stack/actions/estimateL1Gas.ts +2 -2
- package/op-stack/actions/estimateTotalFee.ts +1 -1
- package/op-stack/actions/estimateTotalGas.ts +1 -1
- package/op-stack/actions/getL1BaseFee.ts +3 -3
- package/op-stack/formatters.ts +2 -2
- package/package.json +4 -3
- package/types/contract.ts +16 -16
- package/utils/abi/decodeAbiParameters.ts +2 -2
- package/utils/abi/encodeAbiParameters.ts +2 -2
- package/utils/abi/encodePacked.ts +3 -3
- package/utils/abi/getAbiItem.ts +1 -1
- package/utils/abi/prepareEncodeFunctionData.ts +1 -1
- package/utils/buildRequest.ts +2 -1
- package/utils/ccip.ts +1 -1
- package/utils/cursor.ts +2 -2
- package/utils/encoding/fromRlp.ts +3 -1
- package/utils/ens/avatar/utils.ts +1 -1
- package/utils/promise/withCache.ts +1 -1
- package/utils/rpc/compat.ts +4 -4
- package/utils/transaction/serializeAccessList.ts +1 -1
- package/utils/typedData.ts +3 -3
- package/zksync/actions/sendEip712Transaction.ts +2 -2
- package/zksync/actions/sendTransaction.ts +1 -1
- package/zksync/formatters.ts +1 -1
- package/zksync/utils/abi/encodeDeployData.ts +3 -3
- package/zksync/utils/paymaster/getApprovalBasedPaymasterInput.ts +1 -1
@@ -1,5 +1,5 @@
|
|
1
1
|
import { RpcRequestError } from '../../errors/request.js'
|
2
|
-
import {
|
2
|
+
import type { UrlRequiredErrorType } from '../../errors/transport.js'
|
3
3
|
import type { ErrorType } from '../../errors/utils.js'
|
4
4
|
import type { Hash } from '../../types/misc.js'
|
5
5
|
import type { RpcResponse } from '../../types/rpc.js'
|
package/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '2.10.
|
1
|
+
export const version = '2.10.9'
|
@@ -10,7 +10,7 @@ import {
|
|
10
10
|
type NumberToHexErrorType,
|
11
11
|
numberToHex,
|
12
12
|
} from '../../../utils/encoding/toHex.js'
|
13
|
-
import {
|
13
|
+
import type { Keccak256ErrorType } from '../../../utils/hash/keccak256.js'
|
14
14
|
|
15
15
|
export type ToAuthMessageParameters = {
|
16
16
|
chainId: number
|
@@ -20,7 +20,7 @@ import type {
|
|
20
20
|
DeriveChain,
|
21
21
|
GetChainParameter,
|
22
22
|
} from '../../types/chain.js'
|
23
|
-
import {
|
23
|
+
import type { Hex } from '../../types/misc.js'
|
24
24
|
import type { OneOf, Prettify } from '../../types/utils.js'
|
25
25
|
import { fromRlp } from '../../utils/encoding/fromRlp.js'
|
26
26
|
import { toRlp } from '../../utils/encoding/toRlp.js'
|
@@ -31,7 +31,7 @@ import {
|
|
31
31
|
type GetWithdrawalHashStorageSlotErrorType,
|
32
32
|
getWithdrawalHashStorageSlot,
|
33
33
|
} from '../utils/getWithdrawalHashStorageSlot.js'
|
34
|
-
import {
|
34
|
+
import type { GetGameReturnType } from './getGame.js'
|
35
35
|
import type { GetL2OutputReturnType } from './getL2Output.js'
|
36
36
|
import type { ProveWithdrawalParameters } from './proveWithdrawal.js'
|
37
37
|
|
@@ -13,14 +13,14 @@ import type { Client } from '../../clients/createClient.js'
|
|
13
13
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
14
14
|
import type { ErrorType } from '../../errors/utils.js'
|
15
15
|
import type { Account, GetAccountParameter } from '../../types/account.js'
|
16
|
-
import {
|
16
|
+
import type { Chain, GetChainParameter } from '../../types/chain.js'
|
17
17
|
import type {
|
18
18
|
TransactionRequestEIP1559,
|
19
19
|
TransactionSerializable,
|
20
20
|
} from '../../types/transaction.js'
|
21
21
|
import type { RequestErrorType } from '../../utils/buildRequest.js'
|
22
22
|
import { getChainContractAddress } from '../../utils/chain/getChainContractAddress.js'
|
23
|
-
import {
|
23
|
+
import type { HexToNumberErrorType } from '../../utils/encoding/fromHex.js'
|
24
24
|
import {
|
25
25
|
type AssertRequestErrorType,
|
26
26
|
type AssertRequestParameters,
|
@@ -13,14 +13,14 @@ import type { Client } from '../../clients/createClient.js'
|
|
13
13
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
14
14
|
import type { ErrorType } from '../../errors/utils.js'
|
15
15
|
import type { Account, GetAccountParameter } from '../../types/account.js'
|
16
|
-
import {
|
16
|
+
import type { Chain, GetChainParameter } from '../../types/chain.js'
|
17
17
|
import type {
|
18
18
|
TransactionRequestEIP1559,
|
19
19
|
TransactionSerializable,
|
20
20
|
} from '../../types/transaction.js'
|
21
21
|
import type { RequestErrorType } from '../../utils/buildRequest.js'
|
22
22
|
import { getChainContractAddress } from '../../utils/chain/getChainContractAddress.js'
|
23
|
-
import {
|
23
|
+
import type { HexToNumberErrorType } from '../../utils/encoding/fromHex.js'
|
24
24
|
import {
|
25
25
|
type AssertRequestErrorType,
|
26
26
|
type AssertRequestParameters,
|
@@ -16,7 +16,7 @@ import type { Client } from '../../clients/createClient.js'
|
|
16
16
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
17
17
|
import type { ErrorType } from '../../errors/utils.js'
|
18
18
|
import type { Account } from '../../types/account.js'
|
19
|
-
import {
|
19
|
+
import type { Chain } from '../../types/chain.js'
|
20
20
|
import type { RequestErrorType } from '../../utils/buildRequest.js'
|
21
21
|
import {
|
22
22
|
type EstimateL1FeeErrorType,
|
@@ -12,7 +12,7 @@ import type { Client } from '../../clients/createClient.js'
|
|
12
12
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
13
13
|
import type { ErrorType } from '../../errors/utils.js'
|
14
14
|
import type { Account } from '../../types/account.js'
|
15
|
-
import {
|
15
|
+
import type { Chain } from '../../types/chain.js'
|
16
16
|
import type { RequestErrorType } from '../../utils/buildRequest.js'
|
17
17
|
import {
|
18
18
|
type EstimateL1GasErrorType,
|
@@ -4,14 +4,14 @@ import {
|
|
4
4
|
type ReadContractErrorType,
|
5
5
|
readContract,
|
6
6
|
} from '../../actions/public/readContract.js'
|
7
|
-
import {
|
7
|
+
import type { PrepareTransactionRequestErrorType } from '../../actions/wallet/prepareTransactionRequest.js'
|
8
8
|
import type { Client } from '../../clients/createClient.js'
|
9
9
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
10
10
|
import type { ErrorType } from '../../errors/utils.js'
|
11
|
-
import {
|
11
|
+
import type { Chain, GetChainParameter } from '../../types/chain.js'
|
12
12
|
import type { RequestErrorType } from '../../utils/buildRequest.js'
|
13
13
|
import { getChainContractAddress } from '../../utils/chain/getChainContractAddress.js'
|
14
|
-
import {
|
14
|
+
import type { HexToNumberErrorType } from '../../utils/encoding/fromHex.js'
|
15
15
|
|
16
16
|
import { gasPriceOracleAbi } from '../abis.js'
|
17
17
|
import { contracts } from '../contracts.js'
|
package/op-stack/formatters.ts
CHANGED
@@ -1,6 +1,6 @@
|
|
1
|
-
import {
|
1
|
+
import type { ChainFormatters } from '../types/chain.js'
|
2
2
|
import type { Hash } from '../types/misc.js'
|
3
|
-
import {
|
3
|
+
import type { RpcTransaction } from '../types/rpc.js'
|
4
4
|
import { hexToBigInt } from '../utils/encoding/fromHex.js'
|
5
5
|
import { defineBlock } from '../utils/formatters/block.js'
|
6
6
|
import {
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "viem",
|
3
3
|
"description": "TypeScript Interface for Ethereum",
|
4
|
-
"version": "2.10.
|
4
|
+
"version": "2.10.9",
|
5
5
|
"main": "./_cjs/index.js",
|
6
6
|
"module": "./_esm/index.js",
|
7
7
|
"types": "./_types/index.d.ts",
|
@@ -14,7 +14,8 @@
|
|
14
14
|
"!**/*.test.ts.snap",
|
15
15
|
"!**/*.test-d.ts",
|
16
16
|
"!**/*.bench.ts",
|
17
|
-
"!tsconfig.build.json"
|
17
|
+
"!tsconfig.build.json",
|
18
|
+
"!jsr.json"
|
18
19
|
],
|
19
20
|
"exports": {
|
20
21
|
".": {
|
@@ -139,7 +140,7 @@
|
|
139
140
|
"@scure/bip32": "1.3.2",
|
140
141
|
"@scure/bip39": "1.2.1",
|
141
142
|
"abitype": "1.0.0",
|
142
|
-
"isows": "1.0.
|
143
|
+
"isows": "1.0.4",
|
143
144
|
"ws": "8.13.0"
|
144
145
|
},
|
145
146
|
"license": "MIT",
|
package/types/contract.ts
CHANGED
@@ -1,19 +1,19 @@
|
|
1
|
-
import {
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
1
|
+
import type {
|
2
|
+
Abi,
|
3
|
+
AbiEvent,
|
4
|
+
AbiFunction,
|
5
|
+
AbiParameter,
|
6
|
+
AbiParameterToPrimitiveType,
|
7
|
+
AbiParametersToPrimitiveTypes,
|
8
|
+
AbiStateMutability,
|
9
|
+
Address,
|
10
|
+
ExtractAbiError,
|
11
|
+
ExtractAbiErrorNames,
|
12
|
+
ExtractAbiEvent,
|
13
|
+
ExtractAbiEventNames,
|
14
|
+
ExtractAbiFunction,
|
15
|
+
ExtractAbiFunctionNames,
|
16
|
+
ResolvedRegister,
|
17
17
|
} from 'abitype'
|
18
18
|
|
19
19
|
import type { Hex, LogTopic } from './misc.js'
|
@@ -249,7 +249,7 @@ function decodeBytes(
|
|
249
249
|
return [bytesToHex(data), 32]
|
250
250
|
}
|
251
251
|
|
252
|
-
const value = bytesToHex(cursor.readBytes(parseInt(size), 32))
|
252
|
+
const value = bytesToHex(cursor.readBytes(Number.parseInt(size), 32))
|
253
253
|
return [value, 32]
|
254
254
|
}
|
255
255
|
|
@@ -260,7 +260,7 @@ type DecodeNumberErrorType =
|
|
260
260
|
|
261
261
|
function decodeNumber(cursor: Cursor, param: AbiParameter) {
|
262
262
|
const signed = param.type.startsWith('int')
|
263
|
-
const size = parseInt(param.type.split('int')[1] || '256')
|
263
|
+
const size = Number.parseInt(param.type.split('int')[1] || '256')
|
264
264
|
const value = cursor.readBytes(32)
|
265
265
|
return [
|
266
266
|
size > 48
|
@@ -298,9 +298,9 @@ function encodeBytes<const TParam extends AbiParameter>(
|
|
298
298
|
encoded: concat([padHex(numberToHex(bytesSize, { size: 32 })), value_]),
|
299
299
|
}
|
300
300
|
}
|
301
|
-
if (bytesSize !== parseInt(paramSize))
|
301
|
+
if (bytesSize !== Number.parseInt(paramSize))
|
302
302
|
throw new AbiEncodingBytesSizeMismatchError({
|
303
|
-
expectedSize: parseInt(paramSize),
|
303
|
+
expectedSize: Number.parseInt(paramSize),
|
304
304
|
value,
|
305
305
|
})
|
306
306
|
return { dynamic: false, encoded: padHex(value, { dir: 'right' }) }
|
@@ -107,7 +107,7 @@ function encode<const TPackedAbiType extends PackedAbiType | unknown>(
|
|
107
107
|
const intMatch = (type as string).match(integerRegex)
|
108
108
|
if (intMatch) {
|
109
109
|
const [_type, baseType, bits = '256'] = intMatch
|
110
|
-
const size = parseInt(bits) / 8
|
110
|
+
const size = Number.parseInt(bits) / 8
|
111
111
|
return numberToHex(value as number, {
|
112
112
|
size: isArray ? 32 : size,
|
113
113
|
signed: baseType === 'int',
|
@@ -117,9 +117,9 @@ function encode<const TPackedAbiType extends PackedAbiType | unknown>(
|
|
117
117
|
const bytesMatch = (type as string).match(bytesRegex)
|
118
118
|
if (bytesMatch) {
|
119
119
|
const [_type, size] = bytesMatch
|
120
|
-
if (parseInt(size) !== ((value as Hex).length - 2) / 2)
|
120
|
+
if (Number.parseInt(size) !== ((value as Hex).length - 2) / 2)
|
121
121
|
throw new BytesSizeMismatchError({
|
122
|
-
expectedSize: parseInt(size),
|
122
|
+
expectedSize: Number.parseInt(size),
|
123
123
|
givenSize: ((value as Hex).length - 2) / 2,
|
124
124
|
})
|
125
125
|
return pad(value as Hex, { dir: 'right', size: isArray ? 32 : null }) as Hex
|
package/utils/abi/getAbiItem.ts
CHANGED
@@ -13,7 +13,7 @@ import type {
|
|
13
13
|
ContractFunctionArgs,
|
14
14
|
ContractFunctionName,
|
15
15
|
} from '../../types/contract.js'
|
16
|
-
import {
|
16
|
+
import type { ConcatHexErrorType } from '../data/concat.js'
|
17
17
|
import {
|
18
18
|
type ToFunctionSelectorErrorType,
|
19
19
|
toFunctionSelector,
|
package/utils/buildRequest.ts
CHANGED
@@ -176,7 +176,8 @@ export function buildRequest<request extends (args: any) => Promise<any>>(
|
|
176
176
|
// If we find a Retry-After header, let's retry after the given time.
|
177
177
|
if (error && error instanceof HttpRequestError) {
|
178
178
|
const retryAfter = error?.headers?.get('Retry-After')
|
179
|
-
if (retryAfter?.match(/\d/))
|
179
|
+
if (retryAfter?.match(/\d/))
|
180
|
+
return Number.parseInt(retryAfter) * 1000
|
180
181
|
}
|
181
182
|
|
182
183
|
// Otherwise, let's retry with an exponential backoff.
|
package/utils/ccip.ts
CHANGED
@@ -2,7 +2,7 @@ import type { Abi, Address } from 'abitype'
|
|
2
2
|
|
3
3
|
import { type CallParameters, call } from '../actions/public/call.js'
|
4
4
|
import type { Transport } from '../clients/transports/createTransport.js'
|
5
|
-
import {
|
5
|
+
import type { BaseError } from '../errors/base.js'
|
6
6
|
import {
|
7
7
|
OffchainLookupError,
|
8
8
|
OffchainLookupResponseMalformedError,
|
package/utils/cursor.ts
CHANGED
@@ -61,7 +61,7 @@ const staticCursor: Cursor = {
|
|
61
61
|
position: 0,
|
62
62
|
positionReadCount: new Map(),
|
63
63
|
recursiveReadCount: 0,
|
64
|
-
recursiveReadLimit:
|
64
|
+
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
65
65
|
assertReadLimit() {
|
66
66
|
if (this.recursiveReadCount >= this.recursiveReadLimit)
|
67
67
|
throw new RecursiveReadLimitExceededError({
|
@@ -207,7 +207,7 @@ const staticCursor: Cursor = {
|
|
207
207
|
return () => (this.position = oldPosition)
|
208
208
|
},
|
209
209
|
_touch() {
|
210
|
-
if (this.recursiveReadLimit ===
|
210
|
+
if (this.recursiveReadLimit === Number.POSITIVE_INFINITY) return
|
211
211
|
const count = this.getReadCount()
|
212
212
|
this.positionReadCount.set(this.position, count + 1)
|
213
213
|
if (count > 0) this.recursiveReadCount++
|
@@ -41,7 +41,9 @@ export function fromRlp<to extends To = 'hex'>(
|
|
41
41
|
return value
|
42
42
|
})()
|
43
43
|
|
44
|
-
const cursor = createCursor(bytes, {
|
44
|
+
const cursor = createCursor(bytes, {
|
45
|
+
recursiveReadLimit: Number.POSITIVE_INFINITY,
|
46
|
+
})
|
45
47
|
const result = fromRlpCursor(cursor, to)
|
46
48
|
|
47
49
|
return result as FromRlpReturnType<to>
|
@@ -244,7 +244,7 @@ export function parseNftUri(uri_: string): ParsedNft {
|
|
244
244
|
throw new EnsAvatarInvalidNftUriError({ reason: 'ERC namespace not found' })
|
245
245
|
|
246
246
|
return {
|
247
|
-
chainID: parseInt(chainID),
|
247
|
+
chainID: Number.parseInt(chainID),
|
248
248
|
namespace: erc_namespace.toLowerCase(),
|
249
249
|
contractAddress: contractAddress as Address,
|
250
250
|
tokenID,
|
@@ -41,7 +41,7 @@ export type WithCacheParameters = {
|
|
41
41
|
*/
|
42
42
|
export async function withCache<TData>(
|
43
43
|
fn: () => Promise<TData>,
|
44
|
-
{ cacheKey, cacheTime =
|
44
|
+
{ cacheKey, cacheTime = Number.POSITIVE_INFINITY }: WithCacheParameters,
|
45
45
|
) {
|
46
46
|
const cache = getCache<TData>(cacheKey)
|
47
47
|
|
package/utils/rpc/compat.ts
CHANGED
@@ -2,15 +2,15 @@
|
|
2
2
|
// These APIs will be removed in v3.
|
3
3
|
|
4
4
|
/* c8 ignore start */
|
5
|
-
import {
|
6
|
-
|
5
|
+
import type {
|
6
|
+
TimeoutErrorType,
|
7
7
|
WebSocketRequestError,
|
8
8
|
} from '../../errors/request.js'
|
9
9
|
import type { ErrorType } from '../../errors/utils.js'
|
10
10
|
import type { RpcResponse } from '../../types/rpc.js'
|
11
|
-
import {
|
11
|
+
import type { WithTimeoutErrorType } from '../promise/withTimeout.js'
|
12
12
|
import { type HttpRequestParameters, getHttpRpcClient } from './http.js'
|
13
|
-
import {
|
13
|
+
import type { SocketRpcClient } from './socket.js'
|
14
14
|
import { getWebSocketRpcClient } from './webSocket.js'
|
15
15
|
|
16
16
|
export type WebSocketOptions = Parameters<
|
@@ -10,7 +10,7 @@ import type { ErrorType } from '../../errors/utils.js'
|
|
10
10
|
import type { Hex } from '../../types/misc.js'
|
11
11
|
import type { AccessList } from '../../types/transaction.js'
|
12
12
|
import { type IsAddressErrorType, isAddress } from '../address/isAddress.js'
|
13
|
-
import {
|
13
|
+
import type { RecursiveArray } from '../encoding/toRlp.js'
|
14
14
|
|
15
15
|
export type SerializeAccessListErrorType =
|
16
16
|
| InvalidStorageKeySizeErrorType
|
package/utils/typedData.ts
CHANGED
@@ -47,7 +47,7 @@ export function validateTypedData<
|
|
47
47
|
// and will throw.
|
48
48
|
numberToHex(value, {
|
49
49
|
signed: base === 'int',
|
50
|
-
size: parseInt(size_) / 8,
|
50
|
+
size: Number.parseInt(size_) / 8,
|
51
51
|
})
|
52
52
|
}
|
53
53
|
|
@@ -57,9 +57,9 @@ export function validateTypedData<
|
|
57
57
|
const bytesMatch = type.match(bytesRegex)
|
58
58
|
if (bytesMatch) {
|
59
59
|
const [_type, size_] = bytesMatch
|
60
|
-
if (size_ && size(value as Hex) !== parseInt(size_))
|
60
|
+
if (size_ && size(value as Hex) !== Number.parseInt(size_))
|
61
61
|
throw new BytesSizeMismatchError({
|
62
|
-
expectedSize: parseInt(size_),
|
62
|
+
expectedSize: Number.parseInt(size_),
|
63
63
|
givenSize: size(value as Hex),
|
64
64
|
})
|
65
65
|
}
|
@@ -11,7 +11,7 @@ import type {
|
|
11
11
|
import type { Client } from '../../clients/createClient.js'
|
12
12
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
13
13
|
import { AccountNotFoundError } from '../../errors/account.js'
|
14
|
-
import { BaseError } from '../../errors/base.js'
|
14
|
+
import type { BaseError } from '../../errors/base.js'
|
15
15
|
import type { Chain } from '../../types/chain.js'
|
16
16
|
import { assertCurrentChain } from '../../utils/chain/assertCurrentChain.js'
|
17
17
|
import {
|
@@ -19,7 +19,7 @@ import {
|
|
19
19
|
getTransactionError,
|
20
20
|
} from '../../utils/errors/getTransactionError.js'
|
21
21
|
import { getAction } from '../../utils/getAction.js'
|
22
|
-
import {
|
22
|
+
import type { ChainEIP712 } from '../types/chain.js'
|
23
23
|
import { assertEip712Request } from '../utils/assertEip712Request.js'
|
24
24
|
import { signTransaction } from './signTransaction.js'
|
25
25
|
|
@@ -7,7 +7,7 @@ import type {
|
|
7
7
|
} from '../../actions/wallet/sendTransaction.js'
|
8
8
|
import type { Client } from '../../clients/createClient.js'
|
9
9
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
10
|
-
import {
|
10
|
+
import type { ChainEIP712 } from '../types/chain.js'
|
11
11
|
import { isEIP712Transaction } from '../utils/isEip712Transaction.js'
|
12
12
|
import { sendEip712Transaction } from './sendEip712Transaction.js'
|
13
13
|
|
package/zksync/formatters.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import type { ChainFormatters } from '../types/chain.js'
|
2
2
|
import type { Hash } from '../types/misc.js'
|
3
3
|
import { hexToBigInt, hexToNumber } from '../utils/encoding/fromHex.js'
|
4
4
|
import { hexToBytes } from '../utils/encoding/toBytes.js'
|
@@ -9,9 +9,9 @@ import type { ContractConstructorArgs } from '../../../types/contract.js'
|
|
9
9
|
import type { Hash } from '../../../types/misc.js'
|
10
10
|
import type { Hex } from '../../../types/misc.js'
|
11
11
|
import { encodeAbiParameters } from '../../../utils/abi/encodeAbiParameters.js'
|
12
|
-
import {
|
13
|
-
|
14
|
-
|
12
|
+
import type {
|
13
|
+
EncodeDeployDataParameters as EncodeDeployDataParameters_,
|
14
|
+
EncodeDeployDataReturnType,
|
15
15
|
} from '../../../utils/abi/encodeDeployData.js'
|
16
16
|
import { encodeFunctionData } from '../../../utils/abi/encodeFunctionData.js'
|
17
17
|
import { toHex } from '../../../utils/encoding/toHex.js'
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import {
|
1
|
+
import type { Address } from 'abitype'
|
2
2
|
import type { ByteArray, Hex } from '../../../types/misc.js'
|
3
3
|
import type { EncodeFunctionDataReturnType } from '../../../utils/abi/encodeFunctionData.js'
|
4
4
|
import { bytesToHex, encodeFunctionData } from '../../../utils/index.js'
|