@wagmi/core 2.10.2 → 2.10.4
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/esm/actions/getChains.js.map +1 -1
- package/dist/esm/actions/reconnect.js +1 -1
- package/dist/esm/actions/reconnect.js.map +1 -1
- package/dist/esm/actions/watchChains.js.map +1 -1
- package/dist/esm/actions/writeContract.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/getChains.d.ts +4 -1
- package/dist/types/actions/getChains.d.ts.map +1 -1
- package/dist/types/actions/watchChains.d.ts.map +1 -1
- package/dist/types/actions/writeContract.d.ts +2 -2
- package/dist/types/actions/writeContract.d.ts.map +1 -1
- package/dist/types/experimental/query/getCallsStatus.d.ts +1 -1
- package/dist/types/experimental/query/getCapabilities.d.ts +1 -1
- package/dist/types/query/call.d.ts +1 -1
- package/dist/types/query/getEnsAddress.d.ts +1 -1
- package/dist/types/query/getEnsAvatar.d.ts +1 -1
- package/dist/types/query/getEnsName.d.ts +1 -1
- package/dist/types/query/getEnsText.d.ts +1 -1
- package/dist/types/query/getFeeHistory.d.ts +1 -1
- package/dist/types/query/getProof.d.ts +1 -1
- package/dist/types/query/getStorageAt.d.ts +1 -1
- package/dist/types/query/writeContract.d.ts +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/actions/getChains.ts +6 -5
- package/src/actions/reconnect.ts +1 -1
- package/src/actions/watchChains.ts +4 -1
- package/src/actions/writeContract.ts +11 -12
- package/src/version.ts +1 -1
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '2.10.
|
|
1
|
+
export const version = '2.10.4';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type Chain } from 'viem';
|
|
2
2
|
import { type Config } from '../createConfig.js';
|
|
3
|
-
export type GetChainsReturnType<config extends Config = Config> =
|
|
3
|
+
export type GetChainsReturnType<config extends Config = Config> = readonly [
|
|
4
|
+
...config['chains'],
|
|
5
|
+
...Chain[]
|
|
6
|
+
];
|
|
4
7
|
/** https://wagmi.sh/core/api/actions/getChains */
|
|
5
8
|
export declare function getChains<config extends Config>(config: config): GetChainsReturnType<config>;
|
|
6
9
|
//# sourceMappingURL=getChains.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getChains.d.ts","sourceRoot":"","sources":["../../../src/actions/getChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD,MAAM,MAAM,mBAAmB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,
|
|
1
|
+
{"version":3,"file":"getChains.d.ts","sourceRoot":"","sources":["../../../src/actions/getChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,MAAM,CAAA;AACjC,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD,MAAM,MAAM,mBAAmB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI,SAAS;IACzE,GAAG,MAAM,CAAC,QAAQ,CAAC;IACnB,GAAG,KAAK,EAAE;CACX,CAAA;AAID,kDAAkD;AAClD,wBAAgB,SAAS,CAAC,MAAM,SAAS,MAAM,EAC7C,MAAM,EAAE,MAAM,GACb,mBAAmB,CAAC,MAAM,CAAC,CAM7B"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchChains.d.ts","sourceRoot":"","sources":["../../../src/actions/watchChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,MAAM,MAAM,qBAAqB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI;IAClE,QAAQ,CACN,MAAM,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACnC,UAAU,EAAE,mBAAmB,CAAC,MAAM,CAAC,GACtC,IAAI,CAAA;CACR,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAA;AAE9C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,SAAS,MAAM,EAC/C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACxC,qBAAqB,
|
|
1
|
+
{"version":3,"file":"watchChains.d.ts","sourceRoot":"","sources":["../../../src/actions/watchChains.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,gBAAgB,CAAA;AAEzD,MAAM,MAAM,qBAAqB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAAI;IAClE,QAAQ,CACN,MAAM,EAAE,mBAAmB,CAAC,MAAM,CAAC,EACnC,UAAU,EAAE,mBAAmB,CAAC,MAAM,CAAC,GACtC,IAAI,CAAA;CACR,CAAA;AAED,MAAM,MAAM,qBAAqB,GAAG,MAAM,IAAI,CAAA;AAE9C;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,MAAM,SAAS,MAAM,EAC/C,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,qBAAqB,CAAC,MAAM,CAAC,GACxC,qBAAqB,CAQvB"}
|
|
@@ -4,11 +4,11 @@ import { type Config } from '../createConfig.js';
|
|
|
4
4
|
import { type BaseErrorType, type ErrorType } from '../errors/base.js';
|
|
5
5
|
import { type SelectChains } from '../types/chain.js';
|
|
6
6
|
import { type ChainIdParameter, type ConnectorParameter } from '../types/properties.js';
|
|
7
|
-
import type { Evaluate, UnionEvaluate
|
|
7
|
+
import type { Evaluate, UnionEvaluate } from '../types/utils.js';
|
|
8
8
|
import { type GetConnectorClientErrorType } from './getConnectorClient.js';
|
|
9
9
|
import { type SimulateContractErrorType } from './simulateContract.js';
|
|
10
10
|
export type WriteContractParameters<abi extends Abi | readonly unknown[] = Abi, functionName extends ContractFunctionName<abi, 'nonpayable' | 'payable'> = ContractFunctionName<abi, 'nonpayable' | 'payable'>, args extends ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName> = ContractFunctionArgs<abi, 'nonpayable' | 'payable', functionName>, config extends Config = Config, chainId extends config['chains'][number]['id'] = config['chains'][number]['id'], allFunctionNames = ContractFunctionName<abi, 'nonpayable' | 'payable'>, chains extends readonly Chain[] = SelectChains<config, chainId>> = UnionEvaluate<{
|
|
11
|
-
[key in keyof chains]:
|
|
11
|
+
[key in keyof chains]: viem_WriteContractParameters<abi, functionName, args, chains[key], Account, chains[key], allFunctionNames>;
|
|
12
12
|
}[number] & Evaluate<ChainIdParameter<config, chainId>> & ConnectorParameter & {
|
|
13
13
|
__mode?: 'prepared';
|
|
14
14
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"writeContract.d.ts","sourceRoot":"","sources":["../../../src/actions/writeContract.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,GAAG,EACH,OAAO,EACP,KAAK,EACL,oBAAoB,EACpB,oBAAoB,EACrB,MAAM,MAAM,CAAA;AACb,OAAO,EACL,KAAK,sBAAsB,IAAI,2BAA2B,EAC1D,KAAK,uBAAuB,IAAI,4BAA4B,EAC5D,KAAK,uBAAuB,IAAI,4BAA4B,EAE7D,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,MAAM,mBAAmB,CAAA;AACtE,OAAO,EAAE,KAAK,YAAY,EAAE,MAAM,mBAAmB,CAAA;AACrD,OAAO,EACL,KAAK,gBAAgB,EACrB,KA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,CAAC,GAAG,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,EAAE,OAAO,CAAC,GAC5E,OAAO,CAAC,uBAAuB,CAAC,CA+BlC"}
|
|
@@ -23,7 +23,7 @@ export declare function getCallsStatusQueryOptions<config extends Config>(config
|
|
|
23
23
|
connector?: import("../../createConfig.js").Connector | undefined;
|
|
24
24
|
scopeKey?: string | undefined;
|
|
25
25
|
}];
|
|
26
|
-
readonly retry: (failureCount: number, error: import("
|
|
26
|
+
readonly retry: (failureCount: number, error: import("viem/experimental").GetCallsStatusErrorType) => boolean;
|
|
27
27
|
};
|
|
28
28
|
export type GetCallsStatusQueryFnData = GetCallsStatusReturnType;
|
|
29
29
|
export type GetCallsStatusData = GetCallsStatusQueryFnData;
|
|
@@ -22,7 +22,7 @@ export declare function getCapabilitiesQueryOptions<config extends Config>(confi
|
|
|
22
22
|
connector?: import("../../createConfig.js").Connector | undefined;
|
|
23
23
|
scopeKey?: string | undefined;
|
|
24
24
|
}];
|
|
25
|
-
readonly retry: (failureCount: number, error: import("
|
|
25
|
+
readonly retry: (failureCount: number, error: import("viem/experimental").GetCapabilitiesErrorType) => boolean;
|
|
26
26
|
};
|
|
27
27
|
export type GetCapabilitiesQueryFnData = GetCapabilitiesReturnType;
|
|
28
28
|
export type GetCapabilitiesData = GetCapabilitiesQueryFnData;
|
|
@@ -10,7 +10,7 @@ export declare function callQueryOptions<config extends Config>(config: config,
|
|
|
10
10
|
meta: Record<string, unknown> | undefined;
|
|
11
11
|
pageParam?: unknown;
|
|
12
12
|
direction?: "forward" | "backward" | undefined;
|
|
13
|
-
}) => Promise<import("
|
|
13
|
+
}) => Promise<import("viem").CallReturnType>;
|
|
14
14
|
readonly queryKey: readonly ["call", CallOptions<config>];
|
|
15
15
|
};
|
|
16
16
|
export type CallQueryFnData = CallReturnType;
|
|
@@ -20,7 +20,7 @@ export declare function getEnsAddressQueryOptions<config extends Config>(config:
|
|
|
20
20
|
meta: Record<string, unknown> | undefined;
|
|
21
21
|
pageParam?: unknown;
|
|
22
22
|
direction?: "forward" | "backward" | undefined;
|
|
23
|
-
}) => Promise<import("
|
|
23
|
+
}) => Promise<import("viem").GetEnsAddressReturnType>;
|
|
24
24
|
readonly queryKey: readonly ["ensAddress", {
|
|
25
25
|
blockNumber?: bigint | undefined;
|
|
26
26
|
blockTag?: import("viem").BlockTag | undefined;
|
|
@@ -20,7 +20,7 @@ export declare function getEnsAvatarQueryOptions<config extends Config>(config:
|
|
|
20
20
|
meta: Record<string, unknown> | undefined;
|
|
21
21
|
pageParam?: unknown;
|
|
22
22
|
direction?: "forward" | "backward" | undefined;
|
|
23
|
-
}) => Promise<import("
|
|
23
|
+
}) => Promise<import("viem").GetEnsAvatarReturnType>;
|
|
24
24
|
readonly queryKey: readonly ["ensAvatar", {
|
|
25
25
|
name?: string | undefined;
|
|
26
26
|
blockNumber?: bigint | undefined;
|
|
@@ -19,7 +19,7 @@ export declare function getEnsNameQueryOptions<config extends Config>(config: co
|
|
|
19
19
|
meta: Record<string, unknown> | undefined;
|
|
20
20
|
pageParam?: unknown;
|
|
21
21
|
direction?: "forward" | "backward" | undefined;
|
|
22
|
-
}) => Promise<import("
|
|
22
|
+
}) => Promise<import("viem").GetEnsNameReturnType>;
|
|
23
23
|
readonly queryKey: readonly ["ensName", {
|
|
24
24
|
blockNumber?: bigint | undefined;
|
|
25
25
|
blockTag?: import("viem").BlockTag | undefined;
|
|
@@ -20,7 +20,7 @@ export declare function getEnsTextQueryOptions<config extends Config>(config: co
|
|
|
20
20
|
meta: Record<string, unknown> | undefined;
|
|
21
21
|
pageParam?: unknown;
|
|
22
22
|
direction?: "forward" | "backward" | undefined;
|
|
23
|
-
}) => Promise<import("
|
|
23
|
+
}) => Promise<import("viem").GetEnsTextReturnType>;
|
|
24
24
|
readonly queryKey: readonly ["ensText", {
|
|
25
25
|
blockNumber?: bigint | undefined;
|
|
26
26
|
blockTag?: import("viem").BlockTag | undefined;
|
|
@@ -17,7 +17,7 @@ export declare function getFeeHistoryQueryOptions<config extends Config, chainId
|
|
|
17
17
|
meta: Record<string, unknown> | undefined;
|
|
18
18
|
pageParam?: unknown;
|
|
19
19
|
direction?: "forward" | "backward" | undefined;
|
|
20
|
-
}) => Promise<import("
|
|
20
|
+
}) => Promise<import("viem").GetFeeHistoryReturnType>;
|
|
21
21
|
readonly queryKey: readonly ["feeHistory", {
|
|
22
22
|
blockCount?: number | undefined;
|
|
23
23
|
rewardPercentiles?: number[] | undefined;
|
|
@@ -10,7 +10,7 @@ export declare function getProofQueryOptions<config extends Config>(config: conf
|
|
|
10
10
|
meta: Record<string, unknown> | undefined;
|
|
11
11
|
pageParam?: unknown;
|
|
12
12
|
direction?: "forward" | "backward" | undefined;
|
|
13
|
-
}) => Promise<import("
|
|
13
|
+
}) => Promise<import("viem").GetProofReturnType>;
|
|
14
14
|
readonly queryKey: readonly ["getProof", GetProofOptions<config>];
|
|
15
15
|
};
|
|
16
16
|
export type GetProofQueryFnData = GetProofReturnType;
|
|
@@ -10,7 +10,7 @@ export declare function getStorageAtQueryOptions<config extends Config>(config:
|
|
|
10
10
|
meta: Record<string, unknown> | undefined;
|
|
11
11
|
pageParam?: unknown;
|
|
12
12
|
direction?: "forward" | "backward" | undefined;
|
|
13
|
-
}) => Promise<import("
|
|
13
|
+
}) => Promise<import("viem").GetStorageAtReturnType>;
|
|
14
14
|
readonly queryKey: readonly ["getStorageAt", GetStorageAtOptions<config>];
|
|
15
15
|
};
|
|
16
16
|
export type GetStorageAtQueryFnData = GetStorageAtReturnType;
|
|
@@ -4,7 +4,7 @@ import { type WriteContractErrorType, type WriteContractParameters, type WriteCo
|
|
|
4
4
|
import { type Config } from '../createConfig.js';
|
|
5
5
|
import { type Evaluate } from '../types/utils.js';
|
|
6
6
|
export declare function writeContractMutationOptions<config extends Config>(config: config): {
|
|
7
|
-
readonly mutationFn: (variables: import("../types/utils.js").UnionEvaluate<(import("../types/chain.js").SelectChains<config, config["chains"][number]["id"]> extends infer T extends readonly import("viem").Chain[] ? { [key in keyof T]: import("
|
|
7
|
+
readonly mutationFn: (variables: import("../types/utils.js").UnionEvaluate<(import("../types/chain.js").SelectChains<config, config["chains"][number]["id"]> extends infer T extends readonly import("viem").Chain[] ? { [key in keyof T]: import("viem").WriteContractParameters<Abi, string, readonly unknown[], import("../types/chain.js").SelectChains<config, config["chains"][number]["id"]>[key], import("viem").Account, import("../types/chain.js").SelectChains<config, config["chains"][number]["id"]>[key], string>; } : never)[number] & {
|
|
8
8
|
chainId?: config["chains"][number]["id"] | (config["chains"][number]["id"] extends infer T_1 ? T_1 extends config["chains"][number]["id"] ? T_1 extends config["chains"][number]["id"] ? T_1 : undefined : never : never) | undefined;
|
|
9
9
|
} & import("../types/properties.js").ConnectorParameter & {
|
|
10
10
|
__mode?: "prepared" | undefined;
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.10.
|
|
1
|
+
export declare const version = "2.10.4";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
package/src/actions/getChains.ts
CHANGED
|
@@ -2,9 +2,10 @@ import { type Chain } from 'viem'
|
|
|
2
2
|
import { type Config } from '../createConfig.js'
|
|
3
3
|
import { deepEqual } from '../utils/deepEqual.js'
|
|
4
4
|
|
|
5
|
-
export type GetChainsReturnType<config extends Config = Config> =
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
export type GetChainsReturnType<config extends Config = Config> = readonly [
|
|
6
|
+
...config['chains'],
|
|
7
|
+
...Chain[],
|
|
8
|
+
]
|
|
8
9
|
|
|
9
10
|
let previousChains: readonly Chain[] = []
|
|
10
11
|
|
|
@@ -14,7 +15,7 @@ export function getChains<config extends Config>(
|
|
|
14
15
|
): GetChainsReturnType<config> {
|
|
15
16
|
const chains = config.chains
|
|
16
17
|
if (deepEqual(previousChains, chains))
|
|
17
|
-
return previousChains as GetChainsReturnType
|
|
18
|
+
return previousChains as GetChainsReturnType<config>
|
|
18
19
|
previousChains = chains
|
|
19
|
-
return chains
|
|
20
|
+
return chains as unknown as GetChainsReturnType<config>
|
|
20
21
|
}
|
package/src/actions/reconnect.ts
CHANGED
|
@@ -65,7 +65,7 @@ export async function reconnect(
|
|
|
65
65
|
const connections: Connection[] = []
|
|
66
66
|
const providers: unknown[] = []
|
|
67
67
|
for (const connector of sorted) {
|
|
68
|
-
const provider_ = await connector.getProvider()
|
|
68
|
+
const provider_ = await connector.getProvider().catch(() => undefined)
|
|
69
69
|
if (!provider_) continue
|
|
70
70
|
|
|
71
71
|
// If we already have an instance of this connector's provider,
|
|
@@ -21,6 +21,9 @@ export function watchChains<config extends Config>(
|
|
|
21
21
|
): WatchChainsReturnType {
|
|
22
22
|
const { onChange } = parameters
|
|
23
23
|
return config._internal.chains.subscribe((chains, prevChains) => {
|
|
24
|
-
onChange(
|
|
24
|
+
onChange(
|
|
25
|
+
chains as unknown as GetChainsReturnType<config>,
|
|
26
|
+
prevChains as unknown as GetChainsReturnType<config>,
|
|
27
|
+
)
|
|
25
28
|
})
|
|
26
29
|
}
|
|
@@ -19,7 +19,7 @@ import {
|
|
|
19
19
|
type ChainIdParameter,
|
|
20
20
|
type ConnectorParameter,
|
|
21
21
|
} from '../types/properties.js'
|
|
22
|
-
import type { Evaluate, UnionEvaluate
|
|
22
|
+
import type { Evaluate, UnionEvaluate } from '../types/utils.js'
|
|
23
23
|
import { getAction } from '../utils/getAction.js'
|
|
24
24
|
import { getAccount } from './getAccount.js'
|
|
25
25
|
import {
|
|
@@ -49,17 +49,16 @@ export type WriteContractParameters<
|
|
|
49
49
|
chains extends readonly Chain[] = SelectChains<config, chainId>,
|
|
50
50
|
> = UnionEvaluate<
|
|
51
51
|
{
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
'chain'
|
|
52
|
+
// TODO: Should use `UnionOmit<..., 'chain'>` on `viem_WriteContractParameters` result instead
|
|
53
|
+
// temp workaround that doesn't affect runtime behavior for for https://github.com/wevm/wagmi/issues/3981
|
|
54
|
+
[key in keyof chains]: viem_WriteContractParameters<
|
|
55
|
+
abi,
|
|
56
|
+
functionName,
|
|
57
|
+
args,
|
|
58
|
+
chains[key],
|
|
59
|
+
Account,
|
|
60
|
+
chains[key],
|
|
61
|
+
allFunctionNames
|
|
63
62
|
>
|
|
64
63
|
}[number] &
|
|
65
64
|
Evaluate<ChainIdParameter<config, chainId>> &
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.10.
|
|
1
|
+
export const version = '2.10.4'
|