@wagmi/vue 0.0.10 → 0.0.11
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/composables/useAccount.js +0 -1
- package/dist/esm/composables/useAccount.js.map +1 -1
- package/dist/esm/composables/useBalance.js +0 -1
- package/dist/esm/composables/useBalance.js.map +1 -1
- package/dist/esm/composables/useBlockNumber.js +0 -2
- package/dist/esm/composables/useBlockNumber.js.map +1 -1
- package/dist/esm/composables/useChainId.js +0 -1
- package/dist/esm/composables/useChainId.js.map +1 -1
- package/dist/esm/composables/useConfig.js +0 -1
- package/dist/esm/composables/useConfig.js.map +1 -1
- package/dist/esm/composables/useConnect.js +0 -1
- package/dist/esm/composables/useConnect.js.map +1 -1
- package/dist/esm/composables/useConnectorClient.js +1 -2
- package/dist/esm/composables/useConnectorClient.js.map +1 -1
- package/dist/esm/composables/useDisconnect.js +0 -1
- package/dist/esm/composables/useDisconnect.js.map +1 -1
- package/dist/esm/composables/useEnsAddress.js +0 -1
- package/dist/esm/composables/useEnsAddress.js.map +1 -1
- package/dist/esm/composables/useEnsAvatar.js +0 -1
- package/dist/esm/composables/useEnsAvatar.js.map +1 -1
- package/dist/esm/composables/useEnsName.js +0 -1
- package/dist/esm/composables/useEnsName.js.map +1 -1
- package/dist/esm/composables/useReadContract.js +0 -3
- package/dist/esm/composables/useReadContract.js.map +1 -1
- package/dist/esm/composables/useReconnect.js +0 -1
- package/dist/esm/composables/useReconnect.js.map +1 -1
- package/dist/esm/composables/useSignMessage.js +0 -1
- package/dist/esm/composables/useSignMessage.js.map +1 -1
- package/dist/esm/composables/useSimulateContract.js +0 -1
- package/dist/esm/composables/useSimulateContract.js.map +1 -1
- package/dist/esm/composables/useSwitchChain.js +0 -4
- package/dist/esm/composables/useSwitchChain.js.map +1 -1
- package/dist/esm/composables/useTransaction.js +0 -1
- package/dist/esm/composables/useTransaction.js.map +1 -1
- package/dist/esm/composables/useTransactionReceipt.js +0 -4
- package/dist/esm/composables/useTransactionReceipt.js.map +1 -1
- package/dist/esm/composables/useWaitForTransactionReceipt.js +0 -1
- package/dist/esm/composables/useWaitForTransactionReceipt.js.map +1 -1
- package/dist/esm/composables/useWatchBlockNumber.js +0 -1
- package/dist/esm/composables/useWatchBlockNumber.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/chains.js +2 -0
- package/dist/esm/exports/chains.js.map +1 -1
- package/dist/esm/exports/connectors.js +2 -0
- package/dist/esm/exports/connectors.js.map +1 -1
- package/dist/esm/exports/index.js +1 -0
- package/dist/esm/exports/index.js.map +1 -1
- package/dist/esm/exports/query.js +2 -0
- package/dist/esm/exports/query.js.map +1 -1
- package/dist/esm/nuxt/module.js.map +1 -1
- package/dist/esm/nuxt/runtime/composables.js +2 -0
- package/dist/esm/nuxt/runtime/composables.js.map +1 -1
- package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
- package/dist/esm/utils/cloneDeep.js +1 -0
- package/dist/esm/utils/cloneDeep.js.map +1 -1
- package/dist/esm/utils/query.js +1 -2
- package/dist/esm/utils/query.js.map +1 -1
- package/dist/esm/utils/updateState.js +2 -2
- package/dist/esm/utils/updateState.js.map +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/types/composables/useAccount.d.ts +1 -1
- package/dist/types/composables/useAccount.d.ts.map +1 -1
- package/dist/types/composables/useBalance.d.ts +1 -1
- package/dist/types/composables/useBalance.d.ts.map +1 -1
- package/dist/types/composables/useBlockNumber.d.ts +2 -2
- package/dist/types/composables/useBlockNumber.d.ts.map +1 -1
- package/dist/types/composables/useChainId.d.ts +1 -1
- package/dist/types/composables/useChainId.d.ts.map +1 -1
- package/dist/types/composables/useConfig.d.ts +1 -1
- package/dist/types/composables/useConfig.d.ts.map +1 -1
- package/dist/types/composables/useConnect.d.ts +1 -1
- package/dist/types/composables/useConnect.d.ts.map +1 -1
- package/dist/types/composables/useConnectorClient.d.ts +1 -1
- package/dist/types/composables/useConnectorClient.d.ts.map +1 -1
- package/dist/types/composables/useDisconnect.d.ts +1 -1
- package/dist/types/composables/useDisconnect.d.ts.map +1 -1
- package/dist/types/composables/useEnsAddress.d.ts +1 -1
- package/dist/types/composables/useEnsAddress.d.ts.map +1 -1
- package/dist/types/composables/useEnsAvatar.d.ts +1 -1
- package/dist/types/composables/useEnsAvatar.d.ts.map +1 -1
- package/dist/types/composables/useEnsName.d.ts +1 -1
- package/dist/types/composables/useEnsName.d.ts.map +1 -1
- package/dist/types/composables/useReadContract.d.ts +3 -3
- package/dist/types/composables/useReadContract.d.ts.map +1 -1
- package/dist/types/composables/useReconnect.d.ts +1 -1
- package/dist/types/composables/useReconnect.d.ts.map +1 -1
- package/dist/types/composables/useSignMessage.d.ts +1 -1
- package/dist/types/composables/useSignMessage.d.ts.map +1 -1
- package/dist/types/composables/useSimulateContract.d.ts +1 -1
- package/dist/types/composables/useSimulateContract.d.ts.map +1 -1
- package/dist/types/composables/useSwitchChain.d.ts +4 -4
- package/dist/types/composables/useSwitchChain.d.ts.map +1 -1
- package/dist/types/composables/useTransaction.d.ts +1 -1
- package/dist/types/composables/useTransaction.d.ts.map +1 -1
- package/dist/types/composables/useTransactionReceipt.d.ts +4 -4
- package/dist/types/composables/useTransactionReceipt.d.ts.map +1 -1
- package/dist/types/composables/useWaitForTransactionReceipt.d.ts +1 -1
- package/dist/types/composables/useWaitForTransactionReceipt.d.ts.map +1 -1
- package/dist/types/composables/useWatchBlockNumber.d.ts +1 -1
- package/dist/types/composables/useWatchBlockNumber.d.ts.map +1 -1
- package/dist/types/exports/actions.d.ts.map +1 -1
- package/dist/types/exports/chains.d.ts.map +1 -1
- package/dist/types/exports/connectors.d.ts.map +1 -1
- package/dist/types/exports/index.d.ts.map +1 -1
- package/dist/types/exports/query.d.ts.map +1 -1
- package/dist/types/nuxt/module.d.ts.map +1 -1
- package/dist/types/nuxt/runtime/composables.d.ts.map +1 -1
- package/dist/types/types/ref.d.ts.map +1 -1
- package/dist/types/utils/query.d.ts +2 -2
- package/dist/types/utils/query.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +3 -3
- package/src/composables/useAccount.ts +1 -1
- package/src/composables/useBalance.ts +1 -5
- package/src/composables/useBlockNumber.ts +9 -11
- package/src/composables/useChainId.ts +1 -1
- package/src/composables/useConfig.ts +1 -1
- package/src/composables/useConnect.ts +5 -5
- package/src/composables/useConnectorClient.ts +8 -5
- package/src/composables/useDisconnect.ts +1 -1
- package/src/composables/useEnsAddress.ts +1 -1
- package/src/composables/useEnsAvatar.ts +1 -1
- package/src/composables/useEnsName.ts +1 -1
- package/src/composables/useReadContract.ts +11 -17
- package/src/composables/useReconnect.ts +1 -1
- package/src/composables/useSignMessage.ts +1 -1
- package/src/composables/useSimulateContract.ts +1 -4
- package/src/composables/useSwitchChain.ts +9 -9
- package/src/composables/useTransaction.ts +7 -4
- package/src/composables/useTransactionReceipt.ts +13 -13
- package/src/composables/useWaitForTransactionReceipt.ts +7 -4
- package/src/composables/useWatchBlockNumber.ts +5 -3
- package/src/exports/actions.ts +2 -0
- package/src/exports/chains.ts +2 -0
- package/src/exports/connectors.ts +2 -0
- package/src/exports/index.ts +1 -0
- package/src/exports/query.ts +2 -0
- package/src/nuxt/module.ts +1 -0
- package/src/nuxt/runtime/composables.ts +2 -0
- package/src/types/ref.ts +13 -10
- package/src/utils/cloneDeep.ts +1 -0
- package/src/utils/query.ts +7 -7
- package/src/utils/updateState.ts +2 -2
- package/src/version.ts +1 -1
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '@wagmi/core'
|
|
8
8
|
import { type ToRefs, onScopeDispose, reactive, readonly, toRefs } from 'vue'
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import type { ConfigParameter } from '../types/properties.js'
|
|
11
11
|
import { updateState } from '../utils/updateState.js'
|
|
12
12
|
import { useConfig } from './useConfig.js'
|
|
13
13
|
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
type Config,
|
|
3
|
-
type GetBalanceErrorType,
|
|
4
|
-
type ResolvedRegister,
|
|
5
|
-
} from '@wagmi/core'
|
|
1
|
+
import type { Config, GetBalanceErrorType, ResolvedRegister } from '@wagmi/core'
|
|
6
2
|
import type { Evaluate } from '@wagmi/core/internal'
|
|
7
3
|
import {
|
|
8
4
|
type GetBalanceData,
|
|
@@ -1,14 +1,10 @@
|
|
|
1
1
|
import { useQueryClient } from '@tanstack/vue-query'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type {
|
|
3
|
+
Config,
|
|
4
|
+
GetBlockNumberErrorType,
|
|
5
|
+
ResolvedRegister,
|
|
6
6
|
} from '@wagmi/core'
|
|
7
|
-
import {
|
|
8
|
-
type Evaluate,
|
|
9
|
-
type UnionEvaluate,
|
|
10
|
-
type UnionOmit,
|
|
11
|
-
} from '@wagmi/core/internal'
|
|
7
|
+
import type { Evaluate, UnionEvaluate, UnionOmit } from '@wagmi/core/internal'
|
|
12
8
|
import {
|
|
13
9
|
type GetBlockNumberData,
|
|
14
10
|
type GetBlockNumberOptions,
|
|
@@ -31,7 +27,8 @@ import {
|
|
|
31
27
|
|
|
32
28
|
export type UseBlockNumberParameters<
|
|
33
29
|
config extends Config = Config,
|
|
34
|
-
chainId extends
|
|
30
|
+
chainId extends
|
|
31
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
35
32
|
selectData = GetBlockNumberData,
|
|
36
33
|
> = Evaluate<
|
|
37
34
|
DeepMaybeRef<
|
|
@@ -62,7 +59,8 @@ export type UseBlockNumberReturnType<selectData = GetBlockNumberData> =
|
|
|
62
59
|
/** https://wagmi.sh/vue/api/composables/useBlockNumber */
|
|
63
60
|
export function useBlockNumber<
|
|
64
61
|
config extends Config = ResolvedRegister['config'],
|
|
65
|
-
chainId extends
|
|
62
|
+
chainId extends
|
|
63
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
66
64
|
selectData = GetBlockNumberData,
|
|
67
65
|
>(
|
|
68
66
|
parameters_: UseBlockNumberParameters<config, chainId, selectData> = {},
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
} from '@wagmi/core'
|
|
8
8
|
import { type Ref, onScopeDispose, readonly, ref } from 'vue'
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import type { ConfigParameter } from '../types/properties.js'
|
|
11
11
|
import { useConfig } from './useConfig.js'
|
|
12
12
|
|
|
13
13
|
export type UseChainIdParameters<config extends Config = Config> =
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/vue-query'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
import type {
|
|
3
|
+
Config,
|
|
4
|
+
ConnectErrorType,
|
|
5
|
+
GetConnectorsReturnType,
|
|
6
|
+
ResolvedRegister,
|
|
7
7
|
} from '@wagmi/core'
|
|
8
8
|
import type { Evaluate } from '@wagmi/core/internal'
|
|
9
9
|
import {
|
|
@@ -5,7 +5,7 @@ import type {
|
|
|
5
5
|
GetConnectorClientErrorType,
|
|
6
6
|
ResolvedRegister,
|
|
7
7
|
} from '@wagmi/core'
|
|
8
|
-
import {
|
|
8
|
+
import type { Evaluate, Omit } from '@wagmi/core/internal'
|
|
9
9
|
import {
|
|
10
10
|
type GetConnectorClientData,
|
|
11
11
|
type GetConnectorClientOptions,
|
|
@@ -29,7 +29,8 @@ import { useConfig } from './useConfig.js'
|
|
|
29
29
|
|
|
30
30
|
export type UseConnectorClientParameters<
|
|
31
31
|
config extends Config = Config,
|
|
32
|
-
chainId extends
|
|
32
|
+
chainId extends
|
|
33
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
33
34
|
selectData = GetConnectorClientData<config, chainId>,
|
|
34
35
|
> = Evaluate<
|
|
35
36
|
DeepMaybeRef<
|
|
@@ -56,14 +57,16 @@ export type UseConnectorClientParameters<
|
|
|
56
57
|
|
|
57
58
|
export type UseConnectorClientReturnType<
|
|
58
59
|
config extends Config = Config,
|
|
59
|
-
chainId extends
|
|
60
|
+
chainId extends
|
|
61
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
60
62
|
selectData = GetConnectorClientData<config, chainId>,
|
|
61
63
|
> = UseQueryReturnType<selectData, GetConnectorClientErrorType>
|
|
62
64
|
|
|
63
65
|
/** https://wagmi.sh/vue/api/composables/useConnectorClient */
|
|
64
66
|
export function useConnectorClient<
|
|
65
67
|
config extends Config = ResolvedRegister['config'],
|
|
66
|
-
chainId extends
|
|
68
|
+
chainId extends
|
|
69
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
67
70
|
selectData = GetConnectorClientData<config, chainId>,
|
|
68
71
|
>(
|
|
69
72
|
parameters_: UseConnectorClientParameters<config, chainId, selectData> = {},
|
|
@@ -101,7 +104,7 @@ export function useConnectorClient<
|
|
|
101
104
|
...options,
|
|
102
105
|
queryKey,
|
|
103
106
|
enabled,
|
|
104
|
-
staleTime:
|
|
107
|
+
staleTime: Number.POSITIVE_INFINITY,
|
|
105
108
|
}
|
|
106
109
|
})
|
|
107
110
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/vue-query'
|
|
2
|
-
import {
|
|
2
|
+
import type { Connector, DisconnectErrorType } from '@wagmi/core'
|
|
3
3
|
import type { Evaluate } from '@wagmi/core/internal'
|
|
4
4
|
import {
|
|
5
5
|
type DisconnectData,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type {
|
|
2
|
+
Config,
|
|
3
|
+
ReadContractErrorType,
|
|
4
|
+
ResolvedRegister,
|
|
5
5
|
} from '@wagmi/core'
|
|
6
|
-
import {
|
|
6
|
+
import type { UnionEvaluate } from '@wagmi/core/internal'
|
|
7
7
|
import {
|
|
8
8
|
type ReadContractData,
|
|
9
9
|
type ReadContractOptions,
|
|
@@ -12,13 +12,9 @@ import {
|
|
|
12
12
|
readContractQueryOptions,
|
|
13
13
|
structuralSharing,
|
|
14
14
|
} from '@wagmi/core/query'
|
|
15
|
-
import {
|
|
16
|
-
type Abi,
|
|
17
|
-
type ContractFunctionArgs,
|
|
18
|
-
type ContractFunctionName,
|
|
19
|
-
} from 'viem'
|
|
20
|
-
|
|
15
|
+
import type { Abi, ContractFunctionArgs, ContractFunctionName } from 'viem'
|
|
21
16
|
import { computed } from 'vue'
|
|
17
|
+
|
|
22
18
|
import type { ConfigParameter, QueryParameter } from '../types/properties.js'
|
|
23
19
|
import type { DeepMaybeRef } from '../types/ref.js'
|
|
24
20
|
import { deepUnref } from '../utils/cloneDeep.js'
|
|
@@ -82,9 +78,7 @@ export function useReadContract<
|
|
|
82
78
|
selectData
|
|
83
79
|
> = {} as any,
|
|
84
80
|
): UseReadContractReturnType<abi, functionName, args, selectData> {
|
|
85
|
-
const parameters = computed(() =>
|
|
86
|
-
deepUnref(parameters_),
|
|
87
|
-
) as UseReadContractParameters
|
|
81
|
+
const parameters = computed(() => deepUnref(parameters_)) as any
|
|
88
82
|
|
|
89
83
|
const config = useConfig(parameters)
|
|
90
84
|
const configChainId = useChainId({ config })
|
|
@@ -96,10 +90,10 @@ export function useReadContract<
|
|
|
96
90
|
chainId = configChainId.value,
|
|
97
91
|
functionName,
|
|
98
92
|
query = {},
|
|
99
|
-
} = parameters.value
|
|
93
|
+
} = parameters.value
|
|
100
94
|
const options = readContractQueryOptions<config, abi, functionName, args>(
|
|
101
|
-
config as
|
|
102
|
-
{ ...
|
|
95
|
+
config as any,
|
|
96
|
+
{ ...parameters.value, chainId },
|
|
103
97
|
)
|
|
104
98
|
const enabled = Boolean(
|
|
105
99
|
address && abi && functionName && (query.enabled ?? true),
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/vue-query'
|
|
2
|
-
import {
|
|
2
|
+
import type { Connector, ReconnectErrorType } from '@wagmi/core'
|
|
3
3
|
import type { Evaluate } from '@wagmi/core/internal'
|
|
4
4
|
import {
|
|
5
5
|
type ReconnectData,
|
|
@@ -13,10 +13,7 @@ import {
|
|
|
13
13
|
import type { Abi, ContractFunctionArgs, ContractFunctionName } from 'viem'
|
|
14
14
|
import { type MaybeRef, computed } from 'vue'
|
|
15
15
|
|
|
16
|
-
import {
|
|
17
|
-
type ConfigParameter,
|
|
18
|
-
type QueryParameter,
|
|
19
|
-
} from '../types/properties.js'
|
|
16
|
+
import type { ConfigParameter, QueryParameter } from '../types/properties.js'
|
|
20
17
|
import type { DeepMaybeRef } from '../types/ref.js'
|
|
21
18
|
import { deepUnref } from '../utils/cloneDeep.js'
|
|
22
19
|
import { type UseQueryReturnType, useQuery } from '../utils/query.js'
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { useMutation } from '@tanstack/vue-query'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
2
|
+
import type {
|
|
3
|
+
Config,
|
|
4
|
+
ResolvedRegister,
|
|
5
|
+
SwitchChainErrorType,
|
|
6
6
|
} from '@wagmi/core'
|
|
7
|
-
import {
|
|
7
|
+
import type { Evaluate } from '@wagmi/core/internal'
|
|
8
8
|
import {
|
|
9
9
|
type SwitchChainData,
|
|
10
10
|
type SwitchChainMutate,
|
|
@@ -14,10 +14,10 @@ import {
|
|
|
14
14
|
} from '@wagmi/core/query'
|
|
15
15
|
import type { Ref } from 'vue'
|
|
16
16
|
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
|
|
20
|
-
|
|
17
|
+
import type { ConfigParameter } from '../types/properties.js'
|
|
18
|
+
import type {
|
|
19
|
+
UseMutationParameters,
|
|
20
|
+
UseMutationReturnType,
|
|
21
21
|
} from '../utils/query.js'
|
|
22
22
|
import { useChains } from './useChains.js'
|
|
23
23
|
import { useConfig } from './useConfig.js'
|
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
GetTransactionErrorType,
|
|
4
4
|
ResolvedRegister,
|
|
5
5
|
} from '@wagmi/core'
|
|
6
|
-
import {
|
|
6
|
+
import type { Evaluate } from '@wagmi/core/internal'
|
|
7
7
|
import {
|
|
8
8
|
type GetTransactionData,
|
|
9
9
|
type GetTransactionOptions,
|
|
@@ -22,7 +22,8 @@ import { useConfig } from './useConfig.js'
|
|
|
22
22
|
|
|
23
23
|
export type UseTransactionParameters<
|
|
24
24
|
config extends Config = Config,
|
|
25
|
-
chainId extends
|
|
25
|
+
chainId extends
|
|
26
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
26
27
|
selectData = GetTransactionData<config, chainId>,
|
|
27
28
|
> = Evaluate<
|
|
28
29
|
DeepMaybeRef<
|
|
@@ -39,14 +40,16 @@ export type UseTransactionParameters<
|
|
|
39
40
|
|
|
40
41
|
export type UseTransactionReturnType<
|
|
41
42
|
config extends Config = Config,
|
|
42
|
-
chainId extends
|
|
43
|
+
chainId extends
|
|
44
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
43
45
|
selectData = GetTransactionData<config, chainId>,
|
|
44
46
|
> = UseQueryReturnType<selectData, GetTransactionErrorType>
|
|
45
47
|
|
|
46
48
|
/** https://wagmi.sh/vue/api/composables/useTransaction */
|
|
47
49
|
export function useTransaction<
|
|
48
50
|
config extends Config = ResolvedRegister['config'],
|
|
49
|
-
chainId extends
|
|
51
|
+
chainId extends
|
|
52
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
50
53
|
selectData = GetTransactionData<config, chainId>,
|
|
51
54
|
>(
|
|
52
55
|
parameters_: UseTransactionParameters<config, chainId, selectData> = {},
|
|
@@ -1,22 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type {
|
|
2
|
+
Config,
|
|
3
|
+
GetTransactionReceiptErrorType,
|
|
4
|
+
ResolvedRegister,
|
|
5
5
|
} from '@wagmi/core'
|
|
6
|
-
import {
|
|
6
|
+
import type { Evaluate } from '@wagmi/core/internal'
|
|
7
7
|
import {
|
|
8
8
|
type GetTransactionReceiptData,
|
|
9
9
|
type GetTransactionReceiptOptions,
|
|
10
10
|
type GetTransactionReceiptQueryKey,
|
|
11
11
|
getTransactionReceiptQueryOptions,
|
|
12
12
|
} from '@wagmi/core/query'
|
|
13
|
-
import {
|
|
13
|
+
import type { GetTransactionReceiptQueryFnData } from '@wagmi/core/query'
|
|
14
14
|
|
|
15
15
|
import { computed } from 'vue'
|
|
16
|
-
import {
|
|
17
|
-
type ConfigParameter,
|
|
18
|
-
type QueryParameter,
|
|
19
|
-
} from '../types/properties.js'
|
|
16
|
+
import type { ConfigParameter, QueryParameter } from '../types/properties.js'
|
|
20
17
|
import type { DeepMaybeRef } from '../types/ref.js'
|
|
21
18
|
import { deepUnref } from '../utils/cloneDeep.js'
|
|
22
19
|
import { type UseQueryReturnType, useQuery } from '../utils/query.js'
|
|
@@ -25,7 +22,8 @@ import { useConfig } from './useConfig.js'
|
|
|
25
22
|
|
|
26
23
|
export type UseTransactionReceiptParameters<
|
|
27
24
|
config extends Config = Config,
|
|
28
|
-
chainId extends
|
|
25
|
+
chainId extends
|
|
26
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
29
27
|
selectData = GetTransactionReceiptData<config, chainId>,
|
|
30
28
|
> = Evaluate<
|
|
31
29
|
DeepMaybeRef<
|
|
@@ -42,14 +40,16 @@ export type UseTransactionReceiptParameters<
|
|
|
42
40
|
|
|
43
41
|
export type UseTransactionReceiptReturnType<
|
|
44
42
|
config extends Config = Config,
|
|
45
|
-
chainId extends
|
|
43
|
+
chainId extends
|
|
44
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
46
45
|
selectData = GetTransactionReceiptData<config, chainId>,
|
|
47
46
|
> = UseQueryReturnType<selectData, GetTransactionReceiptErrorType>
|
|
48
47
|
|
|
49
48
|
/** https://wagmi.sh/vue/api/composables/useTransactionReceipt */
|
|
50
49
|
export function useTransactionReceipt<
|
|
51
50
|
config extends Config = ResolvedRegister['config'],
|
|
52
|
-
chainId extends
|
|
51
|
+
chainId extends
|
|
52
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
53
53
|
selectData = GetTransactionReceiptData<config, chainId>,
|
|
54
54
|
>(
|
|
55
55
|
parameters_: UseTransactionReceiptParameters<
|
|
@@ -3,7 +3,7 @@ import type {
|
|
|
3
3
|
ResolvedRegister,
|
|
4
4
|
WaitForTransactionReceiptErrorType,
|
|
5
5
|
} from '@wagmi/core'
|
|
6
|
-
import {
|
|
6
|
+
import type { Evaluate } from '@wagmi/core/internal'
|
|
7
7
|
import {
|
|
8
8
|
type WaitForTransactionReceiptData,
|
|
9
9
|
type WaitForTransactionReceiptOptions,
|
|
@@ -22,7 +22,8 @@ import { useConfig } from './useConfig.js'
|
|
|
22
22
|
|
|
23
23
|
export type UseWaitForTransactionReceiptParameters<
|
|
24
24
|
config extends Config = Config,
|
|
25
|
-
chainId extends
|
|
25
|
+
chainId extends
|
|
26
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
26
27
|
selectData = WaitForTransactionReceiptData<config, chainId>,
|
|
27
28
|
> = Evaluate<
|
|
28
29
|
DeepMaybeRef<
|
|
@@ -39,14 +40,16 @@ export type UseWaitForTransactionReceiptParameters<
|
|
|
39
40
|
|
|
40
41
|
export type UseWaitForTransactionReceiptReturnType<
|
|
41
42
|
config extends Config = Config,
|
|
42
|
-
chainId extends
|
|
43
|
+
chainId extends
|
|
44
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
43
45
|
selectData = WaitForTransactionReceiptData<config, chainId>,
|
|
44
46
|
> = UseQueryReturnType<selectData, WaitForTransactionReceiptErrorType>
|
|
45
47
|
|
|
46
48
|
/** https://wagmi.sh/vue/api/composables/useWaitForTransactionReceipt */
|
|
47
49
|
export function useWaitForTransactionReceipt<
|
|
48
50
|
config extends Config = ResolvedRegister['config'],
|
|
49
|
-
chainId extends
|
|
51
|
+
chainId extends
|
|
52
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
50
53
|
selectData = WaitForTransactionReceiptData<config, chainId>,
|
|
51
54
|
>(
|
|
52
55
|
parameters_: UseWaitForTransactionReceiptParameters<
|
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
type WatchBlockNumberParameters,
|
|
5
5
|
watchBlockNumber,
|
|
6
6
|
} from '@wagmi/core'
|
|
7
|
-
import {
|
|
7
|
+
import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal'
|
|
8
8
|
import { computed, watchEffect } from 'vue'
|
|
9
9
|
|
|
10
10
|
import type { ConfigParameter, EnabledParameter } from '../types/properties.js'
|
|
@@ -15,7 +15,8 @@ import { useConfig } from './useConfig.js'
|
|
|
15
15
|
|
|
16
16
|
export type UseWatchBlockNumberParameters<
|
|
17
17
|
config extends Config = Config,
|
|
18
|
-
chainId extends
|
|
18
|
+
chainId extends
|
|
19
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
19
20
|
> = DeepMaybeRef<
|
|
20
21
|
UnionEvaluate<
|
|
21
22
|
UnionPartial<WatchBlockNumberParameters<config, chainId>> &
|
|
@@ -29,7 +30,8 @@ export type UseWatchBlockNumberReturnType = void
|
|
|
29
30
|
/** https://wagmi.sh/vue/api/composables/useWatchBlockNumber */
|
|
30
31
|
export function useWatchBlockNumber<
|
|
31
32
|
config extends Config = ResolvedRegister['config'],
|
|
32
|
-
chainId extends
|
|
33
|
+
chainId extends
|
|
34
|
+
config['chains'][number]['id'] = config['chains'][number]['id'],
|
|
33
35
|
>(
|
|
34
36
|
parameters_: UseWatchBlockNumberParameters<config, chainId> = {} as any,
|
|
35
37
|
): UseWatchBlockNumberReturnType {
|
package/src/exports/actions.ts
CHANGED
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
// @wagmi/core/actions
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
4
|
|
|
5
|
+
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
6
|
+
// biome-ignore lint/performance/noReExportAll: entrypoint module
|
|
5
7
|
export * from '@wagmi/core/actions'
|
package/src/exports/chains.ts
CHANGED
|
@@ -2,4 +2,6 @@
|
|
|
2
2
|
// @wagmi/connectors
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
4
|
|
|
5
|
+
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
6
|
+
// biome-ignore lint/performance/noReExportAll: entrypoint module
|
|
5
7
|
export * from '@wagmi/connectors'
|
package/src/exports/index.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
// Plugin
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
4
|
|
|
5
|
+
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
5
6
|
export { configKey, type WagmiPluginOptions, WagmiPlugin } from '../plugin.js'
|
|
6
7
|
|
|
7
8
|
////////////////////////////////////////////////////////////////////////////////
|
package/src/exports/query.ts
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
// @wagmi/core/query
|
|
3
3
|
////////////////////////////////////////////////////////////////////////////////
|
|
4
4
|
|
|
5
|
+
// biome-ignore lint/performance/noBarrelFile: entrypoint module
|
|
6
|
+
// biome-ignore lint/performance/noReExportAll: entrypoint module
|
|
5
7
|
export * from '@wagmi/core/query'
|
|
6
8
|
|
|
7
9
|
export {
|
package/src/nuxt/module.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { NuxtModule } from '@nuxt/schema'
|
|
2
2
|
import { addImports, createResolver, defineNuxtModule } from 'nuxt/kit'
|
|
3
3
|
|
|
4
|
+
// biome-ignore lint/complexity/noBannedTypes:
|
|
4
5
|
export type WagmiModuleOptions = {}
|
|
5
6
|
|
|
6
7
|
export const wagmiModule: NuxtModule<WagmiModuleOptions> =
|
package/src/types/ref.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type { MaybeRef, Ref, UnwrapRef } from 'vue'
|
|
|
6
6
|
type Primitive = string | number | boolean | bigint | symbol | undefined | null
|
|
7
7
|
type UnwrapLeaf =
|
|
8
8
|
| Primitive
|
|
9
|
+
// biome-ignore lint/complexity/noBannedTypes: we need to support all types
|
|
9
10
|
| Function
|
|
10
11
|
| Date
|
|
11
12
|
| Error
|
|
@@ -16,21 +17,23 @@ type UnwrapLeaf =
|
|
|
16
17
|
| WeakSet<any>
|
|
17
18
|
|
|
18
19
|
export type DeepMaybeRef<value> = MaybeRef<
|
|
20
|
+
// biome-ignore lint/complexity/noBannedTypes:
|
|
19
21
|
value extends Function | Config | Connector
|
|
20
22
|
? value
|
|
21
23
|
: value extends object | any[]
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
? {
|
|
25
|
+
[key in keyof value]: DeepMaybeRef<value[key]>
|
|
26
|
+
}
|
|
27
|
+
: value
|
|
26
28
|
>
|
|
27
29
|
|
|
28
30
|
export type DeepUnwrapRef<T> = T extends UnwrapLeaf
|
|
29
31
|
? T
|
|
30
32
|
: T extends Ref<infer U>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
? DeepUnwrapRef<U>
|
|
34
|
+
: // biome-ignore lint/complexity/noBannedTypes:
|
|
35
|
+
T extends {}
|
|
36
|
+
? {
|
|
37
|
+
[Property in keyof T]: DeepUnwrapRef<T[Property]>
|
|
38
|
+
}
|
|
39
|
+
: UnwrapRef<T>
|
package/src/utils/cloneDeep.ts
CHANGED
|
@@ -36,6 +36,7 @@ export function deepUnref<value>(value: value): DeepUnwrapRef<value> {
|
|
|
36
36
|
})
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
// biome-ignore lint/complexity/noBannedTypes:
|
|
39
40
|
function isPlainObject(value: unknown): value is Object {
|
|
40
41
|
if (Object.prototype.toString.call(value) !== '[object Object]') return false
|
|
41
42
|
const prototype = Object.getPrototypeOf(value)
|
package/src/utils/query.ts
CHANGED
|
@@ -2,17 +2,17 @@ import {
|
|
|
2
2
|
type DefaultError,
|
|
3
3
|
type MutationObserverOptions,
|
|
4
4
|
type QueryKey,
|
|
5
|
-
type UseMutationReturnType as tanstack_UseMutationReturnType,
|
|
6
5
|
type UseQueryOptions,
|
|
6
|
+
type UseMutationReturnType as tanstack_UseMutationReturnType,
|
|
7
7
|
type UseQueryReturnType as tanstack_UseQueryReturnType,
|
|
8
|
-
useMutation,
|
|
9
8
|
useQuery as tanstack_useQuery,
|
|
9
|
+
useMutation,
|
|
10
10
|
} from '@tanstack/vue-query'
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
import type {
|
|
12
|
+
Evaluate,
|
|
13
|
+
ExactPartial,
|
|
14
|
+
Omit,
|
|
15
|
+
UnionOmit,
|
|
16
16
|
} from '@wagmi/core/internal'
|
|
17
17
|
import { hashFn } from '@wagmi/core/query'
|
|
18
18
|
import { type MaybeRef, computed, unref } from 'vue'
|
package/src/utils/updateState.ts
CHANGED
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.0.
|
|
1
|
+
export const version = '0.0.11'
|