wagmi 2.2.0 → 2.2.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.
@@ -1,2 +1,2 @@
1
- export const version = '2.2.0';
1
+ export const version = '2.2.1';
2
2
  //# sourceMappingURL=version.js.map
@@ -1,7 +1,7 @@
1
- import { type GetAccountReturnType } from '@wagmi/core';
1
+ import { type Config, type GetAccountReturnType, type ResolvedRegister } from '@wagmi/core';
2
2
  import type { ConfigParameter } from '../types/properties.js';
3
- export type UseAccountParameters = ConfigParameter;
4
- export type UseAccountReturnType = GetAccountReturnType;
3
+ export type UseAccountParameters<config extends Config = Config> = ConfigParameter<config>;
4
+ export type UseAccountReturnType<config extends Config = Config> = GetAccountReturnType<config>;
5
5
  /** https://wagmi.sh/react/api/hooks/useAccount */
6
- export declare function useAccount(parameters?: UseAccountParameters): UseAccountReturnType;
6
+ export declare function useAccount<config extends Config = ResolvedRegister['config']>(parameters?: UseAccountParameters<config>): UseAccountReturnType<config>;
7
7
  //# sourceMappingURL=useAccount.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"useAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,oBAAoB,EAG1B,MAAM,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AAI7D,MAAM,MAAM,oBAAoB,GAAG,eAAe,CAAA;AAElD,MAAM,MAAM,oBAAoB,GAAG,oBAAoB,CAAA;AAEvD,kDAAkD;AAClD,wBAAgB,UAAU,CACxB,UAAU,GAAE,oBAAyB,GACpC,oBAAoB,CAOtB"}
1
+ {"version":3,"file":"useAccount.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAccount.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,KAAK,MAAM,EACX,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAGtB,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,2 +1,2 @@
1
- export declare const version = "2.2.0";
1
+ export declare const version = "2.2.1";
2
2
  //# sourceMappingURL=version.d.ts.map
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "wagmi",
3
3
  "description": "React Hooks for Ethereum",
4
- "version": "2.2.0",
4
+ "version": "2.2.1",
5
5
  "license": "MIT",
6
6
  "repository": {
7
7
  "type": "git",
@@ -84,8 +84,8 @@
84
84
  },
85
85
  "dependencies": {
86
86
  "use-sync-external-store": "1.2.0",
87
- "@wagmi/connectors": "4.1.3",
88
- "@wagmi/core": "2.2.0"
87
+ "@wagmi/connectors": "4.1.4",
88
+ "@wagmi/core": "2.2.1"
89
89
  },
90
90
  "contributors": [
91
91
  "awkweb.eth <t@wevm.dev>",
@@ -1,7 +1,9 @@
1
1
  'use client'
2
2
 
3
3
  import {
4
+ type Config,
4
5
  type GetAccountReturnType,
6
+ type ResolvedRegister,
5
7
  getAccount,
6
8
  watchAccount,
7
9
  } from '@wagmi/core'
@@ -10,14 +12,16 @@ import type { ConfigParameter } from '../types/properties.js'
10
12
  import { useConfig } from './useConfig.js'
11
13
  import { useSyncExternalStoreWithTracked } from './useSyncExternalStoreWithTracked.js'
12
14
 
13
- export type UseAccountParameters = ConfigParameter
15
+ export type UseAccountParameters<config extends Config = Config> =
16
+ ConfigParameter<config>
14
17
 
15
- export type UseAccountReturnType = GetAccountReturnType
18
+ export type UseAccountReturnType<config extends Config = Config> =
19
+ GetAccountReturnType<config>
16
20
 
17
21
  /** https://wagmi.sh/react/api/hooks/useAccount */
18
- export function useAccount(
19
- parameters: UseAccountParameters = {},
20
- ): UseAccountReturnType {
22
+ export function useAccount<config extends Config = ResolvedRegister['config']>(
23
+ parameters: UseAccountParameters<config> = {},
24
+ ): UseAccountReturnType<config> {
21
25
  const config = useConfig(parameters)
22
26
 
23
27
  return useSyncExternalStoreWithTracked(
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const version = '2.2.0'
1
+ export const version = '2.2.1'