@coin-voyage/crypto 2.2.1 → 2.2.2

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.
@@ -5,6 +5,7 @@ import { useWallet } from "@solana/wallet-adapter-react";
5
5
  import { useConfig as useWagmiConfig, useConnect as useWagmiConnect } from "wagmi";
6
6
  import { getConnectorId } from "../lib/utils/connector";
7
7
  import { useLastConnector } from "./use-last-connector";
8
+ import { useCallback } from "react";
8
9
  export const useUniversalConnect = (props) => {
9
10
  const utxoConfig = useBigmiConfig();
10
11
  const evmConfig = useWagmiConfig();
@@ -41,7 +42,7 @@ export const useUniversalConnect = (props) => {
41
42
  onError: props?.onError,
42
43
  },
43
44
  });
44
- const connect = async ({ walletConnector }) => {
45
+ const connect = useCallback(async ({ walletConnector }) => {
45
46
  const { connector, chainType } = walletConnector;
46
47
  props?.onMutate?.({ connector });
47
48
  try {
@@ -104,6 +105,18 @@ export const useUniversalConnect = (props) => {
104
105
  catch (err) {
105
106
  props?.onError?.(err);
106
107
  }
107
- };
108
+ }, [
109
+ connectAsync,
110
+ utxoConnectAsync,
111
+ suiConnectAsync,
112
+ connected,
113
+ disconnect,
114
+ select,
115
+ updateLastConnectorId,
116
+ props?.onError,
117
+ props?.onSuccess,
118
+ props?.onSettled,
119
+ props?.onMutate,
120
+ ]);
108
121
  return { connect };
109
122
  };
@@ -1,9 +1,2 @@
1
1
  import { arbitrum, base, bsc, mainnet, optimism, polygon } from "viem/chains";
2
- export const DEFAULT_CHAINS = [
3
- mainnet,
4
- arbitrum,
5
- base,
6
- bsc,
7
- optimism,
8
- polygon,
9
- ];
2
+ export const DEFAULT_CHAINS = [mainnet, arbitrum, base, bsc, optimism, polygon];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@coin-voyage/crypto",
3
3
  "description": "Crypto utilities for Coin Voyage",
4
- "version": "2.2.1",
4
+ "version": "2.2.2",
5
5
  "private": false,
6
6
  "sideEffects": false,
7
7
  "author": "Lars <lars@coinvoyage.io>",