wagmi 0.7.10 → 0.7.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.
@@ -1,7 +1,7 @@
1
1
  import { FetchSignerArgs, FetchSignerResult, Signer } from '@wagmi/core';
2
2
  import { QueryConfig } from '../../types';
3
3
  export declare type UseSignerConfig = Omit<QueryConfig<FetchSignerResult, Error>, 'cacheTime' | 'staleTime' | 'enabled'> & FetchSignerArgs;
4
- export declare const queryKey: ({ chainId }: FetchSignerArgs) => readonly [{
4
+ export declare function queryKey({ chainId }: FetchSignerArgs): readonly [{
5
5
  readonly entity: "signer";
6
6
  readonly chainId: number | undefined;
7
7
  readonly persist: false;
@@ -1,6 +1,5 @@
1
- import { PrepareWriteContractConfig, PrepareWriteContractResult } from '@wagmi/core';
1
+ import { PrepareWriteContractConfig, PrepareWriteContractResult, Signer } from '@wagmi/core';
2
2
  import { Abi } from 'abitype';
3
- import { Signer } from 'ethers';
4
3
  import { QueryConfig } from '../../types';
5
4
  export declare type UsePrepareContractWriteConfig<TAbi extends Abi | readonly unknown[] = Abi, TFunctionName extends string = string, TSigner extends Signer = Signer> = PrepareWriteContractConfig<TAbi, TFunctionName, TSigner, {
6
5
  isAbiOptional: true;
@@ -957,7 +957,7 @@ function useNetwork() {
957
957
  return useSyncExternalStoreWithTracked(core.watchNetwork, core.getNetwork);
958
958
  }
959
959
 
960
- const queryKey$c = _ref => {
960
+ function queryKey$c(_ref) {
961
961
  let {
962
962
  chainId
963
963
  } = _ref;
@@ -966,7 +966,7 @@ const queryKey$c = _ref => {
966
966
  chainId,
967
967
  persist: false
968
968
  }];
969
- };
969
+ }
970
970
 
971
971
  function queryFn$c(_ref2) {
972
972
  let {
@@ -1927,14 +1927,16 @@ function usePrepareContractWrite() {
1927
1927
  onSettled,
1928
1928
  onSuccess
1929
1929
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1930
- const activeChainId = useChainId();
1930
+ const {
1931
+ chain: activeChain
1932
+ } = useNetwork();
1931
1933
  const {
1932
1934
  data: signer
1933
1935
  } = useSigner({
1934
- chainId: chainId ?? activeChainId
1936
+ chainId
1935
1937
  });
1936
1938
  const prepareContractWriteQuery = useQuery(queryKey$8({
1937
- activeChainId,
1939
+ activeChainId: activeChain === null || activeChain === void 0 ? void 0 : activeChain.id,
1938
1940
  address,
1939
1941
  args,
1940
1942
  chainId,
@@ -2344,14 +2346,16 @@ function usePrepareSendTransaction() {
2344
2346
  onSettled,
2345
2347
  onSuccess
2346
2348
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2347
- const activeChainId = useChainId();
2349
+ const {
2350
+ chain: activeChain
2351
+ } = useNetwork();
2348
2352
  const {
2349
2353
  data: signer
2350
2354
  } = useSigner({
2351
- chainId: chainId ?? activeChainId
2355
+ chainId
2352
2356
  });
2353
2357
  const prepareSendTransactionQuery = useQuery(queryKey$2({
2354
- activeChainId,
2358
+ activeChainId: activeChain === null || activeChain === void 0 ? void 0 : activeChain.id,
2355
2359
  chainId,
2356
2360
  request,
2357
2361
  scopeKey,
@@ -957,7 +957,7 @@ function useNetwork() {
957
957
  return useSyncExternalStoreWithTracked(core.watchNetwork, core.getNetwork);
958
958
  }
959
959
 
960
- const queryKey$c = _ref => {
960
+ function queryKey$c(_ref) {
961
961
  let {
962
962
  chainId
963
963
  } = _ref;
@@ -966,7 +966,7 @@ const queryKey$c = _ref => {
966
966
  chainId,
967
967
  persist: false
968
968
  }];
969
- };
969
+ }
970
970
 
971
971
  function queryFn$c(_ref2) {
972
972
  let {
@@ -1927,14 +1927,16 @@ function usePrepareContractWrite() {
1927
1927
  onSettled,
1928
1928
  onSuccess
1929
1929
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1930
- const activeChainId = useChainId();
1930
+ const {
1931
+ chain: activeChain
1932
+ } = useNetwork();
1931
1933
  const {
1932
1934
  data: signer
1933
1935
  } = useSigner({
1934
- chainId: chainId ?? activeChainId
1936
+ chainId
1935
1937
  });
1936
1938
  const prepareContractWriteQuery = useQuery(queryKey$8({
1937
- activeChainId,
1939
+ activeChainId: activeChain === null || activeChain === void 0 ? void 0 : activeChain.id,
1938
1940
  address,
1939
1941
  args,
1940
1942
  chainId,
@@ -2344,14 +2346,16 @@ function usePrepareSendTransaction() {
2344
2346
  onSettled,
2345
2347
  onSuccess
2346
2348
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2347
- const activeChainId = useChainId();
2349
+ const {
2350
+ chain: activeChain
2351
+ } = useNetwork();
2348
2352
  const {
2349
2353
  data: signer
2350
2354
  } = useSigner({
2351
- chainId: chainId ?? activeChainId
2355
+ chainId
2352
2356
  });
2353
2357
  const prepareSendTransactionQuery = useQuery(queryKey$2({
2354
- activeChainId,
2358
+ activeChainId: activeChain === null || activeChain === void 0 ? void 0 : activeChain.id,
2355
2359
  chainId,
2356
2360
  request,
2357
2361
  scopeKey,
package/dist/wagmi.esm.js CHANGED
@@ -933,7 +933,7 @@ function useNetwork() {
933
933
  return useSyncExternalStoreWithTracked(watchNetwork, getNetwork);
934
934
  }
935
935
 
936
- const queryKey$c = _ref => {
936
+ function queryKey$c(_ref) {
937
937
  let {
938
938
  chainId
939
939
  } = _ref;
@@ -942,7 +942,7 @@ const queryKey$c = _ref => {
942
942
  chainId,
943
943
  persist: false
944
944
  }];
945
- };
945
+ }
946
946
 
947
947
  function queryFn$c(_ref2) {
948
948
  let {
@@ -1903,14 +1903,16 @@ function usePrepareContractWrite() {
1903
1903
  onSettled,
1904
1904
  onSuccess
1905
1905
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
1906
- const activeChainId = useChainId();
1906
+ const {
1907
+ chain: activeChain
1908
+ } = useNetwork();
1907
1909
  const {
1908
1910
  data: signer
1909
1911
  } = useSigner({
1910
- chainId: chainId ?? activeChainId
1912
+ chainId
1911
1913
  });
1912
1914
  const prepareContractWriteQuery = useQuery(queryKey$8({
1913
- activeChainId,
1915
+ activeChainId: activeChain === null || activeChain === void 0 ? void 0 : activeChain.id,
1914
1916
  address,
1915
1917
  args,
1916
1918
  chainId,
@@ -2320,14 +2322,16 @@ function usePrepareSendTransaction() {
2320
2322
  onSettled,
2321
2323
  onSuccess
2322
2324
  } = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
2323
- const activeChainId = useChainId();
2325
+ const {
2326
+ chain: activeChain
2327
+ } = useNetwork();
2324
2328
  const {
2325
2329
  data: signer
2326
2330
  } = useSigner({
2327
- chainId: chainId ?? activeChainId
2331
+ chainId
2328
2332
  });
2329
2333
  const prepareSendTransactionQuery = useQuery(queryKey$2({
2330
- activeChainId,
2334
+ activeChainId: activeChain === null || activeChain === void 0 ? void 0 : activeChain.id,
2331
2335
  chainId,
2332
2336
  request,
2333
2337
  scopeKey,
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "wagmi",
3
3
  "description": "React Hooks for Ethereum",
4
4
  "license": "MIT",
5
- "version": "0.7.10",
5
+ "version": "0.7.11",
6
6
  "repository": {
7
7
  "type": "git",
8
8
  "url": "https://github.com/wagmi-dev/wagmi.git",
@@ -108,7 +108,7 @@
108
108
  "@tanstack/query-sync-storage-persister": "^4.10.1",
109
109
  "@tanstack/react-query": "^4.10.1",
110
110
  "@tanstack/react-query-persist-client": "^4.10.1",
111
- "@wagmi/core": "^0.6.9",
111
+ "@wagmi/core": "^0.6.10",
112
112
  "@walletconnect/ethereum-provider": "^1.8.0",
113
113
  "abitype": "^0.1.7",
114
114
  "use-sync-external-store": "^1.2.0"