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

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 (312) 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 +56 -56
  8. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  9. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +0 -2
  10. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
  11. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
  12. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
  13. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
  14. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
  15. package/dist/components/Layout/Layout.d.ts.map +1 -1
  16. package/dist/components/Layout/Layout.types.d.ts +2 -2
  17. package/dist/components/Layout/Layout.types.d.ts.map +1 -1
  18. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  19. package/dist/components/Quote/Quote.d.ts.map +1 -1
  20. package/dist/components/Quote/Quote.styles.d.ts +159 -0
  21. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  22. package/dist/components/Quote/Quote.types.d.ts +0 -1
  23. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  24. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  25. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
  26. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  27. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  28. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  29. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  30. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  31. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  32. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
  33. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  34. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
  35. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
  36. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
  37. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
  38. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  39. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  40. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  41. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  42. package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
  43. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
  44. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  45. package/dist/components/TokenList/TokenList.types.d.ts +3 -9
  46. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
  47. package/dist/components/TokenList/index.d.ts +0 -1
  48. package/dist/components/TokenList/index.d.ts.map +1 -1
  49. package/dist/components/UpdateUrl.d.ts +1 -6
  50. package/dist/components/UpdateUrl.d.ts.map +1 -1
  51. package/dist/components/WidgetEvents.d.ts.map +1 -1
  52. package/dist/constants/errors.d.ts.map +1 -1
  53. package/dist/constants/index.d.ts +1 -0
  54. package/dist/constants/index.d.ts.map +1 -1
  55. package/dist/constants/navigationRoutes.d.ts +1 -2
  56. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  57. package/dist/constants/searchParams.d.ts +2 -1
  58. package/dist/constants/searchParams.d.ts.map +1 -1
  59. package/dist/containers/App/App.d.ts +3 -0
  60. package/dist/containers/App/App.d.ts.map +1 -0
  61. package/dist/containers/App/App.styles.d.ts +158 -0
  62. package/dist/containers/App/App.styles.d.ts.map +1 -0
  63. package/dist/containers/App/index.d.ts +2 -0
  64. package/dist/containers/App/index.d.ts.map +1 -0
  65. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  66. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
  67. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  68. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
  69. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  70. package/dist/containers/Wallets/Wallets.d.ts +6 -0
  71. package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
  72. package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
  73. package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
  74. package/dist/containers/Wallets/index.d.ts +2 -0
  75. package/dist/containers/Wallets/index.d.ts.map +1 -0
  76. package/dist/containers/Widget/Widget.d.ts +5 -0
  77. package/dist/containers/Widget/Widget.d.ts.map +1 -0
  78. package/dist/containers/Widget/Widget.types.d.ts +5 -0
  79. package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
  80. package/dist/containers/Widget/index.d.ts +3 -0
  81. package/dist/containers/Widget/index.d.ts.map +1 -0
  82. package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
  83. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
  84. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
  85. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
  86. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
  87. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
  88. package/dist/containers/WidgetInfo/index.d.ts +2 -0
  89. package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
  90. package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
  91. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
  92. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
  93. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
  94. package/dist/containers/WidgetProvider/index.d.ts +2 -0
  95. package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
  96. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
  97. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
  98. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
  99. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
  100. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
  101. package/dist/hooks/useForceAutoConnect.d.ts +2 -0
  102. package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
  103. package/dist/hooks/useLanguage.d.ts +1 -1
  104. package/dist/hooks/useLanguage.d.ts.map +1 -1
  105. package/dist/hooks/useNavigateBack.d.ts +1 -3
  106. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  107. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
  108. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
  109. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
  110. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
  111. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
  112. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
  113. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  114. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
  115. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
  116. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  117. package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
  118. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  119. package/dist/hooks/useTheme.d.ts +1 -1
  120. package/dist/hooks/useTheme.d.ts.map +1 -1
  121. package/dist/hooks/useWalletList.d.ts.map +1 -1
  122. package/dist/index.d.ts +20 -8
  123. package/dist/index.d.ts.map +1 -1
  124. package/dist/index.js +1 -1
  125. package/dist/index.js.map +4 -4
  126. package/dist/pages/ConfirmSwapPage.d.ts +1 -6
  127. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  128. package/dist/pages/HistoryPage.d.ts.map +1 -1
  129. package/dist/pages/Home.d.ts.map +1 -1
  130. package/dist/pages/LanguagePage.d.ts.map +1 -1
  131. package/dist/pages/LiquiditySourcePage.d.ts +1 -2
  132. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  133. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  134. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  135. package/dist/pages/SettingsPage.d.ts +1 -6
  136. package/dist/pages/SettingsPage.d.ts.map +1 -1
  137. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  138. package/dist/pages/ThemePage.d.ts.map +1 -1
  139. package/dist/pages/WalletsPage.d.ts +1 -8
  140. package/dist/pages/WalletsPage.d.ts.map +1 -1
  141. package/dist/store/AppStore.d.ts +47 -0
  142. package/dist/store/AppStore.d.ts.map +1 -0
  143. package/dist/store/app.d.ts +41 -22
  144. package/dist/store/app.d.ts.map +1 -1
  145. package/dist/store/notification.d.ts +4 -3
  146. package/dist/store/notification.d.ts.map +1 -1
  147. package/dist/store/quote.d.ts +23 -16
  148. package/dist/store/quote.d.ts.map +1 -1
  149. package/dist/store/slices/config.d.ts +3 -2
  150. package/dist/store/slices/config.d.ts.map +1 -1
  151. package/dist/store/slices/data.d.ts +3 -0
  152. package/dist/store/slices/data.d.ts.map +1 -1
  153. package/dist/store/slices/settings.d.ts +39 -0
  154. package/dist/store/slices/settings.d.ts.map +1 -0
  155. package/dist/store/ui.d.ts +2 -1
  156. package/dist/store/ui.d.ts.map +1 -1
  157. package/dist/store/wallets.d.ts +14 -9
  158. package/dist/store/wallets.d.ts.map +1 -1
  159. package/dist/types/config.d.ts +38 -5
  160. package/dist/types/config.d.ts.map +1 -1
  161. package/dist/types/swap.d.ts +4 -14
  162. package/dist/types/swap.d.ts.map +1 -1
  163. package/dist/types/wallets.d.ts +15 -1
  164. package/dist/types/wallets.d.ts.map +1 -1
  165. package/dist/utils/colors.d.ts.map +1 -1
  166. package/dist/utils/configs.d.ts +1 -0
  167. package/dist/utils/configs.d.ts.map +1 -1
  168. package/dist/utils/meta.d.ts +2 -1
  169. package/dist/utils/meta.d.ts.map +1 -1
  170. package/dist/utils/providers.d.ts +2 -2
  171. package/dist/utils/providers.d.ts.map +1 -1
  172. package/dist/utils/queue.d.ts +2 -2
  173. package/dist/utils/queue.d.ts.map +1 -1
  174. package/dist/utils/quote.d.ts +1 -1
  175. package/dist/utils/quote.d.ts.map +1 -1
  176. package/dist/utils/settings.d.ts +6 -2
  177. package/dist/utils/settings.d.ts.map +1 -1
  178. package/dist/utils/swap.d.ts +16 -7
  179. package/dist/utils/swap.d.ts.map +1 -1
  180. package/dist/utils/time.d.ts +1 -1
  181. package/dist/utils/time.d.ts.map +1 -1
  182. package/dist/utils/wallets.d.ts +7 -9
  183. package/dist/utils/wallets.d.ts.map +1 -1
  184. package/package.json +12 -10
  185. package/src/QueueManager.tsx +18 -17
  186. package/src/components/AppRouter.tsx +8 -32
  187. package/src/components/AppRoutes.tsx +57 -69
  188. package/src/components/BlockchainList/BlockchainList.tsx +4 -4
  189. package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
  190. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +16 -19
  191. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +0 -2
  192. package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
  193. package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
  194. package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
  195. package/src/components/Layout/Layout.tsx +20 -7
  196. package/src/components/Layout/Layout.types.ts +2 -2
  197. package/src/components/NoResult/NoResult.helpers.ts +12 -12
  198. package/src/components/NoResult/NoResult.tsx +6 -6
  199. package/src/components/NotificationContent/NotificationContent.tsx +5 -3
  200. package/src/components/Quote/Quote.styles.ts +28 -1
  201. package/src/components/Quote/Quote.tsx +100 -34
  202. package/src/components/Quote/Quote.types.ts +0 -1
  203. package/src/components/Quote/QuoteSkeleton.tsx +1 -1
  204. package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
  205. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
  206. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
  207. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
  208. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  209. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
  210. package/src/components/Slippage/Slippage.tsx +3 -5
  211. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +0 -4
  212. package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
  213. package/src/components/SwapDetails/SwapDetails.tsx +19 -39
  214. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
  215. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
  216. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
  217. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
  218. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
  219. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
  220. package/src/components/SwapsGroup/SwapsGroup.styles.ts +8 -1
  221. package/src/components/SwapsGroup/SwapsGroup.tsx +0 -2
  222. package/src/components/TokenList/TokenList.helpers.ts +2 -2
  223. package/src/components/TokenList/TokenList.styles.ts +14 -2
  224. package/src/components/TokenList/TokenList.tsx +16 -19
  225. package/src/components/TokenList/TokenList.types.ts +3 -10
  226. package/src/components/TokenList/index.ts +0 -1
  227. package/src/components/UpdateUrl.tsx +23 -18
  228. package/src/components/WidgetEvents.tsx +4 -2
  229. package/src/constants/errors.ts +9 -5
  230. package/src/constants/index.ts +1 -0
  231. package/src/constants/navigationRoutes.ts +7 -8
  232. package/src/constants/searchParams.ts +1 -0
  233. package/src/containers/App/App.styles.ts +18 -0
  234. package/src/containers/App/App.tsx +52 -0
  235. package/src/containers/App/index.ts +1 -0
  236. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
  237. package/src/containers/QuoteInfo/QuoteInfo.tsx +44 -43
  238. package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
  239. package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
  240. package/src/containers/Wallets/Wallets.types.ts +12 -0
  241. package/src/containers/Wallets/index.ts +1 -0
  242. package/src/containers/Widget/Widget.tsx +19 -0
  243. package/src/containers/Widget/Widget.types.ts +5 -0
  244. package/src/containers/Widget/index.ts +2 -0
  245. package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
  246. package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
  247. package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
  248. package/src/containers/WidgetInfo/index.ts +1 -0
  249. package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
  250. package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
  251. package/src/containers/WidgetProvider/index.ts +1 -0
  252. package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
  253. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +25 -24
  254. package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
  255. package/src/hooks/useForceAutoConnect.ts +27 -0
  256. package/src/hooks/useLanguage.ts +4 -5
  257. package/src/hooks/useNavigateBack.ts +3 -52
  258. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
  259. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
  260. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
  261. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
  262. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
  263. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
  264. package/src/hooks/useSwapInput.ts +89 -30
  265. package/src/hooks/useSyncStoresWithConfig.ts +38 -22
  266. package/src/hooks/useTheme.ts +4 -5
  267. package/src/hooks/useWalletList.ts +3 -5
  268. package/src/index.ts +53 -5
  269. package/src/pages/ConfirmSwapPage.tsx +39 -24
  270. package/src/pages/HistoryPage.tsx +2 -7
  271. package/src/pages/Home.tsx +58 -88
  272. package/src/pages/LanguagePage.tsx +0 -5
  273. package/src/pages/LiquiditySourcePage.tsx +24 -37
  274. package/src/pages/SelectBlockchainPage.tsx +28 -21
  275. package/src/pages/SelectSwapItemsPage.tsx +10 -27
  276. package/src/pages/SettingsPage.tsx +28 -24
  277. package/src/pages/SwapDetailsPage.tsx +6 -7
  278. package/src/pages/ThemePage.tsx +2 -7
  279. package/src/pages/WalletsPage.tsx +4 -15
  280. package/src/services/httpService.ts +1 -1
  281. package/src/store/AppStore.tsx +41 -0
  282. package/src/store/app.ts +44 -6
  283. package/src/store/quote.ts +29 -26
  284. package/src/store/slices/config.ts +25 -15
  285. package/src/store/slices/data.ts +64 -29
  286. package/src/store/slices/settings.ts +168 -0
  287. package/src/store/wallets.ts +68 -37
  288. package/src/types/config.ts +50 -5
  289. package/src/types/swap.ts +4 -13
  290. package/src/types/wallets.ts +18 -1
  291. package/src/utils/colors.ts +2 -1
  292. package/src/utils/configs.ts +2 -1
  293. package/src/utils/date.ts +1 -1
  294. package/src/utils/meta.ts +8 -1
  295. package/src/utils/providers.ts +8 -5
  296. package/src/utils/queue.ts +2 -2
  297. package/src/utils/quote.ts +7 -7
  298. package/src/utils/settings.ts +17 -10
  299. package/src/utils/swap.ts +59 -55
  300. package/src/utils/time.ts +1 -1
  301. package/src/utils/wallets.ts +107 -149
  302. package/dist/Wallets.d.ts +0 -17
  303. package/dist/Wallets.d.ts.map +0 -1
  304. package/dist/Widget.d.ts +0 -9
  305. package/dist/Widget.d.ts.map +0 -1
  306. package/dist/store/meta.d.ts +0 -23
  307. package/dist/store/meta.d.ts.map +0 -1
  308. package/dist/store/settings.d.ts +0 -81
  309. package/dist/store/settings.d.ts.map +0 -1
  310. package/src/Widget.tsx +0 -119
  311. package/src/store/meta.ts +0 -39
  312. package/src/store/settings.ts +0 -158
@@ -1,5 +1,5 @@
1
1
  import * as Collapsible from '@radix-ui/react-collapsible';
2
- import { darkTheme, styled } from '@rango-dev/ui';
2
+ import { 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: {
@@ -107,11 +108,19 @@ export const SummaryContainer = styled('div', {
107
108
  '& .summary': {
108
109
  width: '100%',
109
110
  padding: '$15 $15 $10 $15',
111
+ cursor: 'default',
110
112
  },
111
113
  '& .basic-info': {
112
114
  paddingTop: '$10',
113
115
  display: 'flex',
114
116
  alignItems: 'center',
117
+ '.usd-value': {
118
+ $$color: '$colors$neutral600',
119
+ [`.${darkTheme} &`]: {
120
+ $$color: '$colors$neutral700',
121
+ },
122
+ color: '$$color',
123
+ },
115
124
  },
116
125
  });
117
126
 
@@ -162,6 +171,24 @@ export const Chains = styled(Collapsible.Trigger, {
162
171
  '& div:nth-child(1)': { display: 'flex' },
163
172
  });
164
173
 
174
+ export const ChainImageContainer = styled('div', {
175
+ width: '18px',
176
+ height: '18px',
177
+ borderRadius: '100%',
178
+ border: '1.5px transparent solid',
179
+ display: 'flex',
180
+ justifyContent: 'center',
181
+ alignItems: 'center',
182
+ variants: {
183
+ state: {
184
+ error: {
185
+ borderColor: '$error500',
186
+ },
187
+ warning: { borderColor: '$warning500' },
188
+ },
189
+ },
190
+ });
191
+
165
192
  export const Content = styled(CollapsibleContent, {
166
193
  width: '100%',
167
194
  });
@@ -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,7 @@ import { getPriceImpact, getPriceImpactLevel } from '../../utils/quote';
41
48
  import { getTotalFeeInUsd } from '../../utils/swap';
42
49
 
43
50
  import {
51
+ ChainImageContainer,
44
52
  Chains,
45
53
  Content,
46
54
  EXPANDABLE_QUOTE_TRANSITION_DURATION,
@@ -53,9 +61,6 @@ import {
53
61
  import { QuoteSummary } from './QuoteSummary';
54
62
 
55
63
  export function Quote(props: QuoteProps) {
56
- const {
57
- meta: { tokens },
58
- } = useMetaStore();
59
64
  const {
60
65
  quote,
61
66
  input,
@@ -65,19 +70,39 @@ export function Quote(props: QuoteProps) {
65
70
  type,
66
71
  recommended = true,
67
72
  } = props;
73
+ const tokens = useAppStore().tokens();
74
+ const blockchains = useAppStore().blockchains();
75
+ const swappers = useAppStore().swappers();
68
76
 
69
77
  const [expanded, setExpanded] = useState(props.expanded);
70
78
  const quoteRef = useRef<HTMLButtonElement | null>(null);
79
+ const prevExpanded = useRef(expanded);
71
80
  const totalFee = numberToString(
72
81
  getTotalFeeInUsd(quote.result?.swaps ?? [], tokens),
73
82
  GAS_FEE_MIN_DECIMALS,
74
83
  GAS_FEE_MAX_DECIMALS
75
84
  );
76
85
  const totalTime = secondsToString(totalArrivalTime(quote.result?.swaps));
77
-
86
+ const roundedInput = numberToString(
87
+ input.value,
88
+ TOKEN_AMOUNT_MIN_DECIMALS,
89
+ TOKEN_AMOUNT_MAX_DECIMALS
90
+ );
91
+ const roundedOutput = numberToString(
92
+ output.value,
93
+ TOKEN_AMOUNT_MIN_DECIMALS,
94
+ TOKEN_AMOUNT_MAX_DECIMALS
95
+ );
96
+ const roundedOutputUsdValue = output.usdValue
97
+ ? numberToString(
98
+ output.usdValue,
99
+ USD_VALUE_MIN_DECIMALS,
100
+ USD_VALUE_MAX_DECIMALS
101
+ )
102
+ : '';
78
103
  const priceImpact = getPriceImpact(input.usdValue, output.usdValue ?? null);
79
104
  const percentageChange = numberToString(
80
- String(priceImpact),
105
+ priceImpact,
81
106
  PERCENTAGE_CHANGE_MIN_DECIMALS,
82
107
  PERCENTAGE_CHANGE_MAX_DECIMALS
83
108
  );
@@ -89,8 +114,8 @@ export function Quote(props: QuoteProps) {
89
114
  const stepHasError =
90
115
  (error?.type === QuoteErrorType.BRIDGE_LIMIT &&
91
116
  error.swap.swapperId === swap.swapperId) ||
92
- (warning?.type === QuoteWarningType.INSUFFICIENT_SLIPPAGE &&
93
- warning.recommendedSlippages?.has(index));
117
+ (error?.type === QuoteErrorType.INSUFFICIENT_SLIPPAGE &&
118
+ error.recommendedSlippages?.has(index));
94
119
  const stepHasWarning =
95
120
  warning?.type === QuoteWarningType.INSUFFICIENT_SLIPPAGE &&
96
121
  warning.recommendedSlippages?.has(index);
@@ -102,11 +127,17 @@ export function Quote(props: QuoteProps) {
102
127
  }
103
128
 
104
129
  return {
105
- swapper: { displayName: swap.swapperId, image: swap.swapperLogo },
130
+ swapper: {
131
+ displayName: getSwapperDisplayName(swap.swapperId, swappers),
132
+ image: swap.swapperLogo,
133
+ },
106
134
  from: {
107
135
  token: { displayName: swap.from.symbol, image: swap.from.logo },
108
136
  chain: {
109
- displayName: swap.from.blockchain,
137
+ displayName: getBlockchainShortNameFor(
138
+ swap.from.blockchain,
139
+ blockchains
140
+ ),
110
141
  image: swap.from.blockchainLogo,
111
142
  },
112
143
  price: {
@@ -117,17 +148,38 @@ export function Quote(props: QuoteProps) {
117
148
  TOKEN_AMOUNT_MIN_DECIMALS,
118
149
  TOKEN_AMOUNT_MAX_DECIMALS
119
150
  )
120
- : swap.fromAmount,
151
+ : numberToString(
152
+ swap.fromAmount,
153
+ TOKEN_AMOUNT_MIN_DECIMALS,
154
+ TOKEN_AMOUNT_MAX_DECIMALS
155
+ ),
156
+ usdValue: numberToString(
157
+ (swap.from.usdPrice ?? 0) * parseFloat(swap.fromAmount),
158
+ USD_VALUE_MIN_DECIMALS,
159
+ USD_VALUE_MAX_DECIMALS
160
+ ),
121
161
  },
122
162
  },
123
163
  to: {
124
164
  token: { displayName: swap.to.symbol, image: swap.to.logo },
125
165
  chain: {
126
- displayName: swap.to.blockchain,
166
+ displayName: getBlockchainShortNameFor(
167
+ swap.to.blockchain,
168
+ blockchains
169
+ ),
127
170
  image: swap.to.blockchainLogo,
128
171
  },
129
172
  price: {
130
- value: swap.toAmount,
173
+ value: numberToString(
174
+ swap.toAmount,
175
+ TOKEN_AMOUNT_MIN_DECIMALS,
176
+ TOKEN_AMOUNT_MAX_DECIMALS
177
+ ),
178
+ usdValue: numberToString(
179
+ (swap.to.usdPrice ?? 0) * parseFloat(swap.toAmount),
180
+ USD_VALUE_MIN_DECIMALS,
181
+ USD_VALUE_MAX_DECIMALS
182
+ ),
131
183
  },
132
184
  },
133
185
  state: stepState,
@@ -185,7 +237,7 @@ export function Quote(props: QuoteProps) {
185
237
  variant="body"
186
238
  color="neutral900">
187
239
  {i18n.t({
188
- id: 'min required Slippage: {minRequiredSlippage}',
240
+ id: 'Minimum required slippage is {minRequiredSlippage}',
189
241
  values: {
190
242
  ...(error?.type ===
191
243
  QuoteErrorType.INSUFFICIENT_SLIPPAGE && {
@@ -211,14 +263,16 @@ export function Quote(props: QuoteProps) {
211
263
  };
212
264
  const steps = getQuoteSteps(quote.result?.swaps ?? []);
213
265
  const numberOfSteps = steps.length;
266
+ const tooltipContainer = getContainer();
214
267
 
215
268
  useLayoutEffect(() => {
216
- if (expanded && quoteRef.current) {
269
+ if (expanded && !prevExpanded.current && quoteRef.current) {
217
270
  setTimeout(() => {
218
271
  quoteRef?.current?.scrollIntoView({ behavior: 'smooth' });
219
272
  }, EXPANDABLE_QUOTE_TRANSITION_DURATION);
220
273
  }
221
- }, [expanded]);
274
+ prevExpanded.current = expanded;
275
+ }, [expanded, prevExpanded]);
222
276
 
223
277
  return (
224
278
  <>
@@ -237,16 +291,18 @@ export function Quote(props: QuoteProps) {
237
291
  size="small"
238
292
  variant="body"
239
293
  style={{ letterSpacing: 0.4 }}>
240
- {`${input.value} ${steps[0].from.token.displayName} = ${
241
- output.value
242
- } ${steps[steps.length - 1].to.token.displayName}`}
294
+ {`${roundedInput} ${
295
+ steps[0].from.token.displayName
296
+ } = ${roundedOutput} ${
297
+ steps[steps.length - 1].to.token.displayName
298
+ }`}
243
299
  </Typography>
244
300
  <Typography
245
301
  color="$neutral600"
246
302
  ml={2}
247
303
  size="xsmall"
248
304
  variant="body">
249
- {`($${output.usdValue})`}
305
+ {`($${roundedOutputUsdValue})`}
250
306
  </Typography>
251
307
  </div>
252
308
  )}
@@ -254,7 +310,7 @@ export function Quote(props: QuoteProps) {
254
310
  <TokenAmount
255
311
  type="output"
256
312
  direction="vertical"
257
- price={{ value: output.value, usdValue: output.usdValue }}
313
+ price={{ value: roundedOutput, usdValue: roundedOutputUsdValue }}
258
314
  token={{
259
315
  displayName: steps[numberOfSteps - 1].to.token.displayName,
260
316
  image: steps[numberOfSteps - 1].to.token.image,
@@ -283,38 +339,48 @@ export function Quote(props: QuoteProps) {
283
339
  <Chains
284
340
  ref={(ref) => (quoteRef.current = ref)}
285
341
  recommended={recommended}
286
- onClick={setExpanded.bind(null, (prevState) => !prevState)}>
342
+ onClick={() => setExpanded((prevState) => !prevState)}>
287
343
  <div>
288
344
  {steps.map((step, index) => {
289
345
  const key = `item-${index}`;
346
+ const arrow = (
347
+ <IconContainer>
348
+ <ChevronRightIcon
349
+ size={12}
350
+ color="black"
351
+ {...(step.state && {
352
+ color: step.state === 'error' ? 'error' : 'warning',
353
+ })}
354
+ />
355
+ </IconContainer>
356
+ );
290
357
  return (
291
358
  <React.Fragment key={key}>
292
359
  <Tooltip
293
- container={props.tooltipContainer}
360
+ container={tooltipContainer}
294
361
  side="bottom"
295
362
  sideOffset={4}
296
363
  content={step.from.chain.displayName}>
297
- <Image src={step.from.chain.image} size={16} />
364
+ <ChainImageContainer
365
+ state={step.state || steps[index - 1]?.state}>
366
+ <Image src={step.from.chain.image} size={16} />
367
+ </ChainImageContainer>
298
368
  </Tooltip>
299
369
  {index === numberOfSteps - 1 && (
300
370
  <>
301
- <IconContainer>
302
- <ChevronRightIcon size={12} color="black" />
303
- </IconContainer>
371
+ {arrow}
304
372
  <Tooltip
305
- container={props.tooltipContainer}
373
+ container={tooltipContainer}
306
374
  side="bottom"
307
375
  sideOffset={4}
308
376
  content={step.to.chain.displayName}>
309
- <Image src={step.to.chain.image} size={16} />
377
+ <ChainImageContainer state={step.state}>
378
+ <Image src={step.to.chain.image} size={16} />
379
+ </ChainImageContainer>
310
380
  </Tooltip>
311
381
  </>
312
382
  )}
313
- {index !== numberOfSteps - 1 && (
314
- <IconContainer>
315
- <ChevronRightIcon size={12} color="black" />
316
- </IconContainer>
317
- )}
383
+ {index !== numberOfSteps - 1 && <>{arrow}</>}
318
384
  </React.Fragment>
319
385
  );
320
386
  })}
@@ -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
  };
@@ -54,7 +54,7 @@ export function QuoteSkeleton(props: PropTypes) {
54
54
  );
55
55
 
56
56
  return (
57
- <Container>
57
+ <Container rounded={type !== 'basic'}>
58
58
  <div className="cost-and-tag">
59
59
  <div className="cost">
60
60
  <Skeleton width={60} height={10} variant="rounded" />
@@ -10,7 +10,7 @@ export function QuoteErrorsModalItem(props: ModalContentData) {
10
10
 
11
11
  return (
12
12
  <Item>
13
- <Typography size="medium" variant="label" color="neutral600">
13
+ <Typography size="medium" variant="label" className="_title">
14
14
  {title}
15
15
  </Typography>
16
16
  <Typography
@@ -31,6 +31,7 @@ export function makeAlerts(
31
31
  if (warningLevel === 'high') {
32
32
  alertInfo.alertType = 'error';
33
33
  }
34
+ alertInfo.action = null;
34
35
  alertInfo.title = errorMessages().highValueLossError.title;
35
36
  }
36
37
  if (warning.type === QuoteWarningType.UNKNOWN_PRICE) {
@@ -38,14 +39,15 @@ export function makeAlerts(
38
39
  }
39
40
  if (warning.type === QuoteWarningType.INSUFFICIENT_SLIPPAGE) {
40
41
  alertInfo.title = i18n.t({
41
- id: 'minimum required slippage for this route: {minRequiredSlippage}',
42
+ id: 'We recommend you to increase slippage to at least {minRequiredSlippage} for this route.',
42
43
  values: {
43
44
  minRequiredSlippage: warning.minRequiredSlippage,
44
45
  },
45
46
  });
47
+ alertInfo.action = 'change-settings';
46
48
  }
47
49
  if (warning.type === QuoteWarningType.HIGH_SLIPPAGE) {
48
- alertInfo.title = i18n.t('Caution, your slippage is high');
50
+ alertInfo.title = i18n.t('Caution, your slippage is high.');
49
51
  }
50
52
  return alertInfo;
51
53
  }
@@ -53,11 +55,16 @@ export function makeAlerts(
53
55
  alertInfo.alertType = 'error';
54
56
  if (error.type === QuoteErrorType.BRIDGE_LIMIT) {
55
57
  alertInfo.title = error.recommendation;
56
- alertInfo.action = null;
58
+ alertInfo.action = 'show-info';
57
59
  }
58
60
 
59
61
  if (error.type === QuoteErrorType.INSUFFICIENT_SLIPPAGE) {
60
- alertInfo.title = '';
62
+ alertInfo.title = i18n.t({
63
+ id: 'You need to increase slippage to at least {minRequiredSlippage} for this route.',
64
+ values: {
65
+ minRequiredSlippage: error.minRequiredSlippage,
66
+ },
67
+ });
61
68
  alertInfo.action = 'change-settings';
62
69
  }
63
70
 
@@ -1,4 +1,4 @@
1
- import { styled } from '@rango-dev/ui';
1
+ import { darkTheme, styled } from '@rango-dev/ui';
2
2
 
3
3
  export const Alerts = styled('div', {
4
4
  width: '100%',
@@ -19,6 +19,13 @@ export const Item = styled('div', {
19
19
  justifyContent: 'space-between',
20
20
  alignItems: 'center',
21
21
  width: '100%',
22
+ '._title': {
23
+ $$color: '$colors$neutral600',
24
+ [`.${darkTheme} &`]: {
25
+ $$color: '$colors$neutral700',
26
+ },
27
+ color: '$$color',
28
+ },
22
29
  });
23
30
 
24
31
  export const Action = styled('div', {
@@ -3,9 +3,7 @@ import type { PropTypes } from './QuoteWarningsAndErrors.types';
3
3
  import { i18n } from '@lingui/core';
4
4
  import { Alert, Button, InfoIcon } from '@rango-dev/ui';
5
5
  import React from 'react';
6
- import { useNavigate } from 'react-router-dom';
7
6
 
8
- import { navigationRoutes } from '../../constants/navigationRoutes';
9
7
  import { QuoteErrorType, QuoteWarningType } from '../../types';
10
8
  import { NoResult } from '../NoResult';
11
9
 
@@ -24,10 +22,9 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
24
22
  onOpenWarningModal,
25
23
  onCloseWarningModal,
26
24
  onConfirmWarningModal,
25
+ onChangeSettings,
27
26
  } = props;
28
27
 
29
- const navigate = useNavigate();
30
-
31
28
  const warningModalHandlers = {
32
29
  open: showWarningModal,
33
30
  onClose: onCloseWarningModal,
@@ -58,20 +55,23 @@ export function QuoteWarningsAndErrors(props: PropTypes) {
58
55
  title={alertInfo.title}
59
56
  type={alertInfo.alertType}
60
57
  variant="alarm"
61
- action={
62
- alertInfo.action === 'show-info' ? (
58
+ {...(alertInfo.action === 'show-info' && {
59
+ action: (
63
60
  <Action onClick={onOpenWarningModal}>
64
61
  <InfoIcon size={12} color="gray" />
65
62
  </Action>
66
- ) : (
63
+ ),
64
+ })}
65
+ {...(alertInfo.action === 'change-settings' && {
66
+ action: (
67
67
  <Button
68
- size="xsmall"
69
- type={'error'}
70
- onClick={() => navigate(navigationRoutes.settings)}>
71
- {i18n.t('Change Settings')}
68
+ size="xxsmall"
69
+ type={alertInfo.alertType}
70
+ onClick={onChangeSettings}>
71
+ {i18n.t('Change')}
72
72
  </Button>
73
- )
74
- }
73
+ ),
74
+ })}
75
75
  />
76
76
  </Alerts>
77
77
  )}
@@ -9,6 +9,7 @@ export interface PropTypes {
9
9
  onOpenWarningModal: () => void;
10
10
  onCloseWarningModal: () => void;
11
11
  onConfirmWarningModal: () => void;
12
+ onChangeSettings: () => void;
12
13
  }
13
14
 
14
15
  type ModalPropTypesKeys = keyof Omit<PropTypes, 'extraSpace' | 'loading'>;
@@ -9,7 +9,7 @@ import React from 'react';
9
9
  import { useNavigate } from 'react-router-dom';
10
10
 
11
11
  import { navigationRoutes } from '../../constants/navigationRoutes';
12
- import { useSettingsStore } from '../../store/settings';
12
+ import { useAppStore } from '../../store/AppStore';
13
13
  import { QuoteWarningType } from '../../types';
14
14
  import { getContainer } from '../../utils/common';
15
15
 
@@ -21,7 +21,7 @@ type PropsTypes = {
21
21
  };
22
22
 
23
23
  export function SlippageWarningModal(props: PropsTypes) {
24
- const { customSlippage, slippage } = useSettingsStore();
24
+ const { customSlippage, slippage } = useAppStore();
25
25
  const { open, onClose, onConfirm, warning } = props;
26
26
  const navigate = useNavigate();
27
27
  const userSlippage = customSlippage ?? slippage;
@@ -33,7 +33,7 @@ export function SlippageWarningModal(props: PropsTypes) {
33
33
  <Button
34
34
  size="small"
35
35
  variant="ghost"
36
- onClick={() => navigate('/' + navigationRoutes.settings)}>
36
+ onClick={() => navigate('../' + navigationRoutes.settings)}>
37
37
  <Typography variant="label" size="medium" color="$neutral900">
38
38
  {i18n.t('Change settings')}
39
39
  </Typography>
@@ -14,17 +14,15 @@ import {
14
14
  MIN_SLIPPGAE,
15
15
  SLIPPAGES,
16
16
  } from '../../constants/swapSettings';
17
- import { useSettingsStore } from '../../store/settings';
17
+ import { useAppStore } from '../../store/AppStore';
18
18
  import { getContainer } from '../../utils/common';
19
19
 
20
20
  import { BaseContainer, Head, SlippageChipsContainer } from './Slippage.styles';
21
21
  import { SlippageTooltipContent } from './SlippageTooltipContent';
22
22
 
23
23
  export function Slippage() {
24
- const slippage = useSettingsStore.use.slippage();
25
- const setSlippage = useSettingsStore.use.setSlippage();
26
- const customSlippage = useSettingsStore.use.customSlippage();
27
- const setCustomSlippage = useSettingsStore.use.setCustomSlippage();
24
+ const { slippage, setSlippage, customSlippage, setCustomSlippage } =
25
+ useAppStore();
28
26
 
29
27
  return (
30
28
  <BaseContainer>
@@ -10,8 +10,6 @@ import {
10
10
  } from '@rango-dev/ui';
11
11
  import React from 'react';
12
12
 
13
- import { navigationRoutes } from '../../constants/navigationRoutes';
14
- import { useNavigateBack } from '../../hooks/useNavigateBack';
15
13
  import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
16
14
  import { Layout } from '../Layout';
17
15
  import { LoadingSwapDetails } from '../LoadingSwapDetails';
@@ -24,14 +22,12 @@ import {
24
22
 
25
23
  export function SwapDetailsPlaceholder(props: SwapDetailsPlaceholderPropTypes) {
26
24
  const { requestId, showSkeleton } = props;
27
- const { navigateBackFrom } = useNavigateBack();
28
25
 
29
26
  return (
30
27
  <Layout
31
28
  noPadding
32
29
  header={{
33
30
  title: i18n.t('Swap and Bridge'),
34
- onBack: () => navigateBackFrom(navigationRoutes.swapDetails),
35
31
  suffix: <SuffixContainer />,
36
32
  }}>
37
33
  {showSkeleton && (
@@ -1,6 +1,6 @@
1
1
  import type { GetStep } from '../SwapDetailsAlerts';
2
- import type { PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
3
2
  import type { Step, StepDetailsProps } from '@rango-dev/ui';
3
+ import type { PendingSwapStep } from 'rango-types';
4
4
 
5
5
  import React from 'react';
6
6