viem 0.0.0-w-20230810183250 → 0.0.0-w-20230816150015
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 +3 -4
- package/dist/cjs/actions/public/multicall.js.map +1 -1
- package/dist/cjs/actions/public/readContract.js +2 -1
- package/dist/cjs/actions/public/readContract.js.map +1 -1
- package/dist/cjs/actions/wallet/writeContract.js +2 -1
- package/dist/cjs/actions/wallet/writeContract.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/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/version.js +1 -1
- package/dist/esm/actions/getContract.js.map +1 -1
- package/dist/esm/actions/public/multicall.js +3 -5
- package/dist/esm/actions/public/multicall.js.map +1 -1
- package/dist/esm/actions/public/readContract.js +2 -1
- package/dist/esm/actions/public/readContract.js.map +1 -1
- package/dist/esm/actions/wallet/writeContract.js +2 -1
- package/dist/esm/actions/wallet/writeContract.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/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 +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 +14 -11
- package/dist/types/actions/public/multicall.d.ts.map +1 -1
- package/dist/types/actions/public/readContract.d.ts +4 -4
- 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 +4 -4
- 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 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/types/contract.d.ts +13 -2
- package/dist/types/types/contract.d.ts.map +1 -1
- package/dist/types/types/multicall.d.ts +35 -35
- 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 +1 -1
- 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 +41 -27
- package/src/actions/public/readContract.ts +19 -21
- 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 +35 -37
- 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/index.ts +3 -0
- package/src/types/contract.ts +56 -2
- package/src/types/multicall.ts +84 -75
- 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 -1
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { Abi, ExtractAbiEventNames
|
1
|
+
import type { Abi, ExtractAbiEventNames } from 'abitype';
|
2
2
|
import type { GetEventArgsFromTopics, InferEventName } from '../../types/contract.js';
|
3
3
|
import type { Hex } from '../../types/misc.js';
|
4
4
|
import type { Prettify } from '../../types/utils.js';
|
5
5
|
export type DecodeEventLogParameters<TAbi extends Abi | readonly unknown[] = Abi, TEventName extends string | undefined = string, TTopics extends Hex[] = Hex[], TData extends Hex | undefined = undefined, TStrict extends boolean = true> = {
|
6
|
-
abi:
|
6
|
+
abi: TAbi;
|
7
7
|
data?: TData;
|
8
8
|
eventName?: InferEventName<TAbi, TEventName>;
|
9
9
|
strict?: TStrict;
|
@@ -16,5 +16,5 @@ export type DecodeEventLogReturnType<TAbi extends Abi | readonly unknown[] = Abi
|
|
16
16
|
eventName: TName;
|
17
17
|
} & GetEventArgsFromTopics<TAbi, TName, TTopics, TData, TStrict>>;
|
18
18
|
}[_EventNames];
|
19
|
-
export declare function decodeEventLog<TAbi extends Abi | readonly unknown[], TEventName extends string | undefined = undefined, TTopics extends Hex[] = Hex[], TData extends Hex | undefined = undefined, TStrict extends boolean = true>({ abi, data, strict: strict_, topics, }: DecodeEventLogParameters<TAbi, TEventName, TTopics, TData, TStrict>): DecodeEventLogReturnType<TAbi, TEventName, TTopics, TData, TStrict>;
|
19
|
+
export declare function decodeEventLog<const TAbi extends Abi | readonly unknown[], TEventName extends string | undefined = undefined, TTopics extends Hex[] = Hex[], TData extends Hex | undefined = undefined, TStrict extends boolean = true>({ abi, data, strict: strict_, topics, }: DecodeEventLogParameters<TAbi, TEventName, TTopics, TData, TStrict>): DecodeEventLogReturnType<TAbi, TEventName, TTopics, TData, TStrict>;
|
20
20
|
//# sourceMappingURL=decodeEventLog.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decodeEventLog.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/decodeEventLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAgB,oBAAoB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"decodeEventLog.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/decodeEventLog.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAgB,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAStE,OAAO,KAAK,EAEV,sBAAsB,EACtB,cAAc,EACf,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAC9C,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAA;AAMpD,MAAM,MAAM,wBAAwB,CAClC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EAC9C,OAAO,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,EAC7B,KAAK,SAAS,GAAG,GAAG,SAAS,GAAG,SAAS,EACzC,OAAO,SAAS,OAAO,GAAG,IAAI,IAC5B;IACF,GAAG,EAAE,IAAI,CAAA;IACT,IAAI,CAAC,EAAE,KAAK,CAAA;IACZ,SAAS,CAAC,EAAE,cAAc,CAAC,IAAI,EAAE,UAAU,CAAC,CAAA;IAC5C,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,CAAC,SAAS,EAAE,GAAG,EAAE,GAAG,IAAI,EAAE,OAAO,CAAC,GAAG,EAAE,CAAA;CAChD,CAAA;AAED,MAAM,MAAM,wBAAwB,CAClC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EAC9C,OAAO,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,EAC7B,KAAK,SAAS,GAAG,GAAG,SAAS,GAAG,SAAS,EACzC,OAAO,SAAS,OAAO,GAAG,IAAI,EAC9B,WAAW,SAAS,MAAM,GAAG,IAAI,SAAS,GAAG,GACzC,GAAG,SAAS,IAAI,GACd,MAAM,GACN,oBAAoB,CAAC,IAAI,CAAC,GAC5B,MAAM,IACR,UAAU,SAAS,WAAW,CAAC,MAAM,CAAC,GACtC,QAAQ,CACN;IACE,SAAS,EAAE,UAAU,CAAA;CACtB,GAAG,sBAAsB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CACtE,GACD;KACG,KAAK,IAAI,WAAW,GAAG,QAAQ,CAC9B;QACE,SAAS,EAAE,KAAK,CAAA;KACjB,GAAG,sBAAsB,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CACjE;CACF,CAAC,WAAW,CAAC,CAAA;AAIlB,wBAAgB,cAAc,CAC5B,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,UAAU,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACjD,OAAO,SAAS,GAAG,EAAE,GAAG,GAAG,EAAE,EAC7B,KAAK,SAAS,GAAG,GAAG,SAAS,GAAG,SAAS,EACzC,OAAO,SAAS,OAAO,GAAG,IAAI,EAC9B,EACA,GAAG,EACH,IAAI,EACJ,MAAM,EAAE,OAAO,EACf,MAAM,GACP,EAAE,wBAAwB,CACzB,IAAI,EACJ,UAAU,EACV,OAAO,EACP,KAAK,EACL,OAAO,CACR,GAAG,wBAAwB,CAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAmFtE"}
|
@@ -1,14 +1,14 @@
|
|
1
|
-
import type { Abi, ExtractAbiFunctionNames
|
1
|
+
import type { Abi, ExtractAbiFunctionNames } from 'abitype';
|
2
2
|
import type { ContractFunctionResult, GetFunctionArgs, InferFunctionName } from '../../types/contract.js';
|
3
3
|
import type { Hex } from '../../types/misc.js';
|
4
4
|
export type DecodeFunctionResultParameters<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string | undefined = string, _FunctionName = InferFunctionName<TAbi, TFunctionName>> = {
|
5
5
|
functionName?: _FunctionName;
|
6
6
|
data: Hex;
|
7
7
|
} & (TFunctionName extends string ? {
|
8
|
-
abi:
|
8
|
+
abi: TAbi;
|
9
9
|
} & Partial<GetFunctionArgs<TAbi, TFunctionName>> : _FunctionName extends string ? {
|
10
|
-
abi: [
|
10
|
+
abi: [TAbi[number]];
|
11
11
|
} & Partial<GetFunctionArgs<TAbi, _FunctionName>> : never);
|
12
12
|
export type DecodeFunctionResultReturnType<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string | undefined = string, _FunctionName extends string = TAbi extends Abi ? Abi extends TAbi ? string : ExtractAbiFunctionNames<TAbi>[number] : string> = TFunctionName extends string ? ContractFunctionResult<TAbi, TFunctionName> : ContractFunctionResult<TAbi, _FunctionName>;
|
13
|
-
export declare function decodeFunctionResult<TAbi extends Abi | readonly unknown[], TFunctionName extends string | undefined = undefined>({ abi, args, functionName, data, }: DecodeFunctionResultParameters<TAbi, TFunctionName>): DecodeFunctionResultReturnType<TAbi, TFunctionName>;
|
13
|
+
export declare function decodeFunctionResult<const TAbi extends Abi | readonly unknown[], TFunctionName extends string | undefined = undefined>({ abi, args, functionName, data, }: DecodeFunctionResultParameters<TAbi, TFunctionName>): DecodeFunctionResultReturnType<TAbi, TFunctionName>;
|
14
14
|
//# sourceMappingURL=decodeFunctionResult.d.ts.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"decodeFunctionResult.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/decodeFunctionResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,uBAAuB,EAAE,MAAM,
|
1
|
+
{"version":3,"file":"decodeFunctionResult.d.ts","sourceRoot":"","sources":["../../../../src/utils/abi/decodeFunctionResult.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,uBAAuB,EAAE,MAAM,SAAS,CAAA;AAM3D,OAAO,KAAK,EAEV,sBAAsB,EACtB,eAAe,EACf,iBAAiB,EAClB,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,qBAAqB,CAAA;AAO9C,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;IAC5B,IAAI,EAAE,GAAG,CAAA;CACV,GAAG,CAAC,aAAa,SAAS,MAAM,GAC7B;IAAE,GAAG,EAAE,IAAI,CAAA;CAAE,GAAG,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,GAC7D,aAAa,SAAS,MAAM,GAC5B;IAAE,GAAG,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAA;CAAE,GAAG,OAAO,CAAC,eAAe,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC,GACvE,KAAK,CAAC,CAAA;AAEV,MAAM,MAAM,8BAA8B,CACxC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,GAAG,GAAG,EAC3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,MAAM,EACjD,aAAa,SAAS,MAAM,GAAG,IAAI,SAAS,GAAG,GAC3C,GAAG,SAAS,IAAI,GACd,MAAM,GACN,uBAAuB,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,GACvC,MAAM,IACR,aAAa,SAAS,MAAM,GAC5B,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,GAC3C,sBAAsB,CAAC,IAAI,EAAE,aAAa,CAAC,CAAA;AAE/C,wBAAgB,oBAAoB,CAClC,KAAK,CAAC,IAAI,SAAS,GAAG,GAAG,SAAS,OAAO,EAAE,EAC3C,aAAa,SAAS,MAAM,GAAG,SAAS,GAAG,SAAS,EACpD,EACA,GAAG,EACH,IAAI,EACJ,YAAY,EACZ,IAAI,GACL,EAAE,8BAA8B,CAC/B,IAAI,EACJ,aAAa,CACd,GAAG,8BAA8B,CAAC,IAAI,EAAE,aAAa,CAAC,CAoBtD"}
|
@@ -1,9 +1,9 @@
|
|
1
|
-
import type { AbiParameter, AbiParametersToPrimitiveTypes
|
1
|
+
import type { AbiParameter, AbiParametersToPrimitiveTypes } from 'abitype';
|
2
2
|
import type { Hex } from '../../types/misc.js';
|
3
3
|
export type EncodeAbiParametersReturnType = Hex;
|
4
4
|
/**
|
5
5
|
* @description Encodes a list of primitive values into an ABI-encoded hex value.
|
6
6
|
*/
|
7
|
-
export declare function encodeAbiParameters<TParams extends readonly AbiParameter[] | readonly unknown[]>(params:
|
7
|
+
export declare function encodeAbiParameters<const TParams extends readonly AbiParameter[] | readonly unknown[]>(params: TParams, values: TParams extends readonly AbiParameter[] ? AbiParametersToPrimitiveTypes<TParams> : never): EncodeAbiParametersReturnType;
|
8
8
|
export declare function getArrayComponents(type: string): [length: number | null, innerType: string] | undefined;
|
9
9
|
//# sourceMappingURL=encodeAbiParameters.d.ts.map
|
@@ -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"}
|
package/dist/types/version.d.ts
CHANGED
@@ -1,2 +1,2 @@
|
|
1
|
-
export declare const version = "1.
|
1
|
+
export declare const version = "1.6.1";
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
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-20230816150015",
|
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'
|
@@ -7,9 +7,13 @@ import { AbiDecodingZeroDataError } from '../../errors/abi.js'
|
|
7
7
|
import type { BaseError } from '../../errors/base.js'
|
8
8
|
import { RawContractError } from '../../errors/contract.js'
|
9
9
|
import type { Chain } from '../../types/chain.js'
|
10
|
-
import type {
|
10
|
+
import type {
|
11
|
+
ContractFunctionConfig,
|
12
|
+
ContractParameters,
|
13
|
+
} from '../../types/contract.js'
|
11
14
|
import type { Hex } from '../../types/misc.js'
|
12
15
|
import type {
|
16
|
+
MulticallContract,
|
13
17
|
MulticallContracts,
|
14
18
|
MulticallResults,
|
15
19
|
} from '../../types/multicall.js'
|
@@ -25,20 +29,23 @@ import type { CallParameters } from './call.js'
|
|
25
29
|
import { readContract } from './readContract.js'
|
26
30
|
|
27
31
|
export type MulticallParameters<
|
28
|
-
|
29
|
-
|
32
|
+
contracts extends readonly MulticallContract[] = readonly MulticallContract[],
|
33
|
+
allowFailure extends boolean = true,
|
30
34
|
> = Pick<CallParameters, 'blockNumber' | 'blockTag'> & {
|
31
|
-
allowFailure?:
|
32
|
-
/**
|
33
|
-
|
34
|
-
|
35
|
-
|
35
|
+
allowFailure?: allowFailure | undefined
|
36
|
+
/**
|
37
|
+
* The maximum size (in bytes) for each calldata chunk. Set to `0` to disable the size limit.
|
38
|
+
* @default 1_024
|
39
|
+
*/
|
40
|
+
batchSize?: number | undefined
|
41
|
+
contracts: readonly [...MulticallContracts<contracts>]
|
42
|
+
multicallAddress?: Address | undefined
|
36
43
|
}
|
37
44
|
|
38
45
|
export type MulticallReturnType<
|
39
|
-
|
40
|
-
|
41
|
-
> = MulticallResults<
|
46
|
+
contracts extends readonly MulticallContract[] = readonly MulticallContract[],
|
47
|
+
allowFailure extends boolean = true,
|
48
|
+
> = MulticallResults<contracts, allowFailure>
|
42
49
|
|
43
50
|
/**
|
44
51
|
* Similar to [`readContract`](https://viem.sh/docs/contract/readContract.html), but batches up multiple functions on a contract in a single RPC call via the [`multicall3` contract](https://github.com/mds1/multicall).
|
@@ -80,21 +87,27 @@ export type MulticallReturnType<
|
|
80
87
|
* // [{ result: 424122n, status: 'success' }, { result: 1000000n, status: 'success' }]
|
81
88
|
*/
|
82
89
|
export async function multicall<
|
83
|
-
|
84
|
-
|
85
|
-
|
90
|
+
const abi extends Abi | readonly unknown[],
|
91
|
+
functionName extends string,
|
92
|
+
const contracts extends readonly ContractParameters<
|
93
|
+
abi,
|
94
|
+
'pure' | 'view',
|
95
|
+
functionName
|
96
|
+
>[],
|
97
|
+
chain extends Chain | undefined,
|
98
|
+
allowFailure extends boolean = true,
|
86
99
|
>(
|
87
|
-
client: Client<Transport,
|
88
|
-
|
89
|
-
): Promise<MulticallReturnType<
|
100
|
+
client: Client<Transport, chain>,
|
101
|
+
parameters: MulticallParameters<contracts, allowFailure>,
|
102
|
+
): Promise<MulticallReturnType<contracts, allowFailure>> {
|
90
103
|
const {
|
91
104
|
allowFailure = true,
|
92
105
|
batchSize: batchSize_,
|
93
106
|
blockNumber,
|
94
107
|
blockTag,
|
95
|
-
contracts
|
108
|
+
contracts,
|
96
109
|
multicallAddress: multicallAddress_,
|
97
|
-
} =
|
110
|
+
} = parameters
|
98
111
|
|
99
112
|
const batchSize =
|
100
113
|
batchSize_ ??
|
@@ -102,9 +115,6 @@ export async function multicall<
|
|
102
115
|
client.batch.multicall.batchSize) ||
|
103
116
|
1_024)
|
104
117
|
|
105
|
-
// Fix type cast from `Narrow` in type definition.
|
106
|
-
const contracts = contracts_ as readonly [...MulticallContracts<TContracts>]
|
107
|
-
|
108
118
|
let multicallAddress = multicallAddress_
|
109
119
|
if (!multicallAddress) {
|
110
120
|
if (!client.chain)
|
@@ -129,7 +139,9 @@ export async function multicall<
|
|
129
139
|
let currentChunk = 0
|
130
140
|
let currentChunkSize = 0
|
131
141
|
for (let i = 0; i < contracts.length; i++) {
|
132
|
-
const { abi, address, args, functionName } = contracts[
|
142
|
+
const { abi, address, args, functionName } = contracts[
|
143
|
+
i
|
144
|
+
] as ContractFunctionConfig
|
133
145
|
try {
|
134
146
|
const callData = encodeFunctionData({
|
135
147
|
abi,
|
@@ -188,7 +200,9 @@ export async function multicall<
|
|
188
200
|
return results.flat().map(({ returnData, success }, i) => {
|
189
201
|
const calls = chunkedCalls.flat()
|
190
202
|
const { callData } = calls[i]
|
191
|
-
const { abi, address, functionName, args } = contracts[
|
203
|
+
const { abi, address, functionName, args } = contracts[
|
204
|
+
i
|
205
|
+
] as ContractFunctionConfig
|
192
206
|
try {
|
193
207
|
if (callData === '0x') throw new AbiDecodingZeroDataError()
|
194
208
|
if (!success) throw new RawContractError({ data: returnData })
|
@@ -196,7 +210,7 @@ export async function multicall<
|
|
196
210
|
abi,
|
197
211
|
args,
|
198
212
|
data: returnData,
|
199
|
-
functionName
|
213
|
+
functionName,
|
200
214
|
})
|
201
215
|
return allowFailure ? { result, status: 'success' } : result
|
202
216
|
} catch (err) {
|
@@ -210,5 +224,5 @@ export async function multicall<
|
|
210
224
|
if (!allowFailure) throw error
|
211
225
|
return { error, result: undefined, status: 'failure' }
|
212
226
|
}
|
213
|
-
}) as MulticallResults<
|
227
|
+
}) as MulticallResults<contracts, allowFailure>
|
214
228
|
}
|