@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.31

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 (331) 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.styles.d.ts +370 -56
  8. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  9. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  10. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +0 -2
  11. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
  12. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  13. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
  14. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
  15. package/dist/components/HeaderButtons/HomeButtons.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/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -1
  20. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
  21. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
  22. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
  23. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  24. package/dist/components/Quote/Quote.d.ts.map +1 -1
  25. package/dist/components/Quote/Quote.styles.d.ts +633 -3
  26. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  27. package/dist/components/Quote/Quote.types.d.ts +0 -1
  28. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  29. package/dist/components/Quote/QuoteSummary.styles.d.ts +157 -0
  30. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
  31. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  32. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
  33. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  34. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  35. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  36. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  37. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  38. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  39. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
  40. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  41. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +628 -0
  42. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  43. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
  44. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
  45. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
  46. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
  47. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  48. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  49. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +157 -0
  50. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  51. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  52. package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
  53. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
  54. package/dist/components/TokenList/TokenList.styles.d.ts +942 -0
  55. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  56. package/dist/components/TokenList/TokenList.types.d.ts +3 -9
  57. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
  58. package/dist/components/TokenList/index.d.ts +0 -1
  59. package/dist/components/TokenList/index.d.ts.map +1 -1
  60. package/dist/components/UpdateUrl.d.ts +1 -6
  61. package/dist/components/UpdateUrl.d.ts.map +1 -1
  62. package/dist/components/WidgetEvents.d.ts.map +1 -1
  63. package/dist/constants/errors.d.ts.map +1 -1
  64. package/dist/constants/index.d.ts +1 -0
  65. package/dist/constants/index.d.ts.map +1 -1
  66. package/dist/constants/navigationRoutes.d.ts +1 -2
  67. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  68. package/dist/constants/searchParams.d.ts +2 -1
  69. package/dist/constants/searchParams.d.ts.map +1 -1
  70. package/dist/containers/App/App.d.ts +3 -0
  71. package/dist/containers/App/App.d.ts.map +1 -0
  72. package/dist/containers/App/App.styles.d.ts +158 -0
  73. package/dist/containers/App/App.styles.d.ts.map +1 -0
  74. package/dist/containers/App/index.d.ts +2 -0
  75. package/dist/containers/App/index.d.ts.map +1 -0
  76. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  77. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
  78. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  79. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
  80. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  81. package/dist/containers/Wallets/Wallets.d.ts +6 -0
  82. package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
  83. package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
  84. package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
  85. package/dist/containers/Wallets/index.d.ts +2 -0
  86. package/dist/containers/Wallets/index.d.ts.map +1 -0
  87. package/dist/containers/Widget/Widget.d.ts +5 -0
  88. package/dist/containers/Widget/Widget.d.ts.map +1 -0
  89. package/dist/containers/Widget/Widget.types.d.ts +5 -0
  90. package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
  91. package/dist/containers/Widget/index.d.ts +3 -0
  92. package/dist/containers/Widget/index.d.ts.map +1 -0
  93. package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
  94. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
  95. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
  96. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
  97. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
  98. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
  99. package/dist/containers/WidgetInfo/index.d.ts +2 -0
  100. package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
  101. package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
  102. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
  103. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
  104. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
  105. package/dist/containers/WidgetProvider/index.d.ts +2 -0
  106. package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
  107. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
  108. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
  109. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
  110. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
  111. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
  112. package/dist/hooks/useForceAutoConnect.d.ts +2 -0
  113. package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
  114. package/dist/hooks/useLanguage.d.ts +1 -1
  115. package/dist/hooks/useLanguage.d.ts.map +1 -1
  116. package/dist/hooks/useNavigateBack.d.ts +1 -3
  117. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  118. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
  119. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
  120. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
  121. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
  122. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
  123. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
  124. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  125. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
  126. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
  127. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  128. package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
  129. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  130. package/dist/hooks/useTheme.d.ts +1 -1
  131. package/dist/hooks/useTheme.d.ts.map +1 -1
  132. package/dist/hooks/useWalletList.d.ts.map +1 -1
  133. package/dist/index.d.ts +20 -8
  134. package/dist/index.d.ts.map +1 -1
  135. package/dist/index.js +1 -1
  136. package/dist/index.js.map +4 -4
  137. package/dist/pages/ConfirmSwapPage.d.ts +1 -6
  138. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  139. package/dist/pages/HistoryPage.d.ts.map +1 -1
  140. package/dist/pages/Home.d.ts.map +1 -1
  141. package/dist/pages/LanguagePage.d.ts.map +1 -1
  142. package/dist/pages/LiquiditySourcePage.d.ts +1 -2
  143. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  144. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  145. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  146. package/dist/pages/SettingsPage.d.ts +1 -6
  147. package/dist/pages/SettingsPage.d.ts.map +1 -1
  148. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  149. package/dist/pages/ThemePage.d.ts.map +1 -1
  150. package/dist/pages/WalletsPage.d.ts +1 -8
  151. package/dist/pages/WalletsPage.d.ts.map +1 -1
  152. package/dist/store/AppStore.d.ts +47 -0
  153. package/dist/store/AppStore.d.ts.map +1 -0
  154. package/dist/store/app.d.ts +41 -22
  155. package/dist/store/app.d.ts.map +1 -1
  156. package/dist/store/notification.d.ts +4 -3
  157. package/dist/store/notification.d.ts.map +1 -1
  158. package/dist/store/quote.d.ts +23 -16
  159. package/dist/store/quote.d.ts.map +1 -1
  160. package/dist/store/slices/config.d.ts +3 -2
  161. package/dist/store/slices/config.d.ts.map +1 -1
  162. package/dist/store/slices/data.d.ts +3 -0
  163. package/dist/store/slices/data.d.ts.map +1 -1
  164. package/dist/store/slices/settings.d.ts +39 -0
  165. package/dist/store/slices/settings.d.ts.map +1 -0
  166. package/dist/store/ui.d.ts +2 -1
  167. package/dist/store/ui.d.ts.map +1 -1
  168. package/dist/store/wallets.d.ts +14 -9
  169. package/dist/store/wallets.d.ts.map +1 -1
  170. package/dist/types/config.d.ts +38 -5
  171. package/dist/types/config.d.ts.map +1 -1
  172. package/dist/types/swap.d.ts +4 -14
  173. package/dist/types/swap.d.ts.map +1 -1
  174. package/dist/types/wallets.d.ts +15 -1
  175. package/dist/types/wallets.d.ts.map +1 -1
  176. package/dist/utils/colors.d.ts.map +1 -1
  177. package/dist/utils/configs.d.ts +1 -0
  178. package/dist/utils/configs.d.ts.map +1 -1
  179. package/dist/utils/meta.d.ts +2 -1
  180. package/dist/utils/meta.d.ts.map +1 -1
  181. package/dist/utils/providers.d.ts +2 -2
  182. package/dist/utils/providers.d.ts.map +1 -1
  183. package/dist/utils/queue.d.ts +2 -2
  184. package/dist/utils/queue.d.ts.map +1 -1
  185. package/dist/utils/quote.d.ts +1 -1
  186. package/dist/utils/quote.d.ts.map +1 -1
  187. package/dist/utils/settings.d.ts +6 -2
  188. package/dist/utils/settings.d.ts.map +1 -1
  189. package/dist/utils/swap.d.ts +16 -7
  190. package/dist/utils/swap.d.ts.map +1 -1
  191. package/dist/utils/time.d.ts +1 -1
  192. package/dist/utils/time.d.ts.map +1 -1
  193. package/dist/utils/wallets.d.ts +7 -9
  194. package/dist/utils/wallets.d.ts.map +1 -1
  195. package/package.json +12 -10
  196. package/src/QueueManager.tsx +18 -17
  197. package/src/components/AppRouter.tsx +8 -32
  198. package/src/components/AppRoutes.tsx +57 -69
  199. package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
  200. package/src/components/BlockchainList/BlockchainList.tsx +4 -4
  201. package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
  202. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +12 -6
  203. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +20 -21
  204. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +0 -2
  205. package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
  206. package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
  207. package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
  208. package/src/components/Layout/Layout.tsx +20 -7
  209. package/src/components/Layout/Layout.types.ts +2 -2
  210. package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +14 -7
  211. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +63 -60
  212. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +17 -8
  213. package/src/components/NoResult/NoResult.helpers.ts +12 -12
  214. package/src/components/NoResult/NoResult.tsx +6 -6
  215. package/src/components/NotificationContent/NotificationContent.tsx +5 -3
  216. package/src/components/Quote/Quote.styles.ts +42 -12
  217. package/src/components/Quote/Quote.tsx +106 -37
  218. package/src/components/Quote/Quote.types.ts +0 -1
  219. package/src/components/Quote/QuoteSkeleton.tsx +1 -1
  220. package/src/components/Quote/QuoteSummary.styles.ts +9 -8
  221. package/src/components/Quote/QuoteSummary.tsx +2 -2
  222. package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
  223. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
  224. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
  225. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
  226. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  227. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
  228. package/src/components/Slippage/Slippage.tsx +3 -5
  229. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -7
  230. package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
  231. package/src/components/SwapDetails/SwapDetails.styles.ts +37 -33
  232. package/src/components/SwapDetails/SwapDetails.tsx +33 -45
  233. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
  234. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
  235. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
  236. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
  237. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
  238. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
  239. package/src/components/SwapsGroup/SwapsGroup.styles.ts +10 -1
  240. package/src/components/SwapsGroup/SwapsGroup.tsx +3 -5
  241. package/src/components/TokenList/TokenList.helpers.ts +2 -2
  242. package/src/components/TokenList/TokenList.styles.ts +58 -37
  243. package/src/components/TokenList/TokenList.tsx +28 -23
  244. package/src/components/TokenList/TokenList.types.ts +3 -10
  245. package/src/components/TokenList/index.ts +0 -1
  246. package/src/components/UpdateUrl.tsx +23 -18
  247. package/src/components/WidgetEvents.tsx +4 -2
  248. package/src/constants/errors.ts +9 -5
  249. package/src/constants/index.ts +1 -0
  250. package/src/constants/navigationRoutes.ts +7 -8
  251. package/src/constants/searchParams.ts +1 -0
  252. package/src/containers/App/App.styles.ts +18 -0
  253. package/src/containers/App/App.tsx +52 -0
  254. package/src/containers/App/index.ts +1 -0
  255. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
  256. package/src/containers/QuoteInfo/QuoteInfo.tsx +44 -43
  257. package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
  258. package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
  259. package/src/containers/Wallets/Wallets.types.ts +12 -0
  260. package/src/containers/Wallets/index.ts +1 -0
  261. package/src/containers/Widget/Widget.tsx +19 -0
  262. package/src/containers/Widget/Widget.types.ts +5 -0
  263. package/src/containers/Widget/index.ts +2 -0
  264. package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
  265. package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
  266. package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
  267. package/src/containers/WidgetInfo/index.ts +1 -0
  268. package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
  269. package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
  270. package/src/containers/WidgetProvider/index.ts +1 -0
  271. package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
  272. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +25 -24
  273. package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
  274. package/src/hooks/useForceAutoConnect.ts +27 -0
  275. package/src/hooks/useLanguage.ts +4 -5
  276. package/src/hooks/useNavigateBack.ts +3 -52
  277. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
  278. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
  279. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
  280. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
  281. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
  282. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
  283. package/src/hooks/useSwapInput.ts +89 -30
  284. package/src/hooks/useSyncStoresWithConfig.ts +38 -22
  285. package/src/hooks/useTheme.ts +4 -5
  286. package/src/hooks/useWalletList.ts +3 -5
  287. package/src/index.ts +53 -5
  288. package/src/pages/ConfirmSwapPage.tsx +61 -41
  289. package/src/pages/HistoryPage.tsx +2 -7
  290. package/src/pages/Home.tsx +58 -88
  291. package/src/pages/LanguagePage.tsx +0 -5
  292. package/src/pages/LiquiditySourcePage.tsx +24 -37
  293. package/src/pages/SelectBlockchainPage.tsx +28 -21
  294. package/src/pages/SelectSwapItemsPage.tsx +10 -27
  295. package/src/pages/SettingsPage.tsx +28 -24
  296. package/src/pages/SwapDetailsPage.tsx +6 -7
  297. package/src/pages/ThemePage.tsx +2 -7
  298. package/src/pages/WalletsPage.tsx +4 -15
  299. package/src/services/httpService.ts +1 -1
  300. package/src/store/AppStore.tsx +41 -0
  301. package/src/store/app.ts +44 -6
  302. package/src/store/quote.ts +29 -26
  303. package/src/store/slices/config.ts +25 -15
  304. package/src/store/slices/data.ts +64 -29
  305. package/src/store/slices/settings.ts +168 -0
  306. package/src/store/wallets.ts +68 -37
  307. package/src/types/config.ts +50 -5
  308. package/src/types/swap.ts +4 -13
  309. package/src/types/wallets.ts +18 -1
  310. package/src/utils/colors.ts +2 -1
  311. package/src/utils/configs.ts +2 -1
  312. package/src/utils/date.ts +1 -1
  313. package/src/utils/meta.ts +8 -1
  314. package/src/utils/providers.ts +8 -5
  315. package/src/utils/queue.ts +2 -2
  316. package/src/utils/quote.ts +7 -7
  317. package/src/utils/settings.ts +17 -10
  318. package/src/utils/swap.ts +59 -55
  319. package/src/utils/time.ts +1 -1
  320. package/src/utils/wallets.ts +107 -149
  321. package/dist/Wallets.d.ts +0 -17
  322. package/dist/Wallets.d.ts.map +0 -1
  323. package/dist/Widget.d.ts +0 -9
  324. package/dist/Widget.d.ts.map +0 -1
  325. package/dist/store/meta.d.ts +0 -23
  326. package/dist/store/meta.d.ts.map +0 -1
  327. package/dist/store/settings.d.ts +0 -81
  328. package/dist/store/settings.d.ts.map +0 -1
  329. package/src/Widget.tsx +0 -119
  330. package/src/store/meta.ts +0 -39
  331. package/src/store/settings.ts +0 -158
@@ -1,74 +1,15 @@
1
- import { styled } from '@rango-dev/ui';
1
+ import { css, styled } from '@rango-dev/ui';
2
2
 
3
3
  export const Container = styled('div', {
4
4
  width: '100%',
5
5
  height: '100%',
6
6
  padding: '$0 $20',
7
-
8
- '.cost': {
9
- paddingTop: '$15',
10
- display: 'flex',
11
- },
12
-
13
- '.quote-summary': {
14
- padding: '$15 $0',
15
- },
16
-
17
- '.quote-summary-item': {
18
- display: 'flex',
19
- justifyContent: 'space-between',
20
- alignItems: 'center',
21
- },
22
-
23
- '.token-amount': {
24
- display: 'flex',
25
- justifyContent: 'space-between',
26
- alignItems: 'center',
27
- },
28
-
29
- '.quote-summary-separator': {
30
- width: '0px',
31
- height: '$16',
32
- borderLeft: '1px solid $neutral400',
33
- marginLeft: '13px',
34
- },
35
-
36
- '.swaps-steps': {
37
- paddingBottom: '$10',
38
- },
39
7
  });
40
8
 
41
9
  export const StepContainer = styled('div', {
42
10
  backgroundColor: '$neutral100',
43
11
  borderRadius: '$xm',
44
12
  padding: '$10 $15',
45
-
46
- '.step-title': {
47
- display: 'flex',
48
- justifyContent: 'start',
49
- alignItems: 'center',
50
- },
51
- '.step-tokens': {
52
- paddingTop: '$5',
53
- display: 'flex',
54
- alignItems: 'center',
55
- },
56
- '.step-token-info': {
57
- display: 'flex',
58
- alignItems: 'center',
59
- },
60
- '.step-icon-container': {
61
- padding: '$4 $6',
62
- display: 'flex',
63
- justifyContent: 'center',
64
- alignItems: 'center',
65
- },
66
-
67
- '.extra-info': {
68
- display: 'flex',
69
- paddingTop: '$10',
70
- paddingBottom: '$5',
71
- },
72
13
  });
73
14
  export const StepSeparator = styled('div', {
74
15
  width: '0px',
@@ -76,3 +17,65 @@ export const StepSeparator = styled('div', {
76
17
  borderLeft: '1px dashed $neutral700',
77
18
  marginLeft: '25px',
78
19
  });
20
+
21
+ export const quoteSummaryItemStyles = css({
22
+ display: 'flex',
23
+ justifyContent: 'space-between',
24
+ alignItems: 'center',
25
+ });
26
+
27
+ export const tokenAmountStyles = css({
28
+ display: 'flex',
29
+ justifyContent: 'space-between',
30
+ alignItems: 'center',
31
+ });
32
+
33
+ export const costStyles = css({
34
+ paddingTop: '$15',
35
+ display: 'flex',
36
+ });
37
+
38
+ export const quoteSummaryStyles = css({
39
+ padding: '$15 $0',
40
+ });
41
+
42
+ export const quoteSummarySeparatorStyles = css({
43
+ width: '0px',
44
+ height: '$16',
45
+ borderLeft: '1px solid $neutral400',
46
+ marginLeft: '13px',
47
+ });
48
+
49
+ export const swapsStepsStyles = css({
50
+ paddingBottom: '$10',
51
+ });
52
+
53
+ export const stepTitleStyles = css({
54
+ display: 'flex',
55
+ justifyContent: 'start',
56
+ alignItems: 'center',
57
+ });
58
+
59
+ export const stepTokensStyles = css({
60
+ paddingTop: '$5',
61
+ display: 'flex',
62
+ alignItems: 'center',
63
+ });
64
+
65
+ export const stepInfoStyles = css({
66
+ display: 'flex',
67
+ alignItems: 'center',
68
+ });
69
+
70
+ export const stepIconStyles = css({
71
+ padding: '$4 $6',
72
+ display: 'flex',
73
+ justifyContent: 'center',
74
+ alignItems: 'center',
75
+ });
76
+
77
+ export const extraInfoStyles = css({
78
+ display: 'flex',
79
+ paddingTop: '$10',
80
+ paddingBottom: '$5',
81
+ });
@@ -2,13 +2,22 @@ import { i18n } from '@lingui/core';
2
2
  import { ChainToken, Divider, Skeleton, Typography } from '@rango-dev/ui';
3
3
  import React from 'react';
4
4
 
5
- import { Container, StepSeparator } from './LoadingSwapDetails.styles';
5
+ import {
6
+ Container,
7
+ costStyles,
8
+ quoteSummaryItemStyles,
9
+ quoteSummarySeparatorStyles,
10
+ quoteSummaryStyles,
11
+ StepSeparator,
12
+ swapsStepsStyles,
13
+ tokenAmountStyles,
14
+ } from './LoadingSwapDetails.styles';
6
15
  import { LoadingSwapDetailStep } from './LoadingSwapDetailStep';
7
16
 
8
17
  export function LoadingSwapDetails() {
9
18
  const quoteSummary = (
10
- <div className="quote-summary-item">
11
- <div className="token-amount">
19
+ <div className={quoteSummaryItemStyles()}>
20
+ <div className={tokenAmountStyles()}>
12
21
  <ChainToken loading size="medium" chainImage="" tokenImage="" />
13
22
  <Divider size={8} direction="horizontal" />
14
23
  <Skeleton height={15} width={148} variant="rounded" />
@@ -19,7 +28,7 @@ export function LoadingSwapDetails() {
19
28
 
20
29
  return (
21
30
  <Container>
22
- <div className="cost">
31
+ <div className={costStyles()}>
23
32
  <Skeleton width={60} height={10} variant="rounded" />
24
33
  <Divider size={4} direction="horizontal" />
25
34
  <Skeleton width={60} height={10} variant="rounded" />
@@ -27,19 +36,19 @@ export function LoadingSwapDetails() {
27
36
  <Skeleton width={60} height={10} variant="rounded" />
28
37
  </div>
29
38
 
30
- <div className="quote-summary">
39
+ <div className={quoteSummaryStyles()}>
31
40
  {quoteSummary}
32
- <div className="quote-summary-separator"></div>
41
+ <div className={quoteSummarySeparatorStyles()}></div>
33
42
  {quoteSummary}
34
43
  </div>
35
44
 
36
- <div className="swaps-steps">
45
+ <div className={swapsStepsStyles()}>
37
46
  <Typography variant="title" size="small">
38
47
  {i18n.t('Swaps steps')}
39
48
  </Typography>
40
49
  </div>
41
50
 
42
- <div className="step-container">
51
+ <div>
43
52
  <LoadingSwapDetailStep extraInfo />
44
53
  <StepSeparator />
45
54
  <LoadingSwapDetailStep />
@@ -27,18 +27,6 @@ export function makeInfo(
27
27
  },
28
28
  description: '',
29
29
  };
30
- } else if (
31
- error?.type === QuoteErrorType.NO_RESULT &&
32
- error.diagnosisMessage
33
- ) {
34
- return {
35
- alert: {
36
- type: 'error',
37
- text: error.diagnosisMessage,
38
- action: null,
39
- },
40
- description: '',
41
- };
42
30
  } else if (disabledLiquiditySources.length) {
43
31
  return {
44
32
  alert: {
@@ -51,6 +39,18 @@ export function makeInfo(
51
39
  },
52
40
  description: errorMessages().liquiditySourcesError.description,
53
41
  };
42
+ } else if (
43
+ error?.type === QuoteErrorType.NO_RESULT &&
44
+ error.diagnosisMessage
45
+ ) {
46
+ return {
47
+ alert: {
48
+ type: 'error',
49
+ text: error.diagnosisMessage,
50
+ action: null,
51
+ },
52
+ description: '',
53
+ };
54
54
  }
55
55
  return {
56
56
  alert: null,
@@ -11,22 +11,22 @@ import {
11
11
  import React from 'react';
12
12
 
13
13
  import { errorMessages } from '../../constants/errors';
14
- import { useSettingsStore } from '../../store/settings';
14
+ import { useAppStore } from '../../store/AppStore';
15
15
 
16
16
  import { makeInfo } from './NoResult.helpers';
17
17
  import { Container, Footer, PrefixIcon } from './NoResult.styles';
18
18
 
19
19
  export function NoResult(props: PropTypes) {
20
20
  const { fetch, error } = props;
21
- const disabledLiquiditySources =
22
- useSettingsStore.use.disabledLiquiditySources();
23
- const toggleAllLiquiditySources =
24
- useSettingsStore.use.toggleAllLiquiditySources();
21
+ const disabledLiquiditySources = useAppStore().disabledLiquiditySources;
22
+ const toggleAllLiquiditySources = useAppStore().toggleAllLiquiditySources;
23
+
24
+ const swappers = useAppStore().swappers();
25
25
 
26
26
  const info = makeInfo(
27
27
  error,
28
28
  disabledLiquiditySources,
29
- toggleAllLiquiditySources,
29
+ () => toggleAllLiquiditySources(swappers, true),
30
30
  fetch
31
31
  );
32
32
 
@@ -10,7 +10,8 @@ import {
10
10
  import React from 'react';
11
11
  import { useNavigate } from 'react-router-dom';
12
12
 
13
- import { useMetaStore } from '../../store/meta';
13
+ import { navigationRoutes } from '../../constants/navigationRoutes';
14
+ import { useAppStore } from '../../store/AppStore';
14
15
  import { useNotificationStore } from '../../store/notification';
15
16
  import { useUiStore } from '../../store/ui';
16
17
 
@@ -26,14 +27,15 @@ export function NotificationContent() {
26
27
  const { getUnreadNotifications } = useNotificationStore();
27
28
 
28
29
  const notifications: Notification[] = getUnreadNotifications();
29
- const { tokens, blockchains } = useMetaStore.use.meta();
30
+ const blockchains = useAppStore().blockchains();
31
+ const tokens = useAppStore().tokens();
30
32
  const sortedNotification = notifications
31
33
  .sort((a, b) => b.creationTime - a.creationTime)
32
34
  .slice(0, MAX_NOTIFICATIONS_DISPLAYED);
33
35
 
34
36
  const handleOnClick = (requestId: Notification['requestId']) => {
35
37
  setSelectedSwap(requestId);
36
- navigate(`/swaps/${requestId}`);
38
+ navigate(`${navigationRoutes.swaps}/${requestId}`);
37
39
  };
38
40
 
39
41
  return (
@@ -1,5 +1,5 @@
1
1
  import * as Collapsible from '@radix-ui/react-collapsible';
2
- import { darkTheme, styled } from '@rango-dev/ui';
2
+ import { css, darkTheme, Image, styled } from '@rango-dev/ui';
3
3
 
4
4
  import { CollapsibleContent } from '../ConfirmWalletsModal/ConfirmWallets.styles';
5
5
 
@@ -13,6 +13,7 @@ export const QuoteContainer = styled(Collapsible.Root, {
13
13
  overflowY: 'hidden',
14
14
  width: '100%',
15
15
  borderRadius: '$xm',
16
+ cursor: 'default',
16
17
  variants: {
17
18
  recommended: {
18
19
  true: {
@@ -31,9 +32,10 @@ export const QuoteContainer = styled(Collapsible.Root, {
31
32
  },
32
33
  },
33
34
  },
34
- '& .steps-details': {
35
- padding: '$10 $15',
36
- },
35
+ });
36
+
37
+ export const stepsDetailsStyles = css({
38
+ padding: '$10 $15',
37
39
  });
38
40
 
39
41
  export const SummaryContainer = styled('div', {
@@ -104,14 +106,24 @@ export const SummaryContainer = styled('div', {
104
106
  },
105
107
  },
106
108
  ],
107
- '& .summary': {
108
- width: '100%',
109
- padding: '$15 $15 $10 $15',
110
- },
111
- '& .basic-info': {
112
- paddingTop: '$10',
113
- display: 'flex',
114
- alignItems: 'center',
109
+ });
110
+
111
+ export const summaryStyles = css({
112
+ width: '100%',
113
+ padding: '$15 $15 $10 $15',
114
+ cursor: 'default',
115
+ });
116
+
117
+ export const basicInfoStyles = css({
118
+ paddingTop: '$10',
119
+ display: 'flex',
120
+ alignItems: 'center',
121
+ '.usd-value': {
122
+ $$color: '$colors$neutral600',
123
+ [`.${darkTheme} &`]: {
124
+ $$color: '$colors$neutral700',
125
+ },
126
+ color: '$$color',
115
127
  },
116
128
  });
117
129
 
@@ -162,6 +174,24 @@ export const Chains = styled(Collapsible.Trigger, {
162
174
  '& div:nth-child(1)': { display: 'flex' },
163
175
  });
164
176
 
177
+ export const ChainImageContainer = styled('div', {
178
+ width: '18px',
179
+ height: '18px',
180
+ borderRadius: '100%',
181
+ border: '1.5px transparent solid',
182
+ display: 'flex',
183
+ justifyContent: 'center',
184
+ alignItems: 'center',
185
+ variants: {
186
+ state: {
187
+ error: {
188
+ borderColor: '$error500',
189
+ },
190
+ warning: { borderColor: '$warning500' },
191
+ },
192
+ },
193
+ });
194
+
165
195
  export const Content = styled(CollapsibleContent, {
166
196
  width: '100%',
167
197
  });
@@ -25,13 +25,20 @@ import {
25
25
  PERCENTAGE_CHANGE_MIN_DECIMALS,
26
26
  TOKEN_AMOUNT_MAX_DECIMALS,
27
27
  TOKEN_AMOUNT_MIN_DECIMALS,
28
+ USD_VALUE_MAX_DECIMALS,
29
+ USD_VALUE_MIN_DECIMALS,
28
30
  } from '../../constants/routing';
29
31
  import {
30
32
  FooterAlert,
31
33
  FooterStepAlarm,
32
34
  } from '../../containers/QuoteInfo/QuoteInfo.styles';
33
- import { useMetaStore } from '../../store/meta';
35
+ import { useAppStore } from '../../store/AppStore';
34
36
  import { QuoteErrorType, QuoteWarningType } from '../../types';
37
+ import { getContainer } from '../../utils/common';
38
+ import {
39
+ getBlockchainShortNameFor,
40
+ getSwapperDisplayName,
41
+ } from '../../utils/meta';
35
42
  import {
36
43
  numberToString,
37
44
  secondsToString,
@@ -41,6 +48,8 @@ import { getPriceImpact, getPriceImpactLevel } from '../../utils/quote';
41
48
  import { getTotalFeeInUsd } from '../../utils/swap';
42
49
 
43
50
  import {
51
+ basicInfoStyles,
52
+ ChainImageContainer,
44
53
  Chains,
45
54
  Content,
46
55
  EXPANDABLE_QUOTE_TRANSITION_DURATION,
@@ -48,14 +57,13 @@ import {
48
57
  HorizontalSeparator,
49
58
  IconContainer,
50
59
  QuoteContainer,
60
+ stepsDetailsStyles,
51
61
  SummaryContainer,
62
+ summaryStyles,
52
63
  } from './Quote.styles';
53
64
  import { QuoteSummary } from './QuoteSummary';
54
65
 
55
66
  export function Quote(props: QuoteProps) {
56
- const {
57
- meta: { tokens },
58
- } = useMetaStore();
59
67
  const {
60
68
  quote,
61
69
  input,
@@ -65,19 +73,39 @@ export function Quote(props: QuoteProps) {
65
73
  type,
66
74
  recommended = true,
67
75
  } = props;
76
+ const tokens = useAppStore().tokens();
77
+ const blockchains = useAppStore().blockchains();
78
+ const swappers = useAppStore().swappers();
68
79
 
69
80
  const [expanded, setExpanded] = useState(props.expanded);
70
81
  const quoteRef = useRef<HTMLButtonElement | null>(null);
82
+ const prevExpanded = useRef(expanded);
71
83
  const totalFee = numberToString(
72
84
  getTotalFeeInUsd(quote.result?.swaps ?? [], tokens),
73
85
  GAS_FEE_MIN_DECIMALS,
74
86
  GAS_FEE_MAX_DECIMALS
75
87
  );
76
88
  const totalTime = secondsToString(totalArrivalTime(quote.result?.swaps));
77
-
89
+ const roundedInput = numberToString(
90
+ input.value,
91
+ TOKEN_AMOUNT_MIN_DECIMALS,
92
+ TOKEN_AMOUNT_MAX_DECIMALS
93
+ );
94
+ const roundedOutput = numberToString(
95
+ output.value,
96
+ TOKEN_AMOUNT_MIN_DECIMALS,
97
+ TOKEN_AMOUNT_MAX_DECIMALS
98
+ );
99
+ const roundedOutputUsdValue = output.usdValue
100
+ ? numberToString(
101
+ output.usdValue,
102
+ USD_VALUE_MIN_DECIMALS,
103
+ USD_VALUE_MAX_DECIMALS
104
+ )
105
+ : '';
78
106
  const priceImpact = getPriceImpact(input.usdValue, output.usdValue ?? null);
79
107
  const percentageChange = numberToString(
80
- String(priceImpact),
108
+ priceImpact,
81
109
  PERCENTAGE_CHANGE_MIN_DECIMALS,
82
110
  PERCENTAGE_CHANGE_MAX_DECIMALS
83
111
  );
@@ -89,8 +117,8 @@ export function Quote(props: QuoteProps) {
89
117
  const stepHasError =
90
118
  (error?.type === QuoteErrorType.BRIDGE_LIMIT &&
91
119
  error.swap.swapperId === swap.swapperId) ||
92
- (warning?.type === QuoteWarningType.INSUFFICIENT_SLIPPAGE &&
93
- warning.recommendedSlippages?.has(index));
120
+ (error?.type === QuoteErrorType.INSUFFICIENT_SLIPPAGE &&
121
+ error.recommendedSlippages?.has(index));
94
122
  const stepHasWarning =
95
123
  warning?.type === QuoteWarningType.INSUFFICIENT_SLIPPAGE &&
96
124
  warning.recommendedSlippages?.has(index);
@@ -102,11 +130,17 @@ export function Quote(props: QuoteProps) {
102
130
  }
103
131
 
104
132
  return {
105
- swapper: { displayName: swap.swapperId, image: swap.swapperLogo },
133
+ swapper: {
134
+ displayName: getSwapperDisplayName(swap.swapperId, swappers),
135
+ image: swap.swapperLogo,
136
+ },
106
137
  from: {
107
138
  token: { displayName: swap.from.symbol, image: swap.from.logo },
108
139
  chain: {
109
- displayName: swap.from.blockchain,
140
+ displayName: getBlockchainShortNameFor(
141
+ swap.from.blockchain,
142
+ blockchains
143
+ ),
110
144
  image: swap.from.blockchainLogo,
111
145
  },
112
146
  price: {
@@ -117,17 +151,38 @@ export function Quote(props: QuoteProps) {
117
151
  TOKEN_AMOUNT_MIN_DECIMALS,
118
152
  TOKEN_AMOUNT_MAX_DECIMALS
119
153
  )
120
- : swap.fromAmount,
154
+ : numberToString(
155
+ swap.fromAmount,
156
+ TOKEN_AMOUNT_MIN_DECIMALS,
157
+ TOKEN_AMOUNT_MAX_DECIMALS
158
+ ),
159
+ usdValue: numberToString(
160
+ (swap.from.usdPrice ?? 0) * parseFloat(swap.fromAmount),
161
+ USD_VALUE_MIN_DECIMALS,
162
+ USD_VALUE_MAX_DECIMALS
163
+ ),
121
164
  },
122
165
  },
123
166
  to: {
124
167
  token: { displayName: swap.to.symbol, image: swap.to.logo },
125
168
  chain: {
126
- displayName: swap.to.blockchain,
169
+ displayName: getBlockchainShortNameFor(
170
+ swap.to.blockchain,
171
+ blockchains
172
+ ),
127
173
  image: swap.to.blockchainLogo,
128
174
  },
129
175
  price: {
130
- value: swap.toAmount,
176
+ value: numberToString(
177
+ swap.toAmount,
178
+ TOKEN_AMOUNT_MIN_DECIMALS,
179
+ TOKEN_AMOUNT_MAX_DECIMALS
180
+ ),
181
+ usdValue: numberToString(
182
+ (swap.to.usdPrice ?? 0) * parseFloat(swap.toAmount),
183
+ USD_VALUE_MIN_DECIMALS,
184
+ USD_VALUE_MAX_DECIMALS
185
+ ),
131
186
  },
132
187
  },
133
188
  state: stepState,
@@ -185,7 +240,7 @@ export function Quote(props: QuoteProps) {
185
240
  variant="body"
186
241
  color="neutral900">
187
242
  {i18n.t({
188
- id: 'min required Slippage: {minRequiredSlippage}',
243
+ id: 'Minimum required slippage is {minRequiredSlippage}',
189
244
  values: {
190
245
  ...(error?.type ===
191
246
  QuoteErrorType.INSUFFICIENT_SLIPPAGE && {
@@ -211,14 +266,16 @@ export function Quote(props: QuoteProps) {
211
266
  };
212
267
  const steps = getQuoteSteps(quote.result?.swaps ?? []);
213
268
  const numberOfSteps = steps.length;
269
+ const tooltipContainer = getContainer();
214
270
 
215
271
  useLayoutEffect(() => {
216
- if (expanded && quoteRef.current) {
272
+ if (expanded && !prevExpanded.current && quoteRef.current) {
217
273
  setTimeout(() => {
218
274
  quoteRef?.current?.scrollIntoView({ behavior: 'smooth' });
219
275
  }, EXPANDABLE_QUOTE_TRANSITION_DURATION);
220
276
  }
221
- }, [expanded]);
277
+ prevExpanded.current = expanded;
278
+ }, [expanded, prevExpanded]);
222
279
 
223
280
  return (
224
281
  <>
@@ -226,10 +283,10 @@ export function Quote(props: QuoteProps) {
226
283
  recommended={recommended}
227
284
  listItem={type === 'list-item'}
228
285
  basic={type === 'basic'}>
229
- <div className="summary">
286
+ <div className={summaryStyles()}>
230
287
  <QuoteCost fee={totalFee} time={totalTime} steps={numberOfSteps} />
231
288
  {type === 'basic' && (
232
- <div className="basic-info">
289
+ <div className={basicInfoStyles()}>
233
290
  <FrameIcon>
234
291
  <InfoIcon size={12} color="gray" />
235
292
  </FrameIcon>
@@ -237,16 +294,18 @@ export function Quote(props: QuoteProps) {
237
294
  size="small"
238
295
  variant="body"
239
296
  style={{ letterSpacing: 0.4 }}>
240
- {`${input.value} ${steps[0].from.token.displayName} = ${
241
- output.value
242
- } ${steps[steps.length - 1].to.token.displayName}`}
297
+ {`${roundedInput} ${
298
+ steps[0].from.token.displayName
299
+ } = ${roundedOutput} ${
300
+ steps[steps.length - 1].to.token.displayName
301
+ }`}
243
302
  </Typography>
244
303
  <Typography
245
304
  color="$neutral600"
246
305
  ml={2}
247
306
  size="xsmall"
248
307
  variant="body">
249
- {`($${output.usdValue})`}
308
+ {`($${roundedOutputUsdValue})`}
250
309
  </Typography>
251
310
  </div>
252
311
  )}
@@ -254,7 +313,7 @@ export function Quote(props: QuoteProps) {
254
313
  <TokenAmount
255
314
  type="output"
256
315
  direction="vertical"
257
- price={{ value: output.value, usdValue: output.usdValue }}
316
+ price={{ value: roundedOutput, usdValue: roundedOutputUsdValue }}
258
317
  token={{
259
318
  displayName: steps[numberOfSteps - 1].to.token.displayName,
260
319
  image: steps[numberOfSteps - 1].to.token.image,
@@ -283,38 +342,48 @@ export function Quote(props: QuoteProps) {
283
342
  <Chains
284
343
  ref={(ref) => (quoteRef.current = ref)}
285
344
  recommended={recommended}
286
- onClick={setExpanded.bind(null, (prevState) => !prevState)}>
345
+ onClick={() => setExpanded((prevState) => !prevState)}>
287
346
  <div>
288
347
  {steps.map((step, index) => {
289
348
  const key = `item-${index}`;
349
+ const arrow = (
350
+ <IconContainer>
351
+ <ChevronRightIcon
352
+ size={12}
353
+ color="black"
354
+ {...(step.state && {
355
+ color: step.state === 'error' ? 'error' : 'warning',
356
+ })}
357
+ />
358
+ </IconContainer>
359
+ );
290
360
  return (
291
361
  <React.Fragment key={key}>
292
362
  <Tooltip
293
- container={props.tooltipContainer}
363
+ container={tooltipContainer}
294
364
  side="bottom"
295
365
  sideOffset={4}
296
366
  content={step.from.chain.displayName}>
297
- <Image src={step.from.chain.image} size={16} />
367
+ <ChainImageContainer
368
+ state={step.state || steps[index - 1]?.state}>
369
+ <Image src={step.from.chain.image} size={16} />
370
+ </ChainImageContainer>
298
371
  </Tooltip>
299
372
  {index === numberOfSteps - 1 && (
300
373
  <>
301
- <IconContainer>
302
- <ChevronRightIcon size={12} color="black" />
303
- </IconContainer>
374
+ {arrow}
304
375
  <Tooltip
305
- container={props.tooltipContainer}
376
+ container={tooltipContainer}
306
377
  side="bottom"
307
378
  sideOffset={4}
308
379
  content={step.to.chain.displayName}>
309
- <Image src={step.to.chain.image} size={16} />
380
+ <ChainImageContainer state={step.state}>
381
+ <Image src={step.to.chain.image} size={16} />
382
+ </ChainImageContainer>
310
383
  </Tooltip>
311
384
  </>
312
385
  )}
313
- {index !== numberOfSteps - 1 && (
314
- <IconContainer>
315
- <ChevronRightIcon size={12} color="black" />
316
- </IconContainer>
317
- )}
386
+ {index !== numberOfSteps - 1 && <>{arrow}</>}
318
387
  </React.Fragment>
319
388
  );
320
389
  })}
@@ -325,7 +394,7 @@ export function Quote(props: QuoteProps) {
325
394
  </Chains>
326
395
  <Content open={expanded}>
327
396
  <HorizontalSeparator />
328
- <div className="steps-details">
397
+ <div className={stepsDetailsStyles()}>
329
398
  {steps.map((step, index) => {
330
399
  const key = `item-${index}`;
331
400
  return (
@@ -12,5 +12,4 @@ export type QuoteProps = {
12
12
  input: { value: string; usdValue: string };
13
13
  output: { value: string; usdValue?: string };
14
14
  expanded?: boolean;
15
- tooltipContainer?: HTMLElement;
16
15
  };