@rango-dev/widget-embedded 0.17.1-next.2 → 0.17.1-next.21

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 (374) hide show
  1. package/dist/QueueManager.d.ts +5 -2
  2. package/dist/QueueManager.d.ts.map +1 -1
  3. package/dist/components/AppRouter.d.ts +0 -2
  4. package/dist/components/AppRouter.d.ts.map +1 -1
  5. package/dist/components/AppRoutes.d.ts +1 -6
  6. package/dist/components/AppRoutes.d.ts.map +1 -1
  7. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +1 -3
  8. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -1
  9. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +1 -1
  10. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  11. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +1 -3
  12. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
  13. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  14. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
  15. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
  16. package/dist/components/Layout/Layout.d.ts.map +1 -1
  17. package/dist/components/Layout/Layout.types.d.ts +2 -2
  18. package/dist/components/Layout/Layout.types.d.ts.map +1 -1
  19. package/dist/components/NoResult/NoResult.d.ts +4 -0
  20. package/dist/components/NoResult/NoResult.d.ts.map +1 -0
  21. package/dist/components/NoResult/NoResult.helpers.d.ts +4 -0
  22. package/dist/components/NoResult/NoResult.helpers.d.ts.map +1 -0
  23. package/dist/components/{NoRoutes/NoRoutes.styles.d.ts → NoResult/NoResult.styles.d.ts} +1 -1
  24. package/dist/components/{NoRoutes/NoRoutes.styles.d.ts.map → NoResult/NoResult.styles.d.ts.map} +1 -1
  25. package/dist/components/{NoRoutes/NoRoutes.types.d.ts → NoResult/NoResult.types.d.ts} +3 -3
  26. package/dist/components/NoResult/NoResult.types.d.ts.map +1 -0
  27. package/dist/components/NoResult/index.d.ts +2 -0
  28. package/dist/components/NoResult/index.d.ts.map +1 -0
  29. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  30. package/dist/components/Quote/Quote.d.ts +4 -0
  31. package/dist/components/Quote/Quote.d.ts.map +1 -0
  32. package/dist/components/Quote/Quote.styles.d.ts +1588 -0
  33. package/dist/components/Quote/Quote.styles.d.ts.map +1 -0
  34. package/dist/components/Quote/Quote.types.d.ts +21 -0
  35. package/dist/components/Quote/Quote.types.d.ts.map +1 -0
  36. package/dist/components/Quote/QuoteSkeleton.d.ts +4 -0
  37. package/dist/components/Quote/QuoteSkeleton.d.ts.map +1 -0
  38. package/dist/components/Quote/QuoteSkeleton.styles.d.ts +319 -0
  39. package/dist/components/Quote/QuoteSkeleton.styles.d.ts.map +1 -0
  40. package/dist/components/Quote/QuoteSkeleton.types.d.ts +6 -0
  41. package/dist/components/Quote/QuoteSkeleton.types.d.ts.map +1 -0
  42. package/dist/components/Quote/QuoteSummary.d.ts +11 -0
  43. package/dist/components/Quote/QuoteSummary.d.ts.map +1 -0
  44. package/dist/components/Quote/QuoteSummary.styles.d.ts +158 -0
  45. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -0
  46. package/dist/components/Quote/index.d.ts +4 -0
  47. package/dist/components/Quote/index.d.ts.map +1 -0
  48. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +11 -0
  49. package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -0
  50. package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts +4 -0
  51. package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts.map +1 -0
  52. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts +4 -0
  53. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -0
  54. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts +9 -0
  55. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -0
  56. package/dist/components/{RouteErrors/RouteErrors.styles.d.ts → QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts} +1 -1
  57. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -0
  58. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +23 -0
  59. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -0
  60. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +11 -0
  61. package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -0
  62. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +11 -0
  63. package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -0
  64. package/dist/components/QuoteWarningsAndErrors/index.d.ts +2 -0
  65. package/dist/components/QuoteWarningsAndErrors/index.d.ts.map +1 -0
  66. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  67. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  68. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
  69. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  70. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  71. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  72. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  73. package/dist/components/UpdateUrl.d.ts +1 -6
  74. package/dist/components/UpdateUrl.d.ts.map +1 -1
  75. package/dist/components/WidgetEvents.d.ts.map +1 -1
  76. package/dist/constants/errors.d.ts +4 -4
  77. package/dist/constants/errors.d.ts.map +1 -1
  78. package/dist/constants/index.d.ts +1 -0
  79. package/dist/constants/index.d.ts.map +1 -1
  80. package/dist/constants/messages.d.ts +1 -1
  81. package/dist/constants/navigationRoutes.d.ts +1 -2
  82. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  83. package/dist/constants/searchParams.d.ts +2 -1
  84. package/dist/constants/searchParams.d.ts.map +1 -1
  85. package/dist/constants/warnings.d.ts +2 -2
  86. package/dist/constants/warnings.d.ts.map +1 -1
  87. package/dist/containers/App/App.d.ts +3 -0
  88. package/dist/containers/App/App.d.ts.map +1 -0
  89. package/dist/containers/App/App.styles.d.ts +158 -0
  90. package/dist/containers/App/App.styles.d.ts.map +1 -0
  91. package/dist/containers/App/index.d.ts +2 -0
  92. package/dist/containers/App/index.d.ts.map +1 -0
  93. package/dist/containers/QuoteInfo/QuoteInfo.d.ts +4 -0
  94. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -0
  95. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +788 -0
  96. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -0
  97. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +20 -0
  98. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -0
  99. package/dist/containers/QuoteInfo/index.d.ts +2 -0
  100. package/dist/containers/QuoteInfo/index.d.ts.map +1 -0
  101. package/dist/containers/Wallets/Wallets.d.ts +6 -0
  102. package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
  103. package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
  104. package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
  105. package/dist/containers/Wallets/index.d.ts +2 -0
  106. package/dist/containers/Wallets/index.d.ts.map +1 -0
  107. package/dist/containers/Widget/Widget.d.ts +5 -0
  108. package/dist/containers/Widget/Widget.d.ts.map +1 -0
  109. package/dist/containers/Widget/Widget.types.d.ts +5 -0
  110. package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
  111. package/dist/containers/Widget/index.d.ts +3 -0
  112. package/dist/containers/Widget/index.d.ts.map +1 -0
  113. package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
  114. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
  115. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +14 -0
  116. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
  117. package/dist/containers/WidgetInfo/index.d.ts +2 -0
  118. package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
  119. package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
  120. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
  121. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
  122. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
  123. package/dist/containers/WidgetProvider/index.d.ts +2 -0
  124. package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
  125. package/dist/hooks/useConfirmSwap/index.d.ts +2 -0
  126. package/dist/hooks/useConfirmSwap/index.d.ts.map +1 -0
  127. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts +3 -0
  128. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -0
  129. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +19 -0
  130. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -0
  131. package/dist/hooks/{useConfirmSwap.d.ts → useConfirmSwap/useConfirmSwap.types.d.ts} +5 -7
  132. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -0
  133. package/dist/hooks/{useFetchBestRoute.d.ts → useFetchQuote.d.ts} +3 -3
  134. package/dist/hooks/useFetchQuote.d.ts.map +1 -0
  135. package/dist/hooks/useForceAutoConnect.d.ts +2 -0
  136. package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
  137. package/dist/hooks/useLanguage.d.ts +1 -1
  138. package/dist/hooks/useLanguage.d.ts.map +1 -1
  139. package/dist/hooks/useNavigateBack.d.ts +1 -3
  140. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  141. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
  142. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
  143. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
  144. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +5 -7
  145. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
  146. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
  147. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  148. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
  149. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
  150. package/dist/hooks/useSwapInput.d.ts +4 -2
  151. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  152. package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
  153. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  154. package/dist/hooks/useWalletList.d.ts.map +1 -1
  155. package/dist/index.d.ts +13 -5
  156. package/dist/index.d.ts.map +1 -1
  157. package/dist/index.js +1 -1
  158. package/dist/index.js.map +4 -4
  159. package/dist/pages/ConfirmSwapPage.d.ts +1 -6
  160. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  161. package/dist/pages/HistoryPage.d.ts.map +1 -1
  162. package/dist/pages/Home.d.ts.map +1 -1
  163. package/dist/pages/LanguagePage.d.ts.map +1 -1
  164. package/dist/pages/LiquiditySourcePage.d.ts +1 -2
  165. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  166. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  167. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  168. package/dist/pages/SettingsPage.d.ts +1 -6
  169. package/dist/pages/SettingsPage.d.ts.map +1 -1
  170. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  171. package/dist/pages/ThemePage.d.ts.map +1 -1
  172. package/dist/pages/WalletsPage.d.ts +1 -8
  173. package/dist/pages/WalletsPage.d.ts.map +1 -1
  174. package/dist/store/AppStore.d.ts +11 -0
  175. package/dist/store/AppStore.d.ts.map +1 -0
  176. package/dist/store/app.d.ts +5 -23
  177. package/dist/store/app.d.ts.map +1 -1
  178. package/dist/store/{bestRoute.d.ts → quote.d.ts} +39 -27
  179. package/dist/store/quote.d.ts.map +1 -0
  180. package/dist/store/settings.d.ts +3 -2
  181. package/dist/store/settings.d.ts.map +1 -1
  182. package/dist/store/slices/config.d.ts +3 -2
  183. package/dist/store/slices/config.d.ts.map +1 -1
  184. package/dist/store/slices/data.d.ts +3 -0
  185. package/dist/store/slices/data.d.ts.map +1 -1
  186. package/dist/store/wallets.d.ts +5 -4
  187. package/dist/store/wallets.d.ts.map +1 -1
  188. package/dist/types/config.d.ts +19 -5
  189. package/dist/types/config.d.ts.map +1 -1
  190. package/dist/types/index.d.ts +1 -1
  191. package/dist/types/index.d.ts.map +1 -1
  192. package/dist/types/quote.d.ts +82 -0
  193. package/dist/types/quote.d.ts.map +1 -0
  194. package/dist/types/swap.d.ts +3 -13
  195. package/dist/types/swap.d.ts.map +1 -1
  196. package/dist/utils/colors.d.ts.map +1 -1
  197. package/dist/utils/configs.d.ts +1 -0
  198. package/dist/utils/configs.d.ts.map +1 -1
  199. package/dist/utils/meta.d.ts +2 -1
  200. package/dist/utils/meta.d.ts.map +1 -1
  201. package/dist/utils/numbers.d.ts +1 -1
  202. package/dist/utils/numbers.d.ts.map +1 -1
  203. package/dist/utils/{routing.d.ts → quote.d.ts} +16 -12
  204. package/dist/utils/quote.d.ts.map +1 -0
  205. package/dist/utils/settings.d.ts +3 -2
  206. package/dist/utils/settings.d.ts.map +1 -1
  207. package/dist/utils/swap.d.ts +34 -23
  208. package/dist/utils/swap.d.ts.map +1 -1
  209. package/dist/utils/wallets.d.ts +2 -2
  210. package/dist/utils/wallets.d.ts.map +1 -1
  211. package/package.json +6 -6
  212. package/src/QueueManager.tsx +18 -17
  213. package/src/components/AppRouter.tsx +8 -32
  214. package/src/components/AppRoutes.tsx +57 -69
  215. package/src/components/BlockchainList/BlockchainList.tsx +4 -4
  216. package/src/components/BlockchainsSection/BlockchainsSection.tsx +7 -7
  217. package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +2 -64
  218. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +39 -45
  219. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +1 -3
  220. package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
  221. package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
  222. package/src/components/Layout/Layout.tsx +10 -7
  223. package/src/components/Layout/Layout.types.ts +2 -2
  224. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +3 -3
  225. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +6 -6
  226. package/src/components/{NoRoutes/NoRoutes.helper.ts → NoResult/NoResult.helpers.ts} +23 -16
  227. package/src/components/{NoRoutes/NoRoutes.styles.ts → NoResult/NoResult.styles.ts} +2 -0
  228. package/src/components/{NoRoutes/NoRoutes.tsx → NoResult/NoResult.tsx} +10 -12
  229. package/src/components/{NoRoutes/NoRoutes.types.ts → NoResult/NoResult.types.ts} +3 -2
  230. package/src/components/NoResult/index.ts +1 -0
  231. package/src/components/NotificationContent/NotificationContent.tsx +5 -3
  232. package/src/components/Quote/Quote.styles.ts +239 -0
  233. package/src/components/Quote/Quote.tsx +413 -0
  234. package/src/components/Quote/Quote.types.ts +15 -0
  235. package/src/components/Quote/QuoteSkeleton.styles.ts +110 -0
  236. package/src/components/Quote/QuoteSkeleton.tsx +108 -0
  237. package/src/components/Quote/QuoteSkeleton.types.ts +5 -0
  238. package/src/components/Quote/QuoteSummary.styles.ts +15 -0
  239. package/src/components/Quote/QuoteSummary.tsx +46 -0
  240. package/src/components/Quote/index.ts +3 -0
  241. package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +107 -0
  242. package/src/components/{RouteErrors/RouteErrorsModalItem.tsx → QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx} +4 -4
  243. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +74 -0
  244. package/src/components/{RouteErrors/RouteErrors.styles.ts → QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts} +8 -1
  245. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +103 -0
  246. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +25 -0
  247. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +77 -0
  248. package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +38 -0
  249. package/src/components/QuoteWarningsAndErrors/index.ts +1 -0
  250. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +0 -4
  251. package/src/components/SwapDetails/SwapDetails.tsx +17 -24
  252. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
  253. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
  254. package/src/components/SwapsGroup/SwapsGroup.styles.ts +8 -1
  255. package/src/components/SwapsGroup/SwapsGroup.tsx +0 -2
  256. package/src/components/SwitchFromAndTo.tsx +2 -2
  257. package/src/components/TokenList/TokenList.styles.ts +14 -2
  258. package/src/components/TokenList/TokenList.tsx +6 -7
  259. package/src/components/UpdateUrl.tsx +36 -29
  260. package/src/components/WidgetEvents.tsx +4 -2
  261. package/src/constants/errors.ts +17 -15
  262. package/src/constants/index.ts +1 -0
  263. package/src/constants/messages.ts +1 -1
  264. package/src/constants/navigationRoutes.ts +7 -8
  265. package/src/constants/searchParams.ts +1 -0
  266. package/src/constants/warnings.ts +7 -7
  267. package/src/containers/App/App.styles.ts +18 -0
  268. package/src/containers/App/App.tsx +55 -0
  269. package/src/containers/App/index.ts +1 -0
  270. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +31 -0
  271. package/src/containers/QuoteInfo/QuoteInfo.tsx +98 -0
  272. package/src/containers/QuoteInfo/QuoteInfo.types.ts +20 -0
  273. package/src/containers/QuoteInfo/index.ts +1 -0
  274. package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +40 -32
  275. package/src/containers/Wallets/Wallets.types.ts +12 -0
  276. package/src/containers/Wallets/index.ts +1 -0
  277. package/src/containers/Widget/Widget.tsx +19 -0
  278. package/src/containers/Widget/Widget.types.ts +5 -0
  279. package/src/containers/Widget/index.ts +2 -0
  280. package/src/containers/WidgetInfo/WidgetInfo.tsx +47 -0
  281. package/src/containers/WidgetInfo/WidgetInfo.types.ts +14 -0
  282. package/src/containers/WidgetInfo/index.ts +1 -0
  283. package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
  284. package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
  285. package/src/containers/WidgetProvider/index.ts +1 -0
  286. package/src/hooks/useConfirmSwap/index.ts +1 -0
  287. package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +172 -0
  288. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +137 -0
  289. package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +19 -0
  290. package/src/hooks/{useFetchBestRoute.ts → useFetchQuote.ts} +3 -3
  291. package/src/hooks/useForceAutoConnect.ts +27 -0
  292. package/src/hooks/useLanguage.ts +2 -2
  293. package/src/hooks/useNavigateBack.ts +3 -52
  294. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
  295. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
  296. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
  297. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
  298. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +13 -4
  299. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
  300. package/src/hooks/useSwapInput.ts +139 -46
  301. package/src/hooks/useSyncStoresWithConfig.ts +22 -19
  302. package/src/hooks/useWalletList.ts +3 -5
  303. package/src/index.ts +14 -3
  304. package/src/pages/ConfirmSwapPage.tsx +95 -248
  305. package/src/pages/HistoryPage.tsx +1 -5
  306. package/src/pages/Home.tsx +75 -270
  307. package/src/pages/LanguagePage.tsx +0 -5
  308. package/src/pages/LiquiditySourcePage.tsx +22 -35
  309. package/src/pages/SelectBlockchainPage.tsx +31 -24
  310. package/src/pages/SelectSwapItemsPage.tsx +9 -23
  311. package/src/pages/SettingsPage.tsx +8 -15
  312. package/src/pages/SwapDetailsPage.tsx +6 -7
  313. package/src/pages/ThemePage.tsx +0 -4
  314. package/src/pages/WalletsPage.tsx +4 -15
  315. package/src/services/httpService.ts +1 -1
  316. package/src/store/AppStore.tsx +35 -0
  317. package/src/store/app.ts +18 -6
  318. package/src/store/{bestRoute.ts → quote.ts} +68 -60
  319. package/src/store/settings.ts +7 -4
  320. package/src/store/slices/config.ts +25 -15
  321. package/src/store/slices/data.ts +64 -29
  322. package/src/store/wallets.ts +12 -8
  323. package/src/types/config.ts +20 -5
  324. package/src/types/index.ts +1 -1
  325. package/src/types/quote.ts +107 -0
  326. package/src/types/swap.ts +3 -12
  327. package/src/utils/colors.ts +2 -1
  328. package/src/utils/configs.ts +2 -1
  329. package/src/utils/meta.ts +8 -1
  330. package/src/utils/numbers.ts +1 -1
  331. package/src/utils/quote.ts +338 -0
  332. package/src/utils/settings.ts +8 -7
  333. package/src/utils/swap.ts +153 -116
  334. package/src/utils/wallets.ts +29 -17
  335. package/dist/Wallets.d.ts +0 -17
  336. package/dist/Wallets.d.ts.map +0 -1
  337. package/dist/Widget.d.ts +0 -9
  338. package/dist/Widget.d.ts.map +0 -1
  339. package/dist/components/NoRoutes/NoRoutes.d.ts +0 -4
  340. package/dist/components/NoRoutes/NoRoutes.d.ts.map +0 -1
  341. package/dist/components/NoRoutes/NoRoutes.helper.d.ts +0 -3
  342. package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +0 -1
  343. package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +0 -1
  344. package/dist/components/NoRoutes/index.d.ts +0 -2
  345. package/dist/components/NoRoutes/index.d.ts.map +0 -1
  346. package/dist/components/RouteErrors/RouteErrors.d.ts +0 -4
  347. package/dist/components/RouteErrors/RouteErrors.d.ts.map +0 -1
  348. package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +0 -1
  349. package/dist/components/RouteErrors/RouteErrors.types.d.ts +0 -24
  350. package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +0 -1
  351. package/dist/components/RouteErrors/RouteErrorsModal.d.ts +0 -4
  352. package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +0 -1
  353. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +0 -4
  354. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +0 -1
  355. package/dist/components/RouteErrors/index.d.ts +0 -2
  356. package/dist/components/RouteErrors/index.d.ts.map +0 -1
  357. package/dist/hooks/useConfirmSwap.d.ts.map +0 -1
  358. package/dist/hooks/useFetchBestRoute.d.ts.map +0 -1
  359. package/dist/store/bestRoute.d.ts.map +0 -1
  360. package/dist/store/meta.d.ts +0 -23
  361. package/dist/store/meta.d.ts.map +0 -1
  362. package/dist/types/routing.d.ts +0 -65
  363. package/dist/types/routing.d.ts.map +0 -1
  364. package/dist/utils/routing.d.ts.map +0 -1
  365. package/src/Widget.tsx +0 -119
  366. package/src/components/NoRoutes/index.ts +0 -1
  367. package/src/components/RouteErrors/RouteErrors.tsx +0 -79
  368. package/src/components/RouteErrors/RouteErrors.types.ts +0 -29
  369. package/src/components/RouteErrors/RouteErrorsModal.tsx +0 -129
  370. package/src/components/RouteErrors/index.ts +0 -1
  371. package/src/hooks/useConfirmSwap.ts +0 -303
  372. package/src/store/meta.ts +0 -39
  373. package/src/types/routing.ts +0 -77
  374. package/src/utils/routing.ts +0 -321
@@ -0,0 +1,172 @@
1
+ import type { ConfirmSwapFetchResult } from './useConfirmSwap.types';
2
+ import type { ConfirmSwapWarnings, Wallet } from '../../types';
3
+ import type { BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
4
+
5
+ import { errorMessages } from '../../constants/errors';
6
+ import { QuoteErrorType, QuoteUpdateType } from '../../types';
7
+ import { numberToString } from '../../utils/numbers';
8
+ import {
9
+ generateQuoteWarnings,
10
+ getPriceImpact,
11
+ isNumberOfSwapsChanged,
12
+ isQuoteChanged,
13
+ isQuoteInternalCoinsUpdated,
14
+ isQuoteSwappersUpdated,
15
+ } from '../../utils/quote';
16
+ import {
17
+ checkSlippageErrors,
18
+ generateBalanceWarnings,
19
+ getLimitErrorMessage,
20
+ getMinRequiredSlippage,
21
+ getQuoteOutputAmount,
22
+ hasLimitError,
23
+ isOutputAmountChangedALot,
24
+ } from '../../utils/swap';
25
+
26
+ /**
27
+ * A request can be successful but in body of the response, it can be some case which is considered as failed.
28
+ */
29
+ export function throwErrorIfResponseIsNotValid(response: BestRouteResponse) {
30
+ if (!response.result) {
31
+ throw new Error(errorMessages().noResultError.title, {
32
+ cause: {
33
+ type: QuoteErrorType.NO_RESULT,
34
+ diagnosisMessage: response.diagnosisMessages?.[0],
35
+ },
36
+ });
37
+ }
38
+ const limitError = hasLimitError(response);
39
+ if (limitError) {
40
+ const { swap, recommendation, fromAmountRangeError } =
41
+ getLimitErrorMessage(response);
42
+
43
+ throw new Error('bridge limit error', {
44
+ cause: {
45
+ type: QuoteErrorType.BRIDGE_LIMIT,
46
+ swap: swap,
47
+ recommendation,
48
+ fromAmountRangeError,
49
+ },
50
+ });
51
+ }
52
+
53
+ const recommendedSlippages = checkSlippageErrors(response);
54
+
55
+ if (recommendedSlippages) {
56
+ const minRequiredSlippage = getMinRequiredSlippage(response);
57
+ throw new Error('', {
58
+ cause: {
59
+ type: QuoteErrorType.INSUFFICIENT_SLIPPAGE,
60
+ recommendedSlippages,
61
+ minRequiredSlippage,
62
+ },
63
+ });
64
+ }
65
+
66
+ return response;
67
+ }
68
+
69
+ export function generateWarnings(
70
+ previousQuote: BestRouteResponse | undefined,
71
+ currentQuote: BestRouteResponse,
72
+ params: {
73
+ fromToken: Token;
74
+ toToken: Token;
75
+ meta: { blockchains: BlockchainMeta[]; tokens: Token[] };
76
+ selectedWallets: Wallet[];
77
+ userSlippage: number;
78
+ }
79
+ ): ConfirmSwapWarnings {
80
+ let quoteChanged = false;
81
+ if (previousQuote) {
82
+ quoteChanged = isQuoteChanged(previousQuote, currentQuote);
83
+ }
84
+ const output: ConfirmSwapWarnings = {
85
+ quote: null,
86
+ quoteUpdate: null,
87
+ balance: null,
88
+ };
89
+
90
+ const quoteWarning = generateQuoteWarnings(currentQuote, {
91
+ fromToken: params.fromToken,
92
+ toToken: params.toToken,
93
+ tokens: params.meta.tokens,
94
+ userSlippage: params.userSlippage,
95
+ });
96
+
97
+ if (quoteWarning) {
98
+ output.quote = quoteWarning;
99
+ }
100
+
101
+ if (previousQuote && quoteChanged) {
102
+ if (isOutputAmountChangedALot(previousQuote, currentQuote)) {
103
+ output.quoteUpdate = {
104
+ type: QuoteUpdateType.QUOTE_AND_OUTPUT_AMOUNT_UPDATED,
105
+ newOutputAmount: numberToString(getQuoteOutputAmount(currentQuote)),
106
+ percentageChange: numberToString(
107
+ getPriceImpact(
108
+ getQuoteOutputAmount(previousQuote) ?? '',
109
+ getQuoteOutputAmount(currentQuote) ?? ''
110
+ ),
111
+ null,
112
+ 2
113
+ ),
114
+ };
115
+ } else if (isNumberOfSwapsChanged(previousQuote, currentQuote)) {
116
+ output.quoteUpdate = {
117
+ type: QuoteUpdateType.QUOTE_UPDATED,
118
+ };
119
+ } else if (isQuoteSwappersUpdated(previousQuote, currentQuote)) {
120
+ output.quoteUpdate = {
121
+ type: QuoteUpdateType.QUOTE_SWAPPERS_UPDATED,
122
+ };
123
+ } else if (isQuoteInternalCoinsUpdated(previousQuote, currentQuote)) {
124
+ output.quoteUpdate = {
125
+ type: QuoteUpdateType.QUOTE_COINS_UPDATED,
126
+ };
127
+ }
128
+ }
129
+
130
+ const balanceWarnings = generateBalanceWarnings(
131
+ currentQuote,
132
+ params.selectedWallets,
133
+ params.meta.blockchains
134
+ );
135
+ const enoughBalance = balanceWarnings.length === 0;
136
+
137
+ if (!enoughBalance) {
138
+ output.balance = {
139
+ messages: balanceWarnings,
140
+ };
141
+ }
142
+
143
+ return output;
144
+ }
145
+
146
+ export function handleQuoteErrors(error: any): ConfirmSwapFetchResult {
147
+ if (error?.code === 'ERR_CANCELED') {
148
+ return {
149
+ swap: null,
150
+ error: {
151
+ type: QuoteErrorType.REQUEST_CANCELED,
152
+ },
153
+ warnings: null,
154
+ };
155
+ }
156
+
157
+ if (error.cause) {
158
+ return {
159
+ swap: null,
160
+ error: error.cause,
161
+ warnings: null,
162
+ };
163
+ }
164
+
165
+ return {
166
+ swap: null,
167
+ error: {
168
+ type: QuoteErrorType.REQUEST_FAILED,
169
+ },
170
+ warnings: null,
171
+ };
172
+ }
@@ -0,0 +1,137 @@
1
+ import type { ConfirmSwap, Params } from './useConfirmSwap.types';
2
+ import type { PendingSwapSettings } from '../../types';
3
+ import type { BestRouteResponse } from 'rango-sdk';
4
+
5
+ import { calculatePendingSwap } from '@rango-dev/queue-manager-rango-preset';
6
+ import { useEffect } from 'react';
7
+
8
+ import { useAppStore } from '../../store/AppStore';
9
+ import { useQuoteStore } from '../../store/quote';
10
+ import { useSettingsStore } from '../../store/settings';
11
+ import { useWalletsStore } from '../../store/wallets';
12
+ import { createQuoteRequestBody, getWalletsForNewSwap } from '../../utils/swap';
13
+ import { useFetchQuote } from '../useFetchQuote';
14
+
15
+ import {
16
+ generateWarnings,
17
+ handleQuoteErrors,
18
+ throwErrorIfResponseIsNotValid,
19
+ } from './useConfirmSwap.helpers';
20
+
21
+ export function useConfirmSwap(): ConfirmSwap {
22
+ const {
23
+ fromToken,
24
+ toToken,
25
+ inputAmount,
26
+ setQuote,
27
+ quote: initialQuote,
28
+ customDestination: customDestinationFromStore,
29
+ setQuoteWarningsConfirmed,
30
+ } = useQuoteStore();
31
+
32
+ const {
33
+ slippage,
34
+ customSlippage,
35
+ affiliatePercent,
36
+ affiliateRef,
37
+ affiliateWallets,
38
+ disabledLiquiditySources,
39
+ } = useSettingsStore();
40
+ const { connectedWallets } = useWalletsStore();
41
+ const blockchains = useAppStore().blockchains();
42
+ const tokens = useAppStore().tokens();
43
+ const { experimental } = useAppStore().config;
44
+ const { enableNewLiquiditySources } = useAppStore().config;
45
+
46
+ const userSlippage = customSlippage || slippage;
47
+
48
+ const { fetch: fetchQuote, cancelFetch, loading } = useFetchQuote();
49
+
50
+ useEffect(() => cancelFetch, []);
51
+
52
+ const fetch: ConfirmSwap['fetch'] = async (params: Params) => {
53
+ const selectedWallets = params.selectedWallets;
54
+ const customDestination =
55
+ params?.customDestination ?? customDestinationFromStore;
56
+
57
+ if (!fromToken || !toToken || !inputAmount) {
58
+ return {
59
+ quote: null,
60
+ swap: null,
61
+ error: null,
62
+ warnings: null,
63
+ };
64
+ }
65
+
66
+ const requestBody = createQuoteRequestBody({
67
+ fromToken,
68
+ toToken,
69
+ inputAmount,
70
+ wallets: connectedWallets,
71
+ selectedWallets,
72
+ excludeLiquiditySources: enableNewLiquiditySources,
73
+ disabledLiquiditySources,
74
+ slippage: userSlippage,
75
+ affiliateRef,
76
+ affiliatePercent,
77
+ affiliateWallets,
78
+ initialQuote: initialQuote ?? undefined,
79
+ destination: customDestination,
80
+ });
81
+ if (experimental?.routing) {
82
+ requestBody.experimental = true;
83
+ }
84
+ let currentQuote: BestRouteResponse;
85
+ try {
86
+ currentQuote = await fetchQuote(requestBody).then((response) =>
87
+ throwErrorIfResponseIsNotValid(response)
88
+ );
89
+ setQuote(currentQuote);
90
+ } catch (error: any) {
91
+ const confirmSwapResult = handleQuoteErrors(error);
92
+ return confirmSwapResult;
93
+ }
94
+
95
+ const swapSettings: PendingSwapSettings = {
96
+ slippage: userSlippage.toString(),
97
+ disabledSwappersGroups: disabledLiquiditySources,
98
+ };
99
+ const swap = calculatePendingSwap(
100
+ inputAmount.toString(),
101
+ currentQuote,
102
+ getWalletsForNewSwap(selectedWallets),
103
+ swapSettings,
104
+ false,
105
+ { blockchains, tokens }
106
+ );
107
+
108
+ const confirmSwapWarnings = generateWarnings(
109
+ initialQuote ?? undefined,
110
+ currentQuote,
111
+ {
112
+ fromToken,
113
+ toToken,
114
+ meta: { blockchains, tokens },
115
+ selectedWallets,
116
+ userSlippage,
117
+ }
118
+ );
119
+
120
+ if (confirmSwapWarnings.quoteUpdate) {
121
+ setQuoteWarningsConfirmed(false);
122
+ }
123
+
124
+ return {
125
+ quote: currentQuote,
126
+ swap,
127
+ error: null,
128
+ warnings: confirmSwapWarnings,
129
+ };
130
+ };
131
+
132
+ return {
133
+ loading,
134
+ fetch,
135
+ cancelFetch,
136
+ };
137
+ }
@@ -0,0 +1,19 @@
1
+ import type { ConfirmSwapWarnings, QuoteError, Wallet } from '../../types';
2
+ import type { PendingSwap } from 'rango-types/lib';
3
+
4
+ export type ConfirmSwapFetchResult = {
5
+ swap: PendingSwap | null;
6
+ error: QuoteError | null;
7
+ warnings: ConfirmSwapWarnings | null;
8
+ };
9
+
10
+ export type ConfirmSwap = {
11
+ loading: boolean;
12
+ fetch: (params: Params) => Promise<ConfirmSwapFetchResult>;
13
+ cancelFetch: () => void;
14
+ };
15
+
16
+ export type Params = {
17
+ selectedWallets: Wallet[];
18
+ customDestination?: string;
19
+ };
@@ -4,18 +4,18 @@ import { useRef, useState } from 'react';
4
4
 
5
5
  import { httpService } from '../services/httpService';
6
6
 
7
- interface UseFetchBestRoute {
7
+ interface UseFetchQuote {
8
8
  fetch: (requestBody: BestRouteRequest) => Promise<BestRouteResponse>;
9
9
  cancelFetch: () => void;
10
10
  loading: boolean;
11
11
  }
12
12
 
13
- export function useFetchBestRoute(): UseFetchBestRoute {
13
+ export function useFetchQuote(): UseFetchQuote {
14
14
  const [loading, setLoading] = useState(false);
15
15
  const abortController = useRef<AbortController | null>(null);
16
16
  const cancel = () => abortController.current?.abort();
17
17
 
18
- const fetch: UseFetchBestRoute['fetch'] = async (requestBody) => {
18
+ const fetch: UseFetchQuote['fetch'] = async (requestBody) => {
19
19
  cancel();
20
20
  abortController.current = new AbortController();
21
21
 
@@ -0,0 +1,27 @@
1
+ import { useWallets } from '@rango-dev/wallets-react';
2
+ import { useEffect, useRef } from 'react';
3
+
4
+ import { SearchParams } from '../constants/searchParams';
5
+ import { useAppStore } from '../store/AppStore';
6
+
7
+ export function useForceAutoConnect(): void {
8
+ const { connect, state } = useWallets();
9
+ const initiated = useRef<{ [key: string]: boolean }>({});
10
+ const { fetchStatus } = useAppStore();
11
+ const walletType =
12
+ new URLSearchParams(location.search).get(SearchParams.AUTO_CONNECT) || '';
13
+ const walletState = state(walletType);
14
+
15
+ useEffect(() => {
16
+ const shouldTryConnect =
17
+ fetchStatus === 'success' &&
18
+ walletType &&
19
+ walletState.installed &&
20
+ !walletState.connecting &&
21
+ !walletState.connected;
22
+ if (shouldTryConnect && !initiated.current[walletType]) {
23
+ initiated.current[walletType] = true;
24
+ void connect(walletType);
25
+ }
26
+ }, [walletState, fetchStatus]);
27
+ }
@@ -9,7 +9,7 @@ interface UseLanguage {
9
9
  languages: LanguageItem[];
10
10
  defaultLanguage: Language;
11
11
  activeLanguage: Language;
12
- changeLanguage: (language: Language) => void;
12
+ changeLanguage: (language?: Language) => void;
13
13
  }
14
14
 
15
15
  export function useLanguage(): UseLanguage {
@@ -22,6 +22,6 @@ export function useLanguage(): UseLanguage {
22
22
  activeLanguage: language,
23
23
  languages,
24
24
  defaultLanguage,
25
- changeLanguage: setLanguage,
25
+ changeLanguage: (language) => setLanguage(language || DEFAULT_LANGUAGE),
26
26
  };
27
27
  }
@@ -1,55 +1,6 @@
1
- import { useInRouterContext, useNavigate } from 'react-router-dom';
1
+ import { useNavigate } from 'react-router-dom';
2
2
 
3
- import { navigationRoutes } from '../constants/navigationRoutes';
4
- import { useBestRouteStore } from '../store/bestRoute';
5
-
6
- export function useNavigateBack() {
7
- const isRouterInContext = useInRouterContext();
3
+ export function useNavigateBack(): () => void {
8
4
  const navigate = useNavigate();
9
- const routeWalletsConfirmed = useBestRouteStore.use.routeWalletsConfirmed();
10
-
11
- navigationRoutes;
12
-
13
- const navigateBackFrom = (currentRoute: string) => {
14
- if (currentRoute === navigationRoutes.swapDetails) {
15
- return navigate('/' + navigationRoutes.swaps, { replace: true });
16
- }
17
-
18
- if (
19
- !isRouterInContext ||
20
- (window.history.state && window.history.state.idx > 0)
21
- ) {
22
- // eslint-disable-next-line @typescript-eslint/no-magic-numbers
23
- navigate(-1);
24
- } else {
25
- if (
26
- [navigationRoutes.settings, navigationRoutes.wallets].includes(
27
- currentRoute
28
- ) &&
29
- routeWalletsConfirmed
30
- ) {
31
- return navigate('/' + navigationRoutes.confirmSwap, { replace: true });
32
- }
33
- if (
34
- [
35
- navigationRoutes.fromSwap,
36
- navigationRoutes.toSwap,
37
- navigationRoutes.settings,
38
- navigationRoutes.wallets,
39
- navigationRoutes.swaps,
40
- navigationRoutes.confirmSwap,
41
- ].includes(currentRoute)
42
- ) {
43
- navigate(navigationRoutes.home, { replace: true });
44
- } else if (currentRoute === navigationRoutes.fromBlockchain) {
45
- navigate('/' + navigationRoutes.fromSwap, { replace: true });
46
- } else if (currentRoute === navigationRoutes.toBlockchain) {
47
- navigate('/' + navigationRoutes.fromSwap, { replace: true });
48
- } else if (currentRoute === navigationRoutes.liquiditySources) {
49
- navigate('/' + navigationRoutes.settings, { replace: true });
50
- }
51
- }
52
- };
53
-
54
- return { navigateBackFrom };
5
+ return () => navigate(-1);
55
6
  }
@@ -1 +1 @@
1
- export const MOST_USED_BLOCKChAINS = ['ETH', 'COSMOS', 'OSMOSIS'];
1
+ export const MOST_USED_BLOCKCHAINS = ['ETH', 'COSMOS', 'OSMOSIS'];
@@ -1,13 +1,16 @@
1
- import type { PrepareListOptions } from './usePrepareBlockchainList.types';
1
+ import type {
2
+ PrepareListOptions,
3
+ PrepareOutput,
4
+ } from './usePrepareBlockchainList.types';
2
5
  import type { BlockchainMeta } from 'rango-sdk';
3
6
 
4
- import { MOST_USED_BLOCKChAINS } from './usePrepareBlockchainList.constants';
7
+ import { MOST_USED_BLOCKCHAINS } from './usePrepareBlockchainList.constants';
5
8
 
6
9
  export function prepare(
7
10
  blockchains: BlockchainMeta[],
8
11
  preferredBlockchains: string[],
9
12
  options?: PrepareListOptions
10
- ) {
13
+ ): PrepareOutput {
11
14
  /*
12
15
  * TODO:
13
16
  * We copying the `blockchains` which can causes performance penalties but we should because we are mutating the original object.
@@ -25,17 +28,37 @@ export function prepare(
25
28
  let preferredBlockchainsWithoutMainList = preferredBlockchains;
26
29
 
27
30
  if (preferredBlockchains.length <= options.limit) {
28
- /*
29
- * For first X (limit) numbers, we need to remove them from preferred if exists.
31
+ /**
32
+ *
33
+ * if we want to show 10 items (aka `options.limit`)
34
+ * and have these items as our preferred list: [x,y,z]
35
+ * and these as our main list: [A, B, C, D, E, F, G, H, I, J]
36
+ * the final list will be like this: [...preferred, ...mainList].
37
+ *
38
+ * Since we have a limit (e.g. 10) on our list (preferred + mainList),
39
+ * we only should check those items from main list that will be in final list.
40
+ *
41
+ * finalListWithoutLimit = [x,y,z, A, B, C, D, E, F, G, H, I, J]
42
+ * finalListWithLimit = [x,y,z, A, B, C, D, E, F, G]
43
+ *
44
+ * As you can see, [H, I, J] will not be in our list.
45
+ *
46
+ * The following code only check preffred blockchain
47
+ * shouldn't be in first 7 of 10 items in main list. (Since, the last 3 items will not be in the final list and we should check those.)
30
48
  */
31
- for (let i = 0; i < options.limit; i++) {
49
+ const howManyItemsShouldBeCheckedFromMainList =
50
+ options.limit - preferredBlockchains.length;
51
+
52
+ for (let i = 0; i <= howManyItemsShouldBeCheckedFromMainList; i++) {
32
53
  const blockchain = list[i];
54
+
33
55
  preferredBlockchainsWithoutMainList =
34
56
  preferredBlockchainsWithoutMainList.filter((preferredBlockchain) => {
35
57
  return blockchain.name !== preferredBlockchain;
36
58
  });
37
59
  }
38
60
  }
61
+
39
62
  list.sort(
40
63
  generateSortByPreferredBlockchainsFor(preferredBlockchainsWithoutMainList)
41
64
  );
@@ -57,7 +80,7 @@ export function sortByMostUsedBlockchains(
57
80
  a: BlockchainMeta,
58
81
  b: BlockchainMeta
59
82
  ) {
60
- const mostUsed = MOST_USED_BLOCKChAINS;
83
+ const mostUsed = MOST_USED_BLOCKCHAINS;
61
84
  const aIndexInMostUsed = mostUsed.findIndex((token) => token === a.name);
62
85
  const bIndexInMostUsed = mostUsed.findIndex((token) => token === b.name);
63
86
  const aIsMostUsed = aIndexInMostUsed > -1;
@@ -106,3 +129,10 @@ export function generateSortByPreferredBlockchainsFor(
106
129
  return 0;
107
130
  };
108
131
  }
132
+
133
+ export function isInVisibleList(
134
+ blockchain: string,
135
+ prepareOutput: PrepareOutput
136
+ ): boolean {
137
+ return !!prepareOutput.list.find((item) => item.name === blockchain);
138
+ }
@@ -2,6 +2,66 @@ import type { BlockchainMeta } from 'rango-sdk';
2
2
 
3
3
  import { TransactionType } from 'rango-sdk';
4
4
 
5
+ export const sampleDefaultBlockchainNames = [
6
+ 'ETH',
7
+ 'COSMOS',
8
+ 'OSMOSIS',
9
+ 'BSC',
10
+ 'ARBITRUM',
11
+ 'POLYGON',
12
+ 'ZKSYNC',
13
+ 'STARKNET',
14
+ 'OPTIMISM',
15
+ 'AVAX_CCHAIN',
16
+ 'POLYGONZK',
17
+ 'LINEA',
18
+ 'TRON',
19
+ 'BTC',
20
+ 'NEUTRON',
21
+ 'NOBLE',
22
+ 'SOLANA',
23
+ 'CRONOS',
24
+ 'BNB',
25
+ 'AURORA',
26
+ 'MAYA',
27
+ 'THOR',
28
+ 'BOBA',
29
+ 'MOONBEAM',
30
+ 'MOONRIVER',
31
+ 'OKC',
32
+ 'BOBA_AVALANCHE',
33
+ 'LTC',
34
+ 'BCH',
35
+ 'HECO',
36
+ 'STARGAZE',
37
+ 'CRYPTO_ORG',
38
+ 'CHIHUAHUA',
39
+ 'BANDCHAIN',
40
+ 'COMDEX',
41
+ 'REGEN',
42
+ 'IRIS',
43
+ 'EMONEY',
44
+ 'JUNO',
45
+ 'STRIDE',
46
+ 'MARS',
47
+ 'TERRA',
48
+ 'BITSONG',
49
+ 'AKASH',
50
+ 'KI',
51
+ 'PERSISTENCE',
52
+ 'MEDIBLOC',
53
+ 'KUJIRA',
54
+ 'SENTINEL',
55
+ 'INJECTIVE',
56
+ 'SECRET',
57
+ 'KONSTELLATION',
58
+ 'STARNAME',
59
+ 'BITCANNA',
60
+ 'UMEE',
61
+ 'DESMOS',
62
+ 'LUMNETWORK',
63
+ ];
64
+
5
65
  export const sampleBlockchains: BlockchainMeta[] = [
6
66
  {
7
67
  name: 'ETH',