@wagmi/core 2.17.0 → 2.17.1
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/getCapabilities.js +5 -2
- package/dist/esm/actions/getCapabilities.js.map +1 -1
- package/dist/esm/query/getCapabilities.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/getCapabilities.d.ts +3 -3
- package/dist/types/actions/getCapabilities.d.ts.map +1 -1
- package/dist/types/query/getCapabilities.d.ts +10 -12
- package/dist/types/query/getCapabilities.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/actions/getCapabilities.ts +19 -8
- package/src/query/getCapabilities.ts +28 -13
- package/src/version.ts +1 -1
package/dist/esm/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const version = '2.17.
|
|
1
|
+
export const version = '2.17.1';
|
|
2
2
|
//# sourceMappingURL=version.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { type GetCapabilitiesErrorType as viem_GetCapabilitiesErrorType, type GetCapabilitiesParameters as viem_GetCapabilitiesParameters, type GetCapabilitiesReturnType as viem_GetCapabilitiesReturnType } from 'viem/actions';
|
|
2
2
|
import type { Config } from '../createConfig.js';
|
|
3
3
|
import type { ConnectorParameter } from '../types/properties.js';
|
|
4
|
-
export type GetCapabilitiesParameters = viem_GetCapabilitiesParameters & ConnectorParameter;
|
|
5
|
-
export type GetCapabilitiesReturnType = viem_GetCapabilitiesReturnType
|
|
4
|
+
export type GetCapabilitiesParameters<config extends Config = Config, chainId extends config['chains'][number]['id'] | undefined = undefined> = viem_GetCapabilitiesParameters<chainId> & ConnectorParameter;
|
|
5
|
+
export type GetCapabilitiesReturnType<config extends Config = Config, chainId extends config['chains'][number]['id'] | undefined = undefined> = viem_GetCapabilitiesReturnType<chainId>;
|
|
6
6
|
export type GetCapabilitiesErrorType = viem_GetCapabilitiesErrorType;
|
|
7
7
|
/** https://wagmi.sh/core/api/actions/getCapabilities */
|
|
8
|
-
export declare function getCapabilities<config extends Config>(config: config, parameters?: GetCapabilitiesParameters): Promise<GetCapabilitiesReturnType
|
|
8
|
+
export declare function getCapabilities<config extends Config, chainId extends config['chains'][number]['id'] | undefined = undefined>(config: config, parameters?: GetCapabilitiesParameters<config, chainId>): Promise<GetCapabilitiesReturnType<config, chainId>>;
|
|
9
9
|
//# sourceMappingURL=getCapabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCapabilities.d.ts","sourceRoot":"","sources":["../../../src/actions/getCapabilities.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,wBAAwB,IAAI,6BAA6B,EAC9D,KAAK,yBAAyB,IAAI,8BAA8B,EAChE,KAAK,yBAAyB,IAAI,8BAA8B,EAEjE,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAGhE,MAAM,MAAM,yBAAyB,GAAG,8BAA8B,
|
|
1
|
+
{"version":3,"file":"getCapabilities.d.ts","sourceRoot":"","sources":["../../../src/actions/getCapabilities.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,wBAAwB,IAAI,6BAA6B,EAC9D,KAAK,yBAAyB,IAAI,8BAA8B,EAChE,KAAK,yBAAyB,IAAI,8BAA8B,EAEjE,MAAM,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AAGhE,MAAM,MAAM,yBAAyB,CACnC,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,OAAO,SAAS,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,SAAS,IACpE,8BAA8B,CAAC,OAAO,CAAC,GAAG,kBAAkB,CAAA;AAEhE,MAAM,MAAM,yBAAyB,CACnC,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,OAAO,SAAS,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,SAAS,IACpE,8BAA8B,CAAC,OAAO,CAAC,CAAA;AAE3C,MAAM,MAAM,wBAAwB,GAAG,6BAA6B,CAAA;AAEpE,wDAAwD;AACxD,wBAAsB,eAAe,CACnC,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,SAAS,EAEtE,MAAM,EAAE,MAAM,EACd,UAAU,GAAE,yBAAyB,CAAC,MAAM,EAAE,OAAO,CAAM,GAC1D,OAAO,CAAC,yBAAyB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAOrD"}
|
|
@@ -2,12 +2,12 @@ import { type GetCapabilitiesParameters, type GetCapabilitiesReturnType } from '
|
|
|
2
2
|
import type { Config } from '../createConfig.js';
|
|
3
3
|
import type { ScopeKeyParameter } from '../types/properties.js';
|
|
4
4
|
import type { Compute, ExactPartial } from '../types/utils.js';
|
|
5
|
-
export type GetCapabilitiesOptions = Compute<ExactPartial<GetCapabilitiesParameters
|
|
6
|
-
export declare function getCapabilitiesQueryOptions<config extends Config>(config: config, options?: GetCapabilitiesOptions): {
|
|
5
|
+
export type GetCapabilitiesOptions<config extends Config = Config, chainId extends config['chains'][number]['id'] | undefined = undefined> = Compute<ExactPartial<GetCapabilitiesParameters<config, chainId>> & ScopeKeyParameter>;
|
|
6
|
+
export declare function getCapabilitiesQueryOptions<config extends Config, chainId extends config['chains'][number]['id'] | undefined = undefined>(config: config, options?: GetCapabilitiesOptions<config, chainId>): {
|
|
7
7
|
readonly queryFn: ({ queryKey }: {
|
|
8
8
|
queryKey: readonly ["capabilities", {
|
|
9
9
|
account?: import("viem").Account | import("viem").Address | undefined;
|
|
10
|
-
chainId?: number | undefined;
|
|
10
|
+
chainId?: number | chainId | undefined;
|
|
11
11
|
connector?: import("../createConfig.js").Connector | undefined;
|
|
12
12
|
scopeKey?: string | undefined;
|
|
13
13
|
}];
|
|
@@ -15,24 +15,22 @@ export declare function getCapabilitiesQueryOptions<config extends Config>(confi
|
|
|
15
15
|
meta: import("@tanstack/query-core").QueryMeta | undefined;
|
|
16
16
|
pageParam?: unknown;
|
|
17
17
|
direction?: unknown;
|
|
18
|
-
}) => Promise<{
|
|
19
|
-
[x: number]: import("viem").WalletCapabilities;
|
|
20
|
-
}>;
|
|
18
|
+
}) => Promise<(chainId extends number ? import("viem").WalletCapabilities : import("viem").WalletCapabilitiesRecord<import("viem").WalletCapabilities, number>) extends infer T ? { [K in keyof T]: (chainId extends number ? import("viem").WalletCapabilities : import("viem").WalletCapabilitiesRecord<import("viem").WalletCapabilities, number>)[K]; } : never>;
|
|
21
19
|
readonly queryKey: readonly ["capabilities", {
|
|
22
20
|
account?: import("viem").Account | import("viem").Address | undefined;
|
|
23
|
-
chainId?: number | undefined;
|
|
21
|
+
chainId?: number | chainId | undefined;
|
|
24
22
|
connector?: import("../createConfig.js").Connector | undefined;
|
|
25
23
|
scopeKey?: string | undefined;
|
|
26
24
|
}];
|
|
27
25
|
readonly retry: (failureCount: number, error: import("viem").GetCapabilitiesErrorType) => boolean;
|
|
28
26
|
};
|
|
29
|
-
export type GetCapabilitiesQueryFnData = GetCapabilitiesReturnType
|
|
30
|
-
export type GetCapabilitiesData = GetCapabilitiesQueryFnData
|
|
31
|
-
export declare function getCapabilitiesQueryKey(options?: GetCapabilitiesOptions): readonly ["capabilities", {
|
|
27
|
+
export type GetCapabilitiesQueryFnData<config extends Config = Config, chainId extends config['chains'][number]['id'] | undefined = undefined> = GetCapabilitiesReturnType<config, chainId>;
|
|
28
|
+
export type GetCapabilitiesData<config extends Config = Config, chainId extends config['chains'][number]['id'] | undefined = undefined> = GetCapabilitiesQueryFnData<config, chainId>;
|
|
29
|
+
export declare function getCapabilitiesQueryKey<config extends Config, chainId extends config['chains'][number]['id'] | undefined = undefined>(options?: GetCapabilitiesOptions<config, chainId>): readonly ["capabilities", {
|
|
32
30
|
account?: import("viem").Account | import("viem").Address | undefined;
|
|
33
|
-
chainId?: number | undefined;
|
|
31
|
+
chainId?: number | chainId | undefined;
|
|
34
32
|
connector?: import("../createConfig.js").Connector | undefined;
|
|
35
33
|
scopeKey?: string | undefined;
|
|
36
34
|
}];
|
|
37
|
-
export type GetCapabilitiesQueryKey = ReturnType<typeof getCapabilitiesQueryKey
|
|
35
|
+
export type GetCapabilitiesQueryKey<config extends Config, chainId extends config['chains'][number]['id'] | undefined = undefined> = ReturnType<typeof getCapabilitiesQueryKey<config, chainId>>;
|
|
38
36
|
//# sourceMappingURL=getCapabilities.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getCapabilities.d.ts","sourceRoot":"","sources":["../../../src/query/getCapabilities.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAE/B,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;AAGhD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAC/D,OAAO,KAAK,EAAE,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAE9D,MAAM,MAAM,sBAAsB,GAAG,OAAO,
|
|
1
|
+
{"version":3,"file":"getCapabilities.d.ts","sourceRoot":"","sources":["../../../src/query/getCapabilities.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,yBAAyB,EAE/B,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAA;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AAS,GAAG,SAAS,EACtE,OAAO,GAAE,sBAAsB,CAAC,MAAM,EAAE,OAAO,CAAM;;;;;GAEtD;AAED,MAAM,MAAM,uBAAuB,CACjC,MAAM,SAAS,MAAM,EACrB,OAAO,SAAS,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,GAAG,SAAS,GAAG,SAAS,IACpE,UAAU,CAAC,OAAO,uBAAuB,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAA"}
|
package/dist/types/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const version = "2.17.
|
|
1
|
+
export declare const version = "2.17.1";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/package.json
CHANGED
|
@@ -10,19 +10,30 @@ import type { Config } from '../createConfig.js'
|
|
|
10
10
|
import type { ConnectorParameter } from '../types/properties.js'
|
|
11
11
|
import { getConnectorClient } from './getConnectorClient.js'
|
|
12
12
|
|
|
13
|
-
export type GetCapabilitiesParameters
|
|
14
|
-
|
|
13
|
+
export type GetCapabilitiesParameters<
|
|
14
|
+
config extends Config = Config,
|
|
15
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
16
|
+
> = viem_GetCapabilitiesParameters<chainId> & ConnectorParameter
|
|
15
17
|
|
|
16
|
-
export type GetCapabilitiesReturnType
|
|
18
|
+
export type GetCapabilitiesReturnType<
|
|
19
|
+
config extends Config = Config,
|
|
20
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
21
|
+
> = viem_GetCapabilitiesReturnType<chainId>
|
|
17
22
|
|
|
18
23
|
export type GetCapabilitiesErrorType = viem_GetCapabilitiesErrorType
|
|
19
24
|
|
|
20
25
|
/** https://wagmi.sh/core/api/actions/getCapabilities */
|
|
21
|
-
export async function getCapabilities<
|
|
26
|
+
export async function getCapabilities<
|
|
27
|
+
config extends Config,
|
|
28
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
29
|
+
>(
|
|
22
30
|
config: config,
|
|
23
|
-
parameters: GetCapabilitiesParameters = {},
|
|
24
|
-
): Promise<GetCapabilitiesReturnType
|
|
25
|
-
const { account, connector } = parameters
|
|
31
|
+
parameters: GetCapabilitiesParameters<config, chainId> = {},
|
|
32
|
+
): Promise<GetCapabilitiesReturnType<config, chainId>> {
|
|
33
|
+
const { account, chainId, connector } = parameters
|
|
26
34
|
const client = await getConnectorClient(config, { account, connector })
|
|
27
|
-
return viem_getCapabilities(client as any, {
|
|
35
|
+
return viem_getCapabilities(client as any, {
|
|
36
|
+
account: account as Account,
|
|
37
|
+
chainId,
|
|
38
|
+
})
|
|
28
39
|
}
|
|
@@ -12,14 +12,17 @@ import { filterQueryOptions } from '../query/utils.js'
|
|
|
12
12
|
import type { ScopeKeyParameter } from '../types/properties.js'
|
|
13
13
|
import type { Compute, ExactPartial } from '../types/utils.js'
|
|
14
14
|
|
|
15
|
-
export type GetCapabilitiesOptions
|
|
16
|
-
|
|
15
|
+
export type GetCapabilitiesOptions<
|
|
16
|
+
config extends Config = Config,
|
|
17
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
18
|
+
> = Compute<
|
|
19
|
+
ExactPartial<GetCapabilitiesParameters<config, chainId>> & ScopeKeyParameter
|
|
17
20
|
>
|
|
18
21
|
|
|
19
|
-
export function getCapabilitiesQueryOptions<
|
|
20
|
-
config
|
|
21
|
-
|
|
22
|
-
) {
|
|
22
|
+
export function getCapabilitiesQueryOptions<
|
|
23
|
+
config extends Config,
|
|
24
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
25
|
+
>(config: config, options: GetCapabilitiesOptions<config, chainId> = {}) {
|
|
23
26
|
return {
|
|
24
27
|
async queryFn({ queryKey }) {
|
|
25
28
|
const { scopeKey: _, ...parameters } = queryKey[1]
|
|
@@ -32,19 +35,31 @@ export function getCapabilitiesQueryOptions<config extends Config>(
|
|
|
32
35
|
return failureCount < 3
|
|
33
36
|
},
|
|
34
37
|
} as const satisfies QueryOptions<
|
|
35
|
-
GetCapabilitiesQueryFnData,
|
|
38
|
+
GetCapabilitiesQueryFnData<config, chainId>,
|
|
36
39
|
GetCapabilitiesErrorType,
|
|
37
|
-
GetCapabilitiesData,
|
|
38
|
-
GetCapabilitiesQueryKey
|
|
40
|
+
GetCapabilitiesData<config, chainId>,
|
|
41
|
+
GetCapabilitiesQueryKey<config, chainId>
|
|
39
42
|
>
|
|
40
43
|
}
|
|
41
44
|
|
|
42
|
-
export type GetCapabilitiesQueryFnData
|
|
45
|
+
export type GetCapabilitiesQueryFnData<
|
|
46
|
+
config extends Config = Config,
|
|
47
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
48
|
+
> = GetCapabilitiesReturnType<config, chainId>
|
|
43
49
|
|
|
44
|
-
export type GetCapabilitiesData
|
|
50
|
+
export type GetCapabilitiesData<
|
|
51
|
+
config extends Config = Config,
|
|
52
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
53
|
+
> = GetCapabilitiesQueryFnData<config, chainId>
|
|
45
54
|
|
|
46
|
-
export function getCapabilitiesQueryKey
|
|
55
|
+
export function getCapabilitiesQueryKey<
|
|
56
|
+
config extends Config,
|
|
57
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
58
|
+
>(options: GetCapabilitiesOptions<config, chainId> = {}) {
|
|
47
59
|
return ['capabilities', filterQueryOptions(options)] as const
|
|
48
60
|
}
|
|
49
61
|
|
|
50
|
-
export type GetCapabilitiesQueryKey
|
|
62
|
+
export type GetCapabilitiesQueryKey<
|
|
63
|
+
config extends Config,
|
|
64
|
+
chainId extends config['chains'][number]['id'] | undefined = undefined,
|
|
65
|
+
> = ReturnType<typeof getCapabilitiesQueryKey<config, chainId>>
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.17.
|
|
1
|
+
export const version = '2.17.1'
|