@rango-dev/widget-embedded 0.60.2-next.8 → 0.61.0

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.8",
3
+ "version": "0.61.0",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -27,16 +27,16 @@
27
27
  "@hub3js/std": "^0.1.1",
28
28
  "@lingui/core": "4.2.1",
29
29
  "@lingui/react": "4.2.1",
30
- "@rango-dev/logging-core": "^0.12.2-next.0",
31
- "@rango-dev/provider-all": "^0.62.2-next.4",
30
+ "@rango-dev/logging-core": "^0.13.0",
31
+ "@rango-dev/provider-all": "^0.63.0",
32
32
  "@rango-dev/queue-manager-core": "^0.33.0",
33
- "@rango-dev/queue-manager-rango-preset": "^0.62.1-next.4",
33
+ "@rango-dev/queue-manager-rango-preset": "^0.63.0",
34
34
  "@rango-dev/queue-manager-react": "^0.33.0",
35
35
  "@rango-dev/signer-solana": "^0.48.0",
36
- "@rango-dev/ui": "^0.63.1-next.3",
37
- "@rango-dev/wallets-core": "^0.59.1-next.1",
38
- "@rango-dev/wallets-react": "^0.46.1-next.3",
39
- "@rango-dev/wallets-shared": "^0.60.1-next.2",
36
+ "@rango-dev/ui": "^0.64.0",
37
+ "@rango-dev/wallets-core": "^0.60.0",
38
+ "@rango-dev/wallets-react": "^0.47.0",
39
+ "@rango-dev/wallets-shared": "^0.61.0",
40
40
  "bignumber.js": "^9.1.1",
41
41
  "copy-to-clipboard": "^3.3.3",
42
42
  "crypto-browserify": "^3.12.1",
@@ -66,4 +66,4 @@
66
66
  "publishConfig": {
67
67
  "access": "public"
68
68
  }
69
- }
69
+ }
@@ -109,6 +109,9 @@ function Main(props: PropsWithChildren<PropTypes>) {
109
109
  [WalletTypes.TON_CONNECT]: {
110
110
  provider: { manifestUrl: config.tonConnect?.manifestUrl },
111
111
  },
112
+ [WalletTypes.TREZOR]: {
113
+ provider: { manifest: config.trezorManifest },
114
+ },
112
115
  },
113
116
  }}>
114
117
  {props.children}
@@ -93,9 +93,6 @@ function generateProviders(config: WidgetConfig) {
93
93
  options?.walletConnectListedDesktopWalletLink,
94
94
  },
95
95
  selectedProviders: config.wallets,
96
- trezor: options?.trezorManifest
97
- ? { manifest: options.trezorManifest }
98
- : undefined,
99
96
  tonConnect: options?.tonConnect?.manifestUrl
100
97
  ? { manifestUrl: options?.tonConnect.manifestUrl }
101
98
  : undefined,
@@ -23,6 +23,8 @@ import {
23
23
  import { legacyReadAccountAddress as readAccountAddress } from '@rango-dev/wallets-core/legacy';
24
24
  import {
25
25
  detectInstallLink,
26
+ HYPERLIQUID_SIGN_NETWORK,
27
+ getBlockChainNameFromId,
26
28
  isEvmAddress,
27
29
  Networks,
28
30
  } from '@rango-dev/wallets-shared';
@@ -44,6 +46,20 @@ import { formatThousandsWithCommas } from './sanitizers';
44
46
  export type ExtendedModalWalletInfo = WalletInfoWithExtra &
45
47
  Pick<ExtendedWalletInfo, 'properties' | 'isHub'>;
46
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
+
47
63
  export function getWalletConnectionStatus(
48
64
  wallet: ExtendedWalletInfo,
49
65
  walletState: ReturnType<ProviderContext['state']>
@@ -74,9 +90,12 @@ export function mapWalletTypesToWalletInfo(
74
90
  .filter((wallet) => {
75
91
  const { supportedChains, isContractWallet } = getWalletInfo(wallet);
76
92
 
77
- const { installed, network } = getState(wallet);
93
+ const { installed, namespaces } = getState(wallet);
78
94
  const filterContractWallets =
79
- isContractWallet && (!installed || (!!chain && network !== chain));
95
+ isContractWallet &&
96
+ (!installed ||
97
+ (!!chain &&
98
+ getConnectedEvmChainName(namespaces, supportedChains) !== chain));
80
99
  if (filterContractWallets) {
81
100
  return false;
82
101
  }
@@ -223,6 +242,14 @@ export function prepareAccountsForWalletStore(
223
242
  */
224
243
  addAccount(network, address.toLowerCase());
225
244
  });
245
+
246
+ const shouldAddHyperliquidAccount = evmChainsSupportedByWallet.includes(
247
+ HYPERLIQUID_SIGN_NETWORK
248
+ );
249
+
250
+ if (shouldAddHyperliquidAccount) {
251
+ addAccount(Networks.HYPERLIQUID, address.toLowerCase());
252
+ }
226
253
  }
227
254
  } else {
228
255
  addAccount(network, address);