@rango-dev/widget-embedded 0.60.2-next.10 → 0.60.2-next.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.60.2-next.10",
3
+ "version": "0.60.2-next.11",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -28,14 +28,14 @@
28
28
  "@lingui/core": "4.2.1",
29
29
  "@lingui/react": "4.2.1",
30
30
  "@rango-dev/logging-core": "^0.12.2-next.0",
31
- "@rango-dev/provider-all": "^0.62.2-next.6",
31
+ "@rango-dev/provider-all": "^0.62.2-next.7",
32
32
  "@rango-dev/queue-manager-core": "^0.33.0",
33
33
  "@rango-dev/queue-manager-rango-preset": "^0.62.1-next.5",
34
34
  "@rango-dev/queue-manager-react": "^0.33.0",
35
35
  "@rango-dev/signer-solana": "^0.48.0",
36
36
  "@rango-dev/ui": "^0.63.1-next.4",
37
37
  "@rango-dev/wallets-core": "^0.59.1-next.2",
38
- "@rango-dev/wallets-react": "^0.46.1-next.4",
38
+ "@rango-dev/wallets-react": "^0.46.1-next.5",
39
39
  "@rango-dev/wallets-shared": "^0.60.1-next.3",
40
40
  "bignumber.js": "^9.1.1",
41
41
  "copy-to-clipboard": "^3.3.3",
@@ -24,6 +24,7 @@ import { legacyReadAccountAddress as readAccountAddress } from '@rango-dev/walle
24
24
  import {
25
25
  detectInstallLink,
26
26
  HYPERLIQUID_SIGN_NETWORK,
27
+ getBlockChainNameFromId,
27
28
  isEvmAddress,
28
29
  Networks,
29
30
  } from '@rango-dev/wallets-shared';
@@ -45,6 +46,20 @@ import { formatThousandsWithCommas } from './sanitizers';
45
46
  export type ExtendedModalWalletInfo = WalletInfoWithExtra &
46
47
  Pick<ExtendedWalletInfo, 'properties' | 'isHub'>;
47
48
 
49
+ function getConnectedEvmChainName(
50
+ namespaces: ReturnType<ProviderContext['state']>['namespaces'],
51
+ supportedChains: BlockchainMeta[]
52
+ ): string | null {
53
+ const evmNamespace = namespaces?.get('EVM');
54
+ if (!!evmNamespace?.network) {
55
+ return (
56
+ getBlockChainNameFromId(evmNamespace.network, supportedChains) ??
57
+ evmNamespace.network
58
+ );
59
+ }
60
+ return null;
61
+ }
62
+
48
63
  export function getWalletConnectionStatus(
49
64
  wallet: ExtendedWalletInfo,
50
65
  walletState: ReturnType<ProviderContext['state']>
@@ -75,9 +90,12 @@ export function mapWalletTypesToWalletInfo(
75
90
  .filter((wallet) => {
76
91
  const { supportedChains, isContractWallet } = getWalletInfo(wallet);
77
92
 
78
- const { installed, network } = getState(wallet);
93
+ const { installed, namespaces } = getState(wallet);
79
94
  const filterContractWallets =
80
- isContractWallet && (!installed || (!!chain && network !== chain));
95
+ isContractWallet &&
96
+ (!installed ||
97
+ (!!chain &&
98
+ getConnectedEvmChainName(namespaces, supportedChains) !== chain));
81
99
  if (filterContractWallets) {
82
100
  return false;
83
101
  }