@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
@@ -2,20 +2,15 @@
2
2
  import type {
3
3
  ConfirmSwap,
4
4
  ConfirmSwapFetchResult,
5
- } from '../hooks/useConfirmSwap';
6
- import type { WidgetConfig } from '../types';
5
+ } from '../hooks/useConfirmSwap/useConfirmSwap.types';
7
6
 
8
7
  import { i18n } from '@lingui/core';
9
8
  import { useManager } from '@rango-dev/queue-manager-react';
10
9
  import {
11
10
  Alert,
12
- BestRoute,
13
- BestRouteSkeleton,
14
11
  Button,
15
12
  Divider,
16
13
  IconButton,
17
- MessageBox,
18
- Modal,
19
14
  RefreshIcon,
20
15
  SettingsIcon,
21
16
  styled,
@@ -23,50 +18,24 @@ import {
23
18
  Typography,
24
19
  WalletIcon,
25
20
  } from '@rango-dev/ui';
26
- import React, { useEffect, useState } from 'react';
21
+ import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
27
22
  import { flushSync } from 'react-dom';
28
23
  import { useNavigate } from 'react-router-dom';
29
24
 
30
- import {
31
- formatBestRoute,
32
- getRequiredWallets,
33
- } from '../components/ConfirmWalletsModal/ConfirmWallets.helpers';
25
+ import { getRequiredWallets } from '../components/ConfirmWalletsModal/ConfirmWallets.helpers';
34
26
  import { ConfirmWalletsModal } from '../components/ConfirmWalletsModal/ConfirmWalletsModal';
35
27
  import { HeaderButton } from '../components/HeaderButtons/HeaderButtons.styles';
36
28
  import { Layout } from '../components/Layout';
37
- import { NoRoutes } from '../components/NoRoutes';
38
- import { getConfirmSwapErrorMessage } from '../constants/errors';
39
29
  import { navigationRoutes } from '../constants/navigationRoutes';
40
- import {
41
- GAS_FEE_MAX_DECIMALS,
42
- GAS_FEE_MIN_DECIMALS,
43
- PERCENTAGE_CHANGE_MAX_DECIMALS,
44
- PERCENTAGE_CHANGE_MIN_DECIMALS,
45
- TOKEN_AMOUNT_MAX_DECIMALS,
46
- TOKEN_AMOUNT_MIN_DECIMALS,
47
- USD_VALUE_MAX_DECIMALS,
48
- USD_VALUE_MIN_DECIMALS,
49
- } from '../constants/routing';
50
- import { getRouteWarningMessage } from '../constants/warnings';
30
+ import { getQuoteUpdateWarningMessage } from '../constants/warnings';
31
+ import { QuoteInfo } from '../containers/QuoteInfo';
51
32
  import { useConfirmSwap } from '../hooks/useConfirmSwap';
52
- import { useBestRouteStore } from '../store/bestRoute';
53
- import { useMetaStore } from '../store/meta';
33
+ import { useQuoteStore } from '../store/quote';
54
34
  import { useSettingsStore } from '../store/settings';
55
35
  import { useUiStore } from '../store/ui';
56
36
  import { useWalletsStore } from '../store/wallets';
57
- import {
58
- ConfirmSwapErrorTypes,
59
- RouteWarningType,
60
- SlippageWarningType,
61
- } from '../types';
37
+ import { QuoteWarningType } from '../types';
62
38
  import { getContainer } from '../utils/common';
63
- import {
64
- numberToString,
65
- secondsToString,
66
- totalArrivalTime,
67
- } from '../utils/numbers';
68
- import { getPriceImpactLevel } from '../utils/routing';
69
- import { getPercentageChange, getTotalFeeInUsd } from '../utils/swap';
70
39
 
71
40
  const Container = styled('div', {
72
41
  position: 'relative',
@@ -75,7 +44,6 @@ const Container = styled('div', {
75
44
  display: 'flex',
76
45
  justifyContent: 'space-between',
77
46
  alignItems: 'center',
78
- paddingBottom: '$10',
79
47
  },
80
48
  '& .icon': {
81
49
  width: '$24',
@@ -84,6 +52,9 @@ const Container = styled('div', {
84
52
  justifyContent: 'center',
85
53
  alignItems: 'center',
86
54
  },
55
+ '& .quote-update__alert': {
56
+ paddingTop: '$10',
57
+ },
87
58
  });
88
59
 
89
60
  const Buttons = styled('div', {
@@ -100,44 +71,31 @@ const Buttons = styled('div', {
100
71
  },
101
72
  });
102
73
 
103
- type PropTypes = {
104
- config?: WidgetConfig;
105
- };
106
-
107
- export function ConfirmSwapPage(props: PropTypes) {
74
+ export function ConfirmSwapPage() {
108
75
  //TODO: move component's logics to a custom hook
109
- const { config } = props;
110
76
  const {
111
- bestRoute,
112
- inputAmount,
113
- outputAmount,
114
- inputUsdValue,
115
- outputUsdValue,
77
+ quote,
116
78
  setInputAmount,
117
79
  selectedWallets,
118
- routeWalletsConfirmed,
119
- setRouteWalletConfirmed,
80
+ quoteWalletsConfirmed,
81
+ setQuoteWalletConfirmed,
120
82
  customDestination,
121
- } = useBestRouteStore();
83
+ quoteWarningsConfirmed,
84
+ } = useQuoteStore();
122
85
  const navigate = useNavigate();
123
86
  const [dbErrorMessage, setDbErrorMessage] = useState<string>('');
124
- const [showSlippageWarning, setShowSlippageWarning] = useState(false);
125
87
 
126
88
  const { connectedWallets } = useWalletsStore();
127
- const showWalletsOnInit = !routeWalletsConfirmed;
89
+ const showWalletsOnInit = !quoteWalletsConfirmed;
128
90
  const [showWallets, setShowWallets] = useState(false);
129
91
  const setSelectedSwap = useUiStore.use.setSelectedSwap();
130
- const {
131
- meta: { tokens, blockchains },
132
- loadingStatus: loadingMetaStatus,
133
- } = useMetaStore();
134
- const slippage = useSettingsStore.use.slippage();
135
- const customSlippage = useSettingsStore.use.customSlippage();
92
+ const disabledLiquiditySources =
93
+ useSettingsStore.use.disabledLiquiditySources();
94
+ const prevDisabledLiquiditySources = useRef(disabledLiquiditySources);
136
95
  const { manager } = useManager();
137
- const selectedSlippage = customSlippage || slippage;
138
96
  const {
139
97
  fetch: confirmSwap,
140
- loading: fetchingConfirmationRoute,
98
+ loading: fetchingConfirmationQuote,
141
99
  cancelFetch,
142
100
  } = useConfirmSwap();
143
101
  const [confirmSwapResult, setConfirmSwapResult] =
@@ -146,32 +104,8 @@ export function ConfirmSwapPage(props: PropTypes) {
146
104
  error: null,
147
105
  warnings: null,
148
106
  });
149
- const showSkeleton =
150
- fetchingConfirmationRoute || loadingMetaStatus === 'loading';
151
- const showNoRouteFound =
152
- !fetchingConfirmationRoute &&
153
- confirmSwapResult.error &&
154
- [
155
- ConfirmSwapErrorTypes.NO_ROUTE,
156
- ConfirmSwapErrorTypes.REQUEST_FAILED,
157
- ].includes(confirmSwapResult.error.type);
158
- const showBestRoute =
159
- !showNoRouteFound &&
160
- !fetchingConfirmationRoute &&
161
- bestRoute &&
162
- bestRoute.result;
163
-
164
- const totalFeeInUsd = getTotalFeeInUsd(bestRoute, tokens);
165
- const percentageChange = numberToString(
166
- getPercentageChange(
167
- inputUsdValue?.toNumber() ?? 0,
168
- outputUsdValue?.toNumber() ?? 0
169
- ),
170
- PERCENTAGE_CHANGE_MIN_DECIMALS,
171
- PERCENTAGE_CHANGE_MAX_DECIMALS
172
- );
173
107
 
174
- const warningLevel = getPriceImpactLevel(parseFloat(percentageChange));
108
+ const [showQuoteWarningModal, setShowQuoteWarningModal] = useState(false);
175
109
 
176
110
  const onConfirmSwap: ConfirmSwap['fetch'] = async ({
177
111
  selectedWallets,
@@ -183,7 +117,7 @@ export function ConfirmSwapPage(props: PropTypes) {
183
117
  };
184
118
 
185
119
  const addNewSwap = async () => {
186
- if (confirmSwapResult.swap && routeWalletsConfirmed) {
120
+ if (confirmSwapResult.swap && quoteWalletsConfirmed) {
187
121
  try {
188
122
  await manager?.create(
189
123
  'swap',
@@ -191,12 +125,11 @@ export function ConfirmSwapPage(props: PropTypes) {
191
125
  { id: confirmSwapResult.swap.requestId }
192
126
  );
193
127
  setSelectedSwap(confirmSwapResult.swap.requestId);
194
- navigate(
195
- '/' + navigationRoutes.swaps + `/${confirmSwapResult.swap.requestId}`,
196
- {
197
- replace: true,
198
- }
199
- );
128
+
129
+ const swap_url = `../${navigationRoutes.swaps}/${confirmSwapResult.swap.requestId}`;
130
+ navigate(swap_url, {
131
+ replace: true,
132
+ });
200
133
  setTimeout(() => {
201
134
  setInputAmount('');
202
135
  }, 0);
@@ -211,8 +144,8 @@ export function ConfirmSwapPage(props: PropTypes) {
211
144
  };
212
145
 
213
146
  const onStartConfirmSwap = async () => {
214
- if (confirmSwapResult?.warnings?.slippage) {
215
- setShowSlippageWarning(true);
147
+ if (confirmSwapResult?.warnings?.quote && !quoteWarningsConfirmed) {
148
+ setShowQuoteWarningModal(true);
216
149
  } else {
217
150
  await onConfirm();
218
151
  }
@@ -224,13 +157,23 @@ export function ConfirmSwapPage(props: PropTypes) {
224
157
  swap: null,
225
158
  warnings: null,
226
159
  });
227
- confirmSwap({ selectedWallets })
160
+ confirmSwap({ selectedWallets, customDestination })
228
161
  .then((res) => {
229
162
  setConfirmSwapResult(res);
230
163
  })
231
164
  .catch((error) => console.error(error));
232
165
  };
233
166
 
167
+ useEffect(() => {
168
+ const disabledLiquiditySourceReset =
169
+ !!prevDisabledLiquiditySources.current.length &&
170
+ !disabledLiquiditySources.length;
171
+ if (disabledLiquiditySourceReset) {
172
+ void onRefresh();
173
+ }
174
+ prevDisabledLiquiditySources.current = disabledLiquiditySources;
175
+ }, [disabledLiquiditySources.length]);
176
+
234
177
  useEffect(() => {
235
178
  if (showWalletsOnInit) {
236
179
  cancelFetch();
@@ -252,10 +195,10 @@ export function ConfirmSwapPage(props: PropTypes) {
252
195
  }, []);
253
196
 
254
197
  useEffect(() => {
255
- const routeChanged =
256
- confirmSwapResult.warnings?.route?.type &&
257
- Object.values(RouteWarningType).includes(
258
- confirmSwapResult.warnings?.route?.type
198
+ const quoteChanged =
199
+ confirmSwapResult.warnings?.quote?.type &&
200
+ Object.values(QuoteWarningType).includes(
201
+ confirmSwapResult.warnings?.quote?.type
259
202
  );
260
203
 
261
204
  const selectedWalletDisconnected =
@@ -269,16 +212,15 @@ export function ConfirmSwapPage(props: PropTypes) {
269
212
  )
270
213
  );
271
214
 
272
- let routeWalletsChanged = false;
215
+ let quoteWalletsChanged = false;
273
216
 
274
- if (routeChanged) {
275
- let requiredWallets = getRequiredWallets(bestRoute);
217
+ if (quoteChanged) {
218
+ let requiredWallets = getRequiredWallets(quote);
276
219
 
277
220
  const lastStepToBlockchain =
278
- bestRoute?.result?.swaps[bestRoute.result.swaps.length - 1].to
279
- .blockchain;
221
+ quote?.result?.swaps[quote.result.swaps.length - 1].to.blockchain;
280
222
 
281
- const isLastWalletRequired = !!bestRoute?.result?.swaps.find(
223
+ const isLastWalletRequired = !!quote?.result?.swaps.find(
282
224
  (swap) => swap.from.blockchain === lastStepToBlockchain
283
225
  );
284
226
 
@@ -297,26 +239,34 @@ export function ConfirmSwapPage(props: PropTypes) {
297
239
  );
298
240
 
299
241
  if (!allRequiredWalletsSelected) {
300
- routeWalletsChanged = true;
242
+ quoteWalletsChanged = true;
301
243
  }
302
244
  }
303
245
 
304
- if (bestRoute && (selectedWalletDisconnected || routeWalletsChanged)) {
246
+ if (quote && (selectedWalletDisconnected || quoteWalletsChanged)) {
305
247
  queueMicrotask(() => flushSync(setShowWallets.bind(null, true)));
306
- setRouteWalletConfirmed(false);
248
+ setQuoteWalletConfirmed(false);
307
249
  }
308
250
  }, [
309
- confirmSwapResult.warnings?.route,
251
+ confirmSwapResult.warnings?.quote,
310
252
  selectedWallets.length,
311
253
  connectedWallets.length,
312
254
  ]);
313
255
 
256
+ useLayoutEffect(() => {
257
+ if (!quote) {
258
+ navigate(`../`);
259
+ }
260
+ }, []);
261
+
314
262
  return (
315
263
  <Layout
316
264
  header={{
317
265
  title: i18n.t('Confirm Swap'),
318
- onBack: navigate.bind(null, -1),
319
- hasConnectWallet: true,
266
+ onWallet: () => {
267
+ const wallets_url = `../${navigationRoutes.wallets}`;
268
+ navigate(wallets_url);
269
+ },
320
270
  suffix: (
321
271
  <Tooltip
322
272
  container={getContainer()}
@@ -325,7 +275,7 @@ export function ConfirmSwapPage(props: PropTypes) {
325
275
  <HeaderButton
326
276
  size="small"
327
277
  variant="ghost"
328
- onClick={() => navigate('/' + navigationRoutes.settings)}>
278
+ onClick={() => navigate('../' + navigationRoutes.settings)}>
329
279
  <SettingsIcon size={18} color="black" />
330
280
  </HeaderButton>
331
281
  </Tooltip>
@@ -339,7 +289,7 @@ export function ConfirmSwapPage(props: PropTypes) {
339
289
  type="primary"
340
290
  size="large"
341
291
  fullWidth
342
- loading={fetchingConfirmationRoute}
292
+ loading={fetchingConfirmationQuote}
343
293
  disabled={!!confirmSwapResult.error}
344
294
  onClick={onStartConfirmSwap}>
345
295
  {i18n.t('Start Swap')}
@@ -349,72 +299,19 @@ export function ConfirmSwapPage(props: PropTypes) {
349
299
  variant="contained"
350
300
  type="primary"
351
301
  size="large"
352
- loading={fetchingConfirmationRoute}
302
+ loading={fetchingConfirmationQuote}
353
303
  onClick={setShowWallets.bind(null, true)}>
354
304
  <WalletIcon size={24} />
355
305
  </IconButton>
356
306
  </Buttons>
357
307
  }>
358
- <Modal
359
- anchor="bottom"
360
- open={showSlippageWarning}
361
- prefix={
362
- <Button
363
- size="small"
364
- variant="ghost"
365
- onClick={() => navigate('/' + navigationRoutes.settings)}>
366
- <Typography variant="label" size="medium" color="$neutral700">
367
- {i18n.t('Change settings')}
368
- </Typography>
369
- </Button>
370
- }
371
- container={document.querySelector('#swap-box') as HTMLDivElement}
372
- onClose={setShowSlippageWarning.bind(null, (prevState) => !prevState)}>
373
- {confirmSwapResult.warnings?.slippage && (
374
- <MessageBox
375
- type="warning"
376
- title={
377
- confirmSwapResult.warnings.slippage.type ===
378
- SlippageWarningType.HIGH_SLIPPAGE
379
- ? i18n.t('High slippage')
380
- : i18n.t('Low slippage')
381
- }
382
- description={
383
- confirmSwapResult.warnings.slippage.type ===
384
- SlippageWarningType.HIGH_SLIPPAGE
385
- ? i18n.t({
386
- id: ' Caution, your slippage is high (={selectedSlippage}). Your trade may be front run.',
387
- values: { selectedSlippage },
388
- })
389
- : i18n.t({
390
- id: 'We recommend you to increase slippage to at least {minRequiredSlippage} for this route.',
391
- values: {
392
- minRequiredSlippage:
393
- confirmSwapResult.warnings.slippage.slippage,
394
- },
395
- })
396
- }>
397
- <Divider size={18} />
398
- <Divider size={32} />
399
- <Button
400
- size="large"
401
- type="primary"
402
- variant="contained"
403
- fullWidth
404
- onClick={onConfirm}>
405
- {i18n.t('Confirm anyway')}
406
- </Button>
407
- </MessageBox>
408
- )}
409
- </Modal>
410
308
  {showWallets && (
411
309
  <ConfirmWalletsModal
412
310
  open={showWallets}
413
311
  onClose={() => setShowWallets(false)}
414
312
  onCancel={cancelFetch}
415
- loading={fetchingConfirmationRoute}
313
+ loading={fetchingConfirmationQuote}
416
314
  onCheckBalance={onConfirmSwap}
417
- config={config}
418
315
  />
419
316
  )}
420
317
 
@@ -426,7 +323,7 @@ export function ConfirmSwapPage(props: PropTypes) {
426
323
  <Button
427
324
  style={{ padding: '0' }}
428
325
  variant="ghost"
429
- disabled={fetchingConfirmationRoute}
326
+ disabled={fetchingConfirmationQuote}
430
327
  onClick={onRefresh}>
431
328
  <div className="icon">
432
329
  <RefreshIcon size={16} />
@@ -439,88 +336,38 @@ export function ConfirmSwapPage(props: PropTypes) {
439
336
  <Divider size={12} />
440
337
  </>
441
338
  )}
442
- {confirmSwapResult.warnings?.route && (
443
- <>
339
+ {confirmSwapResult.warnings?.quoteUpdate && (
340
+ <div className="quote-update__alert">
444
341
  <Alert
445
342
  variant="alarm"
446
343
  type="warning"
447
- title={getRouteWarningMessage(confirmSwapResult.warnings.route)}
448
- />
449
- <Divider size={12} />
450
- </>
451
- )}
452
- {showSkeleton && <BestRouteSkeleton type="swap-preview" expanded />}
453
- {showBestRoute && (
454
- <BestRoute
455
- expanded={true}
456
- tooltipContainer={getContainer()}
457
- steps={formatBestRoute(bestRoute, blockchains) ?? []}
458
- input={{
459
- value: numberToString(
460
- inputAmount,
461
- TOKEN_AMOUNT_MIN_DECIMALS,
462
- TOKEN_AMOUNT_MAX_DECIMALS
463
- ),
464
- usdValue: numberToString(
465
- inputUsdValue,
466
- USD_VALUE_MIN_DECIMALS,
467
- USD_VALUE_MAX_DECIMALS
468
- ),
469
- }}
470
- output={{
471
- value: numberToString(
472
- outputAmount,
473
- TOKEN_AMOUNT_MIN_DECIMALS,
474
- TOKEN_AMOUNT_MAX_DECIMALS
475
- ),
476
- usdValue: numberToString(
477
- outputUsdValue,
478
- USD_VALUE_MIN_DECIMALS,
479
- USD_VALUE_MAX_DECIMALS
480
- ),
481
- }}
482
- totalFee={numberToString(
483
- totalFeeInUsd,
484
- GAS_FEE_MIN_DECIMALS,
485
- GAS_FEE_MAX_DECIMALS
486
- )}
487
- totalTime={secondsToString(
488
- totalArrivalTime(bestRoute.result?.swaps)
489
- )}
490
- recommended={true}
491
- type="swap-preview"
492
- percentageChange={percentageChange}
493
- warningLevel={warningLevel}
494
- />
495
- )}
496
- {showNoRouteFound && (
497
- <>
498
- <Divider size={12} />
499
- <NoRoutes
500
- diagnosisMessage={
501
- confirmSwapResult.error?.type === ConfirmSwapErrorTypes.NO_ROUTE
502
- ? confirmSwapResult.error.diagnosisMessage
503
- : undefined
344
+ title={
345
+ confirmSwapResult.warnings.quoteUpdate &&
346
+ getQuoteUpdateWarningMessage(
347
+ confirmSwapResult.warnings.quoteUpdate
348
+ )
504
349
  }
505
- error={
506
- confirmSwapResult.error?.type ===
507
- ConfirmSwapErrorTypes.REQUEST_FAILED
508
- }
509
- fetch={onRefresh}
510
350
  />
511
- </>
512
- )}
513
- {confirmSwapResult.error?.type ===
514
- ConfirmSwapErrorTypes.ROUTE_UPDATED_WITH_HIGH_VALUE_LOSS && (
515
- <>
516
- <Alert
517
- variant="alarm"
518
- type="error"
519
- title={getConfirmSwapErrorMessage(confirmSwapResult.error)}
520
- />
521
- <Divider size={12} />
522
- </>
351
+ </div>
523
352
  )}
353
+ <QuoteInfo
354
+ quote={quote}
355
+ type="swap-preview"
356
+ expanded={true}
357
+ alertPosition="top"
358
+ error={confirmSwapResult.error}
359
+ loading={fetchingConfirmationQuote}
360
+ warning={confirmSwapResult.warnings?.quote ?? null}
361
+ refetchQuote={onRefresh}
362
+ showWarningModal={showQuoteWarningModal}
363
+ onOpenWarningModal={() => setShowQuoteWarningModal(true)}
364
+ onCloseWarningModal={() => setShowQuoteWarningModal(false)}
365
+ onConfirmWarningModal={async () => {
366
+ setShowQuoteWarningModal(false);
367
+ await addNewSwap();
368
+ }}
369
+ onChangeSettings={() => navigate('../' + navigationRoutes.settings)}
370
+ />
524
371
  </Container>
525
372
  </Layout>
526
373
  );
@@ -11,8 +11,6 @@ import { Layout } from '../components/Layout';
11
11
  import { SearchInput } from '../components/SearchInput';
12
12
  import { SwapsGroup } from '../components/SwapsGroup';
13
13
  import { NotFoundContainer } from '../components/SwapsGroup/SwapsGroup.styles';
14
- import { navigationRoutes } from '../constants/navigationRoutes';
15
- import { useNavigateBack } from '../hooks/useNavigateBack';
16
14
  import { useUiStore } from '../store/ui';
17
15
  import { groupSwapsByDate } from '../utils/date';
18
16
  import { containsText } from '../utils/numbers';
@@ -51,7 +49,6 @@ const isStepContainsText = (steps: PendingSwapStep[], value: string) => {
51
49
  export function HistoryPage() {
52
50
  const setSelectedSwap = useUiStore.use.setSelectedSwap();
53
51
  const navigate = useNavigate();
54
- const { navigateBackFrom } = useNavigateBack();
55
52
  const { manager, state } = useManager();
56
53
  const list: PendingSwap[] = getPendingSwaps(manager).map(({ swap }) => swap);
57
54
  const [searchedFor, setSearchedFor] = useState<string>('');
@@ -78,7 +75,6 @@ export function HistoryPage() {
78
75
  return (
79
76
  <Layout
80
77
  header={{
81
- onBack: navigateBackFrom.bind(null, navigationRoutes.swaps),
82
78
  title: i18n.t('History'),
83
79
  }}>
84
80
  <Container>
@@ -108,7 +104,7 @@ export function HistoryPage() {
108
104
  list={filteredList}
109
105
  onSwapClick={(requestId) => {
110
106
  setSelectedSwap(requestId);
111
- navigate(`${requestId}`, { replace: true });
107
+ navigate(requestId);
112
108
  }}
113
109
  groupBy={groupSwapsByDate}
114
110
  isLoading={loading}