viem 1.6.0 → 1.6.2
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/dist/cjs/actions/getContract.js.map +1 -1
- package/dist/cjs/actions/public/multicall.js +2 -3
- package/dist/cjs/actions/public/multicall.js.map +1 -1
- package/dist/cjs/chains/index.js +2 -1
- package/dist/cjs/chains/index.js.map +1 -1
- package/dist/cjs/clients/decorators/public.js.map +1 -1
- package/dist/cjs/constants/number.js +96 -96
- package/dist/cjs/constants/number.js.map +1 -1
- package/dist/cjs/errors/version.js +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/utils/abi/decodeAbiParameters.js.map +1 -1
- package/dist/cjs/utils/abi/decodeDeployData.js.map +1 -1
- package/dist/cjs/utils/abi/decodeErrorResult.js.map +1 -1
- package/dist/cjs/utils/abi/decodeFunctionResult.js.map +1 -1
- package/dist/cjs/utils/abi/encodeAbiParameters.js.map +1 -1
- package/dist/cjs/utils/abi/encodeDeployData.js.map +1 -1
- package/dist/cjs/utils/abi/encodeEventTopics.js.map +1 -1
- package/dist/cjs/utils/abi/encodePacked.js.map +1 -1
- package/dist/cjs/utils/poll.js +1 -1
- package/dist/cjs/utils/poll.js.map +1 -1
- package/dist/cjs/utils/typedData.js +2 -2
- package/dist/cjs/utils/typedData.js.map +1 -1
- package/dist/esm/actions/getContract.js.map +1 -1
- package/dist/esm/actions/public/multicall.js +2 -4
- package/dist/esm/actions/public/multicall.js.map +1 -1
- package/dist/esm/chains/index.js +1 -0
- package/dist/esm/chains/index.js.map +1 -1
- package/dist/esm/clients/decorators/public.js.map +1 -1
- package/dist/esm/constants/number.js +96 -96
- package/dist/esm/constants/number.js.map +1 -1
- package/dist/esm/errors/version.js +1 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/utils/abi/decodeAbiParameters.js.map +1 -1
- package/dist/esm/utils/abi/decodeDeployData.js.map +1 -1
- package/dist/esm/utils/abi/decodeErrorResult.js.map +1 -1
- package/dist/esm/utils/abi/decodeFunctionResult.js.map +1 -1
- package/dist/esm/utils/abi/encodeAbiParameters.js.map +1 -1
- package/dist/esm/utils/abi/encodeDeployData.js.map +1 -1
- package/dist/esm/utils/abi/encodeEventTopics.js.map +1 -1
- package/dist/esm/utils/abi/encodePacked.js.map +1 -1
- package/dist/esm/utils/poll.js +1 -1
- package/dist/esm/utils/poll.js.map +1 -1
- package/dist/esm/utils/typedData.js +2 -2
- package/dist/esm/utils/typedData.js.map +1 -1
- package/dist/types/accounts/types.d.ts +1 -1
- package/dist/types/accounts/types.d.ts.map +1 -1
- package/dist/types/accounts/utils/signTypedData.d.ts +1 -1
- package/dist/types/accounts/utils/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/getContract.d.ts +5 -5
- package/dist/types/actions/getContract.d.ts.map +1 -1
- package/dist/types/actions/public/createContractEventFilter.d.ts +3 -3
- package/dist/types/actions/public/createContractEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/createEventFilter.d.ts +5 -5
- package/dist/types/actions/public/createEventFilter.d.ts.map +1 -1
- package/dist/types/actions/public/estimateContractGas.d.ts +1 -1
- package/dist/types/actions/public/estimateContractGas.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterChanges.d.ts +1 -1
- package/dist/types/actions/public/getFilterChanges.d.ts.map +1 -1
- package/dist/types/actions/public/getFilterLogs.d.ts +1 -1
- package/dist/types/actions/public/getFilterLogs.d.ts.map +1 -1
- package/dist/types/actions/public/getLogs.d.ts +4 -4
- package/dist/types/actions/public/getLogs.d.ts.map +1 -1
- package/dist/types/actions/public/multicall.d.ts +1 -1
- package/dist/types/actions/public/multicall.d.ts.map +1 -1
- package/dist/types/actions/public/readContract.d.ts +1 -1
- package/dist/types/actions/public/readContract.d.ts.map +1 -1
- package/dist/types/actions/public/simulateContract.d.ts +1 -1
- package/dist/types/actions/public/simulateContract.d.ts.map +1 -1
- package/dist/types/actions/public/watchContractEvent.d.ts +3 -3
- package/dist/types/actions/public/watchContractEvent.d.ts.map +1 -1
- package/dist/types/actions/public/watchEvent.d.ts +4 -4
- package/dist/types/actions/public/watchEvent.d.ts.map +1 -1
- package/dist/types/actions/wallet/deployContract.d.ts +3 -3
- package/dist/types/actions/wallet/deployContract.d.ts.map +1 -1
- package/dist/types/actions/wallet/signTypedData.d.ts +1 -1
- package/dist/types/actions/wallet/signTypedData.d.ts.map +1 -1
- package/dist/types/actions/wallet/writeContract.d.ts +1 -1
- package/dist/types/actions/wallet/writeContract.d.ts.map +1 -1
- package/dist/types/chains/index.d.ts +154 -36
- package/dist/types/chains/index.d.ts.map +1 -1
- package/dist/types/clients/decorators/public.d.ts +10 -10
- package/dist/types/clients/decorators/public.d.ts.map +1 -1
- package/dist/types/clients/decorators/wallet.d.ts +3 -3
- package/dist/types/clients/decorators/wallet.d.ts.map +1 -1
- package/dist/types/constants/number.d.ts.map +1 -1
- package/dist/types/errors/version.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/multicall.d.ts +8 -8
- package/dist/types/types/multicall.d.ts.map +1 -1
- package/dist/types/types/typedData.d.ts +3 -3
- package/dist/types/types/typedData.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeAbiParameters.d.ts +2 -2
- package/dist/types/utils/abi/decodeAbiParameters.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeDeployData.d.ts +3 -3
- package/dist/types/utils/abi/decodeDeployData.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeErrorResult.d.ts +3 -3
- package/dist/types/utils/abi/decodeErrorResult.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeEventLog.d.ts +3 -3
- package/dist/types/utils/abi/decodeEventLog.d.ts.map +1 -1
- package/dist/types/utils/abi/decodeFunctionResult.d.ts +4 -4
- package/dist/types/utils/abi/decodeFunctionResult.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeAbiParameters.d.ts +2 -2
- package/dist/types/utils/abi/encodeAbiParameters.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeDeployData.d.ts +3 -3
- package/dist/types/utils/abi/encodeDeployData.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeErrorResult.d.ts +4 -4
- package/dist/types/utils/abi/encodeErrorResult.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeEventTopics.d.ts +4 -4
- package/dist/types/utils/abi/encodeEventTopics.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeFunctionData.d.ts +4 -4
- package/dist/types/utils/abi/encodeFunctionData.d.ts.map +1 -1
- package/dist/types/utils/abi/encodeFunctionResult.d.ts +4 -4
- package/dist/types/utils/abi/encodeFunctionResult.d.ts.map +1 -1
- package/dist/types/utils/abi/encodePacked.d.ts +3 -3
- package/dist/types/utils/abi/encodePacked.d.ts.map +1 -1
- package/dist/types/utils/abi/getAbiItem.d.ts +3 -3
- package/dist/types/utils/abi/getAbiItem.d.ts.map +1 -1
- package/dist/types/utils/signature/hashTypedData.d.ts +1 -1
- package/dist/types/utils/signature/hashTypedData.d.ts.map +1 -1
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts +1 -1
- package/dist/types/utils/signature/recoverTypedDataAddress.d.ts.map +1 -1
- package/dist/types/utils/signature/verifyTypedData.d.ts +1 -1
- package/dist/types/utils/signature/verifyTypedData.d.ts.map +1 -1
- package/dist/types/utils/typedData.d.ts +1 -1
- package/dist/types/utils/typedData.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/accounts/types.ts +1 -1
- package/src/accounts/utils/signTypedData.ts +1 -1
- package/src/actions/getContract.ts +6 -5
- package/src/actions/public/createContractEventFilter.ts +3 -3
- package/src/actions/public/createEventFilter.ts +6 -6
- package/src/actions/public/estimateContractGas.ts +1 -1
- package/src/actions/public/getFilterChanges.ts +1 -1
- package/src/actions/public/getFilterLogs.ts +1 -1
- package/src/actions/public/getLogs.ts +5 -5
- package/src/actions/public/multicall.ts +9 -8
- package/src/actions/public/readContract.ts +1 -1
- package/src/actions/public/simulateContract.ts +1 -1
- package/src/actions/public/watchContractEvent.ts +3 -3
- package/src/actions/public/watchEvent.ts +5 -5
- package/src/actions/wallet/deployContract.ts +3 -3
- package/src/actions/wallet/signTypedData.ts +1 -1
- package/src/actions/wallet/writeContract.ts +1 -1
- package/src/chains/index.ts +1 -0
- package/src/clients/decorators/public.ts +14 -14
- package/src/clients/decorators/wallet.ts +3 -3
- package/src/constants/number.ts +96 -96
- package/src/errors/version.ts +1 -1
- package/src/index.ts +1 -0
- package/src/types/multicall.ts +14 -11
- package/src/types/typedData.ts +2 -3
- package/src/utils/abi/decodeAbiParameters.ts +7 -8
- package/src/utils/abi/decodeDeployData.ts +3 -3
- package/src/utils/abi/decodeErrorResult.ts +3 -8
- package/src/utils/abi/decodeEventLog.ts +3 -3
- package/src/utils/abi/decodeFunctionResult.ts +4 -6
- package/src/utils/abi/encodeAbiParameters.ts +8 -9
- package/src/utils/abi/encodeDeployData.ts +3 -3
- package/src/utils/abi/encodeErrorResult.ts +4 -4
- package/src/utils/abi/encodeEventTopics.ts +4 -9
- package/src/utils/abi/encodeFunctionData.ts +4 -4
- package/src/utils/abi/encodeFunctionResult.ts +4 -4
- package/src/utils/abi/encodePacked.ts +6 -8
- package/src/utils/abi/getAbiItem.ts +3 -3
- package/src/utils/poll.ts +1 -1
- package/src/utils/signature/hashTypedData.ts +1 -1
- package/src/utils/signature/recoverTypedDataAddress.ts +1 -1
- package/src/utils/signature/verifyTypedData.ts +1 -1
- package/src/utils/typedData.ts +2 -3
package/src/chains/index.ts
CHANGED
@@ -94,6 +94,7 @@ export const polygonZkEvmTestnet = /*#__PURE__*/ defineChain(
|
|
94
94
|
)
|
95
95
|
export const pulsechain = /*#__PURE__*/ defineChain(chains.pulsechain)
|
96
96
|
export const pulsechainV4 = /*#__PURE__*/ defineChain(chains.pulsechainV4)
|
97
|
+
export const scrollSepolia = /*#__PURE__*/ defineChain(chains.scrollSepolia)
|
97
98
|
export const scrollTestnet = /*#__PURE__*/ defineChain(chains.scrollTestnet)
|
98
99
|
export const sepolia = /*#__PURE__*/ defineChain(chains.sepolia)
|
99
100
|
export const skaleBlockBrawlers = /*#__PURE__*/ defineChain(
|
@@ -278,7 +278,7 @@ export type PublicActions<
|
|
278
278
|
* })
|
279
279
|
*/
|
280
280
|
createContractEventFilter: <
|
281
|
-
TAbi extends Abi | readonly unknown[],
|
281
|
+
const TAbi extends Abi | readonly unknown[],
|
282
282
|
TEventName extends string | undefined,
|
283
283
|
TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined,
|
284
284
|
TStrict extends boolean | undefined = undefined,
|
@@ -325,8 +325,8 @@ export type PublicActions<
|
|
325
325
|
* })
|
326
326
|
*/
|
327
327
|
createEventFilter: <
|
328
|
-
TAbiEvent extends AbiEvent | undefined = undefined,
|
329
|
-
TAbiEvents extends
|
328
|
+
const TAbiEvent extends AbiEvent | undefined = undefined,
|
329
|
+
const TAbiEvents extends
|
330
330
|
| readonly AbiEvent[]
|
331
331
|
| readonly unknown[]
|
332
332
|
| undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined,
|
@@ -406,7 +406,7 @@ export type PublicActions<
|
|
406
406
|
*/
|
407
407
|
estimateContractGas: <
|
408
408
|
TChain extends Chain | undefined,
|
409
|
-
TAbi extends Abi | readonly unknown[],
|
409
|
+
const TAbi extends Abi | readonly unknown[],
|
410
410
|
TFunctionName extends string,
|
411
411
|
>(
|
412
412
|
args: EstimateContractGasParameters<TAbi, TFunctionName, TChain, TAccount>,
|
@@ -844,7 +844,7 @@ export type PublicActions<
|
|
844
844
|
*/
|
845
845
|
getFilterChanges: <
|
846
846
|
TFilterType extends FilterType,
|
847
|
-
TAbi extends Abi | readonly unknown[] | undefined,
|
847
|
+
const TAbi extends Abi | readonly unknown[] | undefined,
|
848
848
|
TEventName extends string | undefined,
|
849
849
|
TStrict extends boolean | undefined = undefined,
|
850
850
|
TFromBlock extends BlockNumber | BlockTag | undefined = undefined,
|
@@ -895,7 +895,7 @@ export type PublicActions<
|
|
895
895
|
* const logs = await client.getFilterLogs({ filter })
|
896
896
|
*/
|
897
897
|
getFilterLogs: <
|
898
|
-
TAbi extends Abi | readonly unknown[] | undefined,
|
898
|
+
const TAbi extends Abi | readonly unknown[] | undefined,
|
899
899
|
TEventName extends string | undefined,
|
900
900
|
TStrict extends boolean | undefined = undefined,
|
901
901
|
TFromBlock extends BlockNumber | BlockTag | undefined = undefined,
|
@@ -951,8 +951,8 @@ export type PublicActions<
|
|
951
951
|
* const logs = await client.getLogs()
|
952
952
|
*/
|
953
953
|
getLogs: <
|
954
|
-
TAbiEvent extends AbiEvent | undefined = undefined,
|
955
|
-
TAbiEvents extends
|
954
|
+
const TAbiEvent extends AbiEvent | undefined = undefined,
|
955
|
+
const TAbiEvents extends
|
956
956
|
| readonly AbiEvent[]
|
957
957
|
| readonly unknown[]
|
958
958
|
| undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined,
|
@@ -1170,7 +1170,7 @@ export type PublicActions<
|
|
1170
1170
|
* // 424122n
|
1171
1171
|
*/
|
1172
1172
|
readContract: <
|
1173
|
-
TAbi extends Abi | readonly unknown[],
|
1173
|
+
const TAbi extends Abi | readonly unknown[],
|
1174
1174
|
TFunctionName extends string,
|
1175
1175
|
>(
|
1176
1176
|
args: ReadContractParameters<TAbi, TFunctionName>,
|
@@ -1206,7 +1206,7 @@ export type PublicActions<
|
|
1206
1206
|
* })
|
1207
1207
|
*/
|
1208
1208
|
simulateContract: <
|
1209
|
-
TAbi extends Abi | readonly unknown[],
|
1209
|
+
const TAbi extends Abi | readonly unknown[],
|
1210
1210
|
TFunctionName extends string,
|
1211
1211
|
TChainOverride extends Chain | undefined,
|
1212
1212
|
>(
|
@@ -1383,7 +1383,7 @@ export type PublicActions<
|
|
1383
1383
|
* })
|
1384
1384
|
*/
|
1385
1385
|
watchContractEvent: <
|
1386
|
-
TAbi extends Abi | readonly unknown[],
|
1386
|
+
const TAbi extends Abi | readonly unknown[],
|
1387
1387
|
TEventName extends string,
|
1388
1388
|
TStrict extends boolean | undefined = undefined,
|
1389
1389
|
>(
|
@@ -1421,8 +1421,8 @@ export type PublicActions<
|
|
1421
1421
|
* })
|
1422
1422
|
*/
|
1423
1423
|
watchEvent: <
|
1424
|
-
TAbiEvent extends AbiEvent | undefined = undefined,
|
1425
|
-
TAbiEvents extends
|
1424
|
+
const TAbiEvent extends AbiEvent | undefined = undefined,
|
1425
|
+
const TAbiEvents extends
|
1426
1426
|
| readonly AbiEvent[]
|
1427
1427
|
| readonly unknown[]
|
1428
1428
|
| undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined,
|
@@ -1502,7 +1502,7 @@ export function publicActions<
|
|
1502
1502
|
getTransactionConfirmations(client, args),
|
1503
1503
|
getTransactionCount: (args) => getTransactionCount(client, args),
|
1504
1504
|
getTransactionReceipt: (args) => getTransactionReceipt(client, args),
|
1505
|
-
multicall: (args) => multicall(client, args),
|
1505
|
+
multicall: (args) => multicall(client, args as any) as any,
|
1506
1506
|
readContract: (args) => readContract(client, args),
|
1507
1507
|
simulateContract: (args) => simulateContract(client, args),
|
1508
1508
|
verifyMessage: (args) => verifyMessage(client, args),
|
@@ -112,7 +112,7 @@ export type WalletActions<
|
|
112
112
|
* })
|
113
113
|
*/
|
114
114
|
deployContract: <
|
115
|
-
TAbi extends Abi | readonly unknown[],
|
115
|
+
const TAbi extends Abi | readonly unknown[],
|
116
116
|
TChainOverride extends Chain | undefined,
|
117
117
|
>(
|
118
118
|
args: DeployContractParameters<TAbi, TChain, TAccount, TChainOverride>,
|
@@ -410,7 +410,7 @@ export type WalletActions<
|
|
410
410
|
* })
|
411
411
|
*/
|
412
412
|
signTypedData: <
|
413
|
-
TTypedData extends TypedData | { [key: string]: unknown },
|
413
|
+
const TTypedData extends TypedData | { [key: string]: unknown },
|
414
414
|
TPrimaryType extends string,
|
415
415
|
>(
|
416
416
|
args: SignTypedDataParameters<TTypedData, TPrimaryType, TAccount>,
|
@@ -509,7 +509,7 @@ export type WalletActions<
|
|
509
509
|
* const hash = await client.writeContract(request)
|
510
510
|
*/
|
511
511
|
writeContract: <
|
512
|
-
TAbi extends Abi | readonly unknown[],
|
512
|
+
const TAbi extends Abi | readonly unknown[],
|
513
513
|
TFunctionName extends string,
|
514
514
|
TChainOverride extends Chain | undefined,
|
515
515
|
>(
|
package/src/constants/number.ts
CHANGED
@@ -1,98 +1,98 @@
|
|
1
|
-
export const maxInt8 = 2n ** (8n - 1n)
|
2
|
-
export const maxInt16 = 2n ** (16n - 1n)
|
3
|
-
export const maxInt24 = 2n ** (24n - 1n)
|
4
|
-
export const maxInt32 = 2n ** (32n - 1n)
|
5
|
-
export const maxInt40 = 2n ** (40n - 1n)
|
6
|
-
export const maxInt48 = 2n ** (48n - 1n)
|
7
|
-
export const maxInt56 = 2n ** (56n - 1n)
|
8
|
-
export const maxInt64 = 2n ** (64n - 1n)
|
9
|
-
export const maxInt72 = 2n ** (72n - 1n)
|
10
|
-
export const maxInt80 = 2n ** (80n - 1n)
|
11
|
-
export const maxInt88 = 2n ** (88n - 1n)
|
12
|
-
export const maxInt96 = 2n ** (96n - 1n)
|
13
|
-
export const maxInt104 = 2n ** (104n - 1n)
|
14
|
-
export const maxInt112 = 2n ** (112n - 1n)
|
15
|
-
export const maxInt120 = 2n ** (120n - 1n)
|
16
|
-
export const maxInt128 = 2n ** (128n - 1n)
|
17
|
-
export const maxInt136 = 2n ** (136n - 1n)
|
18
|
-
export const maxInt144 = 2n ** (144n - 1n)
|
19
|
-
export const maxInt152 = 2n ** (152n - 1n)
|
20
|
-
export const maxInt160 = 2n ** (160n - 1n)
|
21
|
-
export const maxInt168 = 2n ** (168n - 1n)
|
22
|
-
export const maxInt176 = 2n ** (176n - 1n)
|
23
|
-
export const maxInt184 = 2n ** (184n - 1n)
|
24
|
-
export const maxInt192 = 2n ** (192n - 1n)
|
25
|
-
export const maxInt200 = 2n ** (200n - 1n)
|
26
|
-
export const maxInt208 = 2n ** (208n - 1n)
|
27
|
-
export const maxInt216 = 2n ** (216n - 1n)
|
28
|
-
export const maxInt224 = 2n ** (224n - 1n)
|
29
|
-
export const maxInt232 = 2n ** (232n - 1n)
|
30
|
-
export const maxInt240 = 2n ** (240n - 1n)
|
31
|
-
export const maxInt248 = 2n ** (248n - 1n)
|
32
|
-
export const maxInt256 = 2n ** (256n - 1n)
|
1
|
+
export const maxInt8 = 2n ** (8n - 1n) - 1n
|
2
|
+
export const maxInt16 = 2n ** (16n - 1n) - 1n
|
3
|
+
export const maxInt24 = 2n ** (24n - 1n) - 1n
|
4
|
+
export const maxInt32 = 2n ** (32n - 1n) - 1n
|
5
|
+
export const maxInt40 = 2n ** (40n - 1n) - 1n
|
6
|
+
export const maxInt48 = 2n ** (48n - 1n) - 1n
|
7
|
+
export const maxInt56 = 2n ** (56n - 1n) - 1n
|
8
|
+
export const maxInt64 = 2n ** (64n - 1n) - 1n
|
9
|
+
export const maxInt72 = 2n ** (72n - 1n) - 1n
|
10
|
+
export const maxInt80 = 2n ** (80n - 1n) - 1n
|
11
|
+
export const maxInt88 = 2n ** (88n - 1n) - 1n
|
12
|
+
export const maxInt96 = 2n ** (96n - 1n) - 1n
|
13
|
+
export const maxInt104 = 2n ** (104n - 1n) - 1n
|
14
|
+
export const maxInt112 = 2n ** (112n - 1n) - 1n
|
15
|
+
export const maxInt120 = 2n ** (120n - 1n) - 1n
|
16
|
+
export const maxInt128 = 2n ** (128n - 1n) - 1n
|
17
|
+
export const maxInt136 = 2n ** (136n - 1n) - 1n
|
18
|
+
export const maxInt144 = 2n ** (144n - 1n) - 1n
|
19
|
+
export const maxInt152 = 2n ** (152n - 1n) - 1n
|
20
|
+
export const maxInt160 = 2n ** (160n - 1n) - 1n
|
21
|
+
export const maxInt168 = 2n ** (168n - 1n) - 1n
|
22
|
+
export const maxInt176 = 2n ** (176n - 1n) - 1n
|
23
|
+
export const maxInt184 = 2n ** (184n - 1n) - 1n
|
24
|
+
export const maxInt192 = 2n ** (192n - 1n) - 1n
|
25
|
+
export const maxInt200 = 2n ** (200n - 1n) - 1n
|
26
|
+
export const maxInt208 = 2n ** (208n - 1n) - 1n
|
27
|
+
export const maxInt216 = 2n ** (216n - 1n) - 1n
|
28
|
+
export const maxInt224 = 2n ** (224n - 1n) - 1n
|
29
|
+
export const maxInt232 = 2n ** (232n - 1n) - 1n
|
30
|
+
export const maxInt240 = 2n ** (240n - 1n) - 1n
|
31
|
+
export const maxInt248 = 2n ** (248n - 1n) - 1n
|
32
|
+
export const maxInt256 = 2n ** (256n - 1n) - 1n
|
33
33
|
|
34
|
-
export const minInt8 = -(2n ** 8n)
|
35
|
-
export const minInt16 = -(2n ** 16n)
|
36
|
-
export const minInt24 = -(2n ** 24n)
|
37
|
-
export const minInt32 = -(2n ** 32n)
|
38
|
-
export const minInt40 = -(2n ** 40n)
|
39
|
-
export const minInt48 = -(2n ** 48n)
|
40
|
-
export const minInt56 = -(2n ** 56n)
|
41
|
-
export const minInt64 = -(2n ** 64n)
|
42
|
-
export const minInt72 = -(2n ** 72n)
|
43
|
-
export const minInt80 = -(2n ** 80n)
|
44
|
-
export const minInt88 = -(2n ** 88n)
|
45
|
-
export const minInt96 = -(2n ** 96n)
|
46
|
-
export const minInt104 = -(2n ** 104n)
|
47
|
-
export const minInt112 = -(2n ** 112n)
|
48
|
-
export const minInt120 = -(2n ** 120n)
|
49
|
-
export const minInt128 = -(2n ** 128n)
|
50
|
-
export const minInt136 = -(2n ** 136n)
|
51
|
-
export const minInt144 = -(2n ** 144n)
|
52
|
-
export const minInt152 = -(2n ** 152n)
|
53
|
-
export const minInt160 = -(2n ** 160n)
|
54
|
-
export const minInt168 = -(2n ** 168n)
|
55
|
-
export const minInt176 = -(2n ** 176n)
|
56
|
-
export const minInt184 = -(2n ** 184n)
|
57
|
-
export const minInt192 = -(2n ** 192n)
|
58
|
-
export const minInt200 = -(2n ** 200n)
|
59
|
-
export const minInt208 = -(2n ** 208n)
|
60
|
-
export const minInt216 = -(2n ** 216n)
|
61
|
-
export const minInt224 = -(2n ** 224n)
|
62
|
-
export const minInt232 = -(2n ** 232n)
|
63
|
-
export const minInt240 = -(2n ** 240n)
|
64
|
-
export const minInt248 = -(2n ** 248n)
|
65
|
-
export const minInt256 = -(2n ** 256n)
|
34
|
+
export const minInt8 = -(2n ** (8n - 1n))
|
35
|
+
export const minInt16 = -(2n ** (16n - 1n))
|
36
|
+
export const minInt24 = -(2n ** (24n - 1n))
|
37
|
+
export const minInt32 = -(2n ** (32n - 1n))
|
38
|
+
export const minInt40 = -(2n ** (40n - 1n))
|
39
|
+
export const minInt48 = -(2n ** (48n - 1n))
|
40
|
+
export const minInt56 = -(2n ** (56n - 1n))
|
41
|
+
export const minInt64 = -(2n ** (64n - 1n))
|
42
|
+
export const minInt72 = -(2n ** (72n - 1n))
|
43
|
+
export const minInt80 = -(2n ** (80n - 1n))
|
44
|
+
export const minInt88 = -(2n ** (88n - 1n))
|
45
|
+
export const minInt96 = -(2n ** (96n - 1n))
|
46
|
+
export const minInt104 = -(2n ** (104n - 1n))
|
47
|
+
export const minInt112 = -(2n ** (112n - 1n))
|
48
|
+
export const minInt120 = -(2n ** (120n - 1n))
|
49
|
+
export const minInt128 = -(2n ** (128n - 1n))
|
50
|
+
export const minInt136 = -(2n ** (136n - 1n))
|
51
|
+
export const minInt144 = -(2n ** (144n - 1n))
|
52
|
+
export const minInt152 = -(2n ** (152n - 1n))
|
53
|
+
export const minInt160 = -(2n ** (160n - 1n))
|
54
|
+
export const minInt168 = -(2n ** (168n - 1n))
|
55
|
+
export const minInt176 = -(2n ** (176n - 1n))
|
56
|
+
export const minInt184 = -(2n ** (184n - 1n))
|
57
|
+
export const minInt192 = -(2n ** (192n - 1n))
|
58
|
+
export const minInt200 = -(2n ** (200n - 1n))
|
59
|
+
export const minInt208 = -(2n ** (208n - 1n))
|
60
|
+
export const minInt216 = -(2n ** (216n - 1n))
|
61
|
+
export const minInt224 = -(2n ** (224n - 1n))
|
62
|
+
export const minInt232 = -(2n ** (232n - 1n))
|
63
|
+
export const minInt240 = -(2n ** (240n - 1n))
|
64
|
+
export const minInt248 = -(2n ** (248n - 1n))
|
65
|
+
export const minInt256 = -(2n ** (256n - 1n))
|
66
66
|
|
67
|
-
export const maxUint8 = 2n ** 8n
|
68
|
-
export const maxUint16 = 2n ** 16n
|
69
|
-
export const maxUint24 = 2n ** 24n
|
70
|
-
export const maxUint32 = 2n ** 32n
|
71
|
-
export const maxUint40 = 2n ** 40n
|
72
|
-
export const maxUint48 = 2n ** 48n
|
73
|
-
export const maxUint56 = 2n ** 56n
|
74
|
-
export const maxUint64 = 2n ** 64n
|
75
|
-
export const maxUint72 = 2n ** 72n
|
76
|
-
export const maxUint80 = 2n ** 80n
|
77
|
-
export const maxUint88 = 2n ** 88n
|
78
|
-
export const maxUint96 = 2n ** 96n
|
79
|
-
export const maxUint104 = 2n ** 104n
|
80
|
-
export const maxUint112 = 2n ** 112n
|
81
|
-
export const maxUint120 = 2n ** 120n
|
82
|
-
export const maxUint128 = 2n ** 128n
|
83
|
-
export const maxUint136 = 2n ** 136n
|
84
|
-
export const maxUint144 = 2n ** 144n
|
85
|
-
export const maxUint152 = 2n ** 152n
|
86
|
-
export const maxUint160 = 2n ** 160n
|
87
|
-
export const maxUint168 = 2n ** 168n
|
88
|
-
export const maxUint176 = 2n ** 176n
|
89
|
-
export const maxUint184 = 2n ** 184n
|
90
|
-
export const maxUint192 = 2n ** 192n
|
91
|
-
export const maxUint200 = 2n ** 200n
|
92
|
-
export const maxUint208 = 2n ** 208n
|
93
|
-
export const maxUint216 = 2n ** 216n
|
94
|
-
export const maxUint224 = 2n ** 224n
|
95
|
-
export const maxUint232 = 2n ** 232n
|
96
|
-
export const maxUint240 = 2n ** 240n
|
97
|
-
export const maxUint248 = 2n ** 248n
|
98
|
-
export const maxUint256 = 2n ** 256n
|
67
|
+
export const maxUint8 = 2n ** 8n - 1n
|
68
|
+
export const maxUint16 = 2n ** 16n - 1n
|
69
|
+
export const maxUint24 = 2n ** 24n - 1n
|
70
|
+
export const maxUint32 = 2n ** 32n - 1n
|
71
|
+
export const maxUint40 = 2n ** 40n - 1n
|
72
|
+
export const maxUint48 = 2n ** 48n - 1n
|
73
|
+
export const maxUint56 = 2n ** 56n - 1n
|
74
|
+
export const maxUint64 = 2n ** 64n - 1n
|
75
|
+
export const maxUint72 = 2n ** 72n - 1n
|
76
|
+
export const maxUint80 = 2n ** 80n - 1n
|
77
|
+
export const maxUint88 = 2n ** 88n - 1n
|
78
|
+
export const maxUint96 = 2n ** 96n - 1n
|
79
|
+
export const maxUint104 = 2n ** 104n - 1n
|
80
|
+
export const maxUint112 = 2n ** 112n - 1n
|
81
|
+
export const maxUint120 = 2n ** 120n - 1n
|
82
|
+
export const maxUint128 = 2n ** 128n - 1n
|
83
|
+
export const maxUint136 = 2n ** 136n - 1n
|
84
|
+
export const maxUint144 = 2n ** 144n - 1n
|
85
|
+
export const maxUint152 = 2n ** 152n - 1n
|
86
|
+
export const maxUint160 = 2n ** 160n - 1n
|
87
|
+
export const maxUint168 = 2n ** 168n - 1n
|
88
|
+
export const maxUint176 = 2n ** 176n - 1n
|
89
|
+
export const maxUint184 = 2n ** 184n - 1n
|
90
|
+
export const maxUint192 = 2n ** 192n - 1n
|
91
|
+
export const maxUint200 = 2n ** 200n - 1n
|
92
|
+
export const maxUint208 = 2n ** 208n - 1n
|
93
|
+
export const maxUint216 = 2n ** 216n - 1n
|
94
|
+
export const maxUint224 = 2n ** 224n - 1n
|
95
|
+
export const maxUint232 = 2n ** 232n - 1n
|
96
|
+
export const maxUint240 = 2n ** 240n - 1n
|
97
|
+
export const maxUint248 = 2n ** 248n - 1n
|
98
|
+
export const maxUint256 = 2n ** 256n - 1n
|
package/src/errors/version.ts
CHANGED
@@ -1 +1 @@
|
|
1
|
-
export const version = '1.
|
1
|
+
export const version = '1.6.2'
|
package/src/index.ts
CHANGED
@@ -633,6 +633,7 @@ export type { GetTransportConfig } from './types/transport.js'
|
|
633
633
|
export type { HDKey } from '@scure/bip32'
|
634
634
|
export type { Log } from './types/log.js'
|
635
635
|
export type {
|
636
|
+
MulticallContract,
|
636
637
|
MulticallContracts,
|
637
638
|
MulticallResult,
|
638
639
|
MulticallResults,
|
package/src/types/multicall.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi } from 'abitype'
|
1
|
+
import type { Abi, ExtractAbiFunctionNames } from 'abitype'
|
2
2
|
|
3
3
|
import type {
|
4
4
|
ContractFunctionConfig,
|
@@ -7,13 +7,16 @@ import type {
|
|
7
7
|
|
8
8
|
type MAXIMUM_DEPTH = 20
|
9
9
|
|
10
|
-
export type
|
10
|
+
export type MulticallContract<
|
11
11
|
TAbi extends Abi | readonly unknown[] = Abi | readonly unknown[],
|
12
|
-
TFunctionName extends
|
12
|
+
TFunctionName extends ExtractAbiFunctionNames<
|
13
|
+
TAbi extends Abi ? TAbi : Abi,
|
14
|
+
'pure' | 'view'
|
15
|
+
> = string,
|
13
16
|
> = { abi: TAbi; functionName: TFunctionName }
|
14
17
|
|
15
18
|
export type MulticallContracts<
|
16
|
-
TContracts extends
|
19
|
+
TContracts extends readonly MulticallContract[],
|
17
20
|
TProperties extends Record<string, any> = object,
|
18
21
|
Result extends any[] = [],
|
19
22
|
Depth extends readonly number[] = [],
|
@@ -21,14 +24,14 @@ export type MulticallContracts<
|
|
21
24
|
? (ContractFunctionConfig & TProperties)[]
|
22
25
|
: TContracts extends []
|
23
26
|
? []
|
24
|
-
: TContracts extends [infer Head extends
|
27
|
+
: TContracts extends [infer Head extends MulticallContract]
|
25
28
|
? [
|
26
29
|
...Result,
|
27
30
|
ContractFunctionConfig<Head['abi'], Head['functionName']> & TProperties,
|
28
31
|
]
|
29
32
|
: TContracts extends [
|
30
|
-
infer Head extends
|
31
|
-
...infer Tail extends
|
33
|
+
infer Head extends MulticallContract,
|
34
|
+
...infer Tail extends readonly MulticallContract[],
|
32
35
|
]
|
33
36
|
? MulticallContracts<
|
34
37
|
[...Tail],
|
@@ -65,7 +68,7 @@ export type MulticallResult<
|
|
65
68
|
: Result
|
66
69
|
|
67
70
|
export type MulticallResults<
|
68
|
-
TContracts extends
|
71
|
+
TContracts extends readonly MulticallContract[],
|
69
72
|
TAllowFailure extends boolean = true,
|
70
73
|
Result extends any[] = [],
|
71
74
|
Depth extends readonly number[] = [],
|
@@ -73,7 +76,7 @@ export type MulticallResults<
|
|
73
76
|
? MulticallResult<ContractFunctionResult, TAllowFailure>[]
|
74
77
|
: TContracts extends []
|
75
78
|
? []
|
76
|
-
: TContracts extends [infer Head extends
|
79
|
+
: TContracts extends [infer Head extends MulticallContract]
|
77
80
|
? [
|
78
81
|
...Result,
|
79
82
|
MulticallResult<
|
@@ -82,8 +85,8 @@ export type MulticallResults<
|
|
82
85
|
>,
|
83
86
|
]
|
84
87
|
: TContracts extends [
|
85
|
-
infer Head extends
|
86
|
-
...infer Tail extends
|
88
|
+
infer Head extends MulticallContract,
|
89
|
+
...infer Tail extends readonly MulticallContract[],
|
87
90
|
]
|
88
91
|
? MulticallResults<
|
89
92
|
[...Tail],
|
package/src/types/typedData.ts
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
import type {
|
2
|
-
Narrow,
|
3
2
|
TypedData,
|
4
3
|
TypedDataDomain,
|
5
4
|
TypedDataToPrimitiveTypes,
|
@@ -74,8 +73,8 @@ export type GetTypedDataTypes<
|
|
74
73
|
TPrimaryType extends string = string,
|
75
74
|
> = TPrimaryType extends 'EIP712Domain'
|
76
75
|
? {
|
77
|
-
types?:
|
76
|
+
types?: TTypedData
|
78
77
|
}
|
79
78
|
: {
|
80
|
-
types:
|
79
|
+
types: TTypedData
|
81
80
|
}
|
@@ -2,7 +2,6 @@ import type {
|
|
2
2
|
AbiParameter,
|
3
3
|
AbiParameterToPrimitiveType,
|
4
4
|
AbiParametersToPrimitiveTypes,
|
5
|
-
Narrow,
|
6
5
|
} from 'abitype'
|
7
6
|
|
8
7
|
import {
|
@@ -33,8 +32,8 @@ export type DecodeAbiParametersReturnType<
|
|
33
32
|
>
|
34
33
|
|
35
34
|
export function decodeAbiParameters<
|
36
|
-
TParams extends readonly AbiParameter[] | readonly unknown[],
|
37
|
-
>(params:
|
35
|
+
const TParams extends readonly AbiParameter[] | readonly unknown[],
|
36
|
+
>(params: TParams, data: Hex): DecodeAbiParametersReturnType<TParams> {
|
38
37
|
if (data === '0x' && (params as unknown[]).length > 0)
|
39
38
|
throw new AbiDecodingZeroDataError()
|
40
39
|
if (size(data) && size(data) < 32)
|
@@ -53,7 +52,7 @@ export function decodeAbiParameters<
|
|
53
52
|
|
54
53
|
type TupleAbiParameter = AbiParameter & { components: readonly AbiParameter[] }
|
55
54
|
|
56
|
-
function decodeParams<TParams extends readonly AbiParameter[]>({
|
55
|
+
function decodeParams<const TParams extends readonly AbiParameter[]>({
|
57
56
|
data,
|
58
57
|
params,
|
59
58
|
}: { data: Hex; params: TParams }) {
|
@@ -126,7 +125,7 @@ function decodeAddress(value: Hex) {
|
|
126
125
|
return { consumed: 32, value: checksumAddress(slice(value, -20)) }
|
127
126
|
}
|
128
127
|
|
129
|
-
function decodeArray<TParam extends AbiParameter>(
|
128
|
+
function decodeArray<const TParam extends AbiParameter>(
|
130
129
|
data: Hex,
|
131
130
|
{
|
132
131
|
param,
|
@@ -211,7 +210,7 @@ function decodeBool(value: Hex) {
|
|
211
210
|
return { consumed: 32, value: hexToBool(value) }
|
212
211
|
}
|
213
212
|
|
214
|
-
function decodeBytes<TParam extends AbiParameter>(
|
213
|
+
function decodeBytes<const TParam extends AbiParameter>(
|
215
214
|
data: Hex,
|
216
215
|
{ param, position }: { param: TParam; position: number },
|
217
216
|
) {
|
@@ -239,7 +238,7 @@ function decodeBytes<TParam extends AbiParameter>(
|
|
239
238
|
return { consumed: 32, value }
|
240
239
|
}
|
241
240
|
|
242
|
-
function decodeNumber<TParam extends AbiParameter>(
|
241
|
+
function decodeNumber<const TParam extends AbiParameter>(
|
243
242
|
value: Hex,
|
244
243
|
{ param }: { param: TParam },
|
245
244
|
) {
|
@@ -268,7 +267,7 @@ function decodeString(data: Hex, { position }: { position: number }) {
|
|
268
267
|
}
|
269
268
|
|
270
269
|
function decodeTuple<
|
271
|
-
TParam extends AbiParameter & { components: readonly AbiParameter[] },
|
270
|
+
const TParam extends AbiParameter & { components: readonly AbiParameter[] },
|
272
271
|
>(data: Hex, { param, position }: { param: TParam; position: number }) {
|
273
272
|
// Tuples can have unnamed components (i.e. they are arrays), so we must
|
274
273
|
// determine whether the tuple is named or unnamed. In the case of a named
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi
|
1
|
+
import type { Abi } from 'abitype'
|
2
2
|
|
3
3
|
import {
|
4
4
|
AbiConstructorNotFoundError,
|
@@ -14,7 +14,7 @@ const docsPath = '/docs/contract/decodeDeployData'
|
|
14
14
|
export type DecodeDeployDataParameters<
|
15
15
|
TAbi extends Abi | readonly unknown[] = Abi,
|
16
16
|
> = {
|
17
|
-
abi:
|
17
|
+
abi: TAbi
|
18
18
|
bytecode: Hex
|
19
19
|
data: Hex
|
20
20
|
}
|
@@ -24,7 +24,7 @@ export type DecodeDeployDataReturnType<
|
|
24
24
|
bytecode: Hex
|
25
25
|
} & GetConstructorArgs<TAbi>
|
26
26
|
|
27
|
-
export function decodeDeployData<TAbi extends Abi | readonly unknown[]>({
|
27
|
+
export function decodeDeployData<const TAbi extends Abi | readonly unknown[]>({
|
28
28
|
abi,
|
29
29
|
bytecode,
|
30
30
|
data,
|
@@ -1,9 +1,4 @@
|
|
1
|
-
import type {
|
2
|
-
Abi,
|
3
|
-
ExtractAbiError,
|
4
|
-
ExtractAbiErrorNames,
|
5
|
-
Narrow,
|
6
|
-
} from 'abitype'
|
1
|
+
import type { Abi, ExtractAbiError, ExtractAbiErrorNames } from 'abitype'
|
7
2
|
|
8
3
|
import { solidityError, solidityPanic } from '../../constants/solidity.js'
|
9
4
|
import {
|
@@ -20,7 +15,7 @@ import { formatAbiItem } from './formatAbiItem.js'
|
|
20
15
|
|
21
16
|
export type DecodeErrorResultParameters<
|
22
17
|
TAbi extends Abi | readonly unknown[] = Abi,
|
23
|
-
> = { abi?:
|
18
|
+
> = { abi?: TAbi; data: Hex }
|
24
19
|
|
25
20
|
export type DecodeErrorResultReturnType<
|
26
21
|
TAbi extends Abi | readonly unknown[] = Abi,
|
@@ -37,7 +32,7 @@ export type DecodeErrorResultReturnType<
|
|
37
32
|
}
|
38
33
|
}[_ErrorNames]
|
39
34
|
|
40
|
-
export function decodeErrorResult<TAbi extends Abi | readonly unknown[]>({
|
35
|
+
export function decodeErrorResult<const TAbi extends Abi | readonly unknown[]>({
|
41
36
|
abi,
|
42
37
|
data,
|
43
38
|
}: DecodeErrorResultParameters<TAbi>): DecodeErrorResultReturnType<TAbi> {
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi, AbiParameter, ExtractAbiEventNames
|
1
|
+
import type { Abi, AbiParameter, ExtractAbiEventNames } from 'abitype'
|
2
2
|
|
3
3
|
import {
|
4
4
|
AbiDecodingDataSizeTooSmallError,
|
@@ -26,7 +26,7 @@ export type DecodeEventLogParameters<
|
|
26
26
|
TData extends Hex | undefined = undefined,
|
27
27
|
TStrict extends boolean = true,
|
28
28
|
> = {
|
29
|
-
abi:
|
29
|
+
abi: TAbi
|
30
30
|
data?: TData
|
31
31
|
eventName?: InferEventName<TAbi, TEventName>
|
32
32
|
strict?: TStrict
|
@@ -61,7 +61,7 @@ export type DecodeEventLogReturnType<
|
|
61
61
|
const docsPath = '/docs/contract/decodeEventLog'
|
62
62
|
|
63
63
|
export function decodeEventLog<
|
64
|
-
TAbi extends Abi | readonly unknown[],
|
64
|
+
const TAbi extends Abi | readonly unknown[],
|
65
65
|
TEventName extends string | undefined = undefined,
|
66
66
|
TTopics extends Hex[] = Hex[],
|
67
67
|
TData extends Hex | undefined = undefined,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi, ExtractAbiFunctionNames
|
1
|
+
import type { Abi, ExtractAbiFunctionNames } from 'abitype'
|
2
2
|
|
3
3
|
import {
|
4
4
|
AbiFunctionNotFoundError,
|
@@ -25,11 +25,9 @@ export type DecodeFunctionResultParameters<
|
|
25
25
|
functionName?: _FunctionName
|
26
26
|
data: Hex
|
27
27
|
} & (TFunctionName extends string
|
28
|
-
? { abi:
|
28
|
+
? { abi: TAbi } & Partial<GetFunctionArgs<TAbi, TFunctionName>>
|
29
29
|
: _FunctionName extends string
|
30
|
-
? { abi: [
|
31
|
-
GetFunctionArgs<TAbi, _FunctionName>
|
32
|
-
>
|
30
|
+
? { abi: [TAbi[number]] } & Partial<GetFunctionArgs<TAbi, _FunctionName>>
|
33
31
|
: never)
|
34
32
|
|
35
33
|
export type DecodeFunctionResultReturnType<
|
@@ -45,7 +43,7 @@ export type DecodeFunctionResultReturnType<
|
|
45
43
|
: ContractFunctionResult<TAbi, _FunctionName>
|
46
44
|
|
47
45
|
export function decodeFunctionResult<
|
48
|
-
TAbi extends Abi | readonly unknown[],
|
46
|
+
const TAbi extends Abi | readonly unknown[],
|
49
47
|
TFunctionName extends string | undefined = undefined,
|
50
48
|
>({
|
51
49
|
abi,
|