@rango-dev/widget-embedded 0.0.0-experimental-e022ed95-20260421 → 0.0.0-experimental-82bcc5d9-20260608

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.
Files changed (142) hide show
  1. package/CHANGELOG.md +34 -0
  2. package/dist/components/AppRoutes.d.ts +1 -2
  3. package/dist/components/AppRoutes.d.ts.map +1 -1
  4. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -1
  5. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  6. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  7. package/dist/components/CustomDestination/CustomDestination.styles.d.ts +4 -4
  8. package/dist/components/CustomDestination/CustomDestination.styles.d.ts.map +1 -1
  9. package/dist/components/CustomTokenModal/CustomTokenModal.d.ts.map +1 -1
  10. package/dist/components/CustomTokenModal/CustomTokenModal.styles.d.ts +169 -169
  11. package/dist/components/CustomTokenModal/CustomTokenModal.styles.d.ts.map +1 -1
  12. package/dist/components/FilterSelector/FilterSelector.style.d.ts +1 -1
  13. package/dist/components/FilterSelector/FilterSelector.style.d.ts.map +1 -1
  14. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +1 -1
  15. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
  16. package/dist/components/NamespaceItem/NamespaceItem.styles.d.ts +1 -1
  17. package/dist/components/NamespaceItem/NamespaceItem.styles.d.ts.map +1 -1
  18. package/dist/components/Quote/Quote.styles.d.ts +171 -171
  19. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  20. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +169 -169
  21. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  22. package/dist/components/RefreshModal/RefreshModal.styles.d.ts +168 -168
  23. package/dist/components/RefreshModal/RefreshModal.styles.d.ts.map +1 -1
  24. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +1 -1
  25. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  26. package/dist/components/SwapMetrics/SwapMetrics.styles.d.ts +1 -1
  27. package/dist/components/SwapMetrics/SwapMetrics.styles.d.ts.map +1 -1
  28. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  29. package/dist/components/TokenList/TokenList.styles.d.ts +2 -2
  30. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  31. package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts +1 -1
  32. package/dist/components/WalletStatefulConnect/DerivationPath.helpers.d.ts.map +1 -1
  33. package/dist/components/WalletStatefulConnect/DerivationPath.styles.d.ts +169 -169
  34. package/dist/components/WalletStatefulConnect/DerivationPath.styles.d.ts.map +1 -1
  35. package/dist/components/WalletStatefulConnect/Detached.types.d.ts +1 -1
  36. package/dist/components/WalletStatefulConnect/Detached.types.d.ts.map +1 -1
  37. package/dist/components/WalletStatefulConnect/Namespaces.styles.d.ts +168 -168
  38. package/dist/components/WalletStatefulConnect/Namespaces.styles.d.ts.map +1 -1
  39. package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts +2 -2
  40. package/dist/components/WalletStatefulConnect/Namespaces.types.d.ts.map +1 -1
  41. package/dist/components/WalletStatefulConnect/index.d.ts +0 -1
  42. package/dist/components/WalletStatefulConnect/index.d.ts.map +1 -1
  43. package/dist/constants/index.d.ts +0 -1
  44. package/dist/constants/index.d.ts.map +1 -1
  45. package/dist/constants/wallets.d.ts +1 -2
  46. package/dist/constants/wallets.d.ts.map +1 -1
  47. package/dist/containers/Inputs/Inputs.d.ts.map +1 -1
  48. package/dist/containers/Wallets/Wallets.d.ts.map +1 -1
  49. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -1
  50. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts.map +1 -1
  51. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  52. package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts +1 -1
  53. package/dist/hooks/useStatefulConnect/useStatefulConnect.d.ts.map +1 -1
  54. package/dist/hooks/useStatefulConnect/useStatefulConnect.state.d.ts +1 -1
  55. package/dist/hooks/useStatefulConnect/useStatefulConnect.state.d.ts.map +1 -1
  56. package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts +1 -1
  57. package/dist/hooks/useStatefulConnect/useStatefulConnect.types.d.ts.map +1 -1
  58. package/dist/hooks/useWalletList.d.ts.map +1 -1
  59. package/dist/hooks/useWalletProviders/useWalletProviders.d.ts +1 -1
  60. package/dist/hooks/useWalletProviders/useWalletProviders.helpers.d.ts +1 -1
  61. package/dist/hooks/useWalletProviders/useWalletProviders.helpers.d.ts.map +1 -1
  62. package/dist/index.js +2 -2
  63. package/dist/index.js.map +4 -4
  64. package/dist/store/quote.d.ts.map +1 -1
  65. package/dist/store/slices/config.d.ts +1 -1
  66. package/dist/store/slices/config.d.ts.map +1 -1
  67. package/dist/store/slices/wallets.d.ts +1 -1
  68. package/dist/store/slices/wallets.d.ts.map +1 -1
  69. package/dist/store/utils/wallets.d.ts +3 -3
  70. package/dist/store/utils/wallets.d.ts.map +1 -1
  71. package/dist/test-utils/fixtures.d.ts.map +1 -1
  72. package/dist/types/config.d.ts +1 -1
  73. package/dist/types/config.d.ts.map +1 -1
  74. package/dist/utils/common.d.ts.map +1 -1
  75. package/dist/utils/configs.d.ts.map +1 -1
  76. package/dist/utils/env.d.ts +12 -0
  77. package/dist/utils/env.d.ts.map +1 -0
  78. package/dist/utils/meta.d.ts +4 -0
  79. package/dist/utils/meta.d.ts.map +1 -1
  80. package/dist/utils/numbers.d.ts.map +1 -1
  81. package/dist/utils/providers.d.ts +2 -1
  82. package/dist/utils/providers.d.ts.map +1 -1
  83. package/dist/utils/sanitizers.d.ts +15 -0
  84. package/dist/utils/sanitizers.d.ts.map +1 -1
  85. package/dist/utils/wallets.d.ts +0 -2
  86. package/dist/utils/wallets.d.ts.map +1 -1
  87. package/dist/widget-embedded.build.json +1 -1
  88. package/package.json +22 -10
  89. package/src/components/ConfirmWalletsModal/WalletList.tsx +16 -166
  90. package/src/components/CustomTokenModal/CustomTokenModal.tsx +7 -2
  91. package/src/components/StatefulConnectModal/StatefulConnectModal.tsx +1 -1
  92. package/src/components/TokenList/TokenList.tsx +11 -8
  93. package/src/components/WalletStatefulConnect/DerivationPath.helpers.ts +1 -1
  94. package/src/components/WalletStatefulConnect/Detached.tsx +1 -1
  95. package/src/components/WalletStatefulConnect/Detached.types.ts +1 -1
  96. package/src/components/WalletStatefulConnect/Namespaces.tsx +1 -1
  97. package/src/components/WalletStatefulConnect/Namespaces.types.tsx +2 -2
  98. package/src/components/WalletStatefulConnect/index.ts +0 -1
  99. package/src/constants/index.ts +0 -1
  100. package/src/constants/wallets.ts +1 -3
  101. package/src/containers/Inputs/Inputs.tsx +2 -7
  102. package/src/containers/Wallets/Wallets.tsx +6 -0
  103. package/src/containers/WidgetProvider/WidgetProvider.tsx +3 -2
  104. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
  105. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +45 -3262
  106. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +26 -228
  107. package/src/hooks/useStatefulConnect/useStatefulConnect.state.ts +1 -1
  108. package/src/hooks/useStatefulConnect/useStatefulConnect.ts +1 -1
  109. package/src/hooks/useStatefulConnect/useStatefulConnect.types.ts +1 -1
  110. package/src/hooks/useWalletList.ts +6 -29
  111. package/src/hooks/useWalletProviders/useWalletProviders.helpers.ts +1 -1
  112. package/src/store/quote.ts +2 -1
  113. package/src/store/slices/config.ts +2 -2
  114. package/src/store/slices/data.test.ts +1 -1
  115. package/src/store/slices/wallets.ts +25 -12
  116. package/src/store/utils/wallets.ts +5 -5
  117. package/src/test-utils/fixtures.ts +1 -39
  118. package/src/types/config.ts +1 -1
  119. package/src/utils/common.ts +0 -1
  120. package/src/utils/configs.ts +2 -3
  121. package/src/utils/env.ts +28 -0
  122. package/src/utils/meta.ts +13 -0
  123. package/src/utils/numbers.ts +4 -0
  124. package/src/utils/providers.ts +2 -2
  125. package/src/utils/sanitizers.test.ts +43 -0
  126. package/src/utils/sanitizers.ts +26 -0
  127. package/src/utils/wallets.ts +0 -32
  128. package/dist/components/CustomTokenModal/CustomTokenModal.helpers.d.ts +0 -3
  129. package/dist/components/CustomTokenModal/CustomTokenModal.helpers.d.ts.map +0 -1
  130. package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts +0 -9
  131. package/dist/components/WalletStatefulConnect/ExperimentalChain.d.ts.map +0 -1
  132. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.d.ts +0 -4
  133. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.d.ts.map +0 -1
  134. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.d.ts +0 -8
  135. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.d.ts.map +0 -1
  136. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.types.d.ts +0 -6
  137. package/dist/components/WalletStatefulConnect/ExperimentalChainStatus.types.d.ts.map +0 -1
  138. package/src/components/CustomTokenModal/CustomTokenModal.helpers.ts +0 -19
  139. package/src/components/WalletStatefulConnect/ExperimentalChain.tsx +0 -39
  140. package/src/components/WalletStatefulConnect/ExperimentalChainStatus.helpers.ts +0 -53
  141. package/src/components/WalletStatefulConnect/ExperimentalChainStatus.tsx +0 -36
  142. package/src/components/WalletStatefulConnect/ExperimentalChainStatus.types.ts +0 -5
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/widget-embedded",
3
- "version": "0.0.0-experimental-e022ed95-20260421",
3
+ "version": "0.0.0-experimental-82bcc5d9-20260608",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -22,31 +22,43 @@
22
22
  "test:coverage": "vitest run --coverage"
23
23
  },
24
24
  "dependencies": {
25
+ "@hub3js/core": "^0.60.1",
26
+ "@hub3js/namespaces": "^0.1.1",
27
+ "@hub3js/std": "^0.1.1",
25
28
  "@lingui/core": "4.2.1",
26
29
  "@lingui/react": "4.2.1",
27
30
  "@rango-dev/logging-core": "^0.12.1",
28
- "@rango-dev/provider-all": "^0.0.0-experimental-e022ed95-20260421",
31
+ "@rango-dev/provider-all": "^0.0.0-experimental-82bcc5d9-20260608",
29
32
  "@rango-dev/queue-manager-core": "^0.33.0",
30
- "@rango-dev/queue-manager-rango-preset": "^0.60.0",
33
+ "@rango-dev/queue-manager-rango-preset": "^0.0.0-experimental-82bcc5d9-20260608",
31
34
  "@rango-dev/queue-manager-react": "^0.33.0",
32
- "@rango-dev/signer-solana": "^0.0.0-experimental-e022ed95-20260421",
33
- "@rango-dev/ui": "^0.61.0",
34
- "@rango-dev/wallets-core": "^0.57.0",
35
- "@rango-dev/wallets-react": "^0.44.0",
36
- "@rango-dev/wallets-shared": "^0.58.0",
35
+ "@rango-dev/signer-solana": "^0.48.0",
36
+ "@rango-dev/ui": "^0.0.0-experimental-82bcc5d9-20260608",
37
+ "@rango-dev/wallets-core": "^0.0.0-experimental-82bcc5d9-20260608",
38
+ "@rango-dev/wallets-react": "^0.0.0-experimental-82bcc5d9-20260608",
39
+ "@rango-dev/wallets-shared": "^0.0.0-experimental-82bcc5d9-20260608",
37
40
  "bignumber.js": "^9.1.1",
38
41
  "copy-to-clipboard": "^3.3.3",
42
+ "crypto-browserify": "^3.12.1",
39
43
  "dayjs": "^1.11.7",
40
44
  "ethers": "^6.13.2",
41
45
  "immer": "^9.0.19",
42
46
  "mitt": "^3.0.0",
43
- "rango-sdk": "^0.1.70",
44
- "rango-types": "^0.1.89",
47
+ "rango-sdk": "^0.5.0",
48
+ "rango-types": "^0.5.0",
49
+ "react": "^18.2.0",
50
+ "react-dom": "^18.2.0",
45
51
  "react-i18next": "^12.2.0",
46
52
  "react-router-dom": "^6.8.0",
47
53
  "values.js": "2.1.1",
48
54
  "zustand": "^4.3.2"
49
55
  },
56
+ "devDependencies": {
57
+ "@faker-js/faker": "^8.4.1",
58
+ "@types/react": "^18.0.28",
59
+ "@types/react-dom": "^18.0.11",
60
+ "vm-browserify": "^1.1.2"
61
+ },
50
62
  "peerDependencies": {
51
63
  "react": ">=16",
52
64
  "react-dom": ">=16"
@@ -1,11 +1,9 @@
1
1
  import type { PropTypes } from './WalletList.type';
2
- import type { Wallet } from '../../types';
3
2
  import type { ExtendedModalWalletInfo } from '../../utils/wallets';
4
3
 
5
4
  import { i18n } from '@lingui/core';
6
5
  import { warn } from '@rango-dev/logging-core';
7
6
  import {
8
- Divider,
9
7
  makeInfo,
10
8
  SelectableWallet,
11
9
  Typography,
@@ -13,42 +11,24 @@ import {
13
11
  } from '@rango-dev/ui';
14
12
  import React, { useEffect, useState } from 'react';
15
13
 
16
- import { useWallets } from '../..';
17
- import { WIDGET_UI_ID } from '../../constants';
18
14
  import { useWalletList } from '../../hooks/useWalletList';
19
15
  import { useAppStore } from '../../store/AppStore';
20
16
  import { useUiStore } from '../../store/ui';
21
- import { getBlockchainDisplayNameFor } from '../../utils/meta';
22
- import {
23
- getAddress,
24
- getConciseAddress,
25
- isExperimentalChain,
26
- } from '../../utils/wallets';
27
- import { WatermarkedModal } from '../common/WatermarkedModal';
17
+ import { getAddress, getConciseAddress } from '../../utils/wallets';
28
18
  import { StatefulConnectModal } from '../StatefulConnectModal';
29
- import { ExperimentalChain } from '../WalletStatefulConnect';
30
- import { ExperimentalChainStatus } from '../WalletStatefulConnect/ExperimentalChainStatus';
31
19
 
32
20
  import { ShowMoreWallets } from './ConfirmWallets.styles';
33
21
 
34
22
  const ACCOUNT_ADDRESS_MAX_CHARACTERS = 7;
35
- const TIME_TO_CLOSE_MODAL = 3_000;
36
23
 
37
24
  export function WalletList(props: PropTypes) {
38
25
  const { chain, quoteChains, isSelected, selectWallet, limit, onShowMore } =
39
26
  props;
40
27
  const isActiveTab = useUiStore.use.isActiveTab();
41
28
 
42
- const { blockchains, connectedWallets } = useAppStore();
29
+ const { connectedWallets } = useAppStore();
43
30
  const [selectedWalletToConnect, setSelectedWalletToConnect] =
44
31
  useState<ExtendedModalWalletInfo>();
45
- const [experimentalChainWallet, setExperimentalChainWallet] =
46
- useState<Wallet | null>(null);
47
- const [showExperimentalChainModal, setShowExperimentalChainModal] =
48
- useState(false);
49
- const [addingExperimentalChainStatus, setAddingExperimentalChainStatus] =
50
- useState<'in-progress' | 'completed' | 'rejected' | null>(null);
51
- const { suggestAndConnect } = useWallets();
52
32
  const { list } = useWalletList({
53
33
  chain,
54
34
  });
@@ -57,45 +37,6 @@ export function WalletList(props: PropTypes) {
57
37
  const numberOfSupportedWallets = list.length;
58
38
  const shouldShowMoreWallets = limit && numberOfSupportedWallets - limit > 0;
59
39
 
60
- const addExperimentalChain = async (wallet: Wallet) => {
61
- setShowExperimentalChainModal(false);
62
- setAddingExperimentalChainStatus('in-progress');
63
- try {
64
- // 1. Finding wallet with namespaces info.
65
- const walletWithNamespace = list.find(
66
- (wallet) => wallet.type === wallet.type
67
- );
68
-
69
- /*
70
- * 2. Getting namespaces info.
71
- * Legacy and hub have different structure to handle each situation.
72
- */
73
- const needsNamespace = walletWithNamespace?.isHub
74
- ? walletWithNamespace.properties?.find(
75
- (item) => item.name === 'namespaces'
76
- )?.value
77
- : walletWithNamespace?.needsNamespace;
78
-
79
- // 3. Finding target namespace.
80
- const allBlockChains = blockchains();
81
- const namespace = needsNamespace?.data.find((ns) =>
82
- ns
83
- .getSupportedChains(allBlockChains)
84
- .some((chain) => chain.name === wallet.chain)
85
- );
86
- if (!namespace) {
87
- throw new Error('Requested chain is not supported');
88
- }
89
- await suggestAndConnect(wallet.walletType, {
90
- namespace: namespace.value,
91
- network: wallet.chain,
92
- });
93
- setAddingExperimentalChainStatus('completed');
94
- } catch {
95
- setAddingExperimentalChainStatus('rejected');
96
- }
97
- };
98
-
99
40
  useEffect(() => {
100
41
  setSortedList((sortedList) => {
101
42
  const selectedWalletIndex = list.findIndex((wallet) =>
@@ -115,29 +56,6 @@ export function WalletList(props: PropTypes) {
115
56
  });
116
57
  }, [JSON.stringify(list)]);
117
58
 
118
- const modalContainer = document.getElementById(
119
- WIDGET_UI_ID.SWAP_BOX_ID
120
- ) as HTMLDivElement;
121
-
122
- useEffect(() => {
123
- let timeout: ReturnType<typeof setTimeout> | null = null;
124
- if (
125
- addingExperimentalChainStatus === 'completed' ||
126
- addingExperimentalChainStatus === 'rejected'
127
- ) {
128
- timeout = setTimeout(
129
- () => setAddingExperimentalChainStatus(null),
130
- TIME_TO_CLOSE_MODAL
131
- );
132
- }
133
-
134
- return () => {
135
- if (timeout) {
136
- clearTimeout(timeout);
137
- }
138
- };
139
- }, [addingExperimentalChainStatus]);
140
-
141
59
  return (
142
60
  <>
143
61
  {sortedList.slice(0, limit).map((wallet) => {
@@ -155,35 +73,11 @@ export function WalletList(props: PropTypes) {
155
73
  const isConnectedButDifferentThanTargetNamespace =
156
74
  isConnected && !!wallet.needsNamespace && !conciseAddress;
157
75
 
158
- const experimentalChain = isExperimentalChain(blockchains(), chain);
159
-
160
- const experimentalChainNotAdded = !connectedWallets.find(
161
- (connectedWallet) =>
162
- connectedWallet.walletType === wallet.type &&
163
- connectedWallet.chain === chain
164
- );
165
-
166
- const couldAddExperimentalChain =
167
- experimentalChain &&
168
- experimentalChainNotAdded &&
169
- wallet.state === WalletState.CONNECTED;
170
-
171
76
  const onSelectableWalletClick = async () => {
172
77
  const isDisconnected = wallet.state === WalletState.DISCONNECTED;
173
78
 
174
- if (
175
- isDisconnected ||
176
- (isConnectedButDifferentThanTargetNamespace &&
177
- !couldAddExperimentalChain)
178
- ) {
79
+ if (isDisconnected || isConnectedButDifferentThanTargetNamespace) {
179
80
  setSelectedWalletToConnect(wallet);
180
- } else if (couldAddExperimentalChain) {
181
- setExperimentalChainWallet({
182
- walletType: wallet.type,
183
- chain,
184
- address: address ?? '',
185
- });
186
- setShowExperimentalChainModal(true);
187
81
  } else {
188
82
  selectWallet({
189
83
  walletType: wallet.type,
@@ -196,12 +90,7 @@ export function WalletList(props: PropTypes) {
196
90
  const info = makeInfo(wallet.state);
197
91
 
198
92
  const getWalletDescription = () => {
199
- if (couldAddExperimentalChain) {
200
- return i18n.t({
201
- id: 'Add {chain} chain',
202
- values: { chain },
203
- });
204
- } else if (isConnectedButDifferentThanTargetNamespace) {
93
+ if (isConnectedButDifferentThanTargetNamespace) {
205
94
  return i18n.t('Chain not connected');
206
95
  } else if (conciseAddress) {
207
96
  return conciseAddress;
@@ -223,57 +112,17 @@ export function WalletList(props: PropTypes) {
223
112
  return info.color;
224
113
  };
225
114
 
226
- const blockchainDisplayName: string | undefined =
227
- experimentalChainWallet?.chain
228
- ? getBlockchainDisplayNameFor(
229
- experimentalChainWallet.chain,
230
- blockchains()
231
- )
232
- : undefined;
233
115
  return (
234
- <React.Fragment key={`${wallet.title}_${blockchainDisplayName}`}>
235
- {!!experimentalChainWallet && (
236
- <WatermarkedModal
237
- id="widget-wallets-list-watermarked-modal"
238
- open={!!experimentalChainWallet && showExperimentalChainModal}
239
- container={modalContainer}
240
- onClose={() => {
241
- setExperimentalChainWallet(null);
242
- }}>
243
- <ExperimentalChain
244
- id="widget-wallets-list-experimental-chain-container"
245
- displayName={blockchainDisplayName}
246
- onConfirm={() => {
247
- void addExperimentalChain(experimentalChainWallet);
248
- }}
249
- />
250
- </WatermarkedModal>
251
- )}
252
- {addingExperimentalChainStatus && (
253
- <WatermarkedModal
254
- id="widget-wallets-list-experimental-chain-watermarked-modal"
255
- open={!!addingExperimentalChainStatus}
256
- onClose={setAddingExperimentalChainStatus.bind(null, null)}
257
- container={modalContainer}>
258
- <ExperimentalChainStatus
259
- status={addingExperimentalChainStatus}
260
- displayName={blockchainDisplayName}
261
- image={wallet.image}
262
- />
263
- <Divider direction="vertical" size={32} />
264
- </WatermarkedModal>
265
- )}
266
- <SelectableWallet
267
- key={wallet.type}
268
- id="widget-wallets-list-selectable-wallet-btn"
269
- description={getWalletDescription()}
270
- descriptionColor={getWalletDescriptionColor()}
271
- onClick={onSelectableWalletClick}
272
- selected={isSelected(wallet.type, chain)}
273
- disabled={!isActiveTab}
274
- {...wallet}
275
- />
276
- </React.Fragment>
116
+ <SelectableWallet
117
+ key={wallet.type}
118
+ id="widget-wallets-list-selectable-wallet-btn"
119
+ description={getWalletDescription()}
120
+ descriptionColor={getWalletDescriptionColor()}
121
+ onClick={onSelectableWalletClick}
122
+ selected={isSelected(wallet.type, chain)}
123
+ disabled={!isActiveTab}
124
+ {...wallet}
125
+ />
277
126
  );
278
127
  })}
279
128
  <StatefulConnectModal
@@ -301,7 +150,8 @@ export function WalletList(props: PropTypes) {
301
150
  <ShowMoreWallets
302
151
  selected={false}
303
152
  onClick={onShowMore}
304
- id="widget-wallets-list-show-more-wallets-btn">
153
+ id="widget-wallets-list-show-more-wallets-btn"
154
+ >
305
155
  <Typography variant="label" size="medium">
306
156
  {i18n.t('Show more wallets')}
307
157
  <Typography variant="label" size="medium" color="$primary">
@@ -13,10 +13,10 @@ import React from 'react';
13
13
 
14
14
  import { DEFAULT_TOKEN_IMAGE_SRC } from '../../constants/customTokens';
15
15
  import { getContainer } from '../../utils/common';
16
+ import { createTokenExplorerUrl } from '../../utils/meta';
16
17
  import { WatermarkedModal } from '../common/WatermarkedModal';
17
18
 
18
19
  import { CUSTOM_TOKEN_LEARN_MORE_LINK } from './CustomTokenModal.constants';
19
- import { generateExplorerLink } from './CustomTokenModal.helpers';
20
20
  import {
21
21
  Container,
22
22
  FlexCenteredContainer,
@@ -29,7 +29,12 @@ const MAX_SYMBOL_LENGTH_THRESHOLD = 9;
29
29
  export function CustomTokenModal(props: PropTypes) {
30
30
  const { open, onClose, token, onExit, onSubmitClick, blockchain } = props;
31
31
 
32
- const explorerLink = generateExplorerLink(token.address, blockchain);
32
+ const explorerLink = token.address
33
+ ? createTokenExplorerUrl({
34
+ contractAddress: token.address,
35
+ blockchainMeta: blockchain,
36
+ })
37
+ : undefined;
33
38
 
34
39
  const onClickLearnMore = () =>
35
40
  window.open(CUSTOM_TOKEN_LEARN_MORE_LINK, '_blank');
@@ -1,6 +1,6 @@
1
1
  import type { Result } from '../../hooks/useStatefulConnect';
2
2
  import type { WalletInfoWithExtra } from '../../types';
3
- import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
3
+ import type { Namespace } from '@hub3js/namespaces';
4
4
 
5
5
  import { Divider } from '@rango-dev/ui';
6
6
  import React, { useEffect, useRef, useState } from 'react';
@@ -25,7 +25,7 @@ import { useAppStore } from '../../store/AppStore';
25
25
  import { useQuoteStore } from '../../store/quote';
26
26
  import { createTintsAndShades } from '../../utils/colors';
27
27
  import { getContainer } from '../../utils/common';
28
- import { findBlockchain } from '../../utils/meta';
28
+ import { createTokenExplorerUrl, findBlockchain } from '../../utils/meta';
29
29
  import { formatBalance } from '../../utils/wallets';
30
30
  import { ImportCustomToken } from '../ImportCustomToken';
31
31
 
@@ -262,6 +262,13 @@ export function TokenList(props: PropTypes) {
262
262
  }
263
263
  };
264
264
 
265
+ const url = address
266
+ ? createTokenExplorerUrl({
267
+ contractAddress: address,
268
+ blockchainMeta: blockchain,
269
+ })
270
+ : undefined;
271
+
265
272
  return (
266
273
  <ListItemContainer>
267
274
  <StyledListItemButton
@@ -292,9 +299,7 @@ export function TokenList(props: PropTypes) {
292
299
  </ImageSection>
293
300
  }
294
301
  title={
295
- blockchain.type === 'COSMOS' ||
296
- !!token.name ||
297
- (!token.name && !address) ? (
302
+ !!token.name || (!token.name && !address) ? (
298
303
  <Title>
299
304
  <Typography variant="title" size="xmedium">
300
305
  {token.symbol}
@@ -321,16 +326,14 @@ export function TokenList(props: PropTypes) {
321
326
  typeof token !== 'string' &&
322
327
  !!blockchain.info &&
323
328
  !!address &&
324
- blockchain.type !== 'COSMOS'
329
+ !!url
325
330
  ? renderDesc({
326
331
  address,
327
332
  token,
328
333
  customCssForTag,
329
334
  customCssForTagTitle,
330
335
  name: token.name,
331
- url: blockchain.info.addressUrl
332
- .split('{wallet}')
333
- .join(address),
336
+ url,
334
337
  })
335
338
  : token.name || undefined
336
339
  }
@@ -1,4 +1,4 @@
1
- import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
1
+ import type { Namespace } from '@hub3js/namespaces';
2
2
  import type { DerivationPath } from '@rango-dev/wallets-shared';
3
3
 
4
4
  import { namespaces } from '@rango-dev/wallets-shared';
@@ -1,6 +1,6 @@
1
1
  import type { PropTypes } from './Detached.types';
2
+ import type { Namespace } from '@hub3js/namespaces';
2
3
  import type { LegacyNamespaceMeta } from '@rango-dev/wallets-core/legacy';
3
- import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
4
4
 
5
5
  import { i18n } from '@lingui/core';
6
6
  import {
@@ -1,5 +1,5 @@
1
1
  import type { NeedsNamespacesState } from '../../hooks/useStatefulConnect';
2
- import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
2
+ import type { Namespace } from '@hub3js/namespaces';
3
3
 
4
4
  export interface PropTypes {
5
5
  value: NeedsNamespacesState;
@@ -1,5 +1,5 @@
1
1
  import type { PropTypes } from './Namespaces.types';
2
- import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
2
+ import type { Namespace } from '@hub3js/namespaces';
3
3
 
4
4
  import { i18n } from '@lingui/core';
5
5
  import {
@@ -1,7 +1,7 @@
1
1
  import type { NeedsNamespacesState } from '../../hooks/useStatefulConnect';
2
+ import type { NamespaceData } from '@hub3js/core/store';
3
+ import type { Namespace } from '@hub3js/namespaces';
2
4
  import type { LegacyNamespaceMeta } from '@rango-dev/wallets-core/legacy';
3
- import type { Namespace } from '@rango-dev/wallets-core/namespaces/common';
4
- import type { NamespaceData } from '@rango-dev/wallets-core/store';
5
5
 
6
6
  export interface PropTypes {
7
7
  onConfirm: (namespaces: Namespace[]) => void;
@@ -2,4 +2,3 @@ export { Namespaces } from './Namespaces';
2
2
  export { Detached } from './Detached';
3
3
  export { DerivationPath } from './DerivationPath';
4
4
  export { ConnectStatus } from './ConnectStatus';
5
- export { ExperimentalChain } from './ExperimentalChain';
@@ -1,6 +1,5 @@
1
1
  import { UI_ID } from '@rango-dev/ui';
2
2
 
3
- export const RANGO_PUBLIC_API_KEY = 'c6381a79-2817-4602-83bf-6a641a409e32';
4
3
  export const DEFAULT_BASE_URL = 'https://api.rango.exchange';
5
4
  export const SCANNER_BASE_URL = 'https://explorer.rango.exchange';
6
5
 
@@ -1,5 +1,3 @@
1
- import { WalletTypes } from '@rango-dev/wallets-shared';
2
-
3
1
  export const BALANCE_SEPARATOR = '~';
4
2
 
5
- export const EXCLUDED_WALLETS = [WalletTypes.LEAP];
3
+ export const EXCLUDED_WALLETS: string[] = [];
@@ -116,14 +116,9 @@ export function Inputs(props: PropTypes) {
116
116
  loadingBalance={fetchingBalance}
117
117
  tooltipContainer={getContainer()}
118
118
  onSelectMaxBalance={() => {
119
- const tokenBalanceReal = numberToString(
120
- fromBalanceAmount,
121
- fromTokenBalance?.decimals
122
- );
123
-
124
119
  // if a token hasn't any value, we will reset the input by setting an empty string.
125
- const nextInputAmount = !!fromTokenBalance?.amount
126
- ? tokenBalanceReal.split(',').join('')
120
+ const nextInputAmount = fromBalanceAmount.isGreaterThan(ZERO)
121
+ ? fromBalanceAmount.toFixed()
127
122
  : '';
128
123
 
129
124
  setInputAmount(nextInputAmount);
@@ -9,6 +9,7 @@ import type { LegacyEventHandler } from '@rango-dev/wallets-core/legacy';
9
9
  import type { PropsWithChildren } from 'react';
10
10
 
11
11
  import { Provider } from '@rango-dev/wallets-react';
12
+ import { WalletTypes } from '@rango-dev/wallets-shared';
12
13
  import React, { createContext, useEffect, useMemo, useRef } from 'react';
13
14
 
14
15
  import { useWalletProviders } from '../../hooks/useWalletProviders';
@@ -104,6 +105,11 @@ function Main(props: PropsWithChildren<PropTypes>) {
104
105
  autoConnect={!!isActiveTab}
105
106
  configs={{
106
107
  wallets: config.wallets,
108
+ walletOptions: {
109
+ [WalletTypes.TON_CONNECT]: {
110
+ provider: { manifestUrl: config.tonConnect?.manifestUrl },
111
+ },
112
+ },
107
113
  }}>
108
114
  {props.children}
109
115
  </Provider>
@@ -4,11 +4,12 @@ import type { PropsWithChildren } from 'react';
4
4
  import { setSolanaSignerConfig } from '@rango-dev/signer-solana';
5
5
  import React, { useEffect, useMemo } from 'react';
6
6
 
7
- import { DEFAULT_BASE_URL, RANGO_PUBLIC_API_KEY } from '../../constants';
7
+ import { DEFAULT_BASE_URL } from '../../constants';
8
8
  import { useFetchApiConfig } from '../../hooks/useFetchApiConfig';
9
9
  import useFontLoader from '../../hooks/useFontLoader';
10
10
  import QueueManager from '../../QueueManager';
11
11
  import { initConfig } from '../../utils/configs';
12
+ import { getApiKeyFromEnvOrThrow } from '../../utils/env';
12
13
  import { WidgetWallets } from '../Wallets';
13
14
  import { WidgetInfo } from '../WidgetInfo';
14
15
 
@@ -32,7 +33,7 @@ export function WidgetProvider(props: PropsWithChildren<PropTypes>) {
32
33
 
33
34
  useMemo(() => {
34
35
  initConfig({
35
- API_KEY: config?.apiKey || RANGO_PUBLIC_API_KEY,
36
+ API_KEY: config?.apiKey || getApiKeyFromEnvOrThrow(),
36
37
  BASE_URL: config?.apiUrl || DEFAULT_BASE_URL,
37
38
  });
38
39
  }, [config.apiKey, config.apiUrl]);
@@ -1 +1 @@
1
- export const MOST_USED_BLOCKCHAINS = ['ETH', 'COSMOS', 'OSMOSIS'];
1
+ export const MOST_USED_BLOCKCHAINS = ['ETH'];