@wagmi/core 2.15.1 → 2.16.0
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/connect.js +2 -1
- package/dist/esm/actions/connect.js.map +1 -1
- package/dist/esm/actions/getConnectors.js.map +1 -1
- package/dist/esm/actions/watchConnectors.js.map +1 -1
- package/dist/esm/connectors/createConnector.js.map +1 -1
- package/dist/esm/connectors/mock.js.map +1 -1
- package/dist/esm/createConfig.js +1 -1
- package/dist/esm/createConfig.js.map +1 -1
- package/dist/esm/errors/config.js +1 -1
- package/dist/esm/errors/config.js.map +1 -1
- package/dist/esm/query/connect.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/connect.d.ts +4 -4
- package/dist/types/actions/connect.d.ts.map +1 -1
- package/dist/types/actions/getConnectors.d.ts +3 -3
- package/dist/types/actions/getConnectors.d.ts.map +1 -1
- package/dist/types/actions/watchConnectors.d.ts +3 -3
- package/dist/types/actions/watchConnectors.d.ts.map +1 -1
- package/dist/types/connectors/createConnector.d.ts +1 -1
- package/dist/types/connectors/createConnector.d.ts.map +1 -1
- package/dist/types/connectors/mock.d.ts +10 -1
- package/dist/types/connectors/mock.d.ts.map +1 -1
- package/dist/types/createConfig.d.ts +7 -7
- package/dist/types/createConfig.d.ts.map +1 -1
- package/dist/types/query/connect.d.ts +8 -9
- package/dist/types/query/connect.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/actions/connect.ts +30 -6
- package/src/actions/getConnectors.ts +5 -2
- package/src/actions/watchConnectors.ts +6 -6
- package/src/connectors/createConnector.ts +7 -1
- package/src/connectors/mock.ts +11 -1
- package/src/createConfig.ts +48 -37
- package/src/errors/config.ts +1 -1
- package/src/query/connect.ts +45 -20
- package/src/version.ts +1 -1
package/src/query/connect.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { MutationOptions } from '@tanstack/query-core'
|
|
1
|
+
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
type ConnectErrorType,
|
|
@@ -6,9 +6,10 @@ import {
|
|
|
6
6
|
type ConnectReturnType,
|
|
7
7
|
connect,
|
|
8
8
|
} from '../actions/connect.js'
|
|
9
|
-
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { Config, Connector } from '../createConfig.js'
|
|
10
10
|
|
|
11
|
-
import type {
|
|
11
|
+
import type { CreateConnectorFn } from '../connectors/createConnector.js'
|
|
12
|
+
import type { Compute } from '../types/utils.js'
|
|
12
13
|
|
|
13
14
|
export function connectMutationOptions<config extends Config>(config: config) {
|
|
14
15
|
return {
|
|
@@ -19,27 +20,51 @@ export function connectMutationOptions<config extends Config>(config: config) {
|
|
|
19
20
|
} as const satisfies MutationOptions<
|
|
20
21
|
ConnectData<config>,
|
|
21
22
|
ConnectErrorType,
|
|
22
|
-
ConnectVariables<config>
|
|
23
|
+
ConnectVariables<config, Connector | CreateConnectorFn>
|
|
23
24
|
>
|
|
24
25
|
}
|
|
25
26
|
|
|
26
27
|
export type ConnectData<config extends Config> = ConnectReturnType<config>
|
|
27
28
|
|
|
28
|
-
export type ConnectVariables<
|
|
29
|
+
export type ConnectVariables<
|
|
30
|
+
config extends Config,
|
|
31
|
+
connector extends Connector | CreateConnectorFn,
|
|
32
|
+
> = ConnectParameters<config, connector>
|
|
29
33
|
|
|
30
|
-
export type ConnectMutate<config extends Config, context = unknown> =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
>
|
|
34
|
+
export type ConnectMutate<config extends Config, context = unknown> = <
|
|
35
|
+
connector extends
|
|
36
|
+
| config['connectors'][number]
|
|
37
|
+
| Connector
|
|
38
|
+
| CreateConnectorFn,
|
|
39
|
+
>(
|
|
40
|
+
variables: ConnectVariables<config, connector>,
|
|
41
|
+
options?:
|
|
42
|
+
| Compute<
|
|
43
|
+
MutateOptions<
|
|
44
|
+
ConnectData<config>,
|
|
45
|
+
ConnectErrorType,
|
|
46
|
+
Compute<ConnectVariables<config, connector>>,
|
|
47
|
+
context
|
|
48
|
+
>
|
|
49
|
+
>
|
|
50
|
+
| undefined,
|
|
51
|
+
) => void
|
|
36
52
|
|
|
37
|
-
export type ConnectMutateAsync<
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
ConnectVariables<config>,
|
|
44
|
-
|
|
45
|
-
|
|
53
|
+
export type ConnectMutateAsync<config extends Config, context = unknown> = <
|
|
54
|
+
connector extends
|
|
55
|
+
| config['connectors'][number]
|
|
56
|
+
| Connector
|
|
57
|
+
| CreateConnectorFn,
|
|
58
|
+
>(
|
|
59
|
+
variables: ConnectVariables<config, connector>,
|
|
60
|
+
options?:
|
|
61
|
+
| Compute<
|
|
62
|
+
MutateOptions<
|
|
63
|
+
ConnectData<config>,
|
|
64
|
+
ConnectErrorType,
|
|
65
|
+
Compute<ConnectVariables<config, connector>>,
|
|
66
|
+
context
|
|
67
|
+
>
|
|
68
|
+
>
|
|
69
|
+
| undefined,
|
|
70
|
+
) => Promise<ConnectData<config>>
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '2.
|
|
1
|
+
export const version = '2.16.0'
|