@dynamic-labs/sdk-react-core 4.9.5 → 4.9.6

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.
@@ -137,6 +137,9 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
137
137
  clearStackAndPushInitialView();
138
138
  };
139
139
  const handleWalletConnectionError = (error) => {
140
+ if (error instanceof utils.GetAddressCancelledError) {
141
+ return;
142
+ }
140
143
  clearStackAndPushInitialView();
141
144
  if (error instanceof utils.CustomError) {
142
145
  setError(error.message, error.code);
@@ -1,6 +1,6 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../../../_virtual/_tslib.js';
3
- import { StorageService, CustomError } from '@dynamic-labs/utils';
3
+ import { StorageService, GetAddressCancelledError, CustomError } from '@dynamic-labs/utils';
4
4
  import { isEmailWalletConnector, isEmailOTPWalletConnector, isBloctoConnector } from '@dynamic-labs/wallet-connector-core';
5
5
  import { useCaptchaContext } from '../../../../context/CaptchaContext/CaptchaContext.js';
6
6
  import 'react';
@@ -133,6 +133,9 @@ const useConnectAndSign = ({ shouldUpdateWallets = true, shouldCallCallback = tr
133
133
  clearStackAndPushInitialView();
134
134
  };
135
135
  const handleWalletConnectionError = (error) => {
136
+ if (error instanceof GetAddressCancelledError) {
137
+ return;
138
+ }
136
139
  clearStackAndPushInitialView();
137
140
  if (error instanceof CustomError) {
138
141
  setError(error.message, error.code);
@@ -211,11 +211,11 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
211
211
  const { walletConnector, isInstalledOnBrowser } = wallet;
212
212
  const shouldEndWalletConnectorSession = walletConnector.connectedChain === 'FLOW' ||
213
213
  walletConnectorCore.isPhantomRedirectConnector(walletConnector) ||
214
- // because WC only supports one connection at a time,
214
+ // because some wallet connectors only supports one connection at a time,
215
215
  // we need to end the session (disconnect) when the user selects
216
216
  // a different wallet to connect with
217
217
  // a new connection is established a few steps further down
218
- walletConnectorCore.isWalletConnectConnector(walletConnector);
218
+ !walletConnector.canHandleMultipleConnections;
219
219
  logger.logger.logVerboseTroubleshootingMessage('[handleWalletItemClick]', {
220
220
  mockedSDK,
221
221
  shouldEndWalletConnectorSession,
@@ -1,7 +1,7 @@
1
1
  'use client'
2
2
  import { __awaiter } from '../../../../../../_virtual/_tslib.js';
3
3
  import { StorageService, isMobile, UserRejectedRequestError } from '@dynamic-labs/utils';
4
- import { isPhantomRedirectConnector, isWalletConnectConnector } from '@dynamic-labs/wallet-connector-core';
4
+ import { isPhantomRedirectConnector } from '@dynamic-labs/wallet-connector-core';
5
5
  import 'react';
6
6
  import '../../../../context/DynamicContext/DynamicContext.js';
7
7
  import '@dynamic-labs/sdk-api-core';
@@ -207,11 +207,11 @@ const useHandleWalletItem = ({ allowAlreadyConnectedWallet, onQrCodeConnect, onC
207
207
  const { walletConnector, isInstalledOnBrowser } = wallet;
208
208
  const shouldEndWalletConnectorSession = walletConnector.connectedChain === 'FLOW' ||
209
209
  isPhantomRedirectConnector(walletConnector) ||
210
- // because WC only supports one connection at a time,
210
+ // because some wallet connectors only supports one connection at a time,
211
211
  // we need to end the session (disconnect) when the user selects
212
212
  // a different wallet to connect with
213
213
  // a new connection is established a few steps further down
214
- isWalletConnectConnector(walletConnector);
214
+ !walletConnector.canHandleMultipleConnections;
215
215
  logger.logVerboseTroubleshootingMessage('[handleWalletItemClick]', {
216
216
  mockedSDK,
217
217
  shouldEndWalletConnectorSession,
@@ -1,7 +1,7 @@
1
1
  import { WalletOption } from '../../../shared';
2
2
  export declare const useWalletOptions: () => {
3
3
  getFilteredWalletOptions: (filter: (options: WalletOption[]) => WalletOption[]) => {
4
- chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE";
4
+ chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI";
5
5
  group: string | undefined;
6
6
  groupName: string | undefined;
7
7
  isInstalledOnBrowser: boolean;
@@ -11,7 +11,7 @@ export declare const useWalletOptions: () => {
11
11
  }[];
12
12
  selectWalletOption: (walletKey: string, selectGroupIfAvailable?: boolean) => Promise<void>;
13
13
  walletOptions: {
14
- chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE";
14
+ chain: "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "STARK" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI";
15
15
  group: string | undefined;
16
16
  groupName: string | undefined;
17
17
  isInstalledOnBrowser: boolean;
@@ -4,7 +4,7 @@ interface IChain {
4
4
  enabled: boolean;
5
5
  name: string;
6
6
  }
7
- export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE")[];
7
+ export declare const getEnabledChains: (chains: IChain[]) => ("STARK" | "ETH" | "FLOW" | "SOL" | "EVM" | "ALGO" | "ATOM" | "COSMOS" | "BTC" | "ECLIPSE" | "SUI")[];
8
8
  type BaseGetSupportedWalletOpts = Omit<GetSupportedWalletsOpts, 'walletConnectProjectId' | 'chainRpcProviders'>;
9
9
  export declare const getWallets: (props: {
10
10
  getSupportedWalletOpts: BaseGetSupportedWalletOpts;