wagmi 2.10.10 → 2.11.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.
Files changed (178) hide show
  1. package/dist/esm/exports/index.js +1 -0
  2. package/dist/esm/exports/index.js.map +1 -1
  3. package/dist/esm/hooks/useBlock.js.map +1 -1
  4. package/dist/esm/hooks/useBlockNumber.js.map +1 -1
  5. package/dist/esm/hooks/useWatchAsset.js +20 -0
  6. package/dist/esm/hooks/useWatchAsset.js.map +1 -0
  7. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  8. package/dist/esm/version.js +1 -1
  9. package/dist/esm/version.js.map +1 -1
  10. package/dist/types/experimental/hooks/useCallsStatus.d.ts +2 -2
  11. package/dist/types/experimental/hooks/useCallsStatus.d.ts.map +1 -1
  12. package/dist/types/experimental/hooks/useCapabilities.d.ts +2 -2
  13. package/dist/types/experimental/hooks/useCapabilities.d.ts.map +1 -1
  14. package/dist/types/experimental/hooks/useSendCalls.d.ts +3 -3
  15. package/dist/types/experimental/hooks/useSendCalls.d.ts.map +1 -1
  16. package/dist/types/experimental/hooks/useShowCallsStatus.d.ts +3 -3
  17. package/dist/types/experimental/hooks/useShowCallsStatus.d.ts.map +1 -1
  18. package/dist/types/experimental/hooks/useWriteContracts.d.ts +3 -3
  19. package/dist/types/experimental/hooks/useWriteContracts.d.ts.map +1 -1
  20. package/dist/types/exports/index.d.ts +1 -0
  21. package/dist/types/exports/index.d.ts.map +1 -1
  22. package/dist/types/hooks/codegen/createUseReadContract.d.ts +2 -2
  23. package/dist/types/hooks/codegen/createUseReadContract.d.ts.map +1 -1
  24. package/dist/types/hooks/codegen/createUseSimulateContract.d.ts +2 -2
  25. package/dist/types/hooks/codegen/createUseSimulateContract.d.ts.map +1 -1
  26. package/dist/types/hooks/codegen/createUseWatchContractEvent.d.ts +2 -2
  27. package/dist/types/hooks/codegen/createUseWatchContractEvent.d.ts.map +1 -1
  28. package/dist/types/hooks/codegen/createUseWriteContract.d.ts +5 -5
  29. package/dist/types/hooks/codegen/createUseWriteContract.d.ts.map +1 -1
  30. package/dist/types/hooks/useAccountEffect.d.ts +3 -3
  31. package/dist/types/hooks/useAccountEffect.d.ts.map +1 -1
  32. package/dist/types/hooks/useBalance.d.ts +2 -2
  33. package/dist/types/hooks/useBalance.d.ts.map +1 -1
  34. package/dist/types/hooks/useBlock.d.ts +3 -3
  35. package/dist/types/hooks/useBlock.d.ts.map +1 -1
  36. package/dist/types/hooks/useBlockNumber.d.ts +3 -3
  37. package/dist/types/hooks/useBlockNumber.d.ts.map +1 -1
  38. package/dist/types/hooks/useBlockTransactionCount.d.ts +2 -2
  39. package/dist/types/hooks/useBlockTransactionCount.d.ts.map +1 -1
  40. package/dist/types/hooks/useBytecode.d.ts +2 -2
  41. package/dist/types/hooks/useBytecode.d.ts.map +1 -1
  42. package/dist/types/hooks/useCall.d.ts +2 -2
  43. package/dist/types/hooks/useCall.d.ts.map +1 -1
  44. package/dist/types/hooks/useClient.d.ts +2 -2
  45. package/dist/types/hooks/useClient.d.ts.map +1 -1
  46. package/dist/types/hooks/useConnect.d.ts +4 -4
  47. package/dist/types/hooks/useConnect.d.ts.map +1 -1
  48. package/dist/types/hooks/useConnectorClient.d.ts +3 -3
  49. package/dist/types/hooks/useConnectorClient.d.ts.map +1 -1
  50. package/dist/types/hooks/useDeployContract.d.ts +2 -2
  51. package/dist/types/hooks/useDeployContract.d.ts.map +1 -1
  52. package/dist/types/hooks/useDisconnect.d.ts +3 -3
  53. package/dist/types/hooks/useDisconnect.d.ts.map +1 -1
  54. package/dist/types/hooks/useEnsAddress.d.ts +2 -2
  55. package/dist/types/hooks/useEnsAddress.d.ts.map +1 -1
  56. package/dist/types/hooks/useEnsAvatar.d.ts +2 -2
  57. package/dist/types/hooks/useEnsAvatar.d.ts.map +1 -1
  58. package/dist/types/hooks/useEnsName.d.ts +2 -2
  59. package/dist/types/hooks/useEnsName.d.ts.map +1 -1
  60. package/dist/types/hooks/useEnsResolver.d.ts +2 -2
  61. package/dist/types/hooks/useEnsResolver.d.ts.map +1 -1
  62. package/dist/types/hooks/useEnsText.d.ts +2 -2
  63. package/dist/types/hooks/useEnsText.d.ts.map +1 -1
  64. package/dist/types/hooks/useEstimateFeesPerGas.d.ts +2 -2
  65. package/dist/types/hooks/useEstimateFeesPerGas.d.ts.map +1 -1
  66. package/dist/types/hooks/useEstimateMaxPriorityFeePerGas.d.ts +2 -2
  67. package/dist/types/hooks/useEstimateMaxPriorityFeePerGas.d.ts.map +1 -1
  68. package/dist/types/hooks/useFeeHistory.d.ts +2 -2
  69. package/dist/types/hooks/useFeeHistory.d.ts.map +1 -1
  70. package/dist/types/hooks/useGasPrice.d.ts +2 -2
  71. package/dist/types/hooks/useGasPrice.d.ts.map +1 -1
  72. package/dist/types/hooks/useProof.d.ts +2 -2
  73. package/dist/types/hooks/useProof.d.ts.map +1 -1
  74. package/dist/types/hooks/usePublicClient.d.ts +2 -2
  75. package/dist/types/hooks/usePublicClient.d.ts.map +1 -1
  76. package/dist/types/hooks/useReadContract.d.ts +2 -2
  77. package/dist/types/hooks/useReadContract.d.ts.map +1 -1
  78. package/dist/types/hooks/useReadContracts.d.ts +2 -2
  79. package/dist/types/hooks/useReadContracts.d.ts.map +1 -1
  80. package/dist/types/hooks/useReconnect.d.ts +3 -3
  81. package/dist/types/hooks/useReconnect.d.ts.map +1 -1
  82. package/dist/types/hooks/useSendTransaction.d.ts +3 -3
  83. package/dist/types/hooks/useSendTransaction.d.ts.map +1 -1
  84. package/dist/types/hooks/useSignMessage.d.ts +3 -3
  85. package/dist/types/hooks/useSignMessage.d.ts.map +1 -1
  86. package/dist/types/hooks/useSignTypedData.d.ts +3 -3
  87. package/dist/types/hooks/useSignTypedData.d.ts.map +1 -1
  88. package/dist/types/hooks/useStorageAt.d.ts +2 -2
  89. package/dist/types/hooks/useStorageAt.d.ts.map +1 -1
  90. package/dist/types/hooks/useSwitchAccount.d.ts +3 -3
  91. package/dist/types/hooks/useSwitchAccount.d.ts.map +1 -1
  92. package/dist/types/hooks/useSwitchChain.d.ts +3 -3
  93. package/dist/types/hooks/useSwitchChain.d.ts.map +1 -1
  94. package/dist/types/hooks/useToken.d.ts +2 -2
  95. package/dist/types/hooks/useToken.d.ts.map +1 -1
  96. package/dist/types/hooks/useTransaction.d.ts +2 -2
  97. package/dist/types/hooks/useTransaction.d.ts.map +1 -1
  98. package/dist/types/hooks/useTransactionCount.d.ts +2 -2
  99. package/dist/types/hooks/useTransactionCount.d.ts.map +1 -1
  100. package/dist/types/hooks/useTransactionReceipt.d.ts +2 -2
  101. package/dist/types/hooks/useTransactionReceipt.d.ts.map +1 -1
  102. package/dist/types/hooks/useVerifyMessage.d.ts +2 -2
  103. package/dist/types/hooks/useVerifyMessage.d.ts.map +1 -1
  104. package/dist/types/hooks/useWaitForTransactionReceipt.d.ts +2 -2
  105. package/dist/types/hooks/useWaitForTransactionReceipt.d.ts.map +1 -1
  106. package/dist/types/hooks/useWalletClient.d.ts +3 -3
  107. package/dist/types/hooks/useWalletClient.d.ts.map +1 -1
  108. package/dist/types/hooks/useWatchAsset.d.ts +15 -0
  109. package/dist/types/hooks/useWatchAsset.d.ts.map +1 -0
  110. package/dist/types/hooks/useWatchBlockNumber.d.ts +2 -2
  111. package/dist/types/hooks/useWatchBlockNumber.d.ts.map +1 -1
  112. package/dist/types/hooks/useWatchBlocks.d.ts +2 -2
  113. package/dist/types/hooks/useWatchBlocks.d.ts.map +1 -1
  114. package/dist/types/hooks/useWatchContractEvent.d.ts +2 -2
  115. package/dist/types/hooks/useWatchContractEvent.d.ts.map +1 -1
  116. package/dist/types/hooks/useWatchPendingTransactions.d.ts +2 -2
  117. package/dist/types/hooks/useWatchPendingTransactions.d.ts.map +1 -1
  118. package/dist/types/utils/query.d.ts +6 -6
  119. package/dist/types/utils/query.d.ts.map +1 -1
  120. package/dist/types/version.d.ts +1 -1
  121. package/dist/types/version.d.ts.map +1 -1
  122. package/package.json +3 -3
  123. package/src/experimental/hooks/useCallsStatus.ts +2 -2
  124. package/src/experimental/hooks/useCapabilities.ts +2 -2
  125. package/src/experimental/hooks/useSendCalls.ts +3 -3
  126. package/src/experimental/hooks/useShowCallsStatus.ts +3 -3
  127. package/src/experimental/hooks/useWriteContracts.ts +3 -3
  128. package/src/exports/index.ts +6 -0
  129. package/src/hooks/codegen/createUseReadContract.ts +6 -6
  130. package/src/hooks/codegen/createUseSimulateContract.ts +2 -2
  131. package/src/hooks/codegen/createUseWatchContractEvent.ts +6 -6
  132. package/src/hooks/codegen/createUseWriteContract.ts +7 -7
  133. package/src/hooks/useAccountEffect.ts +3 -3
  134. package/src/hooks/useBalance.ts +2 -2
  135. package/src/hooks/useBlock.ts +8 -4
  136. package/src/hooks/useBlockNumber.ts +8 -4
  137. package/src/hooks/useBlockTransactionCount.ts +2 -2
  138. package/src/hooks/useBytecode.ts +2 -2
  139. package/src/hooks/useCall.ts +2 -2
  140. package/src/hooks/useClient.ts +2 -2
  141. package/src/hooks/useConnect.ts +4 -4
  142. package/src/hooks/useConnectorClient.ts +3 -3
  143. package/src/hooks/useDeployContract.ts +2 -2
  144. package/src/hooks/useDisconnect.ts +3 -3
  145. package/src/hooks/useEnsAddress.ts +2 -2
  146. package/src/hooks/useEnsAvatar.ts +2 -2
  147. package/src/hooks/useEnsName.ts +2 -2
  148. package/src/hooks/useEnsResolver.ts +2 -2
  149. package/src/hooks/useEnsText.ts +2 -2
  150. package/src/hooks/useEstimateFeesPerGas.ts +2 -2
  151. package/src/hooks/useEstimateMaxPriorityFeePerGas.ts +2 -2
  152. package/src/hooks/useFeeHistory.ts +2 -2
  153. package/src/hooks/useGasPrice.ts +2 -2
  154. package/src/hooks/useProof.ts +2 -2
  155. package/src/hooks/usePublicClient.ts +2 -2
  156. package/src/hooks/useReadContract.ts +2 -2
  157. package/src/hooks/useReadContracts.ts +2 -2
  158. package/src/hooks/useReconnect.ts +3 -3
  159. package/src/hooks/useSendTransaction.ts +3 -3
  160. package/src/hooks/useSignMessage.ts +3 -3
  161. package/src/hooks/useSignTypedData.ts +3 -3
  162. package/src/hooks/useStorageAt.ts +2 -2
  163. package/src/hooks/useSwitchAccount.ts +3 -3
  164. package/src/hooks/useSwitchChain.ts +3 -3
  165. package/src/hooks/useToken.ts +2 -2
  166. package/src/hooks/useTransaction.ts +2 -2
  167. package/src/hooks/useTransactionCount.ts +2 -2
  168. package/src/hooks/useTransactionReceipt.ts +2 -2
  169. package/src/hooks/useVerifyMessage.ts +2 -2
  170. package/src/hooks/useWaitForTransactionReceipt.ts +2 -2
  171. package/src/hooks/useWalletClient.ts +3 -3
  172. package/src/hooks/useWatchAsset.ts +65 -0
  173. package/src/hooks/useWatchBlockNumber.ts +3 -3
  174. package/src/hooks/useWatchBlocks.ts +3 -3
  175. package/src/hooks/useWatchContractEvent.ts +3 -3
  176. package/src/hooks/useWatchPendingTransactions.ts +3 -3
  177. package/src/utils/query.ts +9 -9
  178. package/src/version.ts +1 -1
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { useMutation } from '@tanstack/react-query'
4
4
  import type { Connector, ReconnectErrorType } from '@wagmi/core'
5
- import type { Evaluate } from '@wagmi/core/internal'
5
+ import type { Compute } from '@wagmi/core/internal'
6
6
  import {
7
7
  type ReconnectData,
8
8
  type ReconnectMutate,
@@ -18,7 +18,7 @@ import type {
18
18
  } from '../utils/query.js'
19
19
  import { useConfig } from './useConfig.js'
20
20
 
21
- export type UseReconnectParameters<context = unknown> = Evaluate<
21
+ export type UseReconnectParameters<context = unknown> = Compute<
22
22
  ConfigParameter & {
23
23
  mutation?:
24
24
  | UseMutationParameters<
@@ -31,7 +31,7 @@ export type UseReconnectParameters<context = unknown> = Evaluate<
31
31
  }
32
32
  >
33
33
 
34
- export type UseReconnectReturnType<context = unknown> = Evaluate<
34
+ export type UseReconnectReturnType<context = unknown> = Compute<
35
35
  UseMutationReturnType<
36
36
  ReconnectData,
37
37
  ReconnectErrorType,
@@ -6,7 +6,7 @@ import type {
6
6
  ResolvedRegister,
7
7
  SendTransactionErrorType,
8
8
  } from '@wagmi/core'
9
- import type { Evaluate } from '@wagmi/core/internal'
9
+ import type { Compute } from '@wagmi/core/internal'
10
10
  import {
11
11
  type SendTransactionData,
12
12
  type SendTransactionMutate,
@@ -25,7 +25,7 @@ import { useConfig } from './useConfig.js'
25
25
  export type UseSendTransactionParameters<
26
26
  config extends Config = Config,
27
27
  context = unknown,
28
- > = Evaluate<
28
+ > = Compute<
29
29
  ConfigParameter<config> & {
30
30
  mutation?:
31
31
  | UseMutationParameters<
@@ -41,7 +41,7 @@ export type UseSendTransactionParameters<
41
41
  export type UseSendTransactionReturnType<
42
42
  config extends Config = Config,
43
43
  context = unknown,
44
- > = Evaluate<
44
+ > = Compute<
45
45
  UseMutationReturnType<
46
46
  SendTransactionData,
47
47
  SendTransactionErrorType,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { useMutation } from '@tanstack/react-query'
4
4
  import type { SignMessageErrorType } from '@wagmi/core'
5
- import type { Evaluate } from '@wagmi/core/internal'
5
+ import type { Compute } from '@wagmi/core/internal'
6
6
  import {
7
7
  type SignMessageData,
8
8
  type SignMessageMutate,
@@ -18,7 +18,7 @@ import type {
18
18
  } from '../utils/query.js'
19
19
  import { useConfig } from './useConfig.js'
20
20
 
21
- export type UseSignMessageParameters<context = unknown> = Evaluate<
21
+ export type UseSignMessageParameters<context = unknown> = Compute<
22
22
  ConfigParameter & {
23
23
  mutation?:
24
24
  | UseMutationParameters<
@@ -31,7 +31,7 @@ export type UseSignMessageParameters<context = unknown> = Evaluate<
31
31
  }
32
32
  >
33
33
 
34
- export type UseSignMessageReturnType<context = unknown> = Evaluate<
34
+ export type UseSignMessageReturnType<context = unknown> = Compute<
35
35
  UseMutationReturnType<
36
36
  SignMessageData,
37
37
  SignMessageErrorType,
@@ -2,7 +2,7 @@
2
2
 
3
3
  import { useMutation } from '@tanstack/react-query'
4
4
  import type { SignTypedDataErrorType } from '@wagmi/core'
5
- import type { Evaluate } from '@wagmi/core/internal'
5
+ import type { Compute } from '@wagmi/core/internal'
6
6
  import {
7
7
  type SignTypedDataData,
8
8
  type SignTypedDataMutate,
@@ -18,7 +18,7 @@ import type {
18
18
  } from '../utils/query.js'
19
19
  import { useConfig } from './useConfig.js'
20
20
 
21
- export type UseSignTypedDataParameters<context = unknown> = Evaluate<
21
+ export type UseSignTypedDataParameters<context = unknown> = Compute<
22
22
  ConfigParameter & {
23
23
  mutation?:
24
24
  | UseMutationParameters<
@@ -31,7 +31,7 @@ export type UseSignTypedDataParameters<context = unknown> = Evaluate<
31
31
  }
32
32
  >
33
33
 
34
- export type UseSignTypedDataReturnType<context = unknown> = Evaluate<
34
+ export type UseSignTypedDataReturnType<context = unknown> = Compute<
35
35
  UseMutationReturnType<
36
36
  SignTypedDataData,
37
37
  SignTypedDataErrorType,
@@ -5,7 +5,7 @@ import type {
5
5
  GetStorageAtErrorType,
6
6
  ResolvedRegister,
7
7
  } from '@wagmi/core'
8
- import type { Evaluate } from '@wagmi/core/internal'
8
+ import type { Compute } from '@wagmi/core/internal'
9
9
  import {
10
10
  type GetStorageAtData,
11
11
  type GetStorageAtOptions,
@@ -21,7 +21,7 @@ import { useConfig } from './useConfig.js'
21
21
  export type UseStorageAtParameters<
22
22
  config extends Config = Config,
23
23
  selectData = GetStorageAtData,
24
- > = Evaluate<
24
+ > = Compute<
25
25
  GetStorageAtOptions<config> &
26
26
  ConfigParameter<config> &
27
27
  QueryParameter<
@@ -7,7 +7,7 @@ import type {
7
7
  ResolvedRegister,
8
8
  SwitchAccountErrorType,
9
9
  } from '@wagmi/core'
10
- import type { Evaluate } from '@wagmi/core/internal'
10
+ import type { Compute } from '@wagmi/core/internal'
11
11
  import {
12
12
  type SwitchAccountData,
13
13
  type SwitchAccountMutate,
@@ -27,7 +27,7 @@ import { useConnections } from './useConnections.js'
27
27
  export type UseSwitchAccountParameters<
28
28
  config extends Config = Config,
29
29
  context = unknown,
30
- > = Evaluate<
30
+ > = Compute<
31
31
  ConfigParameter<config> & {
32
32
  mutation?:
33
33
  | UseMutationParameters<
@@ -43,7 +43,7 @@ export type UseSwitchAccountParameters<
43
43
  export type UseSwitchAccountReturnType<
44
44
  config extends Config = Config,
45
45
  context = unknown,
46
- > = Evaluate<
46
+ > = Compute<
47
47
  UseMutationReturnType<
48
48
  SwitchAccountData<config>,
49
49
  SwitchAccountErrorType,
@@ -6,7 +6,7 @@ import type {
6
6
  ResolvedRegister,
7
7
  SwitchChainErrorType,
8
8
  } from '@wagmi/core'
9
- import type { Evaluate } from '@wagmi/core/internal'
9
+ import type { Compute } from '@wagmi/core/internal'
10
10
  import {
11
11
  type SwitchChainData,
12
12
  type SwitchChainMutate,
@@ -26,7 +26,7 @@ import { useConfig } from './useConfig.js'
26
26
  export type UseSwitchChainParameters<
27
27
  config extends Config = Config,
28
28
  context = unknown,
29
- > = Evaluate<
29
+ > = Compute<
30
30
  ConfigParameter<config> & {
31
31
  mutation?:
32
32
  | UseMutationParameters<
@@ -42,7 +42,7 @@ export type UseSwitchChainParameters<
42
42
  export type UseSwitchChainReturnType<
43
43
  config extends Config = Config,
44
44
  context = unknown,
45
- > = Evaluate<
45
+ > = Compute<
46
46
  UseMutationReturnType<
47
47
  SwitchChainData<config, config['chains'][number]['id']>,
48
48
  SwitchChainErrorType,
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
 
3
3
  import type { Config, GetTokenErrorType, ResolvedRegister } from '@wagmi/core'
4
- import type { Evaluate } from '@wagmi/core/internal'
4
+ import type { Compute } from '@wagmi/core/internal'
5
5
  import {
6
6
  type GetTokenData,
7
7
  type GetTokenOptions,
@@ -18,7 +18,7 @@ import { useConfig } from './useConfig.js'
18
18
  export type UseTokenParameters<
19
19
  config extends Config = Config,
20
20
  selectData = GetTokenData,
21
- > = Evaluate<
21
+ > = Compute<
22
22
  GetTokenOptions<config> &
23
23
  ConfigParameter<config> &
24
24
  QueryParameter<
@@ -5,7 +5,7 @@ import type {
5
5
  GetTransactionErrorType,
6
6
  ResolvedRegister,
7
7
  } from '@wagmi/core'
8
- import type { Evaluate } from '@wagmi/core/internal'
8
+ import type { Compute } from '@wagmi/core/internal'
9
9
  import {
10
10
  type GetTransactionData,
11
11
  type GetTransactionOptions,
@@ -24,7 +24,7 @@ export type UseTransactionParameters<
24
24
  chainId extends
25
25
  config['chains'][number]['id'] = config['chains'][number]['id'],
26
26
  selectData = GetTransactionData<config, chainId>,
27
- > = Evaluate<
27
+ > = Compute<
28
28
  GetTransactionOptions<config, chainId> &
29
29
  ConfigParameter<config> &
30
30
  QueryParameter<
@@ -5,7 +5,7 @@ import type {
5
5
  GetTransactionCountErrorType,
6
6
  ResolvedRegister,
7
7
  } from '@wagmi/core'
8
- import type { Evaluate } from '@wagmi/core/internal'
8
+ import type { Compute } from '@wagmi/core/internal'
9
9
  import type { GetTransactionCountQueryFnData } from '@wagmi/core/query'
10
10
  import {
11
11
  type GetTransactionCountData,
@@ -22,7 +22,7 @@ import { useConfig } from './useConfig.js'
22
22
  export type UseTransactionCountParameters<
23
23
  config extends Config = Config,
24
24
  selectData = GetTransactionCountData,
25
- > = Evaluate<
25
+ > = Compute<
26
26
  GetTransactionCountOptions<config> &
27
27
  ConfigParameter<config> &
28
28
  QueryParameter<
@@ -5,7 +5,7 @@ import type {
5
5
  GetTransactionReceiptErrorType,
6
6
  ResolvedRegister,
7
7
  } from '@wagmi/core'
8
- import type { Evaluate } from '@wagmi/core/internal'
8
+ import type { Compute } from '@wagmi/core/internal'
9
9
  import {
10
10
  type GetTransactionReceiptData,
11
11
  type GetTransactionReceiptOptions,
@@ -23,7 +23,7 @@ export type UseTransactionReceiptParameters<
23
23
  chainId extends
24
24
  config['chains'][number]['id'] = config['chains'][number]['id'],
25
25
  selectData = GetTransactionReceiptData<config, chainId>,
26
- > = Evaluate<
26
+ > = Compute<
27
27
  GetTransactionReceiptOptions<config, chainId> &
28
28
  ConfigParameter<config> &
29
29
  QueryParameter<
@@ -5,7 +5,7 @@ import type {
5
5
  ResolvedRegister,
6
6
  VerifyMessageErrorType,
7
7
  } from '@wagmi/core'
8
- import type { Evaluate } from '@wagmi/core/internal'
8
+ import type { Compute } from '@wagmi/core/internal'
9
9
  import {
10
10
  type VerifyMessageData,
11
11
  type VerifyMessageOptions,
@@ -21,7 +21,7 @@ import { useConfig } from './useConfig.js'
21
21
  export type UseVerifyMessageParameters<
22
22
  config extends Config = Config,
23
23
  selectData = VerifyMessageData,
24
- > = Evaluate<
24
+ > = Compute<
25
25
  VerifyMessageOptions<config> &
26
26
  ConfigParameter<config> &
27
27
  QueryParameter<
@@ -5,7 +5,7 @@ import type {
5
5
  ResolvedRegister,
6
6
  WaitForTransactionReceiptErrorType,
7
7
  } from '@wagmi/core'
8
- import type { Evaluate } from '@wagmi/core/internal'
8
+ import type { Compute } from '@wagmi/core/internal'
9
9
  import {
10
10
  type WaitForTransactionReceiptData,
11
11
  type WaitForTransactionReceiptOptions,
@@ -24,7 +24,7 @@ export type UseWaitForTransactionReceiptParameters<
24
24
  chainId extends
25
25
  config['chains'][number]['id'] = config['chains'][number]['id'],
26
26
  selectData = WaitForTransactionReceiptData<config, chainId>,
27
- > = Evaluate<
27
+ > = Compute<
28
28
  WaitForTransactionReceiptOptions<config, chainId> &
29
29
  ConfigParameter<config> &
30
30
  QueryParameter<
@@ -9,7 +9,7 @@ import type {
9
9
  GetWalletClientErrorType,
10
10
  ResolvedRegister,
11
11
  } from '@wagmi/core'
12
- import type { Evaluate, Omit } from '@wagmi/core/internal'
12
+ import type { Compute, Omit } from '@wagmi/core/internal'
13
13
  import {
14
14
  type GetWalletClientData,
15
15
  type GetWalletClientOptions,
@@ -34,11 +34,11 @@ export type UseWalletClientParameters<
34
34
  chainId extends
35
35
  config['chains'][number]['id'] = config['chains'][number]['id'],
36
36
  selectData = GetWalletClientData<config, chainId>,
37
- > = Evaluate<
37
+ > = Compute<
38
38
  GetWalletClientOptions<config, chainId> &
39
39
  ConfigParameter<config> & {
40
40
  query?:
41
- | Evaluate<
41
+ | Compute<
42
42
  Omit<
43
43
  UseQueryParameters<
44
44
  GetWalletClientQueryFnData<config, chainId>,
@@ -0,0 +1,65 @@
1
+ 'use client'
2
+
3
+ import { useMutation } from '@tanstack/react-query'
4
+ import type { WatchAssetErrorType } from '@wagmi/core'
5
+ import type { Compute } from '@wagmi/core/internal'
6
+ import {
7
+ type WatchAssetData,
8
+ type WatchAssetMutate,
9
+ type WatchAssetMutateAsync,
10
+ type WatchAssetVariables,
11
+ watchAssetMutationOptions,
12
+ } from '@wagmi/core/query'
13
+
14
+ import type { ConfigParameter } from '../types/properties.js'
15
+ import type {
16
+ UseMutationParameters,
17
+ UseMutationReturnType,
18
+ } from '../utils/query.js'
19
+ import { useConfig } from './useConfig.js'
20
+
21
+ export type UseWatchAssetParameters<context = unknown> = Compute<
22
+ ConfigParameter & {
23
+ mutation?:
24
+ | UseMutationParameters<
25
+ WatchAssetData,
26
+ WatchAssetErrorType,
27
+ WatchAssetVariables,
28
+ context
29
+ >
30
+ | undefined
31
+ }
32
+ >
33
+
34
+ export type UseWatchAssetReturnType<context = unknown> = Compute<
35
+ UseMutationReturnType<
36
+ WatchAssetData,
37
+ WatchAssetErrorType,
38
+ WatchAssetVariables,
39
+ context
40
+ > & {
41
+ watchAsset: WatchAssetMutate<context>
42
+ watchAssetAsync: WatchAssetMutateAsync<context>
43
+ }
44
+ >
45
+
46
+ /** https://wagmi.sh/react/api/hooks/useWatchAsset */
47
+ export function useWatchAsset<context = unknown>(
48
+ parameters: UseWatchAssetParameters<context> = {},
49
+ ): UseWatchAssetReturnType<context> {
50
+ const { mutation } = parameters
51
+
52
+ const config = useConfig(parameters)
53
+
54
+ const mutationOptions = watchAssetMutationOptions(config)
55
+ const { mutate, mutateAsync, ...result } = useMutation({
56
+ ...mutation,
57
+ ...mutationOptions,
58
+ })
59
+
60
+ return {
61
+ ...result,
62
+ watchAsset: mutate,
63
+ watchAssetAsync: mutateAsync,
64
+ }
65
+ }
@@ -6,7 +6,7 @@ import {
6
6
  type WatchBlockNumberParameters,
7
7
  watchBlockNumber,
8
8
  } from '@wagmi/core'
9
- import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal'
9
+ import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal'
10
10
  import { useEffect } from 'react'
11
11
 
12
12
  import type { ConfigParameter, EnabledParameter } from '../types/properties.js'
@@ -17,8 +17,8 @@ export type UseWatchBlockNumberParameters<
17
17
  config extends Config = Config,
18
18
  chainId extends
19
19
  config['chains'][number]['id'] = config['chains'][number]['id'],
20
- > = UnionEvaluate<
21
- UnionPartial<WatchBlockNumberParameters<config, chainId>> &
20
+ > = UnionCompute<
21
+ UnionExactPartial<WatchBlockNumberParameters<config, chainId>> &
22
22
  ConfigParameter<config> &
23
23
  EnabledParameter
24
24
  >
@@ -6,7 +6,7 @@ import {
6
6
  type WatchBlocksParameters,
7
7
  watchBlocks,
8
8
  } from '@wagmi/core'
9
- import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal'
9
+ import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal'
10
10
  import { useEffect } from 'react'
11
11
  import type { BlockTag } from 'viem'
12
12
 
@@ -20,8 +20,8 @@ export type UseWatchBlocksParameters<
20
20
  config extends Config = Config,
21
21
  chainId extends
22
22
  config['chains'][number]['id'] = config['chains'][number]['id'],
23
- > = UnionEvaluate<
24
- UnionPartial<
23
+ > = UnionCompute<
24
+ UnionExactPartial<
25
25
  WatchBlocksParameters<includeTransactions, blockTag, config, chainId>
26
26
  > &
27
27
  ConfigParameter<config> &
@@ -6,7 +6,7 @@ import {
6
6
  type WatchContractEventParameters,
7
7
  watchContractEvent,
8
8
  } from '@wagmi/core'
9
- import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal'
9
+ import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal'
10
10
  import { useEffect } from 'react'
11
11
 
12
12
  import type { Abi, ContractEventName } from 'viem'
@@ -21,8 +21,8 @@ export type UseWatchContractEventParameters<
21
21
  config extends Config = Config,
22
22
  chainId extends
23
23
  config['chains'][number]['id'] = config['chains'][number]['id'],
24
- > = UnionEvaluate<
25
- UnionPartial<
24
+ > = UnionCompute<
25
+ UnionExactPartial<
26
26
  WatchContractEventParameters<abi, eventName, strict, config, chainId>
27
27
  > &
28
28
  ConfigParameter<config> &
@@ -6,7 +6,7 @@ import {
6
6
  type WatchPendingTransactionsParameters,
7
7
  watchPendingTransactions,
8
8
  } from '@wagmi/core'
9
- import type { UnionEvaluate, UnionPartial } from '@wagmi/core/internal'
9
+ import type { UnionCompute, UnionExactPartial } from '@wagmi/core/internal'
10
10
  import { useEffect } from 'react'
11
11
 
12
12
  import type { ConfigParameter, EnabledParameter } from '../types/properties.js'
@@ -17,8 +17,8 @@ export type UseWatchPendingTransactionsParameters<
17
17
  config extends Config = Config,
18
18
  chainId extends
19
19
  config['chains'][number]['id'] = config['chains'][number]['id'],
20
- > = UnionEvaluate<
21
- UnionPartial<WatchPendingTransactionsParameters<config, chainId>> &
20
+ > = UnionCompute<
21
+ UnionExactPartial<WatchPendingTransactionsParameters<config, chainId>> &
22
22
  ConfigParameter<config> &
23
23
  EnabledParameter
24
24
  >
@@ -12,10 +12,10 @@ import {
12
12
  useMutation,
13
13
  } from '@tanstack/react-query'
14
14
  import type {
15
- Evaluate,
15
+ Compute,
16
16
  ExactPartial,
17
17
  Omit,
18
- UnionOmit,
18
+ UnionStrictOmit,
19
19
  } from '@wagmi/core/internal'
20
20
  import { hashFn } from '@wagmi/core/query'
21
21
 
@@ -24,9 +24,9 @@ export type UseMutationParameters<
24
24
  error = Error,
25
25
  variables = void,
26
26
  context = unknown,
27
- > = Evaluate<
27
+ > = Compute<
28
28
  Omit<
29
- UseMutationOptions<data, error, Evaluate<variables>, context>,
29
+ UseMutationOptions<data, error, Compute<variables>, context>,
30
30
  'mutationFn' | 'mutationKey' | 'throwOnError'
31
31
  >
32
32
  >
@@ -36,8 +36,8 @@ export type UseMutationReturnType<
36
36
  error = Error,
37
37
  variables = void,
38
38
  context = unknown,
39
- > = Evaluate<
40
- UnionOmit<
39
+ > = Compute<
40
+ UnionStrictOmit<
41
41
  UseMutationResult<data, error, variables, context>,
42
42
  'mutate' | 'mutateAsync'
43
43
  >
@@ -52,7 +52,7 @@ export type UseQueryParameters<
52
52
  error = DefaultError,
53
53
  data = queryFnData,
54
54
  queryKey extends QueryKey = QueryKey,
55
- > = Evaluate<
55
+ > = Compute<
56
56
  ExactPartial<
57
57
  Omit<UseQueryOptions<queryFnData, error, data, queryKey>, 'initialData'>
58
58
  > & {
@@ -63,7 +63,7 @@ export type UseQueryParameters<
63
63
  }
64
64
  >
65
65
 
66
- export type UseQueryReturnType<data = unknown, error = DefaultError> = Evaluate<
66
+ export type UseQueryReturnType<data = unknown, error = DefaultError> = Compute<
67
67
  UseQueryResult<data, error> & {
68
68
  queryKey: QueryKey
69
69
  }
@@ -94,7 +94,7 @@ export type UseInfiniteQueryParameters<
94
94
  queryData = queryFnData,
95
95
  queryKey extends QueryKey = QueryKey,
96
96
  pageParam = unknown,
97
- > = Evaluate<
97
+ > = Compute<
98
98
  Omit<
99
99
  UseInfiniteQueryOptions<
100
100
  queryFnData,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.10.10'
1
+ export const version = '2.11.0'