@wagmi/core 3.2.2 → 3.3.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/deployContract.js +7 -1
- package/dist/esm/actions/deployContract.js.map +1 -1
- package/dist/esm/actions/getBlobBaseFee.js +10 -0
- package/dist/esm/actions/getBlobBaseFee.js.map +1 -0
- package/dist/esm/actions/getContractEvents.js +10 -0
- package/dist/esm/actions/getContractEvents.js.map +1 -0
- package/dist/esm/actions/sendTransaction.js +7 -1
- package/dist/esm/actions/sendTransaction.js.map +1 -1
- package/dist/esm/actions/sendTransactionSync.js +7 -1
- package/dist/esm/actions/sendTransactionSync.js.map +1 -1
- package/dist/esm/actions/writeContract.js +7 -1
- package/dist/esm/actions/writeContract.js.map +1 -1
- package/dist/esm/actions/writeContractSync.js +31 -0
- package/dist/esm/actions/writeContractSync.js.map +1 -0
- package/dist/esm/connectors/mock.js +2 -0
- package/dist/esm/connectors/mock.js.map +1 -1
- package/dist/esm/exports/actions.js +2 -0
- package/dist/esm/exports/actions.js.map +1 -1
- package/dist/esm/exports/index.js +3 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/query.js +3 -0
- package/dist/esm/exports/query.js.map +1 -1
- package/dist/esm/query/connect.js +3 -2
- package/dist/esm/query/connect.js.map +1 -1
- package/dist/esm/query/deployContract.js +2 -1
- package/dist/esm/query/deployContract.js.map +1 -1
- package/dist/esm/query/disconnect.js +3 -2
- package/dist/esm/query/disconnect.js.map +1 -1
- package/dist/esm/query/getBlobBaseFee.js +17 -0
- package/dist/esm/query/getBlobBaseFee.js.map +1 -0
- package/dist/esm/query/getContractEvents.js +24 -0
- package/dist/esm/query/getContractEvents.js.map +1 -0
- package/dist/esm/query/readContracts.js +13 -2
- package/dist/esm/query/readContracts.js.map +1 -1
- package/dist/esm/query/reconnect.js +2 -1
- package/dist/esm/query/reconnect.js.map +1 -1
- package/dist/esm/query/sendCalls.js +2 -1
- package/dist/esm/query/sendCalls.js.map +1 -1
- package/dist/esm/query/sendCallsSync.js +2 -1
- package/dist/esm/query/sendCallsSync.js.map +1 -1
- package/dist/esm/query/sendTransaction.js +2 -1
- package/dist/esm/query/sendTransaction.js.map +1 -1
- package/dist/esm/query/sendTransactionSync.js +2 -1
- package/dist/esm/query/sendTransactionSync.js.map +1 -1
- package/dist/esm/query/showCallsStatus.js +2 -1
- package/dist/esm/query/showCallsStatus.js.map +1 -1
- package/dist/esm/query/signMessage.js +2 -1
- package/dist/esm/query/signMessage.js.map +1 -1
- package/dist/esm/query/signTypedData.js +2 -1
- package/dist/esm/query/signTypedData.js.map +1 -1
- package/dist/esm/query/switchChain.js +2 -1
- package/dist/esm/query/switchChain.js.map +1 -1
- package/dist/esm/query/switchConnection.js +2 -1
- package/dist/esm/query/switchConnection.js.map +1 -1
- package/dist/esm/query/verifyTypedData.js.map +1 -1
- package/dist/esm/query/watchAsset.js +2 -1
- package/dist/esm/query/watchAsset.js.map +1 -1
- package/dist/esm/query/writeContract.js +2 -1
- package/dist/esm/query/writeContract.js.map +1 -1
- package/dist/esm/query/writeContractSync.js +11 -0
- package/dist/esm/query/writeContractSync.js.map +1 -0
- package/dist/esm/tempo/Connectors.js +10 -4
- package/dist/esm/tempo/Connectors.js.map +1 -1
- package/dist/esm/tempo/KeyManager.js +49 -1
- package/dist/esm/tempo/KeyManager.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/actions/deployContract.d.ts.map +1 -1
- package/dist/types/actions/getBlobBaseFee.d.ts +10 -0
- package/dist/types/actions/getBlobBaseFee.d.ts.map +1 -0
- package/dist/types/actions/getContractEvents.d.ts +11 -0
- package/dist/types/actions/getContractEvents.d.ts.map +1 -0
- package/dist/types/actions/sendTransaction.d.ts.map +1 -1
- package/dist/types/actions/sendTransactionSync.d.ts.map +1 -1
- package/dist/types/actions/writeContract.d.ts.map +1 -1
- package/dist/types/actions/writeContractSync.d.ts +16 -0
- package/dist/types/actions/writeContractSync.d.ts.map +1 -0
- package/dist/types/connectors/mock.d.ts.map +1 -1
- package/dist/types/exports/actions.d.ts +2 -0
- package/dist/types/exports/actions.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts +3 -0
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/query.d.ts +21 -14
- package/dist/types/exports/query.d.ts.map +1 -1
- package/dist/types/query/connect.d.ts +5 -5
- package/dist/types/query/connect.d.ts.map +1 -1
- package/dist/types/query/deployContract.d.ts +5 -5
- package/dist/types/query/deployContract.d.ts.map +1 -1
- package/dist/types/query/disconnect.d.ts +5 -4
- package/dist/types/query/disconnect.d.ts.map +1 -1
- package/dist/types/query/getBlobBaseFee.d.ts +16 -0
- package/dist/types/query/getBlobBaseFee.d.ts.map +1 -0
- package/dist/types/query/getContractEvents.d.ts +24 -0
- package/dist/types/query/getContractEvents.d.ts.map +1 -0
- 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/readContracts.d.ts +1 -1
- package/dist/types/query/readContracts.d.ts.map +1 -1
- package/dist/types/query/reconnect.d.ts +5 -4
- package/dist/types/query/reconnect.d.ts.map +1 -1
- package/dist/types/query/sendCalls.d.ts +5 -10
- package/dist/types/query/sendCalls.d.ts.map +1 -1
- package/dist/types/query/sendCallsSync.d.ts +5 -18
- package/dist/types/query/sendCallsSync.d.ts.map +1 -1
- package/dist/types/query/sendTransaction.d.ts +5 -5
- package/dist/types/query/sendTransaction.d.ts.map +1 -1
- package/dist/types/query/sendTransactionSync.d.ts +5 -5
- package/dist/types/query/sendTransactionSync.d.ts.map +1 -1
- package/dist/types/query/showCallsStatus.d.ts +5 -5
- package/dist/types/query/showCallsStatus.d.ts.map +1 -1
- package/dist/types/query/signMessage.d.ts +5 -8
- package/dist/types/query/signMessage.d.ts.map +1 -1
- package/dist/types/query/signTypedData.d.ts +5 -223
- package/dist/types/query/signTypedData.d.ts.map +1 -1
- package/dist/types/query/switchChain.d.ts +5 -21
- package/dist/types/query/switchChain.d.ts.map +1 -1
- package/dist/types/query/switchConnection.d.ts +5 -6
- package/dist/types/query/switchConnection.d.ts.map +1 -1
- package/dist/types/query/verifyTypedData.d.ts.map +1 -1
- package/dist/types/query/watchAsset.d.ts +5 -13
- package/dist/types/query/watchAsset.d.ts.map +1 -1
- package/dist/types/query/writeContract.d.ts +5 -7
- package/dist/types/query/writeContract.d.ts.map +1 -1
- package/dist/types/query/writeContractSync.d.ts +14 -0
- package/dist/types/query/writeContractSync.d.ts.map +1 -0
- package/dist/types/tempo/Connectors.d.ts.map +1 -1
- package/dist/types/tempo/KeyManager.d.ts.map +1 -1
- package/dist/types/types/query.d.ts +4 -1
- package/dist/types/types/query.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/actions/deployContract.ts +7 -1
- package/src/actions/getBlobBaseFee.ts +35 -0
- package/src/actions/getContractEvents.ts +68 -0
- package/src/actions/sendTransaction.ts +7 -1
- package/src/actions/sendTransactionSync.ts +7 -1
- package/src/actions/writeContract.ts +7 -1
- package/src/actions/writeContractSync.ts +120 -0
- package/src/connectors/mock.ts +1 -0
- package/src/exports/actions.ts +14 -0
- package/src/exports/index.ts +21 -0
- package/src/exports/query.ts +64 -0
- package/src/query/connect.ts +24 -8
- package/src/query/deployContract.ts +20 -5
- package/src/query/disconnect.ts +20 -9
- package/src/query/getBlobBaseFee.ts +75 -0
- package/src/query/getContractEvents.ts +214 -0
- package/src/query/readContracts.ts +12 -2
- package/src/query/reconnect.ts +20 -7
- package/src/query/sendCalls.ts +22 -8
- package/src/query/sendCallsSync.ts +20 -5
- package/src/query/sendTransaction.ts +20 -5
- package/src/query/sendTransactionSync.ts +23 -5
- package/src/query/showCallsStatus.ts +19 -8
- package/src/query/signMessage.ts +20 -7
- package/src/query/signTypedData.ts +19 -8
- package/src/query/switchChain.ts +22 -8
- package/src/query/switchConnection.ts +20 -5
- package/src/query/verifyTypedData.ts +0 -1
- package/src/query/watchAsset.ts +20 -7
- package/src/query/writeContract.ts +26 -5
- package/src/query/writeContractSync.ts +130 -0
- package/src/tempo/Connectors.ts +9 -6
- package/src/tempo/KeyManager.ts +64 -1
- package/src/types/query.ts +15 -1
- package/src/version.ts +1 -1
package/src/query/sendCalls.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type SendCallsErrorType,
|
|
5
4
|
type SendCallsParameters,
|
|
@@ -7,23 +6,38 @@ import {
|
|
|
7
6
|
sendCalls,
|
|
8
7
|
} from '../actions/sendCalls.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export type SendCallsOptions<
|
|
13
|
+
config extends Config,
|
|
14
|
+
context = unknown,
|
|
15
|
+
> = MutationParameter<
|
|
16
|
+
SendCallsData,
|
|
17
|
+
SendCallsErrorType,
|
|
18
|
+
SendCallsVariables<config, config['chains'][number]['id']>,
|
|
19
|
+
context
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
export function sendCallsMutationOptions<config extends Config, context>(
|
|
13
23
|
config: config,
|
|
14
|
-
|
|
24
|
+
options: SendCallsOptions<config, context> = {},
|
|
25
|
+
): SendCallsMutationOptions<config> {
|
|
15
26
|
return {
|
|
27
|
+
...(options.mutation as any),
|
|
16
28
|
mutationFn(variables) {
|
|
17
29
|
return sendCalls(config, variables)
|
|
18
30
|
},
|
|
19
31
|
mutationKey: ['sendCalls'],
|
|
20
|
-
}
|
|
21
|
-
SendCallsData,
|
|
22
|
-
SendCallsErrorType,
|
|
23
|
-
SendCallsVariables<config, config['chains'][number]['id']>
|
|
24
|
-
>
|
|
32
|
+
}
|
|
25
33
|
}
|
|
26
34
|
|
|
35
|
+
export type SendCallsMutationOptions<config extends Config> = MutationOptions<
|
|
36
|
+
SendCallsData,
|
|
37
|
+
SendCallsErrorType,
|
|
38
|
+
SendCallsVariables<config, config['chains'][number]['id']>
|
|
39
|
+
>
|
|
40
|
+
|
|
27
41
|
export type SendCallsData = Compute<SendCallsReturnType>
|
|
28
42
|
|
|
29
43
|
export type SendCallsVariables<
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type SendCallsSyncErrorType,
|
|
5
4
|
type SendCallsSyncParameters,
|
|
@@ -7,22 +6,38 @@ import {
|
|
|
7
6
|
sendCallsSync,
|
|
8
7
|
} from '../actions/sendCallsSync.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export type SendCallsSyncOptions<
|
|
13
|
+
config extends Config,
|
|
14
|
+
context = unknown,
|
|
15
|
+
> = MutationParameter<
|
|
16
|
+
SendCallsSyncData,
|
|
17
|
+
SendCallsSyncErrorType,
|
|
18
|
+
SendCallsSyncVariables<config, config['chains'][number]['id']>,
|
|
19
|
+
context
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
export function sendCallsSyncMutationOptions<config extends Config, context>(
|
|
13
23
|
config: config,
|
|
14
|
-
|
|
24
|
+
options: SendCallsSyncOptions<config, context> = {},
|
|
25
|
+
): SendCallsSyncMutationOptions<config> {
|
|
15
26
|
return {
|
|
27
|
+
...(options.mutation as any),
|
|
16
28
|
mutationFn(variables) {
|
|
17
29
|
return sendCallsSync(config, variables)
|
|
18
30
|
},
|
|
19
31
|
mutationKey: ['sendCallsSync'],
|
|
20
|
-
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type SendCallsSyncMutationOptions<config extends Config> =
|
|
36
|
+
MutationOptions<
|
|
21
37
|
SendCallsSyncData,
|
|
22
38
|
SendCallsSyncErrorType,
|
|
23
39
|
SendCallsSyncVariables<config, config['chains'][number]['id']>
|
|
24
40
|
>
|
|
25
|
-
}
|
|
26
41
|
|
|
27
42
|
export type SendCallsSyncData = Compute<SendCallsSyncReturnType>
|
|
28
43
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type SendTransactionErrorType,
|
|
5
4
|
type SendTransactionParameters,
|
|
@@ -7,22 +6,38 @@ import {
|
|
|
7
6
|
sendTransaction,
|
|
8
7
|
} from '../actions/sendTransaction.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export type SendTransactionOptions<
|
|
13
|
+
config extends Config,
|
|
14
|
+
context = unknown,
|
|
15
|
+
> = MutationParameter<
|
|
16
|
+
SendTransactionData,
|
|
17
|
+
SendTransactionErrorType,
|
|
18
|
+
SendTransactionVariables<config, config['chains'][number]['id']>,
|
|
19
|
+
context
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
export function sendTransactionMutationOptions<config extends Config, context>(
|
|
13
23
|
config: config,
|
|
14
|
-
|
|
24
|
+
options: SendTransactionOptions<config, context> = {},
|
|
25
|
+
): SendTransactionMutationOptions<config> {
|
|
15
26
|
return {
|
|
27
|
+
...(options.mutation as any),
|
|
16
28
|
mutationFn(variables) {
|
|
17
29
|
return sendTransaction(config, variables)
|
|
18
30
|
},
|
|
19
31
|
mutationKey: ['sendTransaction'],
|
|
20
|
-
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export type SendTransactionMutationOptions<config extends Config> =
|
|
36
|
+
MutationOptions<
|
|
21
37
|
SendTransactionData,
|
|
22
38
|
SendTransactionErrorType,
|
|
23
39
|
SendTransactionVariables<config, config['chains'][number]['id']>
|
|
24
40
|
>
|
|
25
|
-
}
|
|
26
41
|
|
|
27
42
|
export type SendTransactionData = Compute<SendTransactionReturnType>
|
|
28
43
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type SendTransactionSyncErrorType,
|
|
5
4
|
type SendTransactionSyncParameters,
|
|
@@ -7,22 +6,41 @@ import {
|
|
|
7
6
|
sendTransactionSync,
|
|
8
7
|
} from '../actions/sendTransactionSync.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export type SendTransactionSyncOptions<
|
|
13
|
+
config extends Config,
|
|
14
|
+
context = unknown,
|
|
15
|
+
> = MutationParameter<
|
|
16
|
+
SendTransactionSyncData,
|
|
17
|
+
SendTransactionSyncErrorType,
|
|
18
|
+
SendTransactionSyncVariables<config, config['chains'][number]['id']>,
|
|
19
|
+
context
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
export function sendTransactionSyncMutationOptions<
|
|
23
|
+
config extends Config,
|
|
24
|
+
context,
|
|
25
|
+
>(
|
|
13
26
|
config: config,
|
|
14
|
-
|
|
27
|
+
options: SendTransactionSyncOptions<config, context> = {},
|
|
28
|
+
): SendTransactionSyncMutationOptions<config> {
|
|
15
29
|
return {
|
|
30
|
+
...(options.mutation as any),
|
|
16
31
|
mutationFn(variables) {
|
|
17
32
|
return sendTransactionSync(config, variables)
|
|
18
33
|
},
|
|
19
34
|
mutationKey: ['sendTransactionSync'],
|
|
20
|
-
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export type SendTransactionSyncMutationOptions<config extends Config> =
|
|
39
|
+
MutationOptions<
|
|
21
40
|
SendTransactionSyncData,
|
|
22
41
|
SendTransactionSyncErrorType,
|
|
23
42
|
SendTransactionSyncVariables<config, config['chains'][number]['id']>
|
|
24
43
|
>
|
|
25
|
-
}
|
|
26
44
|
|
|
27
45
|
export type SendTransactionSyncData = Compute<SendTransactionSyncReturnType>
|
|
28
46
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type ShowCallsStatusErrorType,
|
|
5
4
|
type ShowCallsStatusParameters,
|
|
@@ -7,23 +6,35 @@ import {
|
|
|
7
6
|
showCallsStatus,
|
|
8
7
|
} from '../actions/showCallsStatus.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export type ShowCallsStatusOptions<context = unknown> = MutationParameter<
|
|
13
|
+
ShowCallsStatusData,
|
|
14
|
+
ShowCallsStatusErrorType,
|
|
15
|
+
ShowCallsStatusVariables,
|
|
16
|
+
context
|
|
17
|
+
>
|
|
18
|
+
|
|
19
|
+
export function showCallsStatusMutationOptions<config extends Config, context>(
|
|
13
20
|
config: config,
|
|
14
|
-
|
|
21
|
+
options: ShowCallsStatusOptions<context> = {},
|
|
22
|
+
): ShowCallsStatusMutationOptions {
|
|
15
23
|
return {
|
|
24
|
+
...(options.mutation as any),
|
|
16
25
|
mutationFn(variables) {
|
|
17
26
|
return showCallsStatus(config, variables)
|
|
18
27
|
},
|
|
19
28
|
mutationKey: ['showCallsStatus'],
|
|
20
|
-
}
|
|
21
|
-
ShowCallsStatusData,
|
|
22
|
-
ShowCallsStatusErrorType,
|
|
23
|
-
ShowCallsStatusVariables
|
|
24
|
-
>
|
|
29
|
+
}
|
|
25
30
|
}
|
|
26
31
|
|
|
32
|
+
export type ShowCallsStatusMutationOptions = MutationOptions<
|
|
33
|
+
ShowCallsStatusData,
|
|
34
|
+
ShowCallsStatusErrorType,
|
|
35
|
+
ShowCallsStatusVariables
|
|
36
|
+
>
|
|
37
|
+
|
|
27
38
|
export type ShowCallsStatusData = Compute<ShowCallsStatusReturnType>
|
|
28
39
|
|
|
29
40
|
export type ShowCallsStatusVariables = ShowCallsStatusParameters
|
package/src/query/signMessage.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type SignMessageErrorType,
|
|
5
4
|
type SignMessageParameters,
|
|
@@ -7,22 +6,36 @@ import {
|
|
|
7
6
|
signMessage,
|
|
8
7
|
} from '../actions/signMessage.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import type { Mutate, MutateAsync } from './types.js'
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type SignMessageOptions<context = unknown> = MutationParameter<
|
|
14
|
+
SignMessageData,
|
|
15
|
+
SignMessageErrorType,
|
|
16
|
+
SignMessageVariables,
|
|
17
|
+
context
|
|
18
|
+
>
|
|
19
|
+
|
|
20
|
+
export function signMessageMutationOptions<context>(
|
|
21
|
+
config: Config,
|
|
22
|
+
options: SignMessageOptions<context> = {},
|
|
23
|
+
): SignMessageMutationOptions {
|
|
14
24
|
return {
|
|
25
|
+
...(options.mutation as any),
|
|
15
26
|
mutationFn(variables) {
|
|
16
27
|
return signMessage(config, variables)
|
|
17
28
|
},
|
|
18
29
|
mutationKey: ['signMessage'],
|
|
19
|
-
}
|
|
20
|
-
SignMessageData,
|
|
21
|
-
SignMessageErrorType,
|
|
22
|
-
SignMessageVariables
|
|
23
|
-
>
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
|
|
33
|
+
export type SignMessageMutationOptions = MutationOptions<
|
|
34
|
+
SignMessageData,
|
|
35
|
+
SignMessageErrorType,
|
|
36
|
+
SignMessageVariables
|
|
37
|
+
>
|
|
38
|
+
|
|
26
39
|
export type SignMessageData = SignMessageReturnType
|
|
27
40
|
|
|
28
41
|
export type SignMessageVariables = Compute<SignMessageParameters>
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import type { TypedData } from 'viem'
|
|
4
3
|
import {
|
|
5
4
|
type SignTypedDataErrorType,
|
|
@@ -8,23 +7,35 @@ import {
|
|
|
8
7
|
signTypedData,
|
|
9
8
|
} from '../actions/signTypedData.js'
|
|
10
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
+
import type { MutationParameter } from '../types/query.js'
|
|
11
11
|
import type { Compute } from '../types/utils.js'
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type SignTypedDataOptions<context = unknown> = MutationParameter<
|
|
14
|
+
SignTypedDataData,
|
|
15
|
+
SignTypedDataErrorType,
|
|
16
|
+
SignTypedDataVariables,
|
|
17
|
+
context
|
|
18
|
+
>
|
|
19
|
+
|
|
20
|
+
export function signTypedDataMutationOptions<config extends Config, context>(
|
|
14
21
|
config: config,
|
|
15
|
-
|
|
22
|
+
options: SignTypedDataOptions<context> = {},
|
|
23
|
+
): SignTypedDataMutationOptions {
|
|
16
24
|
return {
|
|
25
|
+
...(options.mutation as any),
|
|
17
26
|
mutationFn(variables) {
|
|
18
27
|
return signTypedData(config, variables)
|
|
19
28
|
},
|
|
20
29
|
mutationKey: ['signTypedData'],
|
|
21
|
-
}
|
|
22
|
-
SignTypedDataData,
|
|
23
|
-
SignTypedDataErrorType,
|
|
24
|
-
SignTypedDataVariables
|
|
25
|
-
>
|
|
30
|
+
}
|
|
26
31
|
}
|
|
27
32
|
|
|
33
|
+
export type SignTypedDataMutationOptions = MutationOptions<
|
|
34
|
+
SignTypedDataData,
|
|
35
|
+
SignTypedDataErrorType,
|
|
36
|
+
SignTypedDataVariables
|
|
37
|
+
>
|
|
38
|
+
|
|
28
39
|
export type SignTypedDataData = Compute<SignTypedDataReturnType>
|
|
29
40
|
|
|
30
41
|
export type SignTypedDataVariables<
|
package/src/query/switchChain.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type SwitchChainErrorType,
|
|
5
4
|
type SwitchChainParameters,
|
|
@@ -7,23 +6,38 @@ import {
|
|
|
7
6
|
switchChain,
|
|
8
7
|
} from '../actions/switchChain.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
|
|
12
|
-
export
|
|
12
|
+
export type SwitchChainOptions<
|
|
13
|
+
config extends Config,
|
|
14
|
+
context = unknown,
|
|
15
|
+
> = MutationParameter<
|
|
16
|
+
SwitchChainData<config, config['chains'][number]['id']>,
|
|
17
|
+
SwitchChainErrorType,
|
|
18
|
+
SwitchChainVariables<config, config['chains'][number]['id']>,
|
|
19
|
+
context
|
|
20
|
+
>
|
|
21
|
+
|
|
22
|
+
export function switchChainMutationOptions<config extends Config, context>(
|
|
13
23
|
config: config,
|
|
14
|
-
|
|
24
|
+
options: SwitchChainOptions<config, context> = {},
|
|
25
|
+
): SwitchChainMutationOptions<config> {
|
|
15
26
|
return {
|
|
27
|
+
...(options.mutation as any),
|
|
16
28
|
mutationFn(variables) {
|
|
17
29
|
return switchChain(config, variables)
|
|
18
30
|
},
|
|
19
31
|
mutationKey: ['switchChain'],
|
|
20
|
-
}
|
|
21
|
-
SwitchChainData<config, config['chains'][number]['id']>,
|
|
22
|
-
SwitchChainErrorType,
|
|
23
|
-
SwitchChainVariables<config, config['chains'][number]['id']>
|
|
24
|
-
>
|
|
32
|
+
}
|
|
25
33
|
}
|
|
26
34
|
|
|
35
|
+
export type SwitchChainMutationOptions<config extends Config> = MutationOptions<
|
|
36
|
+
SwitchChainData<config, config['chains'][number]['id']>,
|
|
37
|
+
SwitchChainErrorType,
|
|
38
|
+
SwitchChainVariables<config, config['chains'][number]['id']>
|
|
39
|
+
>
|
|
40
|
+
|
|
27
41
|
export type SwitchChainData<
|
|
28
42
|
config extends Config,
|
|
29
43
|
chainId extends config['chains'][number]['id'],
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type SwitchConnectionErrorType,
|
|
5
4
|
type SwitchConnectionParameters,
|
|
@@ -7,23 +6,39 @@ import {
|
|
|
7
6
|
switchConnection,
|
|
8
7
|
} from '../actions/switchConnection.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import type { Mutate, MutateAsync } from './types.js'
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type SwitchConnectionOptions<
|
|
14
|
+
config extends Config,
|
|
15
|
+
context = unknown,
|
|
16
|
+
> = MutationParameter<
|
|
17
|
+
SwitchConnectionData<config>,
|
|
18
|
+
SwitchConnectionErrorType,
|
|
19
|
+
SwitchConnectionVariables,
|
|
20
|
+
context
|
|
21
|
+
>
|
|
22
|
+
|
|
23
|
+
export function switchConnectionMutationOptions<config extends Config, context>(
|
|
14
24
|
config: config,
|
|
15
|
-
|
|
25
|
+
options: SwitchConnectionOptions<config, context> = {},
|
|
26
|
+
): SwitchConnectionMutationOptions<config> {
|
|
16
27
|
return {
|
|
28
|
+
...(options.mutation as any),
|
|
17
29
|
mutationFn(variables) {
|
|
18
30
|
return switchConnection(config, variables)
|
|
19
31
|
},
|
|
20
32
|
mutationKey: ['switchConnection'],
|
|
21
|
-
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export type SwitchConnectionMutationOptions<config extends Config> =
|
|
37
|
+
MutationOptions<
|
|
22
38
|
SwitchConnectionData<config>,
|
|
23
39
|
SwitchConnectionErrorType,
|
|
24
40
|
SwitchConnectionVariables
|
|
25
41
|
>
|
|
26
|
-
}
|
|
27
42
|
|
|
28
43
|
export type SwitchConnectionData<config extends Config> = Compute<
|
|
29
44
|
SwitchConnectionReturnType<config>
|
package/src/query/watchAsset.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import type { MutationOptions } from '@tanstack/query-core'
|
|
2
|
-
|
|
3
2
|
import {
|
|
4
3
|
type WatchAssetErrorType,
|
|
5
4
|
type WatchAssetParameters,
|
|
@@ -7,22 +6,36 @@ import {
|
|
|
7
6
|
watchAsset,
|
|
8
7
|
} from '../actions/watchAsset.js'
|
|
9
8
|
import type { Config } from '../createConfig.js'
|
|
9
|
+
import type { MutationParameter } from '../types/query.js'
|
|
10
10
|
import type { Compute } from '../types/utils.js'
|
|
11
11
|
import type { Mutate, MutateAsync } from './types.js'
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type WatchAssetOptions<context = unknown> = MutationParameter<
|
|
14
|
+
WatchAssetData,
|
|
15
|
+
WatchAssetErrorType,
|
|
16
|
+
WatchAssetVariables,
|
|
17
|
+
context
|
|
18
|
+
>
|
|
19
|
+
|
|
20
|
+
export function watchAssetMutationOptions<context>(
|
|
21
|
+
config: Config,
|
|
22
|
+
options: WatchAssetOptions<context> = {},
|
|
23
|
+
): WatchAssetMutationOptions {
|
|
14
24
|
return {
|
|
25
|
+
...(options.mutation as any),
|
|
15
26
|
mutationFn(variables) {
|
|
16
27
|
return watchAsset(config, variables)
|
|
17
28
|
},
|
|
18
29
|
mutationKey: ['watchAsset'],
|
|
19
|
-
}
|
|
20
|
-
WatchAssetData,
|
|
21
|
-
WatchAssetErrorType,
|
|
22
|
-
WatchAssetVariables
|
|
23
|
-
>
|
|
30
|
+
}
|
|
24
31
|
}
|
|
25
32
|
|
|
33
|
+
export type WatchAssetMutationOptions = MutationOptions<
|
|
34
|
+
WatchAssetData,
|
|
35
|
+
WatchAssetErrorType,
|
|
36
|
+
WatchAssetVariables
|
|
37
|
+
>
|
|
38
|
+
|
|
26
39
|
export type WatchAssetData = WatchAssetReturnType
|
|
27
40
|
|
|
28
41
|
export type WatchAssetVariables = Compute<WatchAssetParameters>
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { MutateOptions, MutationOptions } from '@tanstack/query-core'
|
|
2
2
|
import type { Abi, ContractFunctionArgs, ContractFunctionName } from 'viem'
|
|
3
|
-
|
|
4
3
|
import {
|
|
5
4
|
type WriteContractErrorType,
|
|
6
5
|
type WriteContractParameters,
|
|
@@ -8,17 +7,40 @@ import {
|
|
|
8
7
|
writeContract,
|
|
9
8
|
} from '../actions/writeContract.js'
|
|
10
9
|
import type { Config } from '../createConfig.js'
|
|
10
|
+
import type { MutationParameter } from '../types/query.js'
|
|
11
11
|
import type { Compute } from '../types/utils.js'
|
|
12
12
|
|
|
13
|
-
export
|
|
13
|
+
export type WriteContractOptions<
|
|
14
|
+
config extends Config,
|
|
15
|
+
context = unknown,
|
|
16
|
+
> = MutationParameter<
|
|
17
|
+
WriteContractData,
|
|
18
|
+
WriteContractErrorType,
|
|
19
|
+
WriteContractVariables<
|
|
20
|
+
Abi,
|
|
21
|
+
string,
|
|
22
|
+
readonly unknown[],
|
|
23
|
+
config,
|
|
24
|
+
config['chains'][number]['id']
|
|
25
|
+
>,
|
|
26
|
+
context
|
|
27
|
+
>
|
|
28
|
+
|
|
29
|
+
export function writeContractMutationOptions<config extends Config, context>(
|
|
14
30
|
config: config,
|
|
15
|
-
|
|
31
|
+
options: WriteContractOptions<config, context> = {},
|
|
32
|
+
): WriteContractMutationOptions<config> {
|
|
16
33
|
return {
|
|
34
|
+
...(options.mutation as any),
|
|
17
35
|
mutationFn(variables) {
|
|
18
36
|
return writeContract(config, variables)
|
|
19
37
|
},
|
|
20
38
|
mutationKey: ['writeContract'],
|
|
21
|
-
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export type WriteContractMutationOptions<config extends Config> =
|
|
43
|
+
MutationOptions<
|
|
22
44
|
WriteContractData,
|
|
23
45
|
WriteContractErrorType,
|
|
24
46
|
WriteContractVariables<
|
|
@@ -29,7 +51,6 @@ export function writeContractMutationOptions<config extends Config>(
|
|
|
29
51
|
config['chains'][number]['id']
|
|
30
52
|
>
|
|
31
53
|
>
|
|
32
|
-
}
|
|
33
54
|
|
|
34
55
|
export type WriteContractData = Compute<WriteContractReturnType>
|
|
35
56
|
|