@rango-dev/widget-embedded 0.17.1-next.9 → 0.19.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.
Files changed (271) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/dist/QueueManager.d.ts +1 -2
  3. package/dist/QueueManager.d.ts.map +1 -1
  4. package/dist/Wallets.d.ts +0 -1
  5. package/dist/Wallets.d.ts.map +1 -1
  6. package/dist/Widget.d.ts +1 -1
  7. package/dist/Widget.d.ts.map +1 -1
  8. package/dist/components/AppRouter.d.ts +2 -0
  9. package/dist/components/AppRouter.d.ts.map +1 -1
  10. package/dist/components/AppRoutes.d.ts +6 -1
  11. package/dist/components/AppRoutes.d.ts.map +1 -1
  12. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +3 -1
  13. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -1
  14. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -1
  15. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  16. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +3 -1
  17. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
  18. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  19. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +4 -1
  20. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
  21. package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
  22. package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
  23. package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
  24. package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
  25. package/dist/components/{NoResult/NoResult.styles.d.ts → NoRoutes/NoRoutes.styles.d.ts} +1 -1
  26. package/dist/components/{NoResult/NoResult.styles.d.ts.map → NoRoutes/NoRoutes.styles.d.ts.map} +1 -1
  27. package/dist/components/{NoResult/NoResult.types.d.ts → NoRoutes/NoRoutes.types.d.ts} +3 -3
  28. package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
  29. package/dist/components/NoRoutes/index.d.ts +2 -0
  30. package/dist/components/NoRoutes/index.d.ts.map +1 -0
  31. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  32. package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
  33. package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
  34. package/dist/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts → RouteErrors/RouteErrors.styles.d.ts} +1 -1
  35. package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
  36. package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
  37. package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
  38. package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
  39. package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
  40. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
  41. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
  42. package/dist/components/RouteErrors/index.d.ts +2 -0
  43. package/dist/components/RouteErrors/index.d.ts.map +1 -0
  44. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  45. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  46. package/dist/components/UpdateUrl.d.ts +6 -1
  47. package/dist/components/UpdateUrl.d.ts.map +1 -1
  48. package/dist/components/WidgetEvents.d.ts.map +1 -1
  49. package/dist/constants/errors.d.ts +4 -4
  50. package/dist/constants/errors.d.ts.map +1 -1
  51. package/dist/constants/messages.d.ts +1 -1
  52. package/dist/constants/searchParams.d.ts +1 -2
  53. package/dist/constants/searchParams.d.ts.map +1 -1
  54. package/dist/constants/warnings.d.ts +2 -2
  55. package/dist/constants/warnings.d.ts.map +1 -1
  56. package/dist/hooks/{useConfirmSwap/useConfirmSwap.types.d.ts → useConfirmSwap.d.ts} +7 -5
  57. package/dist/hooks/useConfirmSwap.d.ts.map +1 -0
  58. package/dist/hooks/{useFetchQuote.d.ts → useFetchBestRoute.d.ts} +3 -3
  59. package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
  60. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +2 -2
  61. package/dist/hooks/useSwapInput.d.ts +2 -4
  62. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  63. package/dist/hooks/useSyncStoresWithConfig.d.ts +2 -1
  64. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  65. package/dist/hooks/useWalletList.d.ts.map +1 -1
  66. package/dist/index.js +1 -1
  67. package/dist/index.js.map +4 -4
  68. package/dist/pages/ConfirmSwapPage.d.ts +6 -1
  69. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  70. package/dist/pages/Home.d.ts.map +1 -1
  71. package/dist/pages/LiquiditySourcePage.d.ts +2 -1
  72. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  73. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  74. package/dist/pages/SettingsPage.d.ts +6 -1
  75. package/dist/pages/SettingsPage.d.ts.map +1 -1
  76. package/dist/pages/WalletsPage.d.ts +8 -1
  77. package/dist/pages/WalletsPage.d.ts.map +1 -1
  78. package/dist/store/app.d.ts +23 -5
  79. package/dist/store/app.d.ts.map +1 -1
  80. package/dist/store/{quote.d.ts → bestRoute.d.ts} +27 -39
  81. package/dist/store/bestRoute.d.ts.map +1 -0
  82. package/dist/store/meta.d.ts +23 -0
  83. package/dist/store/meta.d.ts.map +1 -0
  84. package/dist/store/settings.d.ts +2 -3
  85. package/dist/store/settings.d.ts.map +1 -1
  86. package/dist/store/slices/config.d.ts +2 -3
  87. package/dist/store/slices/config.d.ts.map +1 -1
  88. package/dist/store/slices/data.d.ts +0 -3
  89. package/dist/store/slices/data.d.ts.map +1 -1
  90. package/dist/store/wallets.d.ts +4 -5
  91. package/dist/store/wallets.d.ts.map +1 -1
  92. package/dist/types/config.d.ts +5 -5
  93. package/dist/types/config.d.ts.map +1 -1
  94. package/dist/types/index.d.ts +1 -1
  95. package/dist/types/index.d.ts.map +1 -1
  96. package/dist/types/routing.d.ts +65 -0
  97. package/dist/types/routing.d.ts.map +1 -0
  98. package/dist/utils/numbers.d.ts +1 -1
  99. package/dist/utils/numbers.d.ts.map +1 -1
  100. package/dist/utils/{quote.d.ts → routing.d.ts} +12 -16
  101. package/dist/utils/routing.d.ts.map +1 -0
  102. package/dist/utils/settings.d.ts +2 -3
  103. package/dist/utils/settings.d.ts.map +1 -1
  104. package/dist/utils/swap.d.ts +22 -25
  105. package/dist/utils/swap.d.ts.map +1 -1
  106. package/dist/utils/wallets.d.ts +2 -2
  107. package/dist/utils/wallets.d.ts.map +1 -1
  108. package/package.json +8 -8
  109. package/src/QueueManager.tsx +14 -14
  110. package/src/Wallets.tsx +15 -35
  111. package/src/Widget.tsx +24 -11
  112. package/src/components/AppRouter.tsx +5 -6
  113. package/src/components/AppRoutes.tsx +39 -6
  114. package/src/components/BlockchainList/BlockchainList.tsx +4 -4
  115. package/src/components/BlockchainsSection/BlockchainsSection.tsx +7 -7
  116. package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +64 -2
  117. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +40 -28
  118. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +3 -1
  119. package/src/components/ConfirmWalletsModal/WalletList.tsx +5 -6
  120. package/src/components/ConfirmWalletsModal/WalletList.type.ts +4 -1
  121. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +3 -3
  122. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +6 -6
  123. package/src/components/{NoResult/NoResult.helpers.ts → NoRoutes/NoRoutes.helper.ts} +9 -16
  124. package/src/components/{NoResult/NoResult.styles.ts → NoRoutes/NoRoutes.styles.ts} +0 -2
  125. package/src/components/{NoResult/NoResult.tsx → NoRoutes/NoRoutes.tsx} +12 -10
  126. package/src/components/{NoResult/NoResult.types.ts → NoRoutes/NoRoutes.types.ts} +2 -3
  127. package/src/components/NoRoutes/index.ts +1 -0
  128. package/src/components/NotificationContent/NotificationContent.tsx +2 -3
  129. package/src/components/RouteErrors/RouteErrors.tsx +79 -0
  130. package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
  131. package/src/components/RouteErrors/RouteErrorsModal.tsx +129 -0
  132. package/src/components/{QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx → RouteErrors/RouteErrorsModalItem.tsx} +3 -3
  133. package/src/components/RouteErrors/index.ts +1 -0
  134. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +1 -1
  135. package/src/components/SwapDetails/SwapDetails.tsx +22 -18
  136. package/src/components/SwitchFromAndTo.tsx +2 -2
  137. package/src/components/TokenList/TokenList.tsx +6 -5
  138. package/src/components/UpdateUrl.tsx +26 -36
  139. package/src/components/WidgetEvents.tsx +2 -4
  140. package/src/constants/errors.ts +10 -8
  141. package/src/constants/messages.ts +1 -1
  142. package/src/constants/searchParams.ts +0 -1
  143. package/src/constants/warnings.ts +7 -7
  144. package/src/hooks/useConfirmSwap.ts +303 -0
  145. package/src/hooks/{useFetchQuote.ts → useFetchBestRoute.ts} +3 -3
  146. package/src/hooks/useNavigateBack.ts +3 -3
  147. package/src/hooks/useSwapInput.ts +23 -58
  148. package/src/hooks/useSyncStoresWithConfig.ts +19 -22
  149. package/src/hooks/useWalletList.ts +5 -3
  150. package/src/pages/ConfirmSwapPage.tsx +235 -58
  151. package/src/pages/HistoryPage.tsx +1 -1
  152. package/src/pages/Home.tsx +247 -58
  153. package/src/pages/LanguagePage.tsx +1 -1
  154. package/src/pages/LiquiditySourcePage.tsx +32 -23
  155. package/src/pages/SelectBlockchainPage.tsx +7 -6
  156. package/src/pages/SelectSwapItemsPage.tsx +5 -5
  157. package/src/pages/SettingsPage.tsx +13 -9
  158. package/src/pages/SwapDetailsPage.tsx +3 -3
  159. package/src/pages/ThemePage.tsx +1 -1
  160. package/src/pages/WalletsPage.tsx +12 -5
  161. package/src/store/app.ts +6 -18
  162. package/src/store/{quote.ts → bestRoute.ts} +60 -68
  163. package/src/store/meta.ts +39 -0
  164. package/src/store/settings.ts +4 -7
  165. package/src/store/slices/config.ts +15 -25
  166. package/src/store/slices/data.ts +29 -64
  167. package/src/store/wallets.ts +8 -11
  168. package/src/types/config.ts +5 -5
  169. package/src/types/index.ts +1 -1
  170. package/src/types/routing.ts +77 -0
  171. package/src/utils/numbers.ts +1 -1
  172. package/src/utils/routing.ts +321 -0
  173. package/src/utils/settings.ts +7 -8
  174. package/src/utils/swap.ts +85 -113
  175. package/src/utils/wallets.ts +17 -29
  176. package/dist/components/NoResult/NoResult.d.ts +0 -4
  177. package/dist/components/NoResult/NoResult.d.ts.map +0 -1
  178. package/dist/components/NoResult/NoResult.helpers.d.ts +0 -4
  179. package/dist/components/NoResult/NoResult.helpers.d.ts.map +0 -1
  180. package/dist/components/NoResult/NoResult.types.d.ts.map +0 -1
  181. package/dist/components/NoResult/index.d.ts +0 -2
  182. package/dist/components/NoResult/index.d.ts.map +0 -1
  183. package/dist/components/Quote/Quote.d.ts +0 -4
  184. package/dist/components/Quote/Quote.d.ts.map +0 -1
  185. package/dist/components/Quote/Quote.styles.d.ts +0 -1429
  186. package/dist/components/Quote/Quote.styles.d.ts.map +0 -1
  187. package/dist/components/Quote/Quote.types.d.ts +0 -22
  188. package/dist/components/Quote/Quote.types.d.ts.map +0 -1
  189. package/dist/components/Quote/QuoteSkeleton.d.ts +0 -4
  190. package/dist/components/Quote/QuoteSkeleton.d.ts.map +0 -1
  191. package/dist/components/Quote/QuoteSkeleton.styles.d.ts +0 -319
  192. package/dist/components/Quote/QuoteSkeleton.styles.d.ts.map +0 -1
  193. package/dist/components/Quote/QuoteSkeleton.types.d.ts +0 -6
  194. package/dist/components/Quote/QuoteSkeleton.types.d.ts.map +0 -1
  195. package/dist/components/Quote/QuoteSummary.d.ts +0 -11
  196. package/dist/components/Quote/QuoteSummary.d.ts.map +0 -1
  197. package/dist/components/Quote/QuoteSummary.styles.d.ts +0 -158
  198. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +0 -1
  199. package/dist/components/Quote/index.d.ts +0 -4
  200. package/dist/components/Quote/index.d.ts.map +0 -1
  201. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +0 -11
  202. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +0 -1
  203. package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts +0 -4
  204. package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts.map +0 -1
  205. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts +0 -4
  206. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +0 -1
  207. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts +0 -9
  208. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +0 -1
  209. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +0 -1
  210. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +0 -22
  211. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +0 -1
  212. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +0 -11
  213. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +0 -1
  214. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +0 -11
  215. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +0 -1
  216. package/dist/components/QuoteWarningsAndErrors/index.d.ts +0 -2
  217. package/dist/components/QuoteWarningsAndErrors/index.d.ts.map +0 -1
  218. package/dist/containers/QuoteInfo/QuoteInfo.d.ts +0 -4
  219. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +0 -1
  220. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +0 -472
  221. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +0 -1
  222. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -17
  223. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +0 -1
  224. package/dist/containers/QuoteInfo/index.d.ts +0 -2
  225. package/dist/containers/QuoteInfo/index.d.ts.map +0 -1
  226. package/dist/hooks/useConfirmSwap/index.d.ts +0 -2
  227. package/dist/hooks/useConfirmSwap/index.d.ts.map +0 -1
  228. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts +0 -3
  229. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +0 -1
  230. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +0 -16
  231. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +0 -1
  232. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +0 -1
  233. package/dist/hooks/useFetchQuote.d.ts.map +0 -1
  234. package/dist/hooks/useForceAutoConnect.d.ts +0 -2
  235. package/dist/hooks/useForceAutoConnect.d.ts.map +0 -1
  236. package/dist/store/AppStore.d.ts +0 -11
  237. package/dist/store/AppStore.d.ts.map +0 -1
  238. package/dist/store/quote.d.ts.map +0 -1
  239. package/dist/types/quote.d.ts +0 -82
  240. package/dist/types/quote.d.ts.map +0 -1
  241. package/dist/utils/quote.d.ts.map +0 -1
  242. package/src/components/NoResult/index.ts +0 -1
  243. package/src/components/Quote/Quote.styles.ts +0 -212
  244. package/src/components/Quote/Quote.tsx +0 -345
  245. package/src/components/Quote/Quote.types.ts +0 -16
  246. package/src/components/Quote/QuoteSkeleton.styles.ts +0 -110
  247. package/src/components/Quote/QuoteSkeleton.tsx +0 -108
  248. package/src/components/Quote/QuoteSkeleton.types.ts +0 -5
  249. package/src/components/Quote/QuoteSummary.styles.ts +0 -15
  250. package/src/components/Quote/QuoteSummary.tsx +0 -46
  251. package/src/components/Quote/index.ts +0 -3
  252. package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +0 -107
  253. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +0 -67
  254. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +0 -103
  255. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +0 -24
  256. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +0 -77
  257. package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +0 -38
  258. package/src/components/QuoteWarningsAndErrors/index.ts +0 -1
  259. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -15
  260. package/src/containers/QuoteInfo/QuoteInfo.tsx +0 -97
  261. package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -17
  262. package/src/containers/QuoteInfo/index.ts +0 -1
  263. package/src/hooks/useConfirmSwap/index.ts +0 -1
  264. package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +0 -168
  265. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +0 -136
  266. package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +0 -19
  267. package/src/hooks/useForceAutoConnect.ts +0 -27
  268. package/src/store/AppStore.tsx +0 -35
  269. package/src/types/quote.ts +0 -107
  270. package/src/utils/quote.ts +0 -338
  271. /package/src/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts → RouteErrors/RouteErrors.styles.ts} +0 -0
@@ -6,7 +6,7 @@ import { SwapDetails } from '../components/SwapDetails';
6
6
  import { SwapDetailsPlaceholder } from '../components/SwapDetails/SwapDetails.Placeholder';
7
7
  import { navigationRoutes } from '../constants/navigationRoutes';
8
8
  import { useNavigateBack } from '../hooks/useNavigateBack';
9
- import { useAppStore } from '../store/AppStore';
9
+ import { useMetaStore } from '../store/meta';
10
10
  import { useUiStore } from '../store/ui';
11
11
  import { getPendingSwaps } from '../utils/queue';
12
12
 
@@ -16,9 +16,9 @@ export function SwapDetailsPage() {
16
16
  const pendingSwaps = getPendingSwaps(manager);
17
17
  const requestId = useUiStore.use.selectedSwapRequestId();
18
18
  const { navigateBackFrom } = useNavigateBack();
19
- const { fetchStatus: fetchMetaStatus } = useAppStore();
19
+ const { loadingStatus } = useMetaStore();
20
20
 
21
- const showSkeleton = loading || fetchMetaStatus === 'loading';
21
+ const showSkeleton = loading || loadingStatus === 'loading';
22
22
 
23
23
  const selectedSwap = pendingSwaps.find(
24
24
  ({ swap }) => swap.requestId === requestId
@@ -72,7 +72,7 @@ export function ThemePage() {
72
72
  return (
73
73
  <Layout
74
74
  header={{
75
- onBack: () => navigateBackFrom(navigationRoutes.settings),
75
+ onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
76
76
  title: i18n.t('Theme'),
77
77
  }}>
78
78
  <SettingsContainer>
@@ -1,3 +1,4 @@
1
+ import type { WidgetConfig } from '../types';
1
2
  import type { WalletType } from '@rango-dev/wallets-shared';
2
3
 
3
4
  import { i18n } from '@lingui/core';
@@ -9,9 +10,15 @@ import { WalletModal } from '../components/WalletModal';
9
10
  import { navigationRoutes } from '../constants/navigationRoutes';
10
11
  import { useNavigateBack } from '../hooks/useNavigateBack';
11
12
  import { useWalletList } from '../hooks/useWalletList';
12
- import { useAppStore } from '../store/AppStore';
13
+ import { useMetaStore } from '../store/meta';
13
14
  import { getContainer } from '../utils/common';
14
15
 
16
+ interface PropTypes {
17
+ supportedWallets: WidgetConfig['wallets'];
18
+ multiWallets: boolean;
19
+ config?: WidgetConfig;
20
+ }
21
+
15
22
  const ListContainer = styled('div', {
16
23
  display: 'grid',
17
24
  gap: '$10',
@@ -28,8 +35,7 @@ const Container = styled('div', {
28
35
  export const TIME_TO_CLOSE_MODAL = 3_000;
29
36
  export const TIME_TO_IGNORE_MODAL = 300;
30
37
 
31
- export function WalletsPage() {
32
- const { config, fetchStatus: fetchMetaStatus } = useAppStore();
38
+ export function WalletsPage({ config }: PropTypes) {
33
39
  const { navigateBackFrom } = useNavigateBack();
34
40
  const [openModal, setOpenModal] = useState(false);
35
41
  const [selectedWalletType, setSelectedWalletType] = useState<WalletType>('');
@@ -53,6 +59,7 @@ export function WalletsPage() {
53
59
  },
54
60
  });
55
61
 
62
+ const loadingMetaStatus = useMetaStore.use.loadingStatus();
56
63
  const selectedWallet = list.find(
57
64
  (wallet) => wallet.type === selectedWalletType
58
65
  );
@@ -64,7 +71,7 @@ export function WalletsPage() {
64
71
  <Layout
65
72
  header={{
66
73
  title: i18n.t('Connect Wallets'),
67
- onBack: () => navigateBackFrom(navigationRoutes.wallets),
74
+ onBack: navigateBackFrom.bind(null, navigationRoutes.wallets),
68
75
  }}>
69
76
  <Container>
70
77
  <Typography variant="title" size="xmedium" align="center">
@@ -81,7 +88,7 @@ export function WalletsPage() {
81
88
  onClick={(type) => {
82
89
  void handleClick(type);
83
90
  }}
84
- isLoading={fetchMetaStatus === 'loading'}
91
+ isLoading={loadingMetaStatus === 'loading'}
85
92
  />
86
93
  </Fragment>
87
94
  );
package/src/store/app.ts CHANGED
@@ -1,27 +1,15 @@
1
1
  import type { ConfigSlice } from './slices/config';
2
2
  import type { DataSlice } from './slices/data';
3
- import type { WidgetConfig } from '../types';
4
- import type { StateCreator } from 'zustand';
5
3
 
6
4
  import { create } from 'zustand';
7
5
 
6
+ import createSelectors from './selectors';
8
7
  import { createConfigSlice } from './slices/config';
9
8
  import { createDataSlice } from './slices/data';
10
9
 
11
- export type StateCreatorWithInitialData<
12
- T extends Partial<WidgetConfig>,
13
- R extends Record<string, unknown>,
14
- V extends Record<string, unknown>
15
- > = (
16
- initialData: T | undefined,
17
- ...rest: Parameters<StateCreator<R, [], [], V>>
18
- ) => ReturnType<StateCreator<R, [], [], V>>;
10
+ const store = create<DataSlice & ConfigSlice>()((...a) => ({
11
+ ...createDataSlice(...a),
12
+ ...createConfigSlice(...a),
13
+ }));
19
14
 
20
- export type AppStoreState = DataSlice & ConfigSlice;
21
-
22
- export function createAppStore(initialData?: WidgetConfig) {
23
- return create<AppStoreState>()((...a) => ({
24
- ...createDataSlice(...a),
25
- ...createConfigSlice(initialData, ...a),
26
- }));
27
- }
15
+ export const useAppStore = createSelectors(store);
@@ -1,12 +1,7 @@
1
1
  import type { TokenWithBalance } from '../components/TokenList';
2
2
  import type { Wallet } from '../types';
3
3
  import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset/dist/shared';
4
- import type {
5
- BestRouteResponse,
6
- BlockchainMeta,
7
- MetaResponse,
8
- Token,
9
- } from 'rango-sdk';
4
+ import type { BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
10
5
 
11
6
  import BigNumber from 'bignumber.js';
12
7
  import { create } from 'zustand';
@@ -14,24 +9,21 @@ import { subscribeWithSelector } from 'zustand/middleware';
14
9
 
15
10
  import { ZERO } from '../constants/numbers';
16
11
  import { isPositiveNumber } from '../utils/numbers';
17
- import { createRetryQuote, getQuoteToTokenUsdPrice } from '../utils/quote';
12
+ import {
13
+ createRetryRoute,
14
+ getBestRouteToTokenUsdPrice,
15
+ } from '../utils/routing';
18
16
  import { calcOutputUsdValue } from '../utils/swap';
19
17
 
18
+ import { useMetaStore } from './meta';
20
19
  import createSelectors from './selectors';
21
20
 
22
- export const getUsdValue = (
23
- token: Token | null,
24
- amount: string
25
- ): BigNumber | null =>
21
+ const getUsdValue = (token: Token | null, amount: string): BigNumber | null =>
26
22
  token?.usdPrice
27
23
  ? new BigNumber(amount || ZERO).multipliedBy(token?.usdPrice || 0)
28
24
  : null;
29
25
 
30
- export type Meta = Pick<MetaResponse, 'blockchains' | 'tokens'>;
31
-
32
- export type SetTokenParams = { token: Token; meta: Meta } | { token: null };
33
-
34
- export interface QuoteState {
26
+ export interface RouteState {
35
27
  fromBlockchain: BlockchainMeta | null;
36
28
  toBlockchain: BlockchainMeta | null;
37
29
  inputAmount: string;
@@ -40,32 +32,30 @@ export interface QuoteState {
40
32
  outputUsdValue: BigNumber | null;
41
33
  fromToken: TokenWithBalance | null;
42
34
  toToken: TokenWithBalance | null;
43
- quoteWalletsConfirmed: boolean;
35
+ routeWalletsConfirmed: boolean;
44
36
  selectedWallets: Wallet[];
45
- quoteWarningsConfirmed: boolean;
46
- resetQuote: () => void;
37
+ resetRoute: () => void;
47
38
  resetToBlockchain: () => void;
48
39
  resetFromBlockchain: () => void;
49
40
  setFromBlockchain: (chain: BlockchainMeta | null) => void;
50
41
  setToBlockchain: (chian: BlockchainMeta | null) => void;
51
42
 
52
- setFromToken: (params: SetTokenParams) => void;
53
- setToToken: (params: SetTokenParams) => void;
43
+ setFromToken: (token: Token | null) => void;
44
+ setToToken: (token: Token | null) => void;
54
45
  setInputAmount: (amount: string) => void;
55
- quote: BestRouteResponse | null;
56
- setQuote: (quote: BestRouteResponse | null) => void;
57
- retry: (pendingSwap: PendingSwap, meta: Meta) => void;
46
+ bestRoute: BestRouteResponse | null;
47
+ setRoute: (bestRoute: BestRouteResponse | null) => void;
48
+ retry: (pendingSwap: PendingSwap) => void;
58
49
  switchFromAndTo: () => void;
59
- setQuoteWalletConfirmed: (flag: boolean) => void;
50
+ setRouteWalletConfirmed: (flag: boolean) => void;
60
51
  setSelectedWallets: (wallets: Wallet[]) => void;
61
52
  customDestination: string;
62
53
  setCustomDestination: (address: string) => void;
63
- resetQuoteWallets: () => void;
64
- setQuoteWarningsConfirmed: (flag: boolean) => void;
54
+ resetRouteWallets: () => void;
65
55
  }
66
56
 
67
- export const useQuoteStore = createSelectors(
68
- create<QuoteState>()(
57
+ export const useBestRouteStore = createSelectors(
58
+ create<RouteState>()(
69
59
  subscribeWithSelector((set) => ({
70
60
  fromBlockchain: null,
71
61
  fromToken: null,
@@ -75,38 +65,37 @@ export const useQuoteStore = createSelectors(
75
65
  outputUsdValue: new BigNumber(0),
76
66
  toBlockchain: null,
77
67
  toToken: null,
78
- quote: null,
79
- quoteWalletsConfirmed: false,
68
+ bestRoute: null,
69
+ routeWalletsConfirmed: false,
80
70
  selectedWallets: [],
81
71
  customDestination: '',
82
- quoteWarningsConfirmed: false,
83
- setQuote: (quote) =>
72
+ setRoute: (bestRoute) =>
84
73
  set((state) => {
85
74
  let outputAmount: BigNumber | null = null;
86
75
  let outputUsdValue: BigNumber = ZERO;
87
76
  if (!isPositiveNumber(state.inputAmount)) {
88
77
  return {};
89
78
  }
90
- if (!!quote) {
91
- outputAmount = !!quote.result?.outputAmount
92
- ? new BigNumber(quote.result?.outputAmount)
79
+ if (!!bestRoute) {
80
+ outputAmount = !!bestRoute.result?.outputAmount
81
+ ? new BigNumber(bestRoute.result?.outputAmount)
93
82
  : null;
94
83
  outputUsdValue = calcOutputUsdValue(
95
- quote.result?.outputAmount,
96
- getQuoteToTokenUsdPrice(quote) || state.toToken?.usdPrice
84
+ bestRoute.result?.outputAmount,
85
+ getBestRouteToTokenUsdPrice(bestRoute) || state.toToken?.usdPrice
97
86
  );
98
87
  }
99
88
  return {
100
- quote: quote,
101
- ...(!!quote && {
89
+ bestRoute,
90
+ ...(!!bestRoute && {
102
91
  outputAmount,
103
92
  outputUsdValue,
104
93
  }),
105
94
  };
106
95
  }),
107
- resetQuote: () =>
96
+ resetRoute: () =>
108
97
  set(() => ({
109
- quote: null,
98
+ bestRoute: null,
110
99
  outputAmount: null,
111
100
  outputUsdValue: new BigNumber(0),
112
101
  })),
@@ -119,7 +108,7 @@ export const useQuoteStore = createSelectors(
119
108
  return {
120
109
  fromBlockchain: chain,
121
110
  ...(state.fromToken && {
122
- quote: null,
111
+ bestRoute: null,
123
112
  fromToken: null,
124
113
  outputAmount: null,
125
114
  outputUsdValue: null,
@@ -127,17 +116,18 @@ export const useQuoteStore = createSelectors(
127
116
  };
128
117
  });
129
118
  },
130
- setFromToken: (params) => {
119
+ setFromToken: (token) => {
120
+ const { blockchains } = useMetaStore.getState().meta;
131
121
  return set((state) => ({
132
- fromToken: params.token,
133
- ...(params.token && {
122
+ fromToken: token,
123
+ ...(token && {
134
124
  fromBlockchain:
135
- params.meta.blockchains.find(
136
- (blockchain) => blockchain.name === params.token.blockchain
125
+ blockchains.find(
126
+ (blockchain) => blockchain.name === token.blockchain
137
127
  ) ?? null,
138
128
  }),
139
129
  ...(!!state.inputAmount && {
140
- inputUsdValue: getUsdValue(params.token, state.inputAmount),
130
+ inputUsdValue: getUsdValue(token, state.inputAmount),
141
131
  }),
142
132
  }));
143
133
  },
@@ -150,7 +140,7 @@ export const useQuoteStore = createSelectors(
150
140
  return {
151
141
  toBlockchain: chain,
152
142
  ...(state.toToken && {
153
- quote: null,
143
+ bestRoute: null,
154
144
  toToken: null,
155
145
  outputAmount: null,
156
146
  outputUsdValue: null,
@@ -158,13 +148,14 @@ export const useQuoteStore = createSelectors(
158
148
  };
159
149
  });
160
150
  },
161
- setToToken: (params) => {
151
+ setToToken: (token) => {
152
+ const { blockchains } = useMetaStore.getState().meta;
162
153
  return set(() => ({
163
- toToken: params.token,
164
- ...(params.token && {
154
+ toToken: token,
155
+ ...(token && {
165
156
  toBlockchain:
166
- params.meta.blockchains.find(
167
- (blockchain) => blockchain.name === params.token.blockchain
157
+ blockchains.find(
158
+ (blockchain) => blockchain.name === token.blockchain
168
159
  ) ?? null,
169
160
  }),
170
161
  }));
@@ -175,22 +166,24 @@ export const useQuoteStore = createSelectors(
175
166
  ...(!amount && {
176
167
  outputAmount: new BigNumber(0),
177
168
  outputUsdValue: new BigNumber(0),
178
- quote: null,
169
+ bestRoute: null,
179
170
  }),
180
171
  ...(!!state.fromToken && {
181
172
  inputUsdValue: getUsdValue(state.fromToken, amount),
182
173
  }),
183
174
  }));
184
175
  },
185
- retry: (pendingSwap, meta) => {
186
- const { tokens, blockchains } = meta;
176
+ retry: (pendingSwap) => {
177
+ const { tokens, blockchains } = useMetaStore.getState().meta;
178
+
187
179
  const {
188
180
  fromBlockchain,
189
181
  fromToken,
190
182
  toBlockchain,
191
183
  toToken,
192
184
  inputAmount,
193
- } = createRetryQuote(pendingSwap, blockchains, tokens);
185
+ } = createRetryRoute(pendingSwap, blockchains, tokens);
186
+
194
187
  set({
195
188
  fromBlockchain,
196
189
  fromToken,
@@ -200,7 +193,7 @@ export const useQuoteStore = createSelectors(
200
193
  outputUsdValue: new BigNumber(0),
201
194
  toBlockchain,
202
195
  toToken,
203
- quote: null,
196
+ bestRoute: null,
204
197
  });
205
198
  },
206
199
  switchFromAndTo: () =>
@@ -215,13 +208,14 @@ export const useQuoteStore = createSelectors(
215
208
  state.outputAmount?.toString() || ''
216
209
  ),
217
210
  })),
211
+
218
212
  resetFromBlockchain: () =>
219
213
  set(() => ({
220
214
  fromToken: null,
221
215
  fromBlockchain: null,
222
216
  outputAmount: null,
223
217
  outputUsdValue: null,
224
- quote: null,
218
+ bestRoute: null,
225
219
  })),
226
220
  resetToBlockchain: () =>
227
221
  set(() => ({
@@ -229,22 +223,20 @@ export const useQuoteStore = createSelectors(
229
223
  toBlockchain: null,
230
224
  outputAmount: null,
231
225
  outputUsdValue: null,
232
- quote: null,
226
+ bestRoute: null,
233
227
  })),
234
- setQuoteWalletConfirmed: (flag) =>
228
+ setRouteWalletConfirmed: (flag) =>
235
229
  set({
236
- quoteWalletsConfirmed: flag,
230
+ routeWalletsConfirmed: flag,
237
231
  }),
238
232
  setSelectedWallets: (wallets) => set({ selectedWallets: wallets }),
239
233
  setCustomDestination: (address) => set({ customDestination: address }),
240
- resetQuoteWallets: () =>
234
+ resetRouteWallets: () =>
241
235
  set({
242
- quoteWalletsConfirmed: false,
236
+ routeWalletsConfirmed: false,
243
237
  selectedWallets: [],
244
238
  customDestination: '',
245
239
  }),
246
- setQuoteWarningsConfirmed: (flag) =>
247
- set({ quoteWarningsConfirmed: flag }),
248
240
  }))
249
241
  )
250
242
  );
@@ -0,0 +1,39 @@
1
+ import type { TokenWithBalance } from '../components/TokenList';
2
+ import type { MetaResponse } from 'rango-sdk';
3
+
4
+ import { create } from 'zustand';
5
+
6
+ import { useAppStore } from './app';
7
+ import createSelectors from './selectors';
8
+
9
+ export type LoadingStatus = 'loading' | 'success' | 'failed';
10
+
11
+ export interface MetaState {
12
+ meta: MetaResponse & { tokens: TokenWithBalance[] };
13
+ loadingStatus: LoadingStatus;
14
+ fetchMeta: () => Promise<void>;
15
+ }
16
+
17
+ export const useMetaStore = createSelectors(
18
+ create<MetaState>()((set) => ({
19
+ meta: { blockchains: [], popularTokens: [], swappers: [], tokens: [] },
20
+ loadingStatus: 'loading',
21
+ fetchMeta: async () => {
22
+ try {
23
+ await useAppStore.getState().fetch();
24
+
25
+ const state = useAppStore.getState();
26
+ const response: MetaResponse = {
27
+ blockchains: state.blockchains(),
28
+ tokens: state.tokens(),
29
+ popularTokens: state._popularTokens,
30
+ swappers: state._swappers,
31
+ };
32
+
33
+ set({ meta: response, loadingStatus: 'success' });
34
+ } catch (error) {
35
+ set({ loadingStatus: 'failed' });
36
+ }
37
+ },
38
+ }))
39
+ );
@@ -1,5 +1,3 @@
1
- import type { SwapperMeta } from 'rango-sdk';
2
-
3
1
  import { type Language } from '@rango-dev/ui';
4
2
  import { create } from 'zustand';
5
3
  import { persist, subscribeWithSelector } from 'zustand/middleware';
@@ -9,6 +7,7 @@ import { DEFAULT_LANGUAGE } from '../constants/languages';
9
7
  import { DEFAULT_SLIPPAGE } from '../constants/swapSettings';
10
8
  import { removeDuplicateFrom } from '../utils/common';
11
9
 
10
+ import { useMetaStore } from './meta';
12
11
  import createSelectors from './selectors';
13
12
 
14
13
  export type ThemeMode = 'auto' | 'dark' | 'light';
@@ -32,10 +31,7 @@ export interface SettingsState {
32
31
  toggleLiquiditySource: (name: string) => void;
33
32
  setTheme: (theme: ThemeMode) => void;
34
33
  setLanguage: (language: Language) => void;
35
- toggleAllLiquiditySources: (
36
- swappers: SwapperMeta[],
37
- shouldReset?: boolean
38
- ) => void;
34
+ toggleAllLiquiditySources: (shouldReset?: boolean) => void;
39
35
  setAffiliateRef: (affiliateRef: string | null) => void;
40
36
  setAffiliatePercent: (affiliatePercent: number | null) => void;
41
37
  setAffiliateWallets: (
@@ -106,11 +102,12 @@ export const useSettingsStore = createSelectors(
106
102
  set(() => ({
107
103
  affiliateWallets,
108
104
  })),
109
- toggleAllLiquiditySources: (swappers, shouldReset) =>
105
+ toggleAllLiquiditySources: (shouldReset?: boolean) =>
110
106
  set((state) => {
111
107
  if (shouldReset) {
112
108
  return { disabledLiquiditySources: [] };
113
109
  }
110
+ const { swappers } = useMetaStore.getState().meta;
114
111
  const swappersGroup = removeDuplicateFrom(
115
112
  swappers.map((swapper) => swapper.swapperGroup)
116
113
  );
@@ -1,11 +1,7 @@
1
1
  import type { WidgetConfig } from '../../types';
2
- import type { StateCreatorWithInitialData } from '../app';
2
+ import type { StateCreator } from 'zustand';
3
3
 
4
- export const DEFAULT_CONFIG: WidgetConfig = {
5
- apiKey: '',
6
- multiWallets: true,
7
- enableNewLiquiditySources: true,
8
- };
4
+ const initConfig: WidgetConfig = { apiKey: '' };
9
5
 
10
6
  export type ConfigSlice = {
11
7
  config: WidgetConfig;
@@ -13,24 +9,18 @@ export type ConfigSlice = {
13
9
  updateConfig: (config: WidgetConfig) => void;
14
10
  };
15
11
 
16
- export const createConfigSlice: StateCreatorWithInitialData<
17
- WidgetConfig,
18
- ConfigSlice,
19
- ConfigSlice
20
- > = (initialData, set, get) => {
21
- return {
22
- config: { ...DEFAULT_CONFIG, ...initialData },
12
+ export const createConfigSlice: StateCreator<ConfigSlice> = (set, get) => ({
13
+ config: initConfig,
23
14
 
24
- // Actions
25
- updateConfig: (nextConfig: WidgetConfig) => {
26
- const currentConfig = get().config;
15
+ // Actions
16
+ updateConfig: (nextConfig: WidgetConfig) => {
17
+ const currentConfig = get().config;
27
18
 
28
- set({
29
- config: {
30
- ...currentConfig,
31
- ...nextConfig,
32
- },
33
- });
34
- },
35
- };
36
- };
19
+ set({
20
+ config: {
21
+ ...currentConfig,
22
+ ...nextConfig,
23
+ },
24
+ });
25
+ },
26
+ });
@@ -6,7 +6,6 @@ import type { StateCreator } from 'zustand';
6
6
 
7
7
  import { httpService as sdk } from '../../services/httpService';
8
8
  import { containsText } from '../../utils/common';
9
- import { sortLiquiditySourcesByGroupTitle } from '../../utils/settings';
10
9
  import { tokensAreEqual } from '../../utils/wallets';
11
10
 
12
11
  type BlockchainOptions = {
@@ -19,16 +18,15 @@ type TokenOptions = {
19
18
  blockchain?: string;
20
19
  searchFor?: string;
21
20
  };
22
- export type FetchStatus = 'loading' | 'success' | 'failed';
21
+
23
22
  export interface DataSlice {
24
23
  _blockchains: BlockchainMeta[];
25
24
  _tokens: Token[];
26
25
  _popularTokens: Token[];
27
26
  _swappers: SwapperMeta[];
28
- fetchStatus: FetchStatus;
27
+
29
28
  blockchains: (options?: BlockchainOptions) => BlockchainMeta[];
30
29
  tokens: (options?: TokenOptions) => Token[];
31
- swappers: () => SwapperMeta[];
32
30
  isTokenPinned: (token: Token) => boolean;
33
31
 
34
32
  fetch: () => Promise<void>;
@@ -45,7 +43,7 @@ export const createDataSlice: StateCreator<
45
43
  _tokens: [],
46
44
  _popularTokens: [],
47
45
  _swappers: [],
48
- fetchStatus: 'loading',
46
+
49
47
  // Selectors
50
48
  blockchains: (options) => {
51
49
  const blockchainsFromState = get()._blockchains;
@@ -165,74 +163,41 @@ export const createDataSlice: StateCreator<
165
163
  );
166
164
  return pinned;
167
165
  },
168
- swappers: () => {
169
- const {
170
- config: { enableNewLiquiditySources, liquiditySources },
171
- } = get();
172
-
173
- /*
174
- * If the enableNewLiquiditySources flag is set to true, we return all swappers that are not included in the config.
175
- * Otherwise, we return all swappers that are included in the config.
176
- */
177
- const swappers = get()._swappers.filter((swapper) => {
178
- const swapperGroupIncludedInLiquiditySources = liquiditySources?.includes(
179
- swapper.swapperGroup
180
- );
181
-
182
- const shouldExcludeLiquiditySources =
183
- enableNewLiquiditySources ||
184
- !liquiditySources ||
185
- liquiditySources.length === 0;
186
-
187
- return shouldExcludeLiquiditySources
188
- ? !swapperGroupIncludedInLiquiditySources
189
- : swapperGroupIncludedInLiquiditySources;
190
- });
191
-
192
- const sortedSwappers = swappers.sort(sortLiquiditySourcesByGroupTitle);
193
166
 
194
- return sortedSwappers;
195
- },
196
167
  // Actions
197
168
  fetch: async () => {
198
- try {
199
- const response = await sdk().getAllMetadata();
169
+ const response = await sdk().getAllMetadata();
200
170
 
201
- set({ fetchStatus: 'success' });
202
- const blockchains: BlockchainMeta[] = [];
203
- const tokens: Token[] = [];
204
- const popularTokens: Token[] = response.popularTokens;
205
- const swappers: SwapperMeta[] = response.swappers;
171
+ const blockchains: BlockchainMeta[] = [];
172
+ const tokens: Token[] = [];
173
+ const popularTokens: Token[] = response.popularTokens;
174
+ const swappers: SwapperMeta[] = response.swappers;
206
175
 
207
- const blockchainsWithAtLeastOneToken = new Set();
176
+ const blockchainsWithAtLeastOneToken = new Set();
208
177
 
209
- response.tokens.forEach((token) => {
210
- blockchainsWithAtLeastOneToken.add(token.blockchain);
178
+ response.tokens.forEach((token) => {
179
+ blockchainsWithAtLeastOneToken.add(token.blockchain);
211
180
 
212
- tokens.push(token);
213
- });
181
+ tokens.push(token);
182
+ });
214
183
 
215
- response.blockchains.forEach((blockchain) => {
216
- if (
217
- blockchain.enabled &&
218
- blockchainsWithAtLeastOneToken.has(blockchain.name)
219
- ) {
220
- blockchains.push(blockchain);
221
- }
222
- });
184
+ response.blockchains.forEach((blockchain) => {
185
+ if (
186
+ blockchain.enabled &&
187
+ blockchainsWithAtLeastOneToken.has(blockchain.name)
188
+ ) {
189
+ blockchains.push(blockchain);
190
+ }
191
+ });
223
192
 
224
- // Sort
225
- blockchains.sort((a, b) => a.sort - b.sort);
193
+ // Sort
194
+ blockchains.sort((a, b) => a.sort - b.sort);
226
195
 
227
- set({
228
- _blockchains: blockchains,
229
- _tokens: tokens,
230
- _popularTokens: popularTokens,
231
- _swappers: swappers,
232
- });
233
- } catch (error) {
234
- set({ fetchStatus: 'failed' });
235
- throw error;
236
- }
196
+ set({
197
+ _blockchains: blockchains,
198
+ _tokens: tokens,
199
+ _popularTokens: popularTokens,
200
+ _swappers: swappers,
201
+ });
237
202
  },
238
203
  });