@rango-dev/widget-embedded 0.28.3-next.1 → 0.28.3-next.3

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.28.3-next.1",
3
+ "version": "0.28.3-next.3",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -25,7 +25,7 @@
25
25
  "@lingui/core": "4.2.1",
26
26
  "@lingui/react": "4.2.1",
27
27
  "@rango-dev/logging-core": "^0.3.1-next.1",
28
- "@rango-dev/provider-all": "^0.33.3-next.0",
28
+ "@rango-dev/provider-all": "^0.33.3-next.2",
29
29
  "@rango-dev/queue-manager-core": "^0.26.0",
30
30
  "@rango-dev/queue-manager-rango-preset": "^0.33.3-next.0",
31
31
  "@rango-dev/queue-manager-react": "^0.26.0",
@@ -53,4 +53,4 @@
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  }
56
- }
56
+ }
@@ -38,6 +38,9 @@ function Main(props: PropsWithChildren<PropTypes>) {
38
38
 
39
39
  const walletOptions: ProvidersOptions = {
40
40
  walletConnectProjectId: props.config?.walletConnectProjectId,
41
+ walletConnectListedDesktopWalletLink:
42
+ props.config.__UNSTABLE_OR_INTERNAL__
43
+ ?.walletConnectListedDesktopWalletLink,
41
44
  };
42
45
  const { providers } = useWalletProviders(config.wallets, walletOptions);
43
46
  const { connectWallet, disconnectWallet } = useWalletsStore();
@@ -45,6 +45,8 @@ export function useWalletList(params: Params) {
45
45
  const listAvailableWalletTypes =
46
46
  configWalletsToWalletName(config?.wallets, {
47
47
  walletConnectProjectId: config?.walletConnectProjectId,
48
+ walletConnectListedDesktopWalletLink:
49
+ config.__UNSTABLE_OR_INTERNAL__?.walletConnectListedDesktopWalletLink,
48
50
  }) || ALL_SUPPORTED_WALLETS;
49
51
 
50
52
  let wallets = mapWalletTypesToWalletInfo(
@@ -56,7 +58,8 @@ export function useWalletList(params: Params) {
56
58
 
57
59
  wallets = detectMobileScreens()
58
60
  ? wallets.filter(
59
- (wallet) => wallet.showOnMobile || state(wallet.type).installed
61
+ (wallet) =>
62
+ wallet.showOnMobile !== false && state(wallet.type).installed
60
63
  )
61
64
  : wallets;
62
65
 
@@ -137,9 +140,11 @@ export function useWalletList(params: Params) {
137
140
  const isEvmWalletInstalledExceptDefault = wallets.filter(
138
141
  (wallet) =>
139
142
  wallet.state != WalletState.NOT_INSTALLED &&
140
- ![WalletTypes.DEFAULT, WalletTypes.WALLET_CONNECT_2].includes(
141
- wallet.type as WalletTypes
142
- ) &&
143
+ ![
144
+ WalletTypes.DEFAULT,
145
+ WalletTypes.WALLET_CONNECT_2,
146
+ WalletTypes.LEDGER,
147
+ ].includes(wallet.type as WalletTypes) &&
143
148
  getWalletInfo(wallet.type).supportedChains.filter(
144
149
  (blockchain) => blockchain.type == 'EVM'
145
150
  ).length > 0
@@ -14,16 +14,12 @@ export function useWalletProviders(
14
14
  const clearConnectedWallet = useWalletsStore.use.clearConnectedWallet();
15
15
  let generateProviders: ProviderInterface[] = matchAndGenerateProviders(
16
16
  providers,
17
- {
18
- walletConnectProjectId: options?.walletConnectProjectId,
19
- }
17
+ options
20
18
  );
21
19
 
22
20
  useEffect(() => {
23
21
  clearConnectedWallet();
24
- generateProviders = matchAndGenerateProviders(providers, {
25
- walletConnectProjectId: options?.walletConnectProjectId,
26
- });
22
+ generateProviders = matchAndGenerateProviders(providers, options);
27
23
  }, [providers?.length]);
28
24
 
29
25
  return {
@@ -214,4 +214,9 @@ export type WidgetConfig = {
214
214
  variant?: WidgetVariant;
215
215
  enableCentralizedSwappers?: boolean;
216
216
  signers?: SignersConfig;
217
+
218
+ // These are likely to change or remove at anytime. Please use with a caution.
219
+ __UNSTABLE_OR_INTERNAL__?: {
220
+ walletConnectListedDesktopWalletLink?: string;
221
+ };
217
222
  };
@@ -5,6 +5,9 @@ import { allProviders } from '@rango-dev/provider-all';
5
5
 
6
6
  export interface ProvidersOptions {
7
7
  walletConnectProjectId?: WidgetConfig['walletConnectProjectId'];
8
+ walletConnectListedDesktopWalletLink?: NonNullable<
9
+ WidgetConfig['__UNSTABLE_OR_INTERNAL__']
10
+ >['walletConnectListedDesktopWalletLink'];
8
11
  }
9
12
 
10
13
  /**
@@ -20,6 +23,8 @@ export function matchAndGenerateProviders(
20
23
  const all = allProviders({
21
24
  walletconnect2: {
22
25
  WC_PROJECT_ID: options?.walletConnectProjectId || '',
26
+ DISABLE_MODAL_AND_OPEN_LINK:
27
+ options?.walletConnectListedDesktopWalletLink,
23
28
  },
24
29
  selectedProviders: providers,
25
30
  });