viem 0.0.0-w-20230810155401 → 0.0.0-w-20230815171822
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/errors/utils.js +1 -1
- package/dist/cjs/errors/utils.js.map +1 -1
- package/dist/cjs/index.js +3 -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/cjs/{errors/version.js → version.js} +1 -1
- package/dist/cjs/version.js.map +1 -0
- 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/errors/utils.js +1 -1
- package/dist/esm/errors/utils.js.map +1 -1
- package/dist/esm/index.js +1 -0
- 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/esm/version.js +2 -0
- package/dist/esm/version.js.map +1 -0
- 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 +6 -6
- 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/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 +11 -11
- 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/index.d.ts +2 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/contract.d.ts +2 -2
- package/dist/types/types/contract.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 +1 -1
- 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/typedData.d.ts.map +1 -1
- package/dist/types/version.d.ts +2 -0
- package/dist/types/version.d.ts.map +1 -0
- package/package.json +2 -2
- 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 +19 -12
- 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/writeContract.ts +1 -1
- package/src/chains/index.ts +1 -0
- package/src/clients/decorators/public.ts +20 -15
- package/src/clients/decorators/wallet.ts +3 -3
- package/src/errors/utils.ts +1 -1
- package/src/index.ts +2 -0
- package/src/types/contract.ts +1 -2
- package/src/types/multicall.ts +14 -11
- package/src/types/typedData.ts +2 -1
- 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/typedData.ts +1 -2
- package/src/version.ts +1 -0
- package/dist/cjs/errors/version.js.map +0 -1
- package/dist/esm/errors/version.js +0 -2
- package/dist/esm/errors/version.js.map +0 -1
- package/dist/types/errors/version.d.ts +0 -2
- package/dist/types/errors/version.d.ts.map +0 -1
- package/src/errors/version.ts +0 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"encodeAbiParameters.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeAbiParameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,6BAA6B,
|
1
|
+
{"version":3,"file":"encodeAbiParameters.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeAbiParameters.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,YAAY,EAEZ,6BAA6B,EAC9B,MAAM,SAAS,CAAA;AAUhB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAQ9C,MAAM,MAAM,6BAA6B,GAAG,GAAG,CAAA;AAE/C;;GAEG;AACH,wBAAgB,mBAAmB,CACjC,KAAK,CAAC,OAAO,SAAS,SAAS,YAAY,EAAE,GAAG,SAAS,OAAO,EAAE,EAElE,MAAM,EAAE,OAAO,EACf,MAAM,EAAE,OAAO,SAAS,SAAS,YAAY,EAAE,GAC3C,6BAA6B,CAAC,OAAO,CAAC,GACtC,KAAK,GACR,6BAA6B,CAc/B;AA0OD,wBAAgB,kBAAkB,CAChC,IAAI,EAAE,MAAM,GACX,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,SAAS,EAAE,MAAM,CAAC,GAAG,SAAS,CAMxD"}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { Abi
|
1
|
+
import type { Abi } from 'abitype';
|
2
2
|
import type { GetConstructorArgs } from '../../types/contract.js';
|
3
3
|
import type { Hex } from '../../types/misc.js';
|
4
4
|
export type EncodeDeployDataParameters<TAbi extends Abi | readonly unknown[] = Abi> = {
|
5
|
-
abi:
|
5
|
+
abi: TAbi;
|
6
6
|
bytecode: Hex;
|
7
7
|
} & GetConstructorArgs<TAbi>;
|
8
|
-
export declare function encodeDeployData<TAbi extends Abi | readonly unknown[]>({ abi, args, bytecode, }: EncodeDeployDataParameters<TAbi>): `0x${string}`;
|
8
|
+
export declare function encodeDeployData<const TAbi extends Abi | readonly unknown[]>({ abi, args, bytecode, }: EncodeDeployDataParameters<TAbi>): `0x${string}`;
|
9
9
|
//# sourceMappingURL=encodeDeployData.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"encodeDeployData.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeDeployData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"encodeDeployData.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeDeployData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAMlC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AACjE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAO9C,MAAM,MAAM,0BAA0B,CACpC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,IACzC;IACF,GAAG,EAAE,IAAI,CAAA;IACT,QAAQ,EAAE,GAAG,CAAA;CACd,GAAG,kBAAkB,CAAC,IAAI,CAAC,CAAA;AAE5B,wBAAgB,gBAAgB,CAAC,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAAE,EAC5E,GAAG,EACH,IAAI,EACJ,QAAQ,GACT,EAAE,0BAA0B,CAAC,IAAI,CAAC,iBAiBlC"}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import type { Abi
|
1
|
+
import type { Abi } from 'abitype';
|
2
2
|
import type { GetErrorArgs, InferErrorName } from '../../types/contract.js';
|
3
3
|
export type EncodeErrorResultParameters<TAbi extends Abi | readonly unknown[] = Abi, TErrorName extends string | undefined = string, _ErrorName = InferErrorName<TAbi, TErrorName>> = {
|
4
4
|
errorName?: _ErrorName;
|
5
5
|
} & (TErrorName extends string ? {
|
6
|
-
abi:
|
6
|
+
abi: TAbi;
|
7
7
|
} & GetErrorArgs<TAbi, TErrorName> : _ErrorName extends string ? {
|
8
|
-
abi: [
|
8
|
+
abi: [TAbi[number]];
|
9
9
|
} & GetErrorArgs<TAbi, _ErrorName> : never);
|
10
|
-
export declare function encodeErrorResult<TAbi extends Abi | readonly unknown[], TErrorName extends string | undefined = undefined>({ abi, errorName, args }: EncodeErrorResultParameters<TAbi, TErrorName>): `0x${string}`;
|
10
|
+
export declare function encodeErrorResult<const TAbi extends Abi | readonly unknown[], TErrorName extends string | undefined = undefined>({ abi, errorName, args }: EncodeErrorResultParameters<TAbi, TErrorName>): `0x${string}`;
|
11
11
|
//# sourceMappingURL=encodeErrorResult.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"encodeErrorResult.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeErrorResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"encodeErrorResult.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeErrorResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAMlC,OAAO,KAAK,EAEV,YAAY,EACZ,cAAc,EACf,MAAM,yBAAyB,CAAA;AAWhC,MAAM,MAAM,2BAA2B,CACrC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EAC9C,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,IAC3C;IACF,SAAS,CAAC,EAAE,UAAU,CAAA;CACvB,GAAG,CAAC,UAAU,SAAS,MAAM,GAC1B;IAAE,GAAG,EAAE,IAAI,CAAA;CAAE,GAAG,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,GAC9C,UAAU,SAAS,MAAM,GACzB;IAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;CAAE,GAAG,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,GACxD,KAAK,CAAC,CAAA;AAEV,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACjD,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,2BAA2B,CAAC,IAAI,EAAE,UAAU,CAAC,iBAwBxE"}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import type { Abi
|
1
|
+
import type { Abi } from 'abitype';
|
2
2
|
import type { GetEventArgs, InferEventName } from '../../types/contract.js';
|
3
3
|
export type EncodeEventTopicsParameters<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string | undefined = string, _EventName = InferEventName<TAbi, TEventName>> = {
|
4
4
|
eventName?: _EventName;
|
5
5
|
} & (TEventName extends string ? {
|
6
|
-
abi:
|
6
|
+
abi: TAbi;
|
7
7
|
args?: GetEventArgs<TAbi, TEventName>;
|
8
8
|
} : _EventName extends string ? {
|
9
|
-
abi: [
|
9
|
+
abi: [TAbi[number]];
|
10
10
|
args?: GetEventArgs<TAbi, _EventName>;
|
11
11
|
} : never);
|
12
|
-
export declare function encodeEventTopics<TAbi extends Abi | readonly unknown[], TEventName extends string | undefined = undefined>({ abi, eventName, args }: EncodeEventTopicsParameters<TAbi, TEventName>): `0x${string}`[];
|
12
|
+
export declare function encodeEventTopics<const TAbi extends Abi | readonly unknown[], TEventName extends string | undefined = undefined>({ abi, eventName, args }: EncodeEventTopicsParameters<TAbi, TEventName>): `0x${string}`[];
|
13
13
|
//# sourceMappingURL=encodeEventTopics.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"encodeEventTopics.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeEventTopics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
1
|
+
{"version":3,"file":"encodeEventTopics.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeEventTopics.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAA6C,MAAM,SAAS,CAAA;AAI7E,OAAO,KAAK,EAGV,YAAY,EACZ,cAAc,EACf,MAAM,yBAAyB,CAAA;AAUhC,MAAM,MAAM,2BAA2B,CACrC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EAC9C,UAAU,GAAG,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,IAC3C;IACF,SAAS,CAAC,EAAE,UAAU,CAAA;CACvB,GAAG,CAAC,UAAU,SAAS,MAAM,GAC1B;IAAE,GAAG,EAAE,IAAI,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;CAAE,GACpD,UAAU,SAAS,MAAM,GACzB;IAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAAC,IAAI,CAAC,EAAE,YAAY,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;CAAE,GAC9D,KAAK,CAAC,CAAA;AAEV,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACjD,EAAE,GAAG,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,2BAA2B,CAAC,IAAI,EAAE,UAAU,CAAC,mBA+CxE"}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import type { Abi
|
1
|
+
import type { Abi } from 'abitype';
|
2
2
|
import type { GetFunctionArgs, InferFunctionName } from '../../types/contract.js';
|
3
3
|
export type EncodeFunctionDataParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string | undefined = string, _FunctionName = InferFunctionName<TAbi, TFunctionName>> = {
|
4
4
|
functionName?: _FunctionName;
|
5
5
|
} & (TFunctionName extends string ? {
|
6
|
-
abi:
|
6
|
+
abi: TAbi;
|
7
7
|
} & GetFunctionArgs<TAbi, TFunctionName> : _FunctionName extends string ? {
|
8
|
-
abi: [
|
8
|
+
abi: [TAbi[number]];
|
9
9
|
} & GetFunctionArgs<TAbi, _FunctionName> : never);
|
10
|
-
export declare function encodeFunctionData<TAbi extends Abi | readonly unknown[], TFunctionName extends string | undefined = undefined>({ abi, args, functionName, }: EncodeFunctionDataParameters<TAbi, TFunctionName>): `0x${string}`;
|
10
|
+
export declare function encodeFunctionData<const TAbi extends Abi | readonly unknown[], TFunctionName extends string | undefined = undefined>({ abi, args, functionName, }: EncodeFunctionDataParameters<TAbi, TFunctionName>): `0x${string}`;
|
11
11
|
//# sourceMappingURL=encodeFunctionData.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"encodeFunctionData.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeFunctionData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"encodeFunctionData.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeFunctionData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAGlC,OAAO,KAAK,EAEV,eAAe,EACf,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAQhC,MAAM,MAAM,4BAA4B,CACtC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EACjD,aAAa,GAAG,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,IACpD;IACF,YAAY,CAAC,EAAE,aAAa,CAAA;CAC7B,GAAG,CAAC,aAAa,SAAS,MAAM,GAC7B;IAAE,GAAG,EAAE,IAAI,CAAA;CAAE,GAAG,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,GACpD,aAAa,SAAS,MAAM,GAC5B;IAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;CAAE,GAAG,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,GAC9D,KAAK,CAAC,CAAA;AAEV,wBAAgB,kBAAkB,CAChC,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACpD,EACA,GAAG,EACH,IAAI,EACJ,YAAY,GACb,EAAE,4BAA4B,CAAC,IAAI,EAAE,aAAa,CAAC,iBA0BnD"}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import type { Abi
|
1
|
+
import type { Abi } from 'abitype';
|
2
2
|
import type { ContractFunctionResult, InferFunctionName } from '../../types/contract.js';
|
3
3
|
export type EncodeFunctionResultParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string | undefined = string, _FunctionName = InferFunctionName<TAbi, TFunctionName>> = {
|
4
4
|
functionName?: _FunctionName;
|
5
5
|
} & (TFunctionName extends string ? {
|
6
|
-
abi:
|
6
|
+
abi: TAbi;
|
7
7
|
result?: ContractFunctionResult<TAbi, TFunctionName>;
|
8
8
|
} : _FunctionName extends string ? {
|
9
|
-
abi: [
|
9
|
+
abi: [TAbi[number]];
|
10
10
|
result?: ContractFunctionResult<TAbi, _FunctionName>;
|
11
11
|
} : never);
|
12
|
-
export declare function encodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string | undefined = undefined>({ abi, functionName, result, }: EncodeFunctionResultParameters<TAbi, TFunctionName>): `0x${string}`;
|
12
|
+
export declare function encodeFunctionResult<const TAbi extends Abi | readonly unknown[], TFunctionName extends string | undefined = undefined>({ abi, functionName, result, }: EncodeFunctionResultParameters<TAbi, TFunctionName>): `0x${string}`;
|
13
13
|
//# sourceMappingURL=encodeFunctionResult.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"encodeFunctionResult.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeFunctionResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"encodeFunctionResult.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodeFunctionResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,SAAS,CAAA;AAMlC,OAAO,KAAK,EAEV,sBAAsB,EACtB,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAOhC,MAAM,MAAM,8BAA8B,CACxC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EACjD,aAAa,GAAG,iBAAiB,CAAC,IAAI,EAAE,aAAa,CAAC,IACpD;IACF,YAAY,CAAC,EAAE,aAAa,CAAA;CAC7B,GAAG,CAAC,aAAa,SAAS,MAAM,GAC7B;IAAE,GAAG,EAAE,IAAI,CAAC;IAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;CAAE,GACnE,aAAa,SAAS,MAAM,GAC5B;IACE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;IACnB,MAAM,CAAC,EAAE,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;CACrD,GACD,KAAK,CAAC,CAAA;AAEV,wBAAgB,oBAAoB,CAClC,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACpD,EACA,GAAG,EACH,YAAY,EACZ,MAAM,GACP,EAAE,8BAA8B,CAAC,IAAI,EAAE,aAAa,CAAC,iBAyBrD"}
|
@@ -1,11 +1,11 @@
|
|
1
|
-
import type { AbiParameterToPrimitiveType, AbiType,
|
1
|
+
import type { AbiParameterToPrimitiveType, AbiType, SolidityAddress, SolidityArrayWithoutTuple, SolidityBool, SolidityBytes, SolidityInt, SolidityString } from 'abitype';
|
2
2
|
import type { Hex } from '../../types/misc.js';
|
3
3
|
type PackedAbiType = SolidityAddress | SolidityBool | SolidityBytes | SolidityInt | SolidityString | SolidityArrayWithoutTuple;
|
4
|
-
type EncodePackedValues<TPackedAbiTypes extends PackedAbiType[] | unknown[]> = {
|
4
|
+
type EncodePackedValues<TPackedAbiTypes extends readonly PackedAbiType[] | readonly unknown[]> = {
|
5
5
|
[K in keyof TPackedAbiTypes]: TPackedAbiTypes[K] extends AbiType ? AbiParameterToPrimitiveType<{
|
6
6
|
type: TPackedAbiTypes[K];
|
7
7
|
}> : unknown;
|
8
8
|
};
|
9
|
-
export declare function encodePacked<TPackedAbiTypes extends PackedAbiType[] | unknown[]>(types:
|
9
|
+
export declare function encodePacked<const TPackedAbiTypes extends readonly PackedAbiType[] | readonly unknown[]>(types: TPackedAbiTypes, values: EncodePackedValues<TPackedAbiTypes>): Hex;
|
10
10
|
export {};
|
11
11
|
//# sourceMappingURL=encodePacked.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"encodePacked.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodePacked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,OAAO,EAEP,
|
1
|
+
{"version":3,"file":"encodePacked.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/encodePacked.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,OAAO,EAEP,eAAe,EACf,yBAAyB,EACzB,YAAY,EACZ,aAAa,EACb,WAAW,EACX,cAAc,EACf,MAAM,SAAS,CAAA;AAQhB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAO9C,KAAK,aAAa,GACd,eAAe,GACf,YAAY,GACZ,aAAa,GACb,WAAW,GACX,cAAc,GACd,yBAAyB,CAAA;AAE7B,KAAK,kBAAkB,CACrB,eAAe,SAAS,SAAS,aAAa,EAAE,GAAG,SAAS,OAAO,EAAE,IACnE;KACD,CAAC,IAAI,MAAM,eAAe,GAAG,eAAe,CAAC,CAAC,CAAC,SAAS,OAAO,GAC5D,2BAA2B,CAAC;QAAE,IAAI,EAAE,eAAe,CAAC,CAAC,CAAC,CAAA;KAAE,CAAC,GACzD,OAAO;CACZ,CAAA;AAED,wBAAgB,YAAY,CAC1B,KAAK,CAAC,eAAe,SAAS,SAAS,aAAa,EAAE,GAAG,SAAS,OAAO,EAAE,EAC3E,KAAK,EAAE,eAAe,EAAE,MAAM,EAAE,kBAAkB,CAAC,eAAe,CAAC,GAAG,GAAG,CAc1E"}
|
@@ -1,12 +1,12 @@
|
|
1
|
-
import type { Abi, AbiParameter
|
1
|
+
import type { Abi, AbiParameter } from 'abitype';
|
2
2
|
import type { GetFunctionArgs, InferItemName } from '../../types/contract.js';
|
3
3
|
export type GetAbiItemParameters<TAbi extends Abi | readonly unknown[] = Abi, TItemName extends string = string> = {
|
4
|
-
abi:
|
4
|
+
abi: TAbi;
|
5
5
|
name: InferItemName<TAbi, TItemName>;
|
6
6
|
} & Partial<GetFunctionArgs<TAbi, TItemName>>;
|
7
7
|
export type GetAbiItemReturnType<TAbi extends Abi | readonly unknown[] = Abi, TItemName extends string = string> = Extract<TAbi[number], {
|
8
8
|
name: TItemName;
|
9
9
|
}>;
|
10
|
-
export declare function getAbiItem<TAbi extends Abi | readonly unknown[], TItemName extends string>({ abi, args, name, }: GetAbiItemParameters<TAbi, TItemName>): GetAbiItemReturnType<TAbi, TItemName>;
|
10
|
+
export declare function getAbiItem<const TAbi extends Abi | readonly unknown[], TItemName extends string>({ abi, args, name, }: GetAbiItemParameters<TAbi, TItemName>): GetAbiItemReturnType<TAbi, TItemName>;
|
11
11
|
export declare function isArgOfType(arg: unknown, abiParameter: AbiParameter): boolean;
|
12
12
|
//# sourceMappingURL=getAbiItem.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"getAbiItem.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/getAbiItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAW,MAAM,
|
1
|
+
{"version":3,"file":"getAbiItem.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/getAbiItem.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,YAAY,EAAW,MAAM,SAAS,CAAA;AAEzD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAA;AAG7E,MAAM,MAAM,oBAAoB,CAC9B,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,SAAS,SAAS,MAAM,GAAG,MAAM,IAC/B;IACF,GAAG,EAAE,IAAI,CAAA;IACT,IAAI,EAAE,aAAa,CAAC,IAAI,EAAE,SAAS,CAAC,CAAA;CACrC,GAAG,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAA;AAE7C,MAAM,MAAM,oBAAoB,CAC9B,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,SAAS,SAAS,MAAM,GAAG,MAAM,IAC/B,OAAO,CACT,IAAI,CAAC,MAAM,CAAC,EACZ;IACE,IAAI,EAAE,SAAS,CAAA;CAChB,CACF,CAAA;AAED,wBAAgB,UAAU,CACxB,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,SAAS,SAAS,MAAM,EACxB,EACA,GAAG,EACH,IAAS,EACT,IAAI,GACL,EAAE,oBAAoB,CAAC,IAAI,EAAE,SAAS,CAAC,GAAG,oBAAoB,CAC7D,IAAI,EACJ,SAAS,CACV,CAuBA;AAED,wBAAgB,WAAW,CAAC,GAAG,EAAE,OAAO,EAAE,YAAY,EAAE,YAAY,GAAG,OAAO,CAuD7E"}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../src/utils/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAsB,MAAM,SAAS,CAAA;AAK5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAOhE,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,EACpD,UAAU,EAAE,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,
|
1
|
+
{"version":3,"file":"typedData.d.ts","sourceRoot":"","sources":["../../../src/utils/typedData.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAsB,MAAM,SAAS,CAAA;AAK5D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAOhE,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,SAAS,SAAS,SAAS,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC3D,WAAW,SAAS,MAAM,SAAS,GAAG,cAAc,EACpD,UAAU,EAAE,mBAAmB,CAAC,SAAS,EAAE,WAAW,CAAC,QAoDxD"}
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,UAAU,CAAA"}
|
package/package.json
CHANGED
@@ -8,7 +8,7 @@
|
|
8
8
|
"@scure/bip32": "1.3.0",
|
9
9
|
"@scure/bip39": "1.2.0",
|
10
10
|
"@types/ws": "^8.5.4",
|
11
|
-
"@wagmi/chains": "1.
|
11
|
+
"@wagmi/chains": "1.7.0",
|
12
12
|
"abitype": "0.9.3",
|
13
13
|
"isomorphic-ws": "5.0.0",
|
14
14
|
"ws": "8.12.0"
|
@@ -21,7 +21,7 @@
|
|
21
21
|
"optional": true
|
22
22
|
}
|
23
23
|
},
|
24
|
-
"version": "0.0.0-w-
|
24
|
+
"version": "0.0.0-w-20230815171822",
|
25
25
|
"files": [
|
26
26
|
"dist",
|
27
27
|
"!dist/**/*.tsbuildinfo",
|
@@ -8,7 +8,6 @@ import type {
|
|
8
8
|
ExtractAbiEventNames,
|
9
9
|
ExtractAbiFunction,
|
10
10
|
ExtractAbiFunctionNames,
|
11
|
-
Narrow,
|
12
11
|
} from 'abitype'
|
13
12
|
|
14
13
|
import type { Account } from '../accounts/types.js'
|
@@ -72,7 +71,7 @@ export type GetContractParameters<
|
|
72
71
|
TAddress extends Address = Address,
|
73
72
|
> = {
|
74
73
|
/** Contract ABI */
|
75
|
-
abi:
|
74
|
+
abi: TAbi
|
76
75
|
/** Contract address */
|
77
76
|
address: TAddress
|
78
77
|
/**
|
@@ -385,7 +384,7 @@ export type GetContractReturnType<
|
|
385
384
|
export function getContract<
|
386
385
|
TTransport extends Transport,
|
387
386
|
TAddress extends Address,
|
388
|
-
TAbi extends Abi | readonly unknown[],
|
387
|
+
const TAbi extends Abi | readonly unknown[],
|
389
388
|
TChain extends Chain | undefined = Chain | undefined,
|
390
389
|
TAccount extends Account | undefined = Account | undefined,
|
391
390
|
TPublicClient extends PublicClient<TTransport, TChain> | undefined =
|
@@ -865,13 +864,15 @@ type GetEventFilter<
|
|
865
864
|
IndexedInputs = Extract<TAbiEvent['inputs'][number], { indexed: true }>,
|
866
865
|
> = Narrowable extends true
|
867
866
|
? <
|
868
|
-
TArgs extends
|
867
|
+
const TArgs extends
|
868
|
+
| MaybeExtractEventArgsFromAbi<TAbi, TEventName>
|
869
|
+
| undefined,
|
869
870
|
TStrict extends boolean | undefined = undefined,
|
870
871
|
>(
|
871
872
|
...parameters: IsNever<IndexedInputs> extends true
|
872
873
|
? [options?: Options & { strict?: TStrict }]
|
873
874
|
: [
|
874
|
-
args: Args | (Args extends
|
875
|
+
args: Args | (Args extends TArgs ? Readonly<TArgs> : never),
|
875
876
|
options?: Options & { strict?: TStrict },
|
876
877
|
]
|
877
878
|
) => Promise<
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi, Address
|
1
|
+
import type { Abi, Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
@@ -28,7 +28,7 @@ export type CreateContractEventFilterParameters<
|
|
28
28
|
TToBlock extends BlockNumber | BlockTag | undefined = undefined,
|
29
29
|
> = {
|
30
30
|
address?: Address | Address[]
|
31
|
-
abi:
|
31
|
+
abi: TAbi
|
32
32
|
eventName?: InferEventName<TAbi, TEventName>
|
33
33
|
fromBlock?: TFromBlock | BlockNumber | BlockTag
|
34
34
|
/**
|
@@ -87,7 +87,7 @@ export type CreateContractEventFilterReturnType<
|
|
87
87
|
*/
|
88
88
|
export async function createContractEventFilter<
|
89
89
|
TChain extends Chain | undefined,
|
90
|
-
TAbi extends Abi | readonly unknown[],
|
90
|
+
const TAbi extends Abi | readonly unknown[],
|
91
91
|
TEventName extends string | undefined,
|
92
92
|
TArgs extends MaybeExtractEventArgsFromAbi<TAbi, TEventName> | undefined,
|
93
93
|
TStrict extends boolean | undefined = undefined,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { AbiEvent, Address
|
1
|
+
import type { AbiEvent, Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
@@ -44,7 +44,7 @@ export type CreateEventFilterParameters<
|
|
44
44
|
args:
|
45
45
|
| TEventFilterArgs
|
46
46
|
| (_Args extends TEventFilterArgs ? _Args : never)
|
47
|
-
event:
|
47
|
+
event: TAbiEvent
|
48
48
|
events?: never
|
49
49
|
/**
|
50
50
|
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
@@ -54,7 +54,7 @@ export type CreateEventFilterParameters<
|
|
54
54
|
}
|
55
55
|
| {
|
56
56
|
args?: never
|
57
|
-
event?:
|
57
|
+
event?: TAbiEvent
|
58
58
|
events?: never
|
59
59
|
/**
|
60
60
|
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
@@ -65,7 +65,7 @@ export type CreateEventFilterParameters<
|
|
65
65
|
| {
|
66
66
|
args?: never
|
67
67
|
event?: never
|
68
|
-
events:
|
68
|
+
events: TAbiEvents
|
69
69
|
/**
|
70
70
|
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
71
71
|
* @default false
|
@@ -127,8 +127,8 @@ export type CreateEventFilterReturnType<
|
|
127
127
|
*/
|
128
128
|
export async function createEventFilter<
|
129
129
|
TChain extends Chain | undefined,
|
130
|
-
TAbiEvent extends AbiEvent | undefined = undefined,
|
131
|
-
TAbiEvents extends
|
130
|
+
const TAbiEvent extends AbiEvent | undefined = undefined,
|
131
|
+
const TAbiEvents extends
|
132
132
|
| readonly AbiEvent[]
|
133
133
|
| readonly unknown[]
|
134
134
|
| undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined,
|
@@ -60,7 +60,7 @@ export type EstimateContractGasReturnType = bigint
|
|
60
60
|
* })
|
61
61
|
*/
|
62
62
|
export async function estimateContractGas<
|
63
|
-
TAbi extends Abi | readonly unknown[],
|
63
|
+
const TAbi extends Abi | readonly unknown[],
|
64
64
|
TFunctionName extends string,
|
65
65
|
TChain extends Chain | undefined,
|
66
66
|
TAccount extends Account | undefined = undefined,
|
@@ -138,7 +138,7 @@ export async function getFilterChanges<
|
|
138
138
|
TTransport extends Transport,
|
139
139
|
TChain extends Chain | undefined,
|
140
140
|
TFilterType extends FilterType,
|
141
|
-
TAbi extends Abi | readonly unknown[] | undefined,
|
141
|
+
const TAbi extends Abi | readonly unknown[] | undefined,
|
142
142
|
TEventName extends string | undefined,
|
143
143
|
TStrict extends boolean | undefined = undefined,
|
144
144
|
TFromBlock extends BlockNumber | BlockTag | undefined = undefined,
|
@@ -67,7 +67,7 @@ export type GetFilterLogsReturnType<
|
|
67
67
|
*/
|
68
68
|
export async function getFilterLogs<
|
69
69
|
TChain extends Chain | undefined,
|
70
|
-
TAbi extends Abi | readonly unknown[] | undefined,
|
70
|
+
const TAbi extends Abi | readonly unknown[] | undefined,
|
71
71
|
TEventName extends string | undefined,
|
72
72
|
TStrict extends boolean | undefined = undefined,
|
73
73
|
TFromBlock extends BlockNumber | BlockTag | undefined = undefined,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi, AbiEvent, Address
|
1
|
+
import type { Abi, AbiEvent, Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
@@ -38,7 +38,7 @@ export type GetLogsParameters<
|
|
38
38
|
address?: Address | Address[]
|
39
39
|
} & (
|
40
40
|
| {
|
41
|
-
event:
|
41
|
+
event: TAbiEvent
|
42
42
|
events?: never
|
43
43
|
args?: MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName>
|
44
44
|
/**
|
@@ -49,7 +49,7 @@ export type GetLogsParameters<
|
|
49
49
|
}
|
50
50
|
| {
|
51
51
|
event?: never
|
52
|
-
events:
|
52
|
+
events: TAbiEvents
|
53
53
|
args?: never
|
54
54
|
/**
|
55
55
|
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
@@ -119,8 +119,8 @@ export type GetLogsReturnType<
|
|
119
119
|
*/
|
120
120
|
export async function getLogs<
|
121
121
|
TChain extends Chain | undefined,
|
122
|
-
TAbiEvent extends AbiEvent | undefined = undefined,
|
123
|
-
TAbiEvents extends
|
122
|
+
const TAbiEvent extends AbiEvent | undefined = undefined,
|
123
|
+
const TAbiEvents extends
|
124
124
|
| readonly AbiEvent[]
|
125
125
|
| readonly unknown[]
|
126
126
|
| undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type {
|
1
|
+
import type { Abi, Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
@@ -10,6 +10,7 @@ import type { Chain } from '../../types/chain.js'
|
|
10
10
|
import type { ContractFunctionConfig } from '../../types/contract.js'
|
11
11
|
import type { Hex } from '../../types/misc.js'
|
12
12
|
import type {
|
13
|
+
MulticallContract,
|
13
14
|
MulticallContracts,
|
14
15
|
MulticallResults,
|
15
16
|
} from '../../types/multicall.js'
|
@@ -25,18 +26,18 @@ import type { CallParameters } from './call.js'
|
|
25
26
|
import { readContract } from './readContract.js'
|
26
27
|
|
27
28
|
export type MulticallParameters<
|
28
|
-
TContracts extends
|
29
|
+
TContracts extends readonly MulticallContract[] = readonly MulticallContract[],
|
29
30
|
TAllowFailure extends boolean = true,
|
30
31
|
> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
31
32
|
allowFailure?: TAllowFailure
|
32
33
|
/** The maximum size (in bytes) for each calldata chunk. Set to `0` to disable the size limit. @default 1_024 */
|
33
34
|
batchSize?: number
|
34
|
-
contracts:
|
35
|
+
contracts: readonly [...MulticallContracts<TContracts>]
|
35
36
|
multicallAddress?: Address
|
36
37
|
}
|
37
38
|
|
38
39
|
export type MulticallReturnType<
|
39
|
-
TContracts extends
|
40
|
+
TContracts extends readonly MulticallContract[] = readonly MulticallContract[],
|
40
41
|
TAllowFailure extends boolean = true,
|
41
42
|
> = MulticallResults<TContracts, TAllowFailure>
|
42
43
|
|
@@ -80,8 +81,13 @@ export type MulticallReturnType<
|
|
80
81
|
* // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]
|
81
82
|
*/
|
82
83
|
export async function multicall<
|
84
|
+
const TAbi extends Abi | readonly unknown[],
|
85
|
+
TFunctionName extends string,
|
86
|
+
const TContracts extends readonly ContractFunctionConfig<
|
87
|
+
TAbi,
|
88
|
+
TFunctionName
|
89
|
+
>[],
|
83
90
|
TChain extends Chain | undefined,
|
84
|
-
TContracts extends ContractFunctionConfig[],
|
85
91
|
TAllowFailure extends boolean = true,
|
86
92
|
>(
|
87
93
|
client: Client<Transport, TChain>,
|
@@ -92,7 +98,7 @@ export async function multicall<
|
|
92
98
|
batchSize: batchSize_,
|
93
99
|
blockNumber,
|
94
100
|
blockTag,
|
95
|
-
contracts
|
101
|
+
contracts,
|
96
102
|
multicallAddress: multicallAddress_,
|
97
103
|
} = args
|
98
104
|
|
@@ -102,9 +108,6 @@ export async function multicall<
|
|
102
108
|
client.batch.multicall.batchSize) ||
|
103
109
|
1_024)
|
104
110
|
|
105
|
-
// Fix type cast from `Narrow` in type definition.
|
106
|
-
const contracts = contracts_ as readonly [...MulticallContracts<TContracts>]
|
107
|
-
|
108
111
|
let multicallAddress = multicallAddress_
|
109
112
|
if (!multicallAddress) {
|
110
113
|
if (!client.chain)
|
@@ -129,7 +132,9 @@ export async function multicall<
|
|
129
132
|
let currentChunk = 0
|
130
133
|
let currentChunkSize = 0
|
131
134
|
for (let i = 0; i < contracts.length; i++) {
|
132
|
-
const { abi, address, args, functionName } = contracts[
|
135
|
+
const { abi, address, args, functionName } = contracts[
|
136
|
+
i
|
137
|
+
] as ContractFunctionConfig
|
133
138
|
try {
|
134
139
|
const callData = encodeFunctionData({
|
135
140
|
abi,
|
@@ -188,7 +193,9 @@ export async function multicall<
|
|
188
193
|
return results.flat().map(({ returnData, success }, i) => {
|
189
194
|
const calls = chunkedCalls.flat()
|
190
195
|
const { callData } = calls[i]
|
191
|
-
const { abi, address, functionName, args } = contracts[
|
196
|
+
const { abi, address, functionName, args } = contracts[
|
197
|
+
i
|
198
|
+
] as ContractFunctionConfig
|
192
199
|
try {
|
193
200
|
if (callData === '0x') throw new AbiDecodingZeroDataError()
|
194
201
|
if (!success) throw new RawContractError({ data: returnData })
|
@@ -196,7 +203,7 @@ export async function multicall<
|
|
196
203
|
abi,
|
197
204
|
args,
|
198
205
|
data: returnData,
|
199
|
-
functionName
|
206
|
+
functionName,
|
200
207
|
})
|
201
208
|
return allowFailure ? { result, status: 'success' } : result
|
202
209
|
} catch (err) {
|
@@ -64,7 +64,7 @@ export type ReadContractReturnType<
|
|
64
64
|
*/
|
65
65
|
export async function readContract<
|
66
66
|
TChain extends Chain | undefined,
|
67
|
-
TAbi extends Abi | readonly unknown[],
|
67
|
+
const TAbi extends Abi | readonly unknown[],
|
68
68
|
TFunctionName extends string,
|
69
69
|
>(
|
70
70
|
client: Client<Transport, TChain>,
|
@@ -102,7 +102,7 @@ export type SimulateContractReturnType<
|
|
102
102
|
*/
|
103
103
|
export async function simulateContract<
|
104
104
|
TChain extends Chain | undefined,
|
105
|
-
TAbi extends Abi | readonly unknown[],
|
105
|
+
const TAbi extends Abi | readonly unknown[],
|
106
106
|
TFunctionName extends string,
|
107
107
|
TChainOverride extends Chain | undefined,
|
108
108
|
>(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi, AbiEvent, Address, ExtractAbiEvent
|
1
|
+
import type { Abi, AbiEvent, Address, ExtractAbiEvent } from 'abitype'
|
2
2
|
|
3
3
|
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
@@ -68,7 +68,7 @@ export type WatchContractEventParameters<
|
|
68
68
|
/** The address of the contract. */
|
69
69
|
address?: Address | Address[]
|
70
70
|
/** Contract ABI. */
|
71
|
-
abi:
|
71
|
+
abi: TAbi
|
72
72
|
args?: GetEventArgs<TAbi, TEventName>
|
73
73
|
/** Contract event. */
|
74
74
|
eventName?: InferEventName<TAbi, TEventName>
|
@@ -137,7 +137,7 @@ export type WatchContractEventReturnType = () => void
|
|
137
137
|
*/
|
138
138
|
export function watchContractEvent<
|
139
139
|
TChain extends Chain | undefined,
|
140
|
-
TAbi extends Abi | readonly unknown[],
|
140
|
+
const TAbi extends Abi | readonly unknown[],
|
141
141
|
TEventName extends string,
|
142
142
|
TStrict extends boolean | undefined = undefined,
|
143
143
|
>(
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi, AbiEvent, Address
|
1
|
+
import type { Abi, AbiEvent, Address } from 'abitype'
|
2
2
|
|
3
3
|
import type { Client } from '../../clients/createClient.js'
|
4
4
|
import type { Transport } from '../../clients/transports/createTransport.js'
|
@@ -107,7 +107,7 @@ export type WatchEventParameters<
|
|
107
107
|
}) &
|
108
108
|
(
|
109
109
|
| {
|
110
|
-
event:
|
110
|
+
event: TAbiEvent
|
111
111
|
events?: never
|
112
112
|
args?: MaybeExtractEventArgsFromAbi<TAbiEvents, _EventName>
|
113
113
|
/**
|
@@ -118,7 +118,7 @@ export type WatchEventParameters<
|
|
118
118
|
}
|
119
119
|
| {
|
120
120
|
event?: never
|
121
|
-
events?:
|
121
|
+
events?: TAbiEvents
|
122
122
|
args?: never
|
123
123
|
/**
|
124
124
|
* Whether or not the logs must match the indexed/non-indexed arguments on `event`.
|
@@ -170,8 +170,8 @@ export type WatchEventReturnType = () => void
|
|
170
170
|
*/
|
171
171
|
export function watchEvent<
|
172
172
|
TChain extends Chain | undefined,
|
173
|
-
TAbiEvent extends AbiEvent | undefined = undefined,
|
174
|
-
TAbiEvents extends
|
173
|
+
const TAbiEvent extends AbiEvent | undefined = undefined,
|
174
|
+
const TAbiEvents extends
|
175
175
|
| readonly AbiEvent[]
|
176
176
|
| readonly unknown[]
|
177
177
|
| undefined = TAbiEvent extends AbiEvent ? [TAbiEvent] : undefined,
|
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { Abi
|
1
|
+
import type { Abi } from 'abitype'
|
2
2
|
|
3
3
|
import type { Account } from '../../accounts/types.js'
|
4
4
|
import type { Client } from '../../clients/createClient.js'
|
@@ -24,7 +24,7 @@ export type DeployContractParameters<
|
|
24
24
|
SendTransactionParameters<TChain, TAccount, TChainOverride>,
|
25
25
|
'accessList' | 'chain' | 'to' | 'data'
|
26
26
|
> & {
|
27
|
-
abi:
|
27
|
+
abi: TAbi
|
28
28
|
bytecode: Hex
|
29
29
|
} & GetChain<TChain, TChainOverride> &
|
30
30
|
GetConstructorArgs<TAbi>
|
@@ -59,7 +59,7 @@ export type DeployContractReturnType = SendTransactionReturnType
|
|
59
59
|
* })
|
60
60
|
*/
|
61
61
|
export function deployContract<
|
62
|
-
TAbi extends Abi | readonly unknown[],
|
62
|
+
const TAbi extends Abi | readonly unknown[],
|
63
63
|
TChain extends Chain | undefined,
|
64
64
|
TAccount extends Account | undefined,
|
65
65
|
TChainOverride extends Chain | undefined,
|
@@ -104,7 +104,7 @@ export type WriteContractReturnType = SendTransactionReturnType
|
|
104
104
|
export async function writeContract<
|
105
105
|
TChain extends Chain | undefined,
|
106
106
|
TAccount extends Account | undefined,
|
107
|
-
TAbi extends Abi | readonly unknown[],
|
107
|
+
const TAbi extends Abi | readonly unknown[],
|
108
108
|
TFunctionName extends string,
|
109
109
|
TChainOverride extends Chain | undefined,
|
110
110
|
>(
|
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(
|