wagmi 2.19.5 → 3.0.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/exports/index.js +15 -26
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/hooks/useCapabilities.js +2 -2
- package/dist/esm/hooks/useCapabilities.js.map +1 -1
- package/dist/esm/hooks/useConnect.js.map +1 -1
- package/dist/esm/hooks/useConnection.js +10 -0
- package/dist/esm/hooks/useConnection.js.map +1 -0
- package/dist/esm/hooks/{useAccountEffect.js → useConnectionEffect.js} +5 -5
- package/dist/esm/hooks/useConnectionEffect.js.map +1 -0
- package/dist/esm/hooks/useConnectorClient.js +2 -2
- package/dist/esm/hooks/useConnectorClient.js.map +1 -1
- package/dist/esm/hooks/useDisconnect.js.map +1 -1
- package/dist/esm/hooks/useReadContracts.js +2 -3
- package/dist/esm/hooks/useReadContracts.js.map +1 -1
- package/dist/esm/hooks/useSwitchChain.js.map +1 -1
- package/dist/esm/hooks/{useSwitchAccount.js → useSwitchConnection.js} +7 -5
- package/dist/esm/hooks/useSwitchConnection.js.map +1 -0
- package/dist/esm/hooks/useWalletClient.js +2 -2
- package/dist/esm/hooks/useWalletClient.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/exports/index.d.ts +26 -27
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/hooks/codegen/createUseWriteContract.d.ts +1 -4
- package/dist/types/hooks/codegen/createUseWriteContract.d.ts.map +1 -1
- package/dist/types/hooks/useConnect.d.ts +1 -0
- package/dist/types/hooks/useConnect.d.ts.map +1 -1
- package/dist/types/hooks/useConnection.d.ts +7 -0
- package/dist/types/hooks/useConnection.d.ts.map +1 -0
- package/dist/types/hooks/useConnectionEffect.d.ts +14 -0
- package/dist/types/hooks/useConnectionEffect.d.ts.map +1 -0
- package/dist/types/hooks/useDisconnect.d.ts +1 -0
- package/dist/types/hooks/useDisconnect.d.ts.map +1 -1
- package/dist/types/hooks/useSwitchChain.d.ts +1 -0
- package/dist/types/hooks/useSwitchChain.d.ts.map +1 -1
- package/dist/types/hooks/useSwitchConnection.d.ts +21 -0
- package/dist/types/hooks/useSwitchConnection.d.ts.map +1 -0
- package/dist/types/version.d.ts +1 -1
- package/dist/types/version.d.ts.map +1 -1
- package/package.json +4 -16
- package/src/exports/index.ts +36 -37
- package/src/hooks/codegen/createUseWriteContract.ts +1 -4
- package/src/hooks/useCapabilities.ts +2 -2
- package/src/hooks/useConnect.ts +1 -0
- package/src/hooks/useConnection.ts +33 -0
- package/src/hooks/{useAccountEffect.ts → useConnectionEffect.ts} +8 -6
- package/src/hooks/useConnectorClient.ts +2 -2
- package/src/hooks/useDisconnect.ts +1 -0
- package/src/hooks/useReadContracts.ts +2 -2
- package/src/hooks/useSwitchChain.ts +1 -0
- package/src/hooks/{useSwitchAccount.ts → useSwitchConnection.ts} +28 -21
- package/src/hooks/useWalletClient.ts +2 -2
- package/src/version.ts +1 -1
- package/actions/experimental/package.json +0 -5
- package/dist/esm/experimental/hooks/useWriteContracts.js +0 -20
- package/dist/esm/experimental/hooks/useWriteContracts.js.map +0 -1
- package/dist/esm/exports/actions/experimental.js +0 -7
- package/dist/esm/exports/actions/experimental.js.map +0 -1
- package/dist/esm/exports/experimental.js +0 -23
- package/dist/esm/exports/experimental.js.map +0 -1
- package/dist/esm/hooks/useAccount.js +0 -10
- package/dist/esm/hooks/useAccount.js.map +0 -1
- package/dist/esm/hooks/useAccountEffect.js.map +0 -1
- package/dist/esm/hooks/useSwitchAccount.js.map +0 -1
- package/dist/esm/hooks/useToken.js +0 -22
- package/dist/esm/hooks/useToken.js.map +0 -1
- package/dist/types/experimental/hooks/useWriteContracts.d.ts +0 -16
- package/dist/types/experimental/hooks/useWriteContracts.d.ts.map +0 -1
- package/dist/types/exports/actions/experimental.d.ts +0 -2
- package/dist/types/exports/actions/experimental.d.ts.map +0 -1
- package/dist/types/exports/experimental.d.ts +0 -43
- package/dist/types/exports/experimental.d.ts.map +0 -1
- package/dist/types/hooks/useAccount.d.ts +0 -7
- package/dist/types/hooks/useAccount.d.ts.map +0 -1
- package/dist/types/hooks/useAccountEffect.d.ts +0 -14
- package/dist/types/hooks/useAccountEffect.d.ts.map +0 -1
- package/dist/types/hooks/useSwitchAccount.d.ts +0 -16
- package/dist/types/hooks/useSwitchAccount.d.ts.map +0 -1
- package/dist/types/hooks/useToken.d.ts +0 -14
- package/dist/types/hooks/useToken.d.ts.map +0 -1
- package/experimental/package.json +0 -5
- package/src/experimental/hooks/useWriteContracts.ts +0 -85
- package/src/exports/actions/experimental.ts +0 -7
- package/src/exports/experimental.ts +0 -53
- package/src/hooks/useAccount.ts +0 -31
- package/src/hooks/useToken.ts +0 -60
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use client'
|
|
2
2
|
|
|
3
|
-
import { type
|
|
3
|
+
import { type GetConnectionReturnType, watchConnection } from '@wagmi/core'
|
|
4
4
|
import type { Compute } from '@wagmi/core/internal'
|
|
5
5
|
import { useEffect } from 'react'
|
|
6
6
|
|
|
7
7
|
import type { ConfigParameter } from '../types/properties.js'
|
|
8
8
|
import { useConfig } from './useConfig.js'
|
|
9
9
|
|
|
10
|
-
export type
|
|
10
|
+
export type UseConnectionEffectParameters = Compute<
|
|
11
11
|
{
|
|
12
12
|
onConnect?(
|
|
13
13
|
data: Compute<
|
|
14
14
|
Pick<
|
|
15
|
-
Extract<
|
|
15
|
+
Extract<GetConnectionReturnType, { status: 'connected' }>,
|
|
16
16
|
'address' | 'addresses' | 'chain' | 'chainId' | 'connector'
|
|
17
17
|
> & {
|
|
18
18
|
isReconnected: boolean
|
|
@@ -23,14 +23,16 @@ export type UseAccountEffectParameters = Compute<
|
|
|
23
23
|
} & ConfigParameter
|
|
24
24
|
>
|
|
25
25
|
|
|
26
|
-
/** https://wagmi.sh/react/api/hooks/
|
|
27
|
-
export function
|
|
26
|
+
/** https://wagmi.sh/react/api/hooks/useConnectionEffect */
|
|
27
|
+
export function useConnectionEffect(
|
|
28
|
+
parameters: UseConnectionEffectParameters = {},
|
|
29
|
+
) {
|
|
28
30
|
const { onConnect, onDisconnect } = parameters
|
|
29
31
|
|
|
30
32
|
const config = useConfig(parameters)
|
|
31
33
|
|
|
32
34
|
useEffect(() => {
|
|
33
|
-
return
|
|
35
|
+
return watchConnection(config, {
|
|
34
36
|
onChange(data, prevData) {
|
|
35
37
|
if (
|
|
36
38
|
(prevData.status === 'reconnecting' ||
|
|
@@ -22,9 +22,9 @@ import {
|
|
|
22
22
|
type UseQueryReturnType,
|
|
23
23
|
useQuery,
|
|
24
24
|
} from '../utils/query.js'
|
|
25
|
-
import { useAccount } from './useAccount.js'
|
|
26
25
|
import { useChainId } from './useChainId.js'
|
|
27
26
|
import { useConfig } from './useConfig.js'
|
|
27
|
+
import { useConnection } from './useConnection.js'
|
|
28
28
|
|
|
29
29
|
export type UseConnectorClientParameters<
|
|
30
30
|
config extends Config = Config,
|
|
@@ -70,7 +70,7 @@ export function useConnectorClient<
|
|
|
70
70
|
|
|
71
71
|
const config = useConfig(rest)
|
|
72
72
|
const queryClient = useQueryClient()
|
|
73
|
-
const { address, connector, status } =
|
|
73
|
+
const { address, connector, status } = useConnection({ config })
|
|
74
74
|
const chainId = useChainId({ config })
|
|
75
75
|
const activeConnector = parameters.connector ?? connector
|
|
76
76
|
|
|
@@ -39,6 +39,7 @@ export type UseDisconnectReturnType<context = unknown> = Compute<
|
|
|
39
39
|
DisconnectVariables,
|
|
40
40
|
context
|
|
41
41
|
> & {
|
|
42
|
+
/** @deprecated use `useConnections` instead */
|
|
42
43
|
connectors: readonly Connector[]
|
|
43
44
|
disconnect: DisconnectMutate<context>
|
|
44
45
|
disconnectAsync: DisconnectMutateAsync<context>
|
|
@@ -63,8 +63,8 @@ export function useReadContracts<
|
|
|
63
63
|
const config = useConfig(parameters)
|
|
64
64
|
const chainId = useChainId({ config })
|
|
65
65
|
const contractsChainId = useMemo(() => {
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
const firstChainId = (contracts[0] as { chainId?: number } | undefined)
|
|
67
|
+
?.chainId
|
|
68
68
|
if (
|
|
69
69
|
(contracts as { chainId?: number }[]).every(
|
|
70
70
|
(contract) => contract.chainId === firstChainId,
|
|
@@ -49,6 +49,7 @@ export type UseSwitchChainReturnType<
|
|
|
49
49
|
SwitchChainVariables<config, config['chains'][number]['id']>,
|
|
50
50
|
context
|
|
51
51
|
> & {
|
|
52
|
+
/** @deprecated use `useChains` instead */
|
|
52
53
|
chains: config['chains']
|
|
53
54
|
switchChain: SwitchChainMutate<config, context>
|
|
54
55
|
switchChainAsync: SwitchChainMutateAsync<config, context>
|
|
@@ -5,15 +5,15 @@ import type {
|
|
|
5
5
|
Config,
|
|
6
6
|
Connector,
|
|
7
7
|
ResolvedRegister,
|
|
8
|
-
|
|
8
|
+
SwitchConnectionErrorType,
|
|
9
9
|
} from '@wagmi/core'
|
|
10
10
|
import type { Compute } from '@wagmi/core/internal'
|
|
11
11
|
import {
|
|
12
|
-
type
|
|
13
|
-
type
|
|
14
|
-
type
|
|
15
|
-
type
|
|
16
|
-
|
|
12
|
+
type SwitchConnectionData,
|
|
13
|
+
type SwitchConnectionMutate,
|
|
14
|
+
type SwitchConnectionMutateAsync,
|
|
15
|
+
type SwitchConnectionVariables,
|
|
16
|
+
switchConnectionMutationOptions,
|
|
17
17
|
} from '@wagmi/core/query'
|
|
18
18
|
|
|
19
19
|
import type { ConfigParameter } from '../types/properties.js'
|
|
@@ -24,50 +24,55 @@ import type {
|
|
|
24
24
|
import { useConfig } from './useConfig.js'
|
|
25
25
|
import { useConnections } from './useConnections.js'
|
|
26
26
|
|
|
27
|
-
export type
|
|
27
|
+
export type UseSwitchConnectionParameters<
|
|
28
28
|
config extends Config = Config,
|
|
29
29
|
context = unknown,
|
|
30
30
|
> = Compute<
|
|
31
31
|
ConfigParameter<config> & {
|
|
32
32
|
mutation?:
|
|
33
33
|
| UseMutationParameters<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
34
|
+
SwitchConnectionData<config>,
|
|
35
|
+
SwitchConnectionErrorType,
|
|
36
|
+
SwitchConnectionVariables,
|
|
37
37
|
context
|
|
38
38
|
>
|
|
39
39
|
| undefined
|
|
40
40
|
}
|
|
41
41
|
>
|
|
42
42
|
|
|
43
|
-
export type
|
|
43
|
+
export type UseSwitchConnectionReturnType<
|
|
44
44
|
config extends Config = Config,
|
|
45
45
|
context = unknown,
|
|
46
46
|
> = Compute<
|
|
47
47
|
UseMutationReturnType<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
48
|
+
SwitchConnectionData<config>,
|
|
49
|
+
SwitchConnectionErrorType,
|
|
50
|
+
SwitchConnectionVariables,
|
|
51
51
|
context
|
|
52
52
|
> & {
|
|
53
|
+
/** @deprecated use `useConnections` instead */
|
|
53
54
|
connectors: readonly Connector[]
|
|
54
|
-
|
|
55
|
-
|
|
55
|
+
/** @deprecated use `switchConnection` instead */
|
|
56
|
+
switchAccount: SwitchConnectionMutate<config, context>
|
|
57
|
+
/** @deprecated use `switchConnectionAsync` instead */
|
|
58
|
+
switchAccountAsync: SwitchConnectionMutateAsync<config, context>
|
|
59
|
+
switchConnection: SwitchConnectionMutate<config, context>
|
|
60
|
+
switchConnectionAsync: SwitchConnectionMutateAsync<config, context>
|
|
56
61
|
}
|
|
57
62
|
>
|
|
58
63
|
|
|
59
|
-
/** https://wagmi.sh/react/api/hooks/
|
|
60
|
-
export function
|
|
64
|
+
/** https://wagmi.sh/react/api/hooks/useSwitchConnection */
|
|
65
|
+
export function useSwitchConnection<
|
|
61
66
|
config extends Config = ResolvedRegister['config'],
|
|
62
67
|
context = unknown,
|
|
63
68
|
>(
|
|
64
|
-
parameters:
|
|
65
|
-
):
|
|
69
|
+
parameters: UseSwitchConnectionParameters<config, context> = {},
|
|
70
|
+
): UseSwitchConnectionReturnType<config, context> {
|
|
66
71
|
const { mutation } = parameters
|
|
67
72
|
|
|
68
73
|
const config = useConfig(parameters)
|
|
69
74
|
|
|
70
|
-
const mutationOptions =
|
|
75
|
+
const mutationOptions = switchConnectionMutationOptions(config)
|
|
71
76
|
const { mutate, mutateAsync, ...result } = useMutation({
|
|
72
77
|
...mutation,
|
|
73
78
|
...mutationOptions,
|
|
@@ -80,5 +85,7 @@ export function useSwitchAccount<
|
|
|
80
85
|
),
|
|
81
86
|
switchAccount: mutate,
|
|
82
87
|
switchAccountAsync: mutateAsync,
|
|
88
|
+
switchConnection: mutate,
|
|
89
|
+
switchConnectionAsync: mutateAsync,
|
|
83
90
|
}
|
|
84
91
|
}
|
|
@@ -25,9 +25,9 @@ import {
|
|
|
25
25
|
type UseQueryReturnType,
|
|
26
26
|
useQuery,
|
|
27
27
|
} from '../utils/query.js'
|
|
28
|
-
import { useAccount } from './useAccount.js'
|
|
29
28
|
import { useChainId } from './useChainId.js'
|
|
30
29
|
import { useConfig } from './useConfig.js'
|
|
30
|
+
import { useConnection } from './useConnection.js'
|
|
31
31
|
|
|
32
32
|
export type UseWalletClientParameters<
|
|
33
33
|
config extends Config = Config,
|
|
@@ -73,7 +73,7 @@ export function useWalletClient<
|
|
|
73
73
|
|
|
74
74
|
const config = useConfig(rest)
|
|
75
75
|
const queryClient = useQueryClient()
|
|
76
|
-
const { address, connector, status } =
|
|
76
|
+
const { address, connector, status } = useConnection({ config })
|
|
77
77
|
const chainId = useChainId({ config })
|
|
78
78
|
const activeConnector = parameters.connector ?? connector
|
|
79
79
|
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '
|
|
1
|
+
export const version = '3.0.1'
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { useMutation } from '@tanstack/react-query';
|
|
3
|
-
import { writeContractsMutationOptions, } from '@wagmi/core/experimental';
|
|
4
|
-
import { useConfig } from '../../hooks/useConfig.js';
|
|
5
|
-
/** https://wagmi.sh/react/api/hooks/useWriteContracts */
|
|
6
|
-
export function useWriteContracts(parameters = {}) {
|
|
7
|
-
const { mutation } = parameters;
|
|
8
|
-
const config = useConfig(parameters);
|
|
9
|
-
const mutationOptions = writeContractsMutationOptions(config);
|
|
10
|
-
const { mutate, mutateAsync, ...result } = useMutation({
|
|
11
|
-
...mutation,
|
|
12
|
-
...mutationOptions,
|
|
13
|
-
});
|
|
14
|
-
return {
|
|
15
|
-
...result,
|
|
16
|
-
writeContracts: mutate,
|
|
17
|
-
writeContractsAsync: mutateAsync,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
//# sourceMappingURL=useWriteContracts.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useWriteContracts.js","sourceRoot":"","sources":["../../../../src/experimental/hooks/useWriteContracts.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AAEnD,OAAO,EAML,6BAA6B,GAC9B,MAAM,0BAA0B,CAAA;AAIjC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AA4CpD,yDAAyD;AACzD,MAAM,UAAU,iBAAiB,CAM/B,aAAsE,EAAE;IAExE,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;IAE/B,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;IAEpC,MAAM,eAAe,GAAG,6BAA6B,CAAC,MAAM,CAAC,CAAA;IAC7D,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,GAAG,MAAM,EAAE,GAAG,WAAW,CAAC;QACrD,GAAG,QAAQ;QACX,GAAG,eAAe;KACnB,CAAC,CAAA;IAGF,OAAO;QACL,GAAG,MAAM;QACT,cAAc,EAAE,MAAkC;QAClD,mBAAmB,EAAE,WAA4C;KAClE,CAAA;AACH,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// @wagmi/core/experimental
|
|
3
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
5
|
-
// biome-ignore lint/performance/noReExportAll: entrypoint module
|
|
6
|
-
export * from '@wagmi/core/experimental';
|
|
7
|
-
//# sourceMappingURL=experimental.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../../src/exports/actions/experimental.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,2BAA2B;AAC3B,gFAAgF;AAEhF,gEAAgE;AAChE,iEAAiE;AACjE,cAAc,0BAA0B,CAAA"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// Hooks
|
|
3
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
5
|
-
export {
|
|
6
|
-
/** @deprecated Use `useSendCalls` instead. */
|
|
7
|
-
useWriteContracts, } from '../experimental/hooks/useWriteContracts.js';
|
|
8
|
-
export {
|
|
9
|
-
/** @deprecated This is no longer experimental – use `import { useCallsStatus } from 'wagmi'` instead. */
|
|
10
|
-
useCallsStatus, } from '../hooks/useCallsStatus.js';
|
|
11
|
-
export {
|
|
12
|
-
/** @deprecated This is no longer experimental – use `import { useCapabilities } from 'wagmi'` instead. */
|
|
13
|
-
useCapabilities, } from '../hooks/useCapabilities.js';
|
|
14
|
-
export {
|
|
15
|
-
/** @deprecated This is no longer experimental – use `import { useSendCalls } from 'wagmi'` instead. */
|
|
16
|
-
useSendCalls, } from '../hooks/useSendCalls.js';
|
|
17
|
-
export {
|
|
18
|
-
/** @deprecated This is no longer experimental – use `import { useShowCallsStatus } from 'wagmi'` instead. */
|
|
19
|
-
useShowCallsStatus, } from '../hooks/useShowCallsStatus.js';
|
|
20
|
-
export {
|
|
21
|
-
/** @deprecated This is no longer experimental – use `import { useWaitForCallsStatus } from 'wagmi'` instead. */
|
|
22
|
-
useWaitForCallsStatus, } from '../hooks/useWaitForCallsStatus.js';
|
|
23
|
-
//# sourceMappingURL=experimental.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.js","sourceRoot":"","sources":["../../../src/exports/experimental.ts"],"names":[],"mappings":"AAAA,gFAAgF;AAChF,QAAQ;AACR,gFAAgF;AAEhF,gEAAgE;AAChE,OAAO;AAKL,8CAA8C;AAC9C,iBAAiB,GAClB,MAAM,4CAA4C,CAAA;AACnD,OAAO;AAKL,yGAAyG;AACzG,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,OAAO;AAKL,0GAA0G;AAC1G,eAAe,GAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO;AAKL,uGAAuG;AACvG,YAAY,GACb,MAAM,0BAA0B,CAAA;AACjC,OAAO;AAKL,6GAA6G;AAC7G,kBAAkB,GACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO;AAKL,gHAAgH;AAChH,qBAAqB,GACtB,MAAM,mCAAmC,CAAA"}
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { getAccount, watchAccount, } from '@wagmi/core';
|
|
3
|
-
import { useConfig } from './useConfig.js';
|
|
4
|
-
import { useSyncExternalStoreWithTracked } from './useSyncExternalStoreWithTracked.js';
|
|
5
|
-
/** https://wagmi.sh/react/api/hooks/useAccount */
|
|
6
|
-
export function useAccount(parameters = {}) {
|
|
7
|
-
const config = useConfig(parameters);
|
|
8
|
-
return useSyncExternalStoreWithTracked((onChange) => watchAccount(config, { onChange }), () => getAccount(config));
|
|
9
|
-
}
|
|
10
|
-
//# sourceMappingURL=useAccount.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccount.js","sourceRoot":"","sources":["../../../src/hooks/useAccount.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAEZ,OAAO,EAGL,U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Ae;KACnB,CAAC,CAAA;IAEF,OAAO;QACL,GAAG,MAAM;QACT,UAAU,EAAE,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC,CAAC,GAAG,CACxC,CAAC,UAAU,EAAE,EAAE,CAAC,UAAU,CAAC,SAAS,CACrC;QACD,aAAa,EAAE,MAAM;QACrB,kBAAkB,EAAE,WAAW;KAChC,CAAA;AACH,CAAC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
'use client';
|
|
2
|
-
import { getTokenQueryOptions, } from '@wagmi/core/query';
|
|
3
|
-
import { useQuery } from '../utils/query.js';
|
|
4
|
-
import { useChainId } from './useChainId.js';
|
|
5
|
-
import { useConfig } from './useConfig.js';
|
|
6
|
-
/**
|
|
7
|
-
* @deprecated
|
|
8
|
-
*
|
|
9
|
-
* https://wagmi.sh/react/api/hooks/useToken
|
|
10
|
-
*/
|
|
11
|
-
export function useToken(parameters = {}) {
|
|
12
|
-
const { address, query = {} } = parameters;
|
|
13
|
-
const config = useConfig(parameters);
|
|
14
|
-
const chainId = useChainId({ config });
|
|
15
|
-
const options = getTokenQueryOptions(config, {
|
|
16
|
-
...parameters,
|
|
17
|
-
chainId: parameters.chainId ?? chainId,
|
|
18
|
-
});
|
|
19
|
-
const enabled = Boolean(address && (query.enabled ?? true));
|
|
20
|
-
return useQuery({ ...query, ...options, enabled });
|
|
21
|
-
}
|
|
22
|
-
//# sourceMappingURL=useToken.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToken.js","sourceRoot":"","sources":["../../../src/hooks/useToken.ts"],"names":[],"mappings":"AAAA,YAAY,CAAA;AAIZ,OAAO,EAKL,oBAAoB,GACrB,MAAM,mBAAmB,CAAA;AAG1B,OAAO,EAA2B,QAAQ,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAA;AAqB1C;;;;GAIG;AACH,MAAM,UAAU,QAAQ,CAItB,aAAqD,EAAE;IAEvD,MAAM,EAAE,OAAO,EAAE,KAAK,GAAG,EAAE,EAAE,GAAG,UAAU,CAAA;IAE1C,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;IACpC,MAAM,OAAO,GAAG,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC,CAAA;IAEtC,MAAM,OAAO,GAAG,oBAAoB,CAAC,MAAM,EAAE;QAC3C,GAAG,UAAU;QACb,OAAO,EAAE,UAAU,CAAC,OAAO,IAAI,OAAO;KACvC,CAAC,CAAA;IACF,MAAM,OAAO,GAAG,OAAO,CAAC,OAAO,IAAI,CAAC,KAAK,CAAC,OAAO,IAAI,IAAI,CAAC,CAAC,CAAA;IAE3D,OAAO,QAAQ,CAAC,EAAE,GAAG,KAAK,EAAE,GAAG,OAAO,EAAE,OAAO,EAAE,CAAC,CAAA;AACpD,CAAC"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Config, ResolvedRegister } from '@wagmi/core';
|
|
2
|
-
import { type WriteContractsData, type WriteContractsErrorType, type WriteContractsMutate, type WriteContractsMutateAsync, type WriteContractsVariables } from '@wagmi/core/experimental';
|
|
3
|
-
import type { Compute } from '@wagmi/core/internal';
|
|
4
|
-
import type { ContractFunctionParameters } from 'viem';
|
|
5
|
-
import type { ConfigParameter } from '../../types/properties.js';
|
|
6
|
-
import type { UseMutationParameters, UseMutationReturnType } from '../../utils/query.js';
|
|
7
|
-
export type UseWriteContractsParameters<contracts extends readonly unknown[] = readonly ContractFunctionParameters[], config extends Config = Config, context = unknown> = Compute<ConfigParameter<config> & {
|
|
8
|
-
mutation?: UseMutationParameters<WriteContractsData, WriteContractsErrorType, WriteContractsVariables<contracts, config, config['chains'][number]['id']>, context> | undefined;
|
|
9
|
-
}>;
|
|
10
|
-
export type UseWriteContractsReturnType<contracts extends readonly unknown[] = readonly ContractFunctionParameters[], config extends Config = Config, context = unknown> = Compute<UseMutationReturnType<WriteContractsData, WriteContractsErrorType, WriteContractsVariables<contracts, config, config['chains'][number]['id']>, context> & {
|
|
11
|
-
writeContracts: WriteContractsMutate<contracts, config, context>;
|
|
12
|
-
writeContractsAsync: WriteContractsMutateAsync<contracts, config, context>;
|
|
13
|
-
}>;
|
|
14
|
-
/** https://wagmi.sh/react/api/hooks/useWriteContracts */
|
|
15
|
-
export declare function useWriteContracts<const contracts extends readonly unknown[] = readonly ContractFunctionParameters[], config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: UseWriteContractsParameters<contracts, config, context>): UseWriteContractsReturnType<contracts, config, context>;
|
|
16
|
-
//# sourceMappingURL=useWriteContracts.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useWriteContracts.d.ts","sourceRoot":"","sources":["../../../../src/experimental/hooks/useWriteContracts.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,MAAM,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,uBAAuB,EAC5B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,uBAAuB,EAE7B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,MAAM,CAAA;AAGtD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAChE,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,sBAAsB,CAAA;AAE7B,MAAM,MAAM,2BAA2B,CACrC,SAAS,SAAS,SAAS,OAAO,EAAE,GAAG,SAAS,0BAA0B,EAAE,EAC5E,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,OAAO,GAAG,OAAO,IACf,OAAO,CACT,eAAe,CAAC,MAAM,CAAC,GAAG;IACxB,QAAQ,CAAC,EACL,qBAAqB,CACnB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,CACrB,SAAS,EACT,MAAM,EACN,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAC/B,EACD,OAAO,CACR,GACD,SAAS,CAAA;CACd,CACF,CAAA;AAED,MAAM,MAAM,2BAA2B,CACrC,SAAS,SAAS,SAAS,OAAO,EAAE,GAAG,SAAS,0BAA0B,EAAE,EAC5E,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,OAAO,GAAG,OAAO,IACf,OAAO,CACT,qBAAqB,CACnB,kBAAkB,EAClB,uBAAuB,EACvB,uBAAuB,CAAC,SAAS,EAAE,MAAM,EAAE,MAAM,CAAC,QAAQ,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,CAAC,EAC1E,OAAO,CACR,GAAG;IACF,cAAc,EAAE,oBAAoB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;IAChE,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAAA;CAC3E,CACF,CAAA;AAED,yDAAyD;AACzD,wBAAgB,iBAAiB,CAC/B,KAAK,CAAC,SAAS,SACb,SAAS,OAAO,EAAE,GAAG,SAAS,0BAA0B,EAAE,EAC5D,MAAM,SAAS,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,EAClD,OAAO,GAAG,OAAO,EAEjB,UAAU,GAAE,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAM,GACvE,2BAA2B,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,CAAC,CAiBzD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../../src/exports/actions/experimental.ts"],"names":[],"mappings":"AAMA,cAAc,0BAA0B,CAAA"}
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
export {
|
|
2
|
-
/** @deprecated Use `UseSendCallsParameters` instead. */
|
|
3
|
-
type UseWriteContractsParameters,
|
|
4
|
-
/** @deprecated Use `UseSendCallsReturnType` instead. */
|
|
5
|
-
type UseWriteContractsReturnType,
|
|
6
|
-
/** @deprecated Use `useSendCalls` instead. */
|
|
7
|
-
useWriteContracts, } from '../experimental/hooks/useWriteContracts.js';
|
|
8
|
-
export {
|
|
9
|
-
/** @deprecated This is no longer experimental – use `import type { UseCallsStatusParameters } from 'wagmi'` instead. */
|
|
10
|
-
type UseCallsStatusParameters,
|
|
11
|
-
/** @deprecated This is no longer experimental – use `import type { UseCallsStatusReturnType } from 'wagmi'` instead. */
|
|
12
|
-
type UseCallsStatusReturnType,
|
|
13
|
-
/** @deprecated This is no longer experimental – use `import { useCallsStatus } from 'wagmi'` instead. */
|
|
14
|
-
useCallsStatus, } from '../hooks/useCallsStatus.js';
|
|
15
|
-
export {
|
|
16
|
-
/** @deprecated This is no longer experimental – use `import type { UseCapabilitiesParameters } from 'wagmi'` instead. */
|
|
17
|
-
type UseCapabilitiesParameters,
|
|
18
|
-
/** @deprecated This is no longer experimental – use `import type { UseCapabilitiesReturnType } from 'wagmi'` instead. */
|
|
19
|
-
type UseCapabilitiesReturnType,
|
|
20
|
-
/** @deprecated This is no longer experimental – use `import { useCapabilities } from 'wagmi'` instead. */
|
|
21
|
-
useCapabilities, } from '../hooks/useCapabilities.js';
|
|
22
|
-
export {
|
|
23
|
-
/** @deprecated This is no longer experimental – use `import type { UseSendCallsParameters } from 'wagmi'` instead. */
|
|
24
|
-
type UseSendCallsParameters,
|
|
25
|
-
/** @deprecated This is no longer experimental – use `import type { UseSendCallsReturnType } from 'wagmi'` instead. */
|
|
26
|
-
type UseSendCallsReturnType,
|
|
27
|
-
/** @deprecated This is no longer experimental – use `import { useSendCalls } from 'wagmi'` instead. */
|
|
28
|
-
useSendCalls, } from '../hooks/useSendCalls.js';
|
|
29
|
-
export {
|
|
30
|
-
/** @deprecated This is no longer experimental – use `import type { UseShowCallsStatusParameters } from 'wagmi'` instead. */
|
|
31
|
-
type UseShowCallsStatusParameters,
|
|
32
|
-
/** @deprecated This is no longer experimental – use `import type { UseShowCallsStatusReturnType } from 'wagmi'` instead. */
|
|
33
|
-
type UseShowCallsStatusReturnType,
|
|
34
|
-
/** @deprecated This is no longer experimental – use `import { useShowCallsStatus } from 'wagmi'` instead. */
|
|
35
|
-
useShowCallsStatus, } from '../hooks/useShowCallsStatus.js';
|
|
36
|
-
export {
|
|
37
|
-
/** @deprecated This is no longer experimental – use `import type { UseWaitForCallsStatusParameters } from 'wagmi'` instead. */
|
|
38
|
-
type UseWaitForCallsStatusParameters,
|
|
39
|
-
/** @deprecated This is no longer experimental – use `import type { UseWaitForCallsStatusReturnType } from 'wagmi'` instead. */
|
|
40
|
-
type UseWaitForCallsStatusReturnType,
|
|
41
|
-
/** @deprecated This is no longer experimental – use `import { useWaitForCallsStatus } from 'wagmi'` instead. */
|
|
42
|
-
useWaitForCallsStatus, } from '../hooks/useWaitForCallsStatus.js';
|
|
43
|
-
//# sourceMappingURL=experimental.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"experimental.d.ts","sourceRoot":"","sources":["../../../src/exports/experimental.ts"],"names":[],"mappings":"AAKA,OAAO;AACL,wDAAwD;AACxD,KAAK,2BAA2B;AAChC,wDAAwD;AACxD,KAAK,2BAA2B;AAChC,8CAA8C;AAC9C,iBAAiB,GAClB,MAAM,4CAA4C,CAAA;AACnD,OAAO;AACL,wHAAwH;AACxH,KAAK,wBAAwB;AAC7B,wHAAwH;AACxH,KAAK,wBAAwB;AAC7B,yGAAyG;AACzG,cAAc,GACf,MAAM,4BAA4B,CAAA;AACnC,OAAO;AACL,yHAAyH;AACzH,KAAK,yBAAyB;AAC9B,yHAAyH;AACzH,KAAK,yBAAyB;AAC9B,0GAA0G;AAC1G,eAAe,GAChB,MAAM,6BAA6B,CAAA;AACpC,OAAO;AACL,sHAAsH;AACtH,KAAK,sBAAsB;AAC3B,sHAAsH;AACtH,KAAK,sBAAsB;AAC3B,uGAAuG;AACvG,YAAY,GACb,MAAM,0BAA0B,CAAA;AACjC,OAAO;AACL,4HAA4H;AAC5H,KAAK,4BAA4B;AACjC,4HAA4H;AAC5H,KAAK,4BAA4B;AACjC,6GAA6G;AAC7G,kBAAkB,GACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO;AACL,+HAA+H;AAC/H,KAAK,+BAA+B;AACpC,+HAA+H;AAC/H,KAAK,+BAA+B;AACpC,gHAAgH;AAChH,qBAAqB,GACtB,MAAM,mCAAmC,CAAA"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { type Config, type GetAccountReturnType, type ResolvedRegister } from '@wagmi/core';
|
|
2
|
-
import type { ConfigParameter } from '../types/properties.js';
|
|
3
|
-
export type UseAccountParameters<config extends Config = Config> = ConfigParameter<config>;
|
|
4
|
-
export type UseAccountReturnType<config extends Config = Config> = GetAccountReturnType<config>;
|
|
5
|
-
/** https://wagmi.sh/react/api/hooks/useAccount */
|
|
6
|
-
export declare function useAccount<config extends Config = ResolvedRegister['config']>(parameters?: UseAccountParameters<config>): UseAccountReturnType<config>;
|
|
7
|
-
//# sourceMappingURL=useAccount.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,oBAAoB,EAEzB,KAAK,gBAAgB,EAEtB,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAI7D,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAC7D,eAAe,CAAC,MAAM,CAAC,CAAA;AAEzB,MAAM,MAAM,oBAAoB,CAAC,MAAM,SAAS,MAAM,GAAG,MAAM,IAC7D,oBAAoB,CAAC,MAAM,CAAC,CAAA;AAE9B,kDAAkD;AAClD,wBAAgB,UAAU,CAAC,MAAM,SAAS,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,EAC3E,UAAU,GAAE,oBAAoB,CAAC,MAAM,CAAM,GAC5C,oBAAoB,CAAC,MAAM,CAAC,CAO9B"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { type GetAccountReturnType } from '@wagmi/core';
|
|
2
|
-
import type { Compute } from '@wagmi/core/internal';
|
|
3
|
-
import type { ConfigParameter } from '../types/properties.js';
|
|
4
|
-
export type UseAccountEffectParameters = Compute<{
|
|
5
|
-
onConnect?(data: Compute<Pick<Extract<GetAccountReturnType, {
|
|
6
|
-
status: 'connected';
|
|
7
|
-
}>, 'address' | 'addresses' | 'chain' | 'chainId' | 'connector'> & {
|
|
8
|
-
isReconnected: boolean;
|
|
9
|
-
}>): void;
|
|
10
|
-
onDisconnect?(): void;
|
|
11
|
-
} & ConfigParameter>;
|
|
12
|
-
/** https://wagmi.sh/react/api/hooks/useAccountEffect */
|
|
13
|
-
export declare function useAccountEffect(parameters?: UseAccountEffectParameters): void;
|
|
14
|
-
//# sourceMappingURL=useAccountEffect.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useAccountEffect.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAccountEffect.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAgB,MAAM,aAAa,CAAA;AACrE,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AAGnD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAG7D,MAAM,MAAM,0BAA0B,GAAG,OAAO,CAC9C;IACE,SAAS,CAAC,CACR,IAAI,EAAE,OAAO,CACX,IAAI,CACF,OAAO,CAAC,oBAAoB,EAAE;QAAE,MAAM,EAAE,WAAW,CAAA;KAAE,CAAC,EACtD,SAAS,GAAG,WAAW,GAAG,OAAO,GAAG,SAAS,GAAG,WAAW,CAC5D,GAAG;QACF,aAAa,EAAE,OAAO,CAAA;KACvB,CACF,GACA,IAAI,CAAA;IACP,YAAY,CAAC,IAAI,IAAI,CAAA;CACtB,GAAG,eAAe,CACpB,CAAA;AAED,wDAAwD;AACxD,wBAAgB,gBAAgB,CAAC,UAAU,GAAE,0BAA+B,QAmC3E"}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import type { Config, Connector, ResolvedRegister, SwitchAccountErrorType } from '@wagmi/core';
|
|
2
|
-
import type { Compute } from '@wagmi/core/internal';
|
|
3
|
-
import { type SwitchAccountData, type SwitchAccountMutate, type SwitchAccountMutateAsync, type SwitchAccountVariables } from '@wagmi/core/query';
|
|
4
|
-
import type { ConfigParameter } from '../types/properties.js';
|
|
5
|
-
import type { UseMutationParameters, UseMutationReturnType } from '../utils/query.js';
|
|
6
|
-
export type UseSwitchAccountParameters<config extends Config = Config, context = unknown> = Compute<ConfigParameter<config> & {
|
|
7
|
-
mutation?: UseMutationParameters<SwitchAccountData<config>, SwitchAccountErrorType, SwitchAccountVariables, context> | undefined;
|
|
8
|
-
}>;
|
|
9
|
-
export type UseSwitchAccountReturnType<config extends Config = Config, context = unknown> = Compute<UseMutationReturnType<SwitchAccountData<config>, SwitchAccountErrorType, SwitchAccountVariables, context> & {
|
|
10
|
-
connectors: readonly Connector[];
|
|
11
|
-
switchAccount: SwitchAccountMutate<config, context>;
|
|
12
|
-
switchAccountAsync: SwitchAccountMutateAsync<config, context>;
|
|
13
|
-
}>;
|
|
14
|
-
/** https://wagmi.sh/react/api/hooks/useSwitchAccount */
|
|
15
|
-
export declare function useSwitchAccount<config extends Config = ResolvedRegister['config'], context = unknown>(parameters?: UseSwitchAccountParameters<config, context>): UseSwitchAccountReturnType<config, context>;
|
|
16
|
-
//# sourceMappingURL=useSwitchAccount.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSwitchAccount.d.ts","sourceRoot":"","sources":["../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AAE,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAM,GAC3D,0BAA0B,CAAC,MAAM,EAAE,OAAO,CAAC,CAmB7C"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import type { Config, GetTokenErrorType, ResolvedRegister } from '@wagmi/core';
|
|
2
|
-
import type { Compute } from '@wagmi/core/internal';
|
|
3
|
-
import { type GetTokenData, type GetTokenOptions, type GetTokenQueryFnData, type GetTokenQueryKey } from '@wagmi/core/query';
|
|
4
|
-
import type { ConfigParameter, QueryParameter } from '../types/properties.js';
|
|
5
|
-
import { type UseQueryReturnType } from '../utils/query.js';
|
|
6
|
-
export type UseTokenParameters<config extends Config = Config, selectData = GetTokenData> = Compute<GetTokenOptions<config> & ConfigParameter<config> & QueryParameter<GetTokenQueryFnData, GetTokenErrorType, selectData, GetTokenQueryKey<config>>>;
|
|
7
|
-
export type UseTokenReturnType<selectData = GetTokenData> = UseQueryReturnType<selectData, GetTokenErrorType>;
|
|
8
|
-
/**
|
|
9
|
-
* @deprecated
|
|
10
|
-
*
|
|
11
|
-
* https://wagmi.sh/react/api/hooks/useToken
|
|
12
|
-
*/
|
|
13
|
-
export declare function useToken<config extends Config = ResolvedRegister['config'], selectData = GetTokenData>(parameters?: UseTokenParameters<config, selectData>): UseTokenReturnType<selectData>;
|
|
14
|
-
//# sourceMappingURL=useToken.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useToken.d.ts","sourceRoot":"","sources":["../../../src/hooks/useToken.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAA;AAC9E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAA;AACnD,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,eAAe,EACpB,KAAK,mBAAmB,EACxB,KAAK,gBAAgB,EAEtB,MAAM,mBAAmB,CAAA;AAE1B,OAAO,KAAK,EAAE,eAAe,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,EAAE,KAAK,kBAAkB,EAAY,MAAM,mBAAmB,CAAA;AAIrE,MAAM,MAAM,kBAAkB,CAC5B,MAAM,SAAS,MAAM,GAAG,MAAM,EAC9B,UAAU,GAAG,YAAY,IACvB,OAAO,CACT,eAAe,CAAC,MAAM,CAAC,GACrB,eAAe,CAAC,MAAM,CAAC,GACvB,cAAc,CACZ,mBAAmB,EACnB,iBAAiB,EACjB,UAAU,EACV,gBAAgB,CAAC,MAAM,CAAC,CACzB,CACJ,CAAA;AAED,MAAM,MAAM,kBAAkB,CAAC,UAAU,GAAG,YAAY,IAAI,kBAAkB,CAC5E,UAAU,EACV,iBAAiB,CAClB,CAAA;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CACtB,MAAM,SAAS,MAAM,GAAG,gBAAgB,CAAC,QAAQ,CAAC,EAClD,UAAU,GAAG,YAAY,EAEzB,UAAU,GAAE,kBAAkB,CAAC,MAAM,EAAE,UAAU,CAAM,GACtD,kBAAkB,CAAC,UAAU,CAAC,CAahC"}
|
|
@@ -1,85 +0,0 @@
|
|
|
1
|
-
'use client'
|
|
2
|
-
|
|
3
|
-
import { useMutation } from '@tanstack/react-query'
|
|
4
|
-
import type { Config, ResolvedRegister } from '@wagmi/core'
|
|
5
|
-
import {
|
|
6
|
-
type WriteContractsData,
|
|
7
|
-
type WriteContractsErrorType,
|
|
8
|
-
type WriteContractsMutate,
|
|
9
|
-
type WriteContractsMutateAsync,
|
|
10
|
-
type WriteContractsVariables,
|
|
11
|
-
writeContractsMutationOptions,
|
|
12
|
-
} from '@wagmi/core/experimental'
|
|
13
|
-
import type { Compute } from '@wagmi/core/internal'
|
|
14
|
-
import type { ContractFunctionParameters } from 'viem'
|
|
15
|
-
|
|
16
|
-
import { useConfig } from '../../hooks/useConfig.js'
|
|
17
|
-
import type { ConfigParameter } from '../../types/properties.js'
|
|
18
|
-
import type {
|
|
19
|
-
UseMutationParameters,
|
|
20
|
-
UseMutationReturnType,
|
|
21
|
-
} from '../../utils/query.js'
|
|
22
|
-
|
|
23
|
-
export type UseWriteContractsParameters<
|
|
24
|
-
contracts extends readonly unknown[] = readonly ContractFunctionParameters[],
|
|
25
|
-
config extends Config = Config,
|
|
26
|
-
context = unknown,
|
|
27
|
-
> = Compute<
|
|
28
|
-
ConfigParameter<config> & {
|
|
29
|
-
mutation?:
|
|
30
|
-
| UseMutationParameters<
|
|
31
|
-
WriteContractsData,
|
|
32
|
-
WriteContractsErrorType,
|
|
33
|
-
WriteContractsVariables<
|
|
34
|
-
contracts,
|
|
35
|
-
config,
|
|
36
|
-
config['chains'][number]['id']
|
|
37
|
-
>,
|
|
38
|
-
context
|
|
39
|
-
>
|
|
40
|
-
| undefined
|
|
41
|
-
}
|
|
42
|
-
>
|
|
43
|
-
|
|
44
|
-
export type UseWriteContractsReturnType<
|
|
45
|
-
contracts extends readonly unknown[] = readonly ContractFunctionParameters[],
|
|
46
|
-
config extends Config = Config,
|
|
47
|
-
context = unknown,
|
|
48
|
-
> = Compute<
|
|
49
|
-
UseMutationReturnType<
|
|
50
|
-
WriteContractsData,
|
|
51
|
-
WriteContractsErrorType,
|
|
52
|
-
WriteContractsVariables<contracts, config, config['chains'][number]['id']>,
|
|
53
|
-
context
|
|
54
|
-
> & {
|
|
55
|
-
writeContracts: WriteContractsMutate<contracts, config, context>
|
|
56
|
-
writeContractsAsync: WriteContractsMutateAsync<contracts, config, context>
|
|
57
|
-
}
|
|
58
|
-
>
|
|
59
|
-
|
|
60
|
-
/** https://wagmi.sh/react/api/hooks/useWriteContracts */
|
|
61
|
-
export function useWriteContracts<
|
|
62
|
-
const contracts extends
|
|
63
|
-
readonly unknown[] = readonly ContractFunctionParameters[],
|
|
64
|
-
config extends Config = ResolvedRegister['config'],
|
|
65
|
-
context = unknown,
|
|
66
|
-
>(
|
|
67
|
-
parameters: UseWriteContractsParameters<contracts, config, context> = {},
|
|
68
|
-
): UseWriteContractsReturnType<contracts, config, context> {
|
|
69
|
-
const { mutation } = parameters
|
|
70
|
-
|
|
71
|
-
const config = useConfig(parameters)
|
|
72
|
-
|
|
73
|
-
const mutationOptions = writeContractsMutationOptions(config)
|
|
74
|
-
const { mutate, mutateAsync, ...result } = useMutation({
|
|
75
|
-
...mutation,
|
|
76
|
-
...mutationOptions,
|
|
77
|
-
})
|
|
78
|
-
|
|
79
|
-
type Return = UseWriteContractsReturnType<contracts, config, context>
|
|
80
|
-
return {
|
|
81
|
-
...result,
|
|
82
|
-
writeContracts: mutate as Return['writeContracts'],
|
|
83
|
-
writeContractsAsync: mutateAsync as Return['writeContractsAsync'],
|
|
84
|
-
}
|
|
85
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
2
|
-
// @wagmi/core/experimental
|
|
3
|
-
////////////////////////////////////////////////////////////////////////////////
|
|
4
|
-
|
|
5
|
-
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
6
|
-
// biome-ignore lint/performance/noReExportAll: entrypoint module
|
|
7
|
-
export * from '@wagmi/core/experimental'
|