@wagmi/core 2.17.3 → 2.18.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.
Files changed (101) hide show
  1. package/dist/esm/actions/estimateFeesPerGas.js.map +1 -1
  2. package/dist/esm/actions/getBalance.js.map +1 -1
  3. package/dist/esm/actions/getClient.js +4 -4
  4. package/dist/esm/actions/getClient.js.map +1 -1
  5. package/dist/esm/actions/readContract.js.map +1 -1
  6. package/dist/esm/actions/watchBlockNumber.js.map +1 -1
  7. package/dist/esm/actions/watchBlocks.js.map +1 -1
  8. package/dist/esm/connectors/injected.js +1 -1
  9. package/dist/esm/connectors/injected.js.map +1 -1
  10. package/dist/esm/connectors/mock.js +8 -2
  11. package/dist/esm/connectors/mock.js.map +1 -1
  12. package/dist/esm/createConfig.js.map +1 -1
  13. package/dist/esm/exports/actions.js +6 -6
  14. package/dist/esm/exports/actions.js.map +1 -1
  15. package/dist/esm/exports/codegen.js +1 -1
  16. package/dist/esm/exports/codegen.js.map +1 -1
  17. package/dist/esm/exports/experimental.js +9 -9
  18. package/dist/esm/exports/experimental.js.map +1 -1
  19. package/dist/esm/exports/index.js +7 -7
  20. package/dist/esm/exports/index.js.map +1 -1
  21. package/dist/esm/exports/internal.js +1 -1
  22. package/dist/esm/exports/internal.js.map +1 -1
  23. package/dist/esm/exports/query.js +3 -3
  24. package/dist/esm/exports/query.js.map +1 -1
  25. package/dist/esm/query/connect.js.map +1 -1
  26. package/dist/esm/query/getTransactionReceipt.js.map +1 -1
  27. package/dist/esm/query/readContracts.js.map +1 -1
  28. package/dist/esm/query/utils.js +6 -2
  29. package/dist/esm/query/utils.js.map +1 -1
  30. package/dist/esm/transports/connector.js +1 -1
  31. package/dist/esm/transports/connector.js.map +1 -1
  32. package/dist/esm/tsconfig.build.tsbuildinfo +1 -1
  33. package/dist/esm/utils/cookie.js +2 -0
  34. package/dist/esm/utils/cookie.js.map +1 -1
  35. package/dist/esm/utils/deepEqual.js +2 -2
  36. package/dist/esm/utils/deepEqual.js.map +1 -1
  37. package/dist/esm/version.js +1 -1
  38. package/dist/types/actions/estimateFeesPerGas.d.ts +1 -2
  39. package/dist/types/actions/estimateFeesPerGas.d.ts.map +1 -1
  40. package/dist/types/actions/readContract.d.ts +1 -2
  41. package/dist/types/actions/readContract.d.ts.map +1 -1
  42. package/dist/types/actions/watchBlockNumber.d.ts +1 -1
  43. package/dist/types/actions/watchBlockNumber.d.ts.map +1 -1
  44. package/dist/types/actions/watchBlocks.d.ts +1 -1
  45. package/dist/types/actions/watchBlocks.d.ts.map +1 -1
  46. package/dist/types/connectors/injected.d.ts.map +1 -1
  47. package/dist/types/connectors/mock.d.ts.map +1 -1
  48. package/dist/types/createConfig.d.ts.map +1 -1
  49. package/dist/types/exports/actions.d.ts +10 -10
  50. package/dist/types/exports/actions.d.ts.map +1 -1
  51. package/dist/types/exports/codegen.d.ts +1 -1
  52. package/dist/types/exports/codegen.d.ts.map +1 -1
  53. package/dist/types/exports/experimental.d.ts +17 -17
  54. package/dist/types/exports/experimental.d.ts.map +1 -1
  55. package/dist/types/exports/index.d.ts +15 -15
  56. package/dist/types/exports/index.d.ts.map +1 -1
  57. package/dist/types/exports/internal.d.ts +2 -2
  58. package/dist/types/exports/internal.d.ts.map +1 -1
  59. package/dist/types/exports/query.d.ts +14 -14
  60. package/dist/types/exports/query.d.ts.map +1 -1
  61. package/dist/types/query/connect.d.ts +1 -1
  62. package/dist/types/query/connect.d.ts.map +1 -1
  63. package/dist/types/query/getConnectorClient.d.ts.map +1 -1
  64. package/dist/types/query/getTransactionReceipt.d.ts +1 -1
  65. package/dist/types/query/getTransactionReceipt.d.ts.map +1 -1
  66. package/dist/types/query/getWalletClient.d.ts +2 -2
  67. package/dist/types/query/infiniteReadContracts.d.ts +3 -0
  68. package/dist/types/query/infiniteReadContracts.d.ts.map +1 -1
  69. package/dist/types/query/readContracts.d.ts +4 -2
  70. package/dist/types/query/readContracts.d.ts.map +1 -1
  71. package/dist/types/query/utils.d.ts.map +1 -1
  72. package/dist/types/transports/connector.d.ts.map +1 -1
  73. package/dist/types/utils/cookie.d.ts.map +1 -1
  74. package/dist/types/utils/deepEqual.d.ts.map +1 -1
  75. package/dist/types/version.d.ts +1 -1
  76. package/package.json +1 -1
  77. package/src/actions/estimateFeesPerGas.ts +1 -2
  78. package/src/actions/getBalance.ts +1 -1
  79. package/src/actions/getClient.ts +4 -4
  80. package/src/actions/readContract.ts +1 -2
  81. package/src/actions/watchBlockNumber.ts +1 -2
  82. package/src/actions/watchBlocks.ts +1 -2
  83. package/src/actions/writeContract.ts +1 -1
  84. package/src/connectors/injected.ts +2 -2
  85. package/src/connectors/mock.ts +13 -7
  86. package/src/createConfig.ts +8 -9
  87. package/src/exports/actions.ts +27 -42
  88. package/src/exports/codegen.ts +5 -6
  89. package/src/exports/experimental.ts +16 -21
  90. package/src/exports/index.ts +44 -59
  91. package/src/exports/internal.ts +4 -4
  92. package/src/exports/query.ts +26 -37
  93. package/src/query/connect.ts +1 -2
  94. package/src/query/getTransactionReceipt.ts +1 -2
  95. package/src/query/readContracts.ts +4 -2
  96. package/src/query/utils.ts +6 -2
  97. package/src/transports/connector.ts +2 -2
  98. package/src/types/register.ts +1 -1
  99. package/src/utils/cookie.ts +2 -0
  100. package/src/utils/deepEqual.ts +2 -3
  101. package/src/version.ts +1 -1
@@ -14,25 +14,25 @@ export {
14
14
 
15
15
  export {
16
16
  type ConnectData,
17
- type ConnectVariables,
18
17
  type ConnectMutate,
19
18
  type ConnectMutateAsync,
19
+ type ConnectVariables,
20
20
  connectMutationOptions,
21
21
  } from '../query/connect.js'
22
22
 
23
23
  export {
24
24
  type DeployContractData,
25
- type DeployContractVariables,
26
25
  type DeployContractMutate,
27
26
  type DeployContractMutateAsync,
27
+ type DeployContractVariables,
28
28
  deployContractMutationOptions,
29
29
  } from '../query/deployContract.js'
30
30
 
31
31
  export {
32
32
  type DisconnectData,
33
- type DisconnectVariables,
34
33
  type DisconnectMutate,
35
34
  type DisconnectMutateAsync,
35
+ type DisconnectVariables,
36
36
  disconnectMutationOptions,
37
37
  } from '../query/disconnect.js'
38
38
 
@@ -308,60 +308,49 @@ export {
308
308
 
309
309
  export {
310
310
  type ReconnectData,
311
- type ReconnectVariables,
312
311
  type ReconnectMutate,
313
312
  type ReconnectMutateAsync,
313
+ type ReconnectVariables,
314
314
  reconnectMutationOptions,
315
315
  } from '../query/reconnect.js'
316
316
 
317
317
  export {
318
318
  type SendCallsData,
319
- type SendCallsVariables,
320
319
  type SendCallsMutate,
321
320
  type SendCallsMutateAsync,
321
+ type SendCallsVariables,
322
322
  sendCallsMutationOptions,
323
323
  } from '../query/sendCalls.js'
324
-
325
- export {
326
- type ShowCallsStatusData,
327
- type ShowCallsStatusVariables,
328
- type ShowCallsStatusMutate,
329
- type ShowCallsStatusMutateAsync,
330
- showCallsStatusMutationOptions,
331
- } from '../query/showCallsStatus.js'
332
-
333
324
  export {
334
325
  type SendTransactionData,
335
- type SendTransactionVariables,
336
326
  type SendTransactionMutate,
337
327
  type SendTransactionMutateAsync,
328
+ type SendTransactionVariables,
338
329
  sendTransactionMutationOptions,
339
330
  } from '../query/sendTransaction.js'
331
+ export {
332
+ type ShowCallsStatusData,
333
+ type ShowCallsStatusMutate,
334
+ type ShowCallsStatusMutateAsync,
335
+ type ShowCallsStatusVariables,
336
+ showCallsStatusMutationOptions,
337
+ } from '../query/showCallsStatus.js'
340
338
 
341
339
  export {
342
340
  type SignMessageData,
343
- type SignMessageVariables,
344
341
  type SignMessageMutate,
345
342
  type SignMessageMutateAsync,
343
+ type SignMessageVariables,
346
344
  signMessageMutationOptions,
347
345
  } from '../query/signMessage.js'
348
346
 
349
347
  export {
350
348
  type SignTypedDataData,
351
- type SignTypedDataVariables,
352
349
  type SignTypedDataMutate,
353
350
  type SignTypedDataMutateAsync,
351
+ type SignTypedDataVariables,
354
352
  signTypedDataMutationOptions,
355
353
  } from '../query/signTypedData.js'
356
-
357
- export {
358
- type SwitchAccountData,
359
- type SwitchAccountVariables,
360
- type SwitchAccountMutate,
361
- type SwitchAccountMutateAsync,
362
- switchAccountMutationOptions,
363
- } from '../query/switchAccount.js'
364
-
365
354
  export {
366
355
  type SimulateContractData,
367
356
  type SimulateContractOptions,
@@ -370,15 +359,22 @@ export {
370
359
  simulateContractQueryKey,
371
360
  simulateContractQueryOptions,
372
361
  } from '../query/simulateContract.js'
362
+ export {
363
+ type SwitchAccountData,
364
+ type SwitchAccountMutate,
365
+ type SwitchAccountMutateAsync,
366
+ type SwitchAccountVariables,
367
+ switchAccountMutationOptions,
368
+ } from '../query/switchAccount.js'
373
369
 
374
370
  export {
375
371
  type SwitchChainData,
376
- type SwitchChainVariables,
377
372
  type SwitchChainMutate,
378
373
  type SwitchChainMutateAsync,
374
+ type SwitchChainVariables,
379
375
  switchChainMutationOptions,
380
376
  } from '../query/switchChain.js'
381
-
377
+ export { hashFn, structuralSharing } from '../query/utils.js'
382
378
  export {
383
379
  type VerifyMessageData,
384
380
  type VerifyMessageOptions,
@@ -387,7 +383,6 @@ export {
387
383
  verifyMessageQueryKey,
388
384
  verifyMessageQueryOptions,
389
385
  } from '../query/verifyMessage.js'
390
-
391
386
  export {
392
387
  type VerifyTypedDataData,
393
388
  type VerifyTypedDataOptions,
@@ -396,7 +391,6 @@ export {
396
391
  verifyTypedDataQueryKey,
397
392
  verifyTypedDataQueryOptions,
398
393
  } from '../query/verifyTypedData.js'
399
-
400
394
  export {
401
395
  type WaitForCallsStatusData,
402
396
  type WaitForCallsStatusOptions,
@@ -405,7 +399,6 @@ export {
405
399
  waitForCallsStatusQueryKey,
406
400
  waitForCallsStatusQueryOptions,
407
401
  } from '../query/waitForCallsStatus.js'
408
-
409
402
  export {
410
403
  type WaitForTransactionReceiptData,
411
404
  type WaitForTransactionReceiptOptions,
@@ -414,21 +407,17 @@ export {
414
407
  waitForTransactionReceiptQueryKey,
415
408
  waitForTransactionReceiptQueryOptions,
416
409
  } from '../query/waitForTransactionReceipt.js'
417
-
418
410
  export {
419
411
  type WatchAssetData,
420
- type WatchAssetVariables,
421
412
  type WatchAssetMutate,
422
413
  type WatchAssetMutateAsync,
414
+ type WatchAssetVariables,
423
415
  watchAssetMutationOptions,
424
416
  } from '../query/watchAsset.js'
425
-
426
417
  export {
427
418
  type WriteContractData,
428
- type WriteContractVariables,
429
419
  type WriteContractMutate,
430
420
  type WriteContractMutateAsync,
421
+ type WriteContractVariables,
431
422
  writeContractMutationOptions,
432
423
  } from '../query/writeContract.js'
433
-
434
- export { hashFn, structuralSharing } from '../query/utils.js'
@@ -6,9 +6,8 @@ import {
6
6
  type ConnectReturnType,
7
7
  connect,
8
8
  } from '../actions/connect.js'
9
- import type { Config, Connector } from '../createConfig.js'
10
-
11
9
  import type { CreateConnectorFn } from '../connectors/createConnector.js'
10
+ import type { Config, Connector } from '../createConfig.js'
12
11
  import type { Compute } from '../types/utils.js'
13
12
 
14
13
  export function connectMutationOptions<config extends Config>(config: config) {
@@ -1,11 +1,10 @@
1
1
  import type { QueryOptions } from '@tanstack/query-core'
2
-
2
+ import type { GetTransactionReceiptReturnType } from '../actions/getTransactionReceipt.js'
3
3
  import {
4
4
  type GetTransactionReceiptErrorType,
5
5
  type GetTransactionReceiptParameters,
6
6
  getTransactionReceipt,
7
7
  } from '../actions/getTransactionReceipt.js'
8
- import type { GetTransactionReceiptReturnType } from '../actions/getTransactionReceipt.js'
9
8
  import type { Config } from '../createConfig.js'
10
9
  import type { ScopeKeyParameter } from '../types/properties.js'
11
10
  import type { Compute, ExactPartial } from '../types/utils.js'
@@ -10,8 +10,10 @@ import {
10
10
  readContracts,
11
11
  } from '../actions/readContracts.js'
12
12
  import type { Config } from '../createConfig.js'
13
- import type { ChainIdParameter } from '../types/properties.js'
14
- import type { ScopeKeyParameter } from '../types/properties.js'
13
+ import type {
14
+ ChainIdParameter,
15
+ ScopeKeyParameter,
16
+ } from '../types/properties.js'
15
17
  import type { ExactPartial } from '../types/utils.js'
16
18
  import { filterQueryOptions } from './utils.js'
17
19
 
@@ -21,7 +21,7 @@ export function hashFn(queryKey: QueryKey): string {
21
21
  })
22
22
  }
23
23
 
24
- // biome-ignore lint/complexity/noBannedTypes:
24
+ // biome-ignore lint/complexity/noBannedTypes: using
25
25
  function isPlainObject(value: any): value is Object {
26
26
  if (!hasObjectPrototype(value)) {
27
27
  return false
@@ -36,7 +36,7 @@ function isPlainObject(value: any): value is Object {
36
36
  if (!hasObjectPrototype(prot)) return false
37
37
 
38
38
  // If constructor does not have an Object-specific method
39
- // biome-ignore lint/suspicious/noPrototypeBuiltins: <explanation>
39
+ // biome-ignore lint/suspicious/noPrototypeBuiltins: using
40
40
  if (!prot.hasOwnProperty('isPrototypeOf')) return false
41
41
 
42
42
  // Most likely a plain Object
@@ -54,17 +54,21 @@ export function filterQueryOptions<type extends Record<string, unknown>>(
54
54
  // biome-ignore format: no formatting
55
55
  const {
56
56
  // import('@tanstack/query-core').QueryOptions
57
+ // biome-ignore lint/correctness/noUnusedVariables: tossing
57
58
  _defaulted, behavior, gcTime, initialData, initialDataUpdatedAt, maxPages, meta, networkMode, queryFn, queryHash, queryKey, queryKeyHashFn, retry, retryDelay, structuralSharing,
58
59
 
59
60
  // import('@tanstack/query-core').InfiniteQueryObserverOptions
61
+ // biome-ignore lint/correctness/noUnusedVariables: tossing
60
62
  getPreviousPageParam, getNextPageParam, initialPageParam,
61
63
 
62
64
  // import('@tanstack/react-query').UseQueryOptions
65
+ // biome-ignore lint/correctness/noUnusedVariables: tossing
63
66
  _optimisticResults, enabled, notifyOnChangeProps, placeholderData, refetchInterval, refetchIntervalInBackground, refetchOnMount, refetchOnReconnect, refetchOnWindowFocus, retryOnMount, select, staleTime, suspense, throwOnError,
64
67
 
65
68
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
66
69
  // wagmi
67
70
  ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
71
+ // biome-ignore lint/correctness/noUnusedVariables: tossing
68
72
  config, connector, query,
69
73
  ...rest
70
74
  } = options
@@ -1,13 +1,13 @@
1
1
  import {
2
2
  ChainDisconnectedError,
3
+ createTransport,
3
4
  type EIP1193Parameters,
4
5
  type EIP1193Provider,
5
6
  type EIP1193RequestFn,
7
+ hexToNumber,
6
8
  ProviderDisconnectedError,
7
9
  type TransportConfig,
8
10
  type WalletRpcSchema,
9
- createTransport,
10
- hexToNumber,
11
11
  withRetry,
12
12
  withTimeout,
13
13
  } from 'viem'
@@ -1,6 +1,6 @@
1
1
  import type { Config } from '../createConfig.js'
2
2
 
3
- // biome-ignore lint/suspicious/noEmptyInterface: <explanation>
3
+ // biome-ignore lint/suspicious/noEmptyInterface: using
4
4
  export interface Register {}
5
5
  export type ResolvedRegister = {
6
6
  config: Register extends { config: infer config extends Config }
@@ -10,10 +10,12 @@ export const cookieStorage = {
10
10
  },
11
11
  setItem(key, value) {
12
12
  if (typeof window === 'undefined') return
13
+ // biome-ignore lint/suspicious/noDocumentCookie: using
13
14
  document.cookie = `${key}=${value};path=/;samesite=Lax`
14
15
  },
15
16
  removeItem(key) {
16
17
  if (typeof window === 'undefined') return
18
+ // biome-ignore lint/suspicious/noDocumentCookie: using
17
19
  document.cookie = `${key}=;max-age=-1;path=/`
18
20
  },
19
21
  } satisfies BaseStorage
@@ -25,8 +25,7 @@ export function deepEqual(a: any, b: any) {
25
25
  length = keys.length
26
26
  if (length !== Object.keys(b).length) return false
27
27
 
28
- for (i = length; i-- !== 0; )
29
- if (!Object.prototype.hasOwnProperty.call(b, keys[i]!)) return false
28
+ for (i = length; i-- !== 0; ) if (!Object.hasOwn(b, keys[i]!)) return false
30
29
 
31
30
  for (i = length; i-- !== 0; ) {
32
31
  const key = keys[i]
@@ -38,6 +37,6 @@ export function deepEqual(a: any, b: any) {
38
37
  }
39
38
 
40
39
  // true if both NaN, false otherwise
41
- // biome-ignore lint/suspicious/noSelfCompare: <explanation>
40
+ // biome-ignore lint/suspicious/noSelfCompare: using
42
41
  return a !== a && b !== b
43
42
  }
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.17.3'
1
+ export const version = '2.18.1'