@rango-dev/widget-embedded 0.12.1-next.3 → 0.12.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 (491) hide show
  1. package/dist/Wallets.d.ts +4 -3
  2. package/dist/Wallets.d.ts.map +1 -1
  3. package/dist/Widget.d.ts +3 -2
  4. package/dist/Widget.d.ts.map +1 -1
  5. package/dist/components/AppRouter.d.ts +5 -2
  6. package/dist/components/AppRouter.d.ts.map +1 -1
  7. package/dist/components/AppRoutes.d.ts +1 -1
  8. package/dist/components/AppRoutes.d.ts.map +1 -1
  9. package/dist/components/BlockchainList/BlockchainList.d.ts +4 -0
  10. package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -0
  11. package/dist/components/BlockchainList/BlockchainList.helpers.d.ts +4 -0
  12. package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -0
  13. package/dist/components/BlockchainList/BlockchainList.styles.d.ts +307 -0
  14. package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -0
  15. package/dist/components/BlockchainList/BlockchainList.types.d.ts +8 -0
  16. package/dist/components/BlockchainList/BlockchainList.types.d.ts.map +1 -0
  17. package/dist/components/BlockchainList/LoadingBlockchainList.d.ts +3 -0
  18. package/dist/components/BlockchainList/LoadingBlockchainList.d.ts.map +1 -0
  19. package/dist/components/BlockchainList/index.d.ts +2 -0
  20. package/dist/components/BlockchainList/index.d.ts.map +1 -0
  21. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts +4 -0
  22. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -0
  23. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +154 -0
  24. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -0
  25. package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts +9 -0
  26. package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts.map +1 -0
  27. package/dist/components/BlockchainsSection/index.d.ts +2 -0
  28. package/dist/components/BlockchainsSection/index.d.ts.map +1 -0
  29. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +6 -0
  30. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -0
  31. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +2599 -0
  32. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -0
  33. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts +4 -0
  34. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -0
  35. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +11 -0
  36. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -0
  37. package/dist/components/ConfirmWalletsModal/WalletList.d.ts +4 -0
  38. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -0
  39. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +460 -0
  40. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -0
  41. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +12 -0
  42. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -0
  43. package/dist/components/HeaderButtons/BackButton.d.ts +5 -0
  44. package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -0
  45. package/dist/components/HeaderButtons/CancelButton.d.ts +5 -0
  46. package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -0
  47. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +616 -0
  48. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
  49. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +13 -0
  50. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -0
  51. package/dist/components/HeaderButtons/HomeButtons.d.ts +4 -0
  52. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -0
  53. package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts +3 -0
  54. package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -0
  55. package/dist/components/HeaderButtons/WalletButton.d.ts +5 -0
  56. package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -0
  57. package/dist/components/HeaderButtons/index.d.ts +5 -0
  58. package/dist/components/HeaderButtons/index.d.ts.map +1 -0
  59. package/dist/components/Layout/Layout.d.ts +7 -0
  60. package/dist/components/Layout/Layout.d.ts.map +1 -0
  61. package/dist/components/Layout/Layout.styles.d.ts +464 -0
  62. package/dist/components/Layout/Layout.styles.d.ts.map +1 -0
  63. package/dist/components/Layout/Layout.types.d.ts +17 -0
  64. package/dist/components/Layout/Layout.types.d.ts.map +1 -0
  65. package/dist/components/Layout/index.d.ts +2 -0
  66. package/dist/components/Layout/index.d.ts.map +1 -0
  67. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts +3 -0
  68. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts.map +1 -0
  69. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +155 -0
  70. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -0
  71. package/dist/components/LoadingLiquiditySourceList/index.d.ts +2 -0
  72. package/dist/components/LoadingLiquiditySourceList/index.d.ts.map +1 -0
  73. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +4 -0
  74. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -0
  75. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts +3 -0
  76. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -0
  77. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +460 -0
  78. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -0
  79. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
  80. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +1 -0
  81. package/dist/components/LoadingSwapDetails/index.d.ts +2 -0
  82. package/dist/components/LoadingSwapDetails/index.d.ts.map +1 -0
  83. package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
  84. package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
  85. package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
  86. package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
  87. package/dist/components/NoRoutes/NoRoutes.styles.d.ts +460 -0
  88. package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -0
  89. package/dist/components/NoRoutes/NoRoutes.types.d.ts +20 -0
  90. package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
  91. package/dist/components/NoRoutes/index.d.ts +2 -0
  92. package/dist/components/NoRoutes/index.d.ts.map +1 -0
  93. package/dist/components/NotificationContent/NotificationContent.d.ts +3 -0
  94. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -0
  95. package/dist/components/NotificationContent/NotificationContent.styles.d.ts +613 -0
  96. package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -0
  97. package/dist/components/NotificationContent/NotificationNotFound.d.ts +3 -0
  98. package/dist/components/NotificationContent/NotificationNotFound.d.ts.map +1 -0
  99. package/dist/components/NotificationContent/index.d.ts +2 -0
  100. package/dist/components/NotificationContent/index.d.ts.map +1 -0
  101. package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
  102. package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
  103. package/dist/components/RouteErrors/RouteErrors.styles.d.ts +613 -0
  104. package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
  105. package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
  106. package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
  107. package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
  108. package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
  109. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
  110. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
  111. package/dist/components/RouteErrors/index.d.ts +2 -0
  112. package/dist/components/RouteErrors/index.d.ts.map +1 -0
  113. package/dist/components/SearchInput/SearchInput.d.ts +4 -0
  114. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
  115. package/dist/components/SearchInput/SearchInput.styles.d.ts +154 -0
  116. package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
  117. package/dist/components/SearchInput/SearchInput.types.d.ts +10 -0
  118. package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -0
  119. package/dist/components/SearchInput/index.d.ts +2 -0
  120. package/dist/components/SearchInput/index.d.ts.map +1 -0
  121. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +613 -0
  122. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -0
  123. package/dist/components/SettingsContainer/index.d.ts +2 -0
  124. package/dist/components/SettingsContainer/index.d.ts.map +1 -0
  125. package/dist/components/Slippage/Slippage.d.ts +3 -0
  126. package/dist/components/Slippage/Slippage.d.ts.map +1 -0
  127. package/dist/components/Slippage/Slippage.styles.d.ts +613 -0
  128. package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -0
  129. package/dist/components/Slippage/SlippageTooltipContent.d.ts +3 -0
  130. package/dist/components/Slippage/SlippageTooltipContent.d.ts.map +1 -0
  131. package/dist/components/Slippage/index.d.ts +2 -0
  132. package/dist/components/Slippage/index.d.ts.map +1 -0
  133. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts +4 -0
  134. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -0
  135. package/dist/components/SwapDetails/SwapDetails.d.ts +4 -0
  136. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -0
  137. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +8 -0
  138. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
  139. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +919 -0
  140. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -0
  141. package/dist/components/SwapDetails/SwapDetails.types.d.ts +12 -0
  142. package/dist/components/SwapDetails/SwapDetails.types.d.ts.map +1 -0
  143. package/dist/components/SwapDetails/index.d.ts +2 -0
  144. package/dist/components/SwapDetails/index.d.ts.map +1 -0
  145. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts +4 -0
  146. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -0
  147. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts +4 -0
  148. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -0
  149. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts +4 -0
  150. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -0
  151. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +154 -0
  152. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -0
  153. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +20 -0
  154. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -0
  155. package/dist/components/SwapDetailsAlerts/index.d.ts +3 -0
  156. package/dist/components/SwapDetailsAlerts/index.d.ts.map +1 -0
  157. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts +4 -0
  158. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -0
  159. package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts +4 -0
  160. package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -0
  161. package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts +4 -0
  162. package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -0
  163. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts +4 -0
  164. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -0
  165. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts +4 -0
  166. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -0
  167. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +4 -0
  168. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -0
  169. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +154 -0
  170. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
  171. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +46 -0
  172. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -0
  173. package/dist/components/SwapDetailsModal/index.d.ts +4 -0
  174. package/dist/components/SwapDetailsModal/index.d.ts.map +1 -0
  175. package/dist/components/SwapsGroup/SwapsGroup.d.ts +4 -0
  176. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -0
  177. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +613 -0
  178. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -0
  179. package/dist/components/SwapsGroup/SwapsGroup.types.d.ts +12 -0
  180. package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +1 -0
  181. package/dist/components/SwapsGroup/index.d.ts +2 -0
  182. package/dist/components/SwapsGroup/index.d.ts.map +1 -0
  183. package/dist/components/SwitchFromAndTo.d.ts +1 -1
  184. package/dist/components/SwitchFromAndTo.d.ts.map +1 -1
  185. package/dist/components/TokenList/LoadingTokenList.d.ts +4 -0
  186. package/dist/components/TokenList/LoadingTokenList.d.ts.map +1 -0
  187. package/dist/components/TokenList/TokenList.d.ts +4 -0
  188. package/dist/components/TokenList/TokenList.d.ts.map +1 -0
  189. package/dist/components/TokenList/TokenList.helpers.d.ts +3 -0
  190. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -0
  191. package/dist/components/TokenList/TokenList.styles.d.ts +1532 -0
  192. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
  193. package/dist/components/TokenList/TokenList.types.d.ts +40 -0
  194. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -0
  195. package/dist/components/TokenList/index.d.ts +3 -0
  196. package/dist/components/TokenList/index.d.ts.map +1 -0
  197. package/dist/components/UpdateUrl.d.ts +6 -1
  198. package/dist/components/UpdateUrl.d.ts.map +1 -1
  199. package/dist/components/WalletModal/WalletModal.d.ts +4 -0
  200. package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
  201. package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
  202. package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
  203. package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
  204. package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
  205. package/dist/components/WalletModal/WalletModalContent.styles.d.ts +613 -0
  206. package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -0
  207. package/dist/components/WalletModal/index.d.ts +2 -0
  208. package/dist/components/WalletModal/index.d.ts.map +1 -0
  209. package/dist/components/WidgetEvents.d.ts.map +1 -1
  210. package/dist/constants/errors.d.ts +29 -0
  211. package/dist/constants/errors.d.ts.map +1 -1
  212. package/dist/constants/messages.d.ts +7 -0
  213. package/dist/constants/messages.d.ts.map +1 -0
  214. package/dist/constants/navigationRoutes.d.ts +8 -4
  215. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  216. package/dist/constants/routing.d.ts +13 -0
  217. package/dist/constants/routing.d.ts.map +1 -0
  218. package/dist/constants/searchParams.d.ts +2 -2
  219. package/dist/constants/searchParams.d.ts.map +1 -1
  220. package/dist/constants/swapSettings.d.ts.map +1 -1
  221. package/dist/constants/wallets.d.ts +3 -0
  222. package/dist/constants/wallets.d.ts.map +1 -0
  223. package/dist/constants/warnings.d.ts +3 -0
  224. package/dist/constants/warnings.d.ts.map +1 -0
  225. package/dist/constants.d.ts +2 -0
  226. package/dist/constants.d.ts.map +1 -0
  227. package/dist/globalStyles.d.ts +1 -1
  228. package/dist/globalStyles.d.ts.map +1 -1
  229. package/dist/hooks/useConfirmSwap.d.ts +14 -6
  230. package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
  231. package/dist/hooks/useFetchBestRoute.d.ts +9 -0
  232. package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
  233. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  234. package/dist/hooks/usePrepareBlockchainList.d.ts +18 -0
  235. package/dist/hooks/usePrepareBlockchainList.d.ts.map +1 -0
  236. package/dist/hooks/useSwapInput.d.ts +12 -0
  237. package/dist/hooks/useSwapInput.d.ts.map +1 -0
  238. package/dist/hooks/useSyncStoresWithConfig.d.ts +3 -0
  239. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -0
  240. package/dist/hooks/useTheme.d.ts +3 -29
  241. package/dist/hooks/useTheme.d.ts.map +1 -1
  242. package/dist/hooks/useWalletList.d.ts +20 -0
  243. package/dist/hooks/useWalletList.d.ts.map +1 -0
  244. package/dist/hooks/useWalletProviders.d.ts +3 -3
  245. package/dist/hooks/useWalletProviders.d.ts.map +1 -1
  246. package/dist/index.js +1 -1
  247. package/dist/index.js.map +4 -4
  248. package/dist/pages/ConfirmSwapPage.d.ts +6 -3
  249. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  250. package/dist/pages/HistoryPage.d.ts.map +1 -1
  251. package/dist/pages/Home.d.ts.map +1 -1
  252. package/dist/pages/LanguagePage.d.ts +3 -0
  253. package/dist/pages/LanguagePage.d.ts.map +1 -0
  254. package/dist/pages/LiquiditySourcePage.d.ts +8 -0
  255. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -0
  256. package/dist/pages/SelectBlockchainPage.d.ts +7 -0
  257. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -0
  258. package/dist/pages/SelectSwapItemsPage.d.ts +7 -0
  259. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -0
  260. package/dist/pages/SettingsPage.d.ts.map +1 -1
  261. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  262. package/dist/pages/ThemePage.d.ts +3 -0
  263. package/dist/pages/ThemePage.d.ts.map +1 -0
  264. package/dist/pages/WalletsPage.d.ts +4 -2
  265. package/dist/pages/WalletsPage.d.ts.map +1 -1
  266. package/dist/services/httpService.d.ts +0 -1
  267. package/dist/services/httpService.d.ts.map +1 -1
  268. package/dist/store/app.d.ts +26 -0
  269. package/dist/store/app.d.ts.map +1 -0
  270. package/dist/store/bestRoute.d.ts +32 -23
  271. package/dist/store/bestRoute.d.ts.map +1 -1
  272. package/dist/store/meta.d.ts +8 -3
  273. package/dist/store/meta.d.ts.map +1 -1
  274. package/dist/store/notification.d.ts +38 -0
  275. package/dist/store/notification.d.ts.map +1 -0
  276. package/dist/store/settings.d.ts +2 -2
  277. package/dist/store/settings.d.ts.map +1 -1
  278. package/dist/store/slices/config.d.ts +8 -0
  279. package/dist/store/slices/config.d.ts.map +1 -0
  280. package/dist/store/slices/data.d.ts +26 -0
  281. package/dist/store/slices/data.d.ts.map +1 -0
  282. package/dist/store/ui.d.ts +0 -2
  283. package/dist/store/ui.d.ts.map +1 -1
  284. package/dist/store/wallets.d.ts +14 -12
  285. package/dist/store/wallets.d.ts.map +1 -1
  286. package/dist/types/config.d.ts +11 -6
  287. package/dist/types/config.d.ts.map +1 -1
  288. package/dist/types/notification.d.ts +22 -0
  289. package/dist/types/notification.d.ts.map +1 -0
  290. package/dist/types/routing.d.ts +30 -23
  291. package/dist/types/routing.d.ts.map +1 -1
  292. package/dist/types/swap.d.ts +8 -1
  293. package/dist/types/swap.d.ts.map +1 -1
  294. package/dist/utils/common.d.ts +6 -0
  295. package/dist/utils/common.d.ts.map +1 -1
  296. package/dist/utils/configs.d.ts +5 -0
  297. package/dist/utils/configs.d.ts.map +1 -1
  298. package/dist/utils/date.d.ts +1 -1
  299. package/dist/utils/date.d.ts.map +1 -1
  300. package/dist/utils/meta.d.ts +3 -0
  301. package/dist/utils/meta.d.ts.map +1 -0
  302. package/dist/utils/numbers.d.ts +5 -2
  303. package/dist/utils/numbers.d.ts.map +1 -1
  304. package/dist/utils/routing.d.ts +10 -7
  305. package/dist/utils/routing.d.ts.map +1 -1
  306. package/dist/utils/settings.d.ts +10 -0
  307. package/dist/utils/settings.d.ts.map +1 -0
  308. package/dist/utils/swap.d.ts +29 -14
  309. package/dist/utils/swap.d.ts.map +1 -1
  310. package/dist/utils/time.d.ts +2 -2
  311. package/dist/utils/time.d.ts.map +1 -1
  312. package/dist/utils/wallets.d.ts +21 -15
  313. package/dist/utils/wallets.d.ts.map +1 -1
  314. package/package.json +8 -8
  315. package/src/Wallets.tsx +23 -17
  316. package/src/Widget.tsx +43 -30
  317. package/src/components/AppRouter.tsx +38 -7
  318. package/src/components/AppRoutes.tsx +40 -29
  319. package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
  320. package/src/components/BlockchainList/BlockchainList.styles.ts +19 -0
  321. package/src/components/BlockchainList/BlockchainList.tsx +73 -0
  322. package/src/components/BlockchainList/BlockchainList.types.ts +8 -0
  323. package/src/components/BlockchainList/LoadingBlockchainList.tsx +20 -0
  324. package/src/components/BlockchainList/index.ts +1 -0
  325. package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
  326. package/src/components/BlockchainsSection/BlockchainsSection.tsx +83 -0
  327. package/src/components/BlockchainsSection/BlockchainsSection.types.ts +9 -0
  328. package/src/components/BlockchainsSection/index.ts +1 -0
  329. package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +86 -0
  330. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +210 -0
  331. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +494 -0
  332. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +11 -0
  333. package/src/components/ConfirmWalletsModal/WalletList.styles.ts +34 -0
  334. package/src/components/ConfirmWalletsModal/WalletList.tsx +294 -0
  335. package/src/components/ConfirmWalletsModal/WalletList.type.ts +12 -0
  336. package/src/components/HeaderButtons/BackButton.tsx +16 -0
  337. package/src/components/HeaderButtons/CancelButton.tsx +21 -0
  338. package/src/components/HeaderButtons/HeaderButtons.styles.ts +40 -0
  339. package/src/components/HeaderButtons/HeaderButtons.types.ts +12 -0
  340. package/src/components/HeaderButtons/HomeButtons.tsx +81 -0
  341. package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +20 -0
  342. package/src/components/HeaderButtons/WalletButton.tsx +23 -0
  343. package/src/components/HeaderButtons/index.ts +4 -0
  344. package/src/components/Layout/Layout.styles.ts +53 -0
  345. package/src/components/Layout/Layout.tsx +74 -0
  346. package/src/components/Layout/Layout.types.ts +20 -0
  347. package/src/components/Layout/index.ts +1 -0
  348. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +5 -0
  349. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +23 -0
  350. package/src/components/LoadingLiquiditySourceList/index.ts +1 -0
  351. package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
  352. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +78 -0
  353. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +53 -0
  354. package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
  355. package/src/components/LoadingSwapDetails/index.ts +1 -0
  356. package/src/components/NoRoutes/NoRoutes.helper.ts +52 -0
  357. package/src/components/NoRoutes/NoRoutes.styles.ts +15 -0
  358. package/src/components/NoRoutes/NoRoutes.tsx +81 -0
  359. package/src/components/NoRoutes/NoRoutes.types.ts +21 -0
  360. package/src/components/NoRoutes/index.ts +1 -0
  361. package/src/components/NotificationContent/NotificationContent.styles.ts +34 -0
  362. package/src/components/NotificationContent/NotificationContent.tsx +108 -0
  363. package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
  364. package/src/components/NotificationContent/index.ts +1 -0
  365. package/src/components/RouteErrors/RouteErrors.styles.ts +28 -0
  366. package/src/components/RouteErrors/RouteErrors.tsx +79 -0
  367. package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
  368. package/src/components/RouteErrors/RouteErrorsModal.tsx +129 -0
  369. package/src/components/RouteErrors/RouteErrorsModalItem.tsx +24 -0
  370. package/src/components/RouteErrors/index.ts +1 -0
  371. package/src/components/SearchInput/SearchInput.styles.ts +9 -0
  372. package/src/components/SearchInput/SearchInput.tsx +51 -0
  373. package/src/components/SearchInput/SearchInput.types.ts +10 -0
  374. package/src/components/SearchInput/index.ts +1 -0
  375. package/src/components/SettingsContainer/SettingsContainer.style.ts +27 -0
  376. package/src/components/SettingsContainer/index.ts +6 -0
  377. package/src/components/Slippage/Slippage.styles.ts +24 -0
  378. package/src/components/Slippage/Slippage.tsx +94 -0
  379. package/src/components/Slippage/SlippageTooltipContent.tsx +23 -0
  380. package/src/components/Slippage/index.ts +1 -0
  381. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +79 -0
  382. package/src/components/SwapDetails/SwapDetails.helpers.tsx +85 -0
  383. package/src/components/SwapDetails/SwapDetails.styles.ts +72 -0
  384. package/src/components/SwapDetails/SwapDetails.tsx +428 -0
  385. package/src/components/SwapDetails/SwapDetails.types.ts +12 -0
  386. package/src/components/SwapDetails/index.ts +1 -0
  387. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +36 -0
  388. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +55 -0
  389. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +7 -0
  390. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +74 -0
  391. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +28 -0
  392. package/src/components/SwapDetailsAlerts/index.ts +2 -0
  393. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +101 -0
  394. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +34 -0
  395. package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +34 -0
  396. package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +34 -0
  397. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +22 -0
  398. package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +6 -0
  399. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +45 -0
  400. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +54 -0
  401. package/src/components/SwapDetailsModal/index.ts +3 -0
  402. package/src/components/SwapsGroup/SwapsGroup.styles.ts +26 -0
  403. package/src/components/SwapsGroup/SwapsGroup.tsx +126 -0
  404. package/src/components/SwapsGroup/SwapsGroup.types.ts +13 -0
  405. package/src/components/SwapsGroup/index.ts +1 -0
  406. package/src/components/SwitchFromAndTo.tsx +23 -41
  407. package/src/components/TokenList/LoadingTokenList.tsx +34 -0
  408. package/src/components/TokenList/TokenList.helpers.ts +11 -0
  409. package/src/components/TokenList/TokenList.styles.ts +121 -0
  410. package/src/components/TokenList/TokenList.tsx +275 -0
  411. package/src/components/TokenList/TokenList.types.ts +47 -0
  412. package/src/components/TokenList/index.ts +2 -0
  413. package/src/components/UpdateUrl.tsx +47 -23
  414. package/src/components/WalletModal/WalletModal.tsx +20 -0
  415. package/src/components/WalletModal/WalletModal.types.ts +11 -0
  416. package/src/components/WalletModal/WalletModalContent.styles.ts +44 -0
  417. package/src/components/WalletModal/WalletModalContent.tsx +54 -0
  418. package/src/components/WalletModal/index.ts +1 -0
  419. package/src/components/WidgetEvents.tsx +37 -5
  420. package/src/constants/errors.ts +56 -1
  421. package/src/constants/messages.ts +8 -0
  422. package/src/constants/navigationRoutes.ts +8 -4
  423. package/src/constants/routing.ts +17 -0
  424. package/src/constants/searchParams.ts +2 -2
  425. package/src/constants/swapSettings.ts +5 -1
  426. package/src/constants/wallets.ts +3 -0
  427. package/src/constants/warnings.ts +26 -0
  428. package/src/constants.ts +1 -0
  429. package/src/globalStyles.ts +1 -4
  430. package/src/hooks/useConfirmSwap.ts +251 -220
  431. package/src/hooks/useFetchBestRoute.ts +38 -0
  432. package/src/hooks/useNavigateBack.ts +25 -9
  433. package/src/hooks/usePrepareBlockchainList.ts +122 -0
  434. package/src/hooks/useSwapInput.ts +116 -0
  435. package/src/hooks/useSyncStoresWithConfig.ts +102 -0
  436. package/src/hooks/useTheme.ts +35 -74
  437. package/src/hooks/useWalletList.ts +125 -0
  438. package/src/hooks/useWalletProviders.ts +7 -7
  439. package/src/pages/ConfirmSwapPage.tsx +499 -228
  440. package/src/pages/HistoryPage.tsx +104 -15
  441. package/src/pages/Home.tsx +405 -110
  442. package/src/pages/LanguagePage.tsx +83 -0
  443. package/src/pages/LiquiditySourcePage.tsx +159 -0
  444. package/src/pages/SelectBlockchainPage.tsx +76 -0
  445. package/src/pages/SelectSwapItemsPage.tsx +131 -0
  446. package/src/pages/SettingsPage.tsx +165 -72
  447. package/src/pages/SwapDetailsPage.tsx +40 -141
  448. package/src/pages/ThemePage.tsx +96 -0
  449. package/src/pages/WalletsPage.tsx +79 -124
  450. package/src/services/httpService.ts +4 -5
  451. package/src/store/app.ts +15 -0
  452. package/src/store/bestRoute.ts +118 -239
  453. package/src/store/meta.ts +16 -14
  454. package/src/store/notification.ts +77 -0
  455. package/src/store/settings.ts +20 -13
  456. package/src/store/slices/config.ts +26 -0
  457. package/src/store/slices/data.ts +203 -0
  458. package/src/store/ui.ts +1 -5
  459. package/src/store/wallets.ts +92 -103
  460. package/src/types/config.ts +12 -7
  461. package/src/types/notification.ts +33 -0
  462. package/src/types/routing.ts +29 -28
  463. package/src/types/swap.ts +9 -1
  464. package/src/utils/common.ts +56 -3
  465. package/src/utils/configs.ts +8 -2
  466. package/src/utils/date.ts +15 -18
  467. package/src/utils/meta.ts +9 -0
  468. package/src/utils/numbers.ts +66 -20
  469. package/src/utils/routing.ts +105 -27
  470. package/src/utils/settings.ts +57 -0
  471. package/src/utils/swap.ts +244 -117
  472. package/src/utils/time.ts +69 -36
  473. package/src/utils/wallets.ts +195 -126
  474. package/dist/components/ConfirmSwapErrors.d.ts +0 -4
  475. package/dist/components/ConfirmSwapErrors.d.ts.map +0 -1
  476. package/dist/components/ConfirmSwapWarnings.d.ts +0 -3
  477. package/dist/components/ConfirmSwapWarnings.d.ts.map +0 -1
  478. package/dist/components/Layout.d.ts +0 -7
  479. package/dist/components/Layout.d.ts.map +0 -1
  480. package/dist/pages/LiquiditySourcesPage.d.ts +0 -7
  481. package/dist/pages/LiquiditySourcesPage.d.ts.map +0 -1
  482. package/dist/pages/SelectChainPage.d.ts +0 -8
  483. package/dist/pages/SelectChainPage.d.ts.map +0 -1
  484. package/dist/pages/SelectTokenPage.d.ts +0 -15
  485. package/dist/pages/SelectTokenPage.d.ts.map +0 -1
  486. package/src/components/ConfirmSwapErrors.tsx +0 -34
  487. package/src/components/ConfirmSwapWarnings.tsx +0 -22
  488. package/src/components/Layout.tsx +0 -105
  489. package/src/pages/LiquiditySourcesPage.tsx +0 -63
  490. package/src/pages/SelectChainPage.tsx +0 -42
  491. package/src/pages/SelectTokenPage.tsx +0 -64
@@ -0,0 +1,74 @@
1
+ import type { PropTypes, Ref } from './Layout.types';
2
+ import type { PropsWithChildren } from 'react';
3
+
4
+ import { BottomLogo, Divider, Header } from '@rango-dev/ui';
5
+ import React from 'react';
6
+ import { useNavigate } from 'react-router-dom';
7
+
8
+ import { navigationRoutes } from '../../constants/navigationRoutes';
9
+ import { useUiStore } from '../../store/ui';
10
+ import { useWalletsStore } from '../../store/wallets';
11
+ import { getContainer } from '../../utils/common';
12
+ import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
13
+
14
+ import { Container, Content, Footer } from './Layout.styles';
15
+
16
+ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
17
+ const {
18
+ children,
19
+ header,
20
+ footer,
21
+ noPadding,
22
+ hasLogo = true,
23
+ fixedHeight = true,
24
+ } = props;
25
+ const connectedWallets = useWalletsStore.use.connectedWallets();
26
+
27
+ const connectWalletsButtonDisabled =
28
+ useUiStore.use.connectWalletsButtonDisabled();
29
+ const navigate = useNavigate();
30
+
31
+ const onConnectWallet = () => {
32
+ if (!connectWalletsButtonDisabled) {
33
+ navigate('/' + navigationRoutes.wallets);
34
+ }
35
+ };
36
+ return (
37
+ <Container ref={ref} fixedHeight={fixedHeight} id="swap-box">
38
+ <Header
39
+ prefix={<>{header.onBack && <BackButton onClick={header.onBack} />}</>}
40
+ title={header.title}
41
+ suffix={
42
+ <>
43
+ {header.suffix}
44
+ {header.hasConnectWallet && (
45
+ <WalletButton
46
+ container={getContainer()}
47
+ onClick={onConnectWallet}
48
+ isConnected={!!connectedWallets?.length}
49
+ />
50
+ )}
51
+ {header.onCancel && <CancelButton onClick={header.onCancel} />}
52
+ </>
53
+ }
54
+ />
55
+ <Content noPadding={noPadding}>{children}</Content>
56
+ {(hasLogo || footer) && (
57
+ <Footer>
58
+ <div className="footer__content">{footer}</div>
59
+ {hasLogo && (
60
+ <div className="footer__logo">
61
+ <Divider size={12} />
62
+ <BottomLogo />
63
+ </div>
64
+ )}
65
+ </Footer>
66
+ )}
67
+ </Container>
68
+ );
69
+ }
70
+
71
+ const Layout = React.forwardRef(LayoutComponent);
72
+ Layout.displayName = 'Layout';
73
+
74
+ export { Layout };
@@ -0,0 +1,20 @@
1
+ export interface PropTypes {
2
+ header: {
3
+ title: string;
4
+ hasConnectWallet?: boolean;
5
+ hasSettings?: boolean;
6
+ suffix?: React.ReactNode;
7
+ onBack?: () => void;
8
+ onCancel?: () => void;
9
+ };
10
+ hasLogo?: boolean;
11
+ footer?: React.ReactNode;
12
+ noPadding?: boolean;
13
+ fixedHeight?: boolean;
14
+ }
15
+
16
+ export type Ref =
17
+ | ((instance: HTMLDivElement | null) => void)
18
+ | React.RefObject<HTMLDivElement>
19
+ | null
20
+ | undefined;
@@ -0,0 +1 @@
1
+ export { Layout } from './Layout';
@@ -0,0 +1,5 @@
1
+ import { ListItem, styled } from '@rango-dev/ui';
2
+
3
+ export const CustomeListItem = styled(ListItem, {
4
+ height: 61,
5
+ });
@@ -0,0 +1,23 @@
1
+ import { Checkbox, Skeleton } from '@rango-dev/ui';
2
+ import React from 'react';
3
+
4
+ import { LiquiditySourceList } from '../SettingsContainer';
5
+
6
+ import { CustomeListItem } from './LoadingLiquiditySourceList.styles';
7
+
8
+ const ITEM_SKELETON_COUNT = 30;
9
+ export function LoadingLiquiditySourceList() {
10
+ return (
11
+ <LiquiditySourceList>
12
+ {Array.from(Array(ITEM_SKELETON_COUNT), (e) => (
13
+ <CustomeListItem
14
+ hasDivider
15
+ key={e}
16
+ start={<Skeleton variant="circular" width={35} height={35} />}
17
+ title={<Skeleton variant="text" size="large" width={90} />}
18
+ end={<Checkbox checked={false} />}
19
+ />
20
+ ))}
21
+ </LiquiditySourceList>
22
+ );
23
+ }
@@ -0,0 +1 @@
1
+ export { LoadingLiquiditySourceList } from './LoadingLiquiditySourceList';
@@ -0,0 +1,41 @@
1
+ import type { StepSkeletonPropsTypes } from './LoadingSwapDetails.types';
2
+
3
+ import { ChainToken, Divider, NextIcon, Skeleton } from '@rango-dev/ui';
4
+ import React from 'react';
5
+
6
+ import { StepContainer } from './LoadingSwapDetails.styles';
7
+
8
+ export function LoadingSwapDetailStep(props: StepSkeletonPropsTypes) {
9
+ const { extraInfo } = props;
10
+ return (
11
+ <StepContainer>
12
+ <div className="step-title">
13
+ <Skeleton height={28} width={28} variant="circular" />
14
+ <Divider direction="horizontal" size={8} />
15
+ <Skeleton height={15} width={148} variant="rounded" />
16
+ </div>
17
+ <div className="step-tokens">
18
+ <Divider direction="horizontal" size={20} />
19
+ <div className="step-token-info">
20
+ <ChainToken size="small" loading chainImage="" tokenImage="" />
21
+ <Divider direction="horizontal" size={8} />
22
+ <Skeleton height={12} width={76} variant="rounded" />
23
+ </div>
24
+ <div className="step-icon-container">
25
+ <NextIcon color="gray" size={16} />
26
+ </div>
27
+ <div className="step-token-info">
28
+ <ChainToken size="small" loading chainImage="" tokenImage="" />
29
+ <Divider direction="horizontal" size={8} />
30
+ <Skeleton height={12} width={76} variant="rounded" />
31
+ </div>
32
+ </div>
33
+ {extraInfo && (
34
+ <div className="extra-info">
35
+ <Divider direction="horizontal" size={20} />
36
+ <Skeleton height={22} width={297} variant="rectangular" />
37
+ </div>
38
+ )}
39
+ </StepContainer>
40
+ );
41
+ }
@@ -0,0 +1,78 @@
1
+ import { styled } from '@rango-dev/ui';
2
+
3
+ export const Container = styled('div', {
4
+ width: '100%',
5
+ height: '100%',
6
+ padding: '$0 $20',
7
+
8
+ '.cost': {
9
+ paddingTop: '$15',
10
+ display: 'flex',
11
+ },
12
+
13
+ '.route-summary': {
14
+ padding: '$15 $0',
15
+ },
16
+
17
+ '.route-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
+ '.route-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
+ });
40
+
41
+ export const StepContainer = styled('div', {
42
+ backgroundColor: '$neutral100',
43
+ borderRadius: '$xm',
44
+ 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
+ });
73
+ export const StepSeparator = styled('div', {
74
+ width: '0px',
75
+ height: '$20',
76
+ borderLeft: '1px dashed $neutral900',
77
+ marginLeft: '25px',
78
+ });
@@ -0,0 +1,53 @@
1
+ import { i18n } from '@lingui/core';
2
+ import { ChainToken, Divider, Skeleton, Typography } from '@rango-dev/ui';
3
+ import React from 'react';
4
+
5
+ import { Container, StepSeparator } from './LoadingSwapDetails.styles';
6
+ import { LoadingSwapDetailStep } from './LoadingSwapDetailStep';
7
+
8
+ export function LoadingSwapDetails() {
9
+ const routeSummary = (
10
+ <div className="route-summary-item">
11
+ <div className="token-amount">
12
+ <ChainToken loading size="medium" chainImage="" tokenImage="" />
13
+ <Divider size={8} direction="horizontal" />
14
+ <Skeleton height={15} width={148} variant="rounded" />
15
+ </div>
16
+ <Skeleton height={12} width={64} variant="rounded" />
17
+ </div>
18
+ );
19
+
20
+ return (
21
+ <Container>
22
+ <div className="cost">
23
+ <Skeleton width={60} height={10} variant="rounded" />
24
+ <Divider size={4} direction="horizontal" />
25
+ <Skeleton width={60} height={10} variant="rounded" />
26
+ <Divider size={4} direction="horizontal" />
27
+ <Skeleton width={60} height={10} variant="rounded" />
28
+ </div>
29
+
30
+ <div className="route-summary">
31
+ {routeSummary}
32
+ <div className="route-summary-separator"></div>
33
+ {routeSummary}
34
+ </div>
35
+
36
+ <div className="swaps-steps">
37
+ <Typography variant="title" size="small">
38
+ {i18n.t('Swaps steps')}
39
+ </Typography>
40
+ </div>
41
+
42
+ <div className="step-container">
43
+ <LoadingSwapDetailStep extraInfo />
44
+ <StepSeparator />
45
+ <LoadingSwapDetailStep />
46
+ <StepSeparator />
47
+ <LoadingSwapDetailStep />
48
+ <StepSeparator />
49
+ <LoadingSwapDetailStep />
50
+ </div>
51
+ </Container>
52
+ );
53
+ }
@@ -0,0 +1,3 @@
1
+ export interface StepSkeletonPropsTypes {
2
+ extraInfo?: boolean;
3
+ }
@@ -0,0 +1 @@
1
+ export { LoadingSwapDetails } from './LoadingSwapDetails';
@@ -0,0 +1,52 @@
1
+ import type { Info } from './NoRoutes.types';
2
+
3
+ import { i18n } from '@lingui/core';
4
+
5
+ import { errorMessages } from '../../constants/errors';
6
+
7
+ export function makeInfo(
8
+ diagnosisMessage: string | null,
9
+ disabledLiquiditySources: string[],
10
+ hasError: boolean,
11
+ toggleAllLiquiditySources: (shouldReset: boolean) => void,
12
+ refetchBestRoute: () => void
13
+ ): Info {
14
+ if (hasError) {
15
+ return {
16
+ alert: {
17
+ type: 'warning',
18
+ text: errorMessages.genericServerError,
19
+ action: {
20
+ onClick: refetchBestRoute,
21
+ title: i18n.t('Retry'),
22
+ },
23
+ },
24
+ description: '',
25
+ };
26
+ } else if (diagnosisMessage) {
27
+ return {
28
+ alert: {
29
+ type: 'error',
30
+ text: diagnosisMessage,
31
+ action: null,
32
+ },
33
+ description: '',
34
+ };
35
+ } else if (disabledLiquiditySources.length) {
36
+ return {
37
+ alert: {
38
+ type: 'warning',
39
+ text: errorMessages.liquiditySourcesError.title,
40
+ action: {
41
+ onClick: () => toggleAllLiquiditySources(true),
42
+ title: i18n.t('Reset'),
43
+ },
44
+ },
45
+ description: errorMessages.liquiditySourcesError.description,
46
+ };
47
+ }
48
+ return {
49
+ alert: null,
50
+ description: errorMessages.noRoutesError.description,
51
+ };
52
+ }
@@ -0,0 +1,15 @@
1
+ import { styled } from '@rango-dev/ui';
2
+
3
+ export const Container = styled('div', {
4
+ display: 'flex',
5
+ flexDirection: 'column',
6
+ alignItems: 'center',
7
+ });
8
+
9
+ export const Footer = styled('div', {
10
+ width: '100%',
11
+ });
12
+
13
+ export const PrefixIcon = styled('div', {
14
+ padding: '$6 $0',
15
+ });
@@ -0,0 +1,81 @@
1
+ import type { PropTypes } from './NoRoutes.types';
2
+
3
+ import {
4
+ Alert,
5
+ Button,
6
+ Divider,
7
+ NoRouteIcon,
8
+ RefreshIcon,
9
+ Typography,
10
+ } from '@rango-dev/ui';
11
+ import React from 'react';
12
+
13
+ import { errorMessages } from '../../constants/errors';
14
+ import { useMetaStore } from '../../store/meta';
15
+ import { useSettingsStore } from '../../store/settings';
16
+
17
+ import { makeInfo } from './NoRoutes.helper';
18
+ import { Container, Footer, PrefixIcon } from './NoRoutes.styles';
19
+
20
+ export function NoRoutes(props: PropTypes) {
21
+ const { diagnosisMessage, fetch, error } = props;
22
+ const disabledLiquiditySources =
23
+ useSettingsStore.use.disabledLiquiditySources();
24
+ const loadingMetaStatus = useMetaStore.use.loadingStatus();
25
+ const toggleAllLiquiditySources =
26
+ useSettingsStore.use.toggleAllLiquiditySources();
27
+
28
+ const hasError = error || loadingMetaStatus === 'failed';
29
+
30
+ const info = makeInfo(
31
+ diagnosisMessage ?? null,
32
+ disabledLiquiditySources,
33
+ hasError,
34
+ toggleAllLiquiditySources,
35
+ fetch
36
+ );
37
+
38
+ return (
39
+ <Container>
40
+ <NoRouteIcon size={24} color="gray" />
41
+ <Divider size={4} />
42
+ <Typography variant="title" size="small">
43
+ {errorMessages.noRoutesError.title}
44
+ </Typography>
45
+ {!!info.description && (
46
+ <Typography
47
+ variant="body"
48
+ size="small"
49
+ align="center"
50
+ color="neutral900">
51
+ {info.description}
52
+ </Typography>
53
+ )}
54
+ <Divider size={4} />
55
+ {!!info.alert && (
56
+ <Footer>
57
+ <Alert
58
+ type={info.alert.type}
59
+ title={info.alert.text}
60
+ action={
61
+ info.alert.action && (
62
+ <Button
63
+ size="xsmall"
64
+ type={info.alert.type}
65
+ prefix={
66
+ <PrefixIcon>
67
+ <RefreshIcon size={8} />
68
+ </PrefixIcon>
69
+ }
70
+ onClick={info.alert.action.onClick}>
71
+ {info.alert.action.title}
72
+ </Button>
73
+ )
74
+ }
75
+ variant="alarm"
76
+ />
77
+ </Footer>
78
+ )}
79
+ </Container>
80
+ );
81
+ }
@@ -0,0 +1,21 @@
1
+ export interface PropTypes {
2
+ fetch: () => void;
3
+ error: boolean;
4
+ diagnosisMessage?: string;
5
+ }
6
+
7
+ type AlertAction = {
8
+ title: string;
9
+ onClick: () => void;
10
+ };
11
+
12
+ type NotFoundAlert = {
13
+ type: 'error' | 'warning';
14
+ text: string;
15
+ action: AlertAction | null;
16
+ };
17
+
18
+ export interface Info {
19
+ alert: NotFoundAlert | null;
20
+ description: string;
21
+ }
@@ -0,0 +1 @@
1
+ export { NoRoutes } from './NoRoutes';
@@ -0,0 +1,34 @@
1
+ import { styled } from '@rango-dev/ui';
2
+
3
+ export const Container = styled('div', {
4
+ padding: '$10',
5
+ width: '350px',
6
+ minHeight: '150px',
7
+ });
8
+
9
+ export const List = styled('ul', {
10
+ padding: 0,
11
+ margin: 0,
12
+ listStyle: 'none',
13
+
14
+ '.to-chain-token': {
15
+ transform: 'translateX(-3px)',
16
+ },
17
+ });
18
+
19
+ export const Images = styled('div', {
20
+ display: 'flex',
21
+ padding: 0,
22
+ alignItems: 'center',
23
+ alignSelf: 'stretch',
24
+ });
25
+
26
+ export const NotFoundContainer = styled('div', {
27
+ display: 'flex',
28
+ justifyContent: 'center',
29
+ alignItems: 'center',
30
+ flexDirection: 'column',
31
+ padding: '$10',
32
+ width: '100%',
33
+ height: '150px',
34
+ });
@@ -0,0 +1,108 @@
1
+ import type { Notification } from '../../types/notification';
2
+
3
+ import { i18n } from '@lingui/core';
4
+ import {
5
+ ChainToken,
6
+ ChevronRightIcon,
7
+ ListItemButton,
8
+ Typography,
9
+ } from '@rango-dev/ui';
10
+ import React from 'react';
11
+ import { useNavigate } from 'react-router-dom';
12
+
13
+ import { useMetaStore } from '../../store/meta';
14
+ import { useNotificationStore } from '../../store/notification';
15
+ import { useUiStore } from '../../store/ui';
16
+
17
+ import { Container, Images, List } from './NotificationContent.styles';
18
+ import { NotificationNotFound } from './NotificationNotFound';
19
+
20
+ const MAX_NOTIFICATIONS_DISPLAYED = 4;
21
+
22
+ export function NotificationContent() {
23
+ const navigate = useNavigate();
24
+ const setSelectedSwap = useUiStore.use.setSelectedSwap();
25
+
26
+ const { getUnreadNotifications } = useNotificationStore();
27
+
28
+ const notifications: Notification[] = getUnreadNotifications();
29
+ const { tokens, blockchains } = useMetaStore.use.meta();
30
+ const sortedNotification = notifications
31
+ .sort((a, b) => b.creationTime - a.creationTime)
32
+ .slice(0, MAX_NOTIFICATIONS_DISPLAYED);
33
+
34
+ const handleOnClick = (requestId: Notification['requestId']) => {
35
+ setSelectedSwap(requestId);
36
+ navigate(`/swaps/${requestId}`);
37
+ };
38
+
39
+ return (
40
+ <Container>
41
+ {sortedNotification.length ? (
42
+ <List>
43
+ {sortedNotification.map((notificationItem) => {
44
+ const fromToken = tokens.find(
45
+ (tokenItem) =>
46
+ tokenItem.address ===
47
+ notificationItem.route.from.tokenAddress &&
48
+ tokenItem.blockchain ===
49
+ notificationItem.route.from.blockchain &&
50
+ tokenItem.symbol === notificationItem.route.from.tokenSymbol
51
+ );
52
+
53
+ const fromBlockchain = blockchains.find(
54
+ (blockchainItem) =>
55
+ blockchainItem.name === notificationItem.route.from.blockchain
56
+ );
57
+
58
+ const toToken = tokens.find(
59
+ (tokenItem) =>
60
+ tokenItem.address === notificationItem.route.to.tokenAddress &&
61
+ tokenItem.blockchain === notificationItem.route.to.blockchain &&
62
+ tokenItem.symbol === notificationItem.route.to.tokenSymbol
63
+ );
64
+
65
+ const toBlockchain = blockchains.find(
66
+ (blockchainItem) =>
67
+ blockchainItem.name === notificationItem.route.to.blockchain
68
+ );
69
+
70
+ return (
71
+ <ListItemButton
72
+ key={notificationItem.requestId}
73
+ onClick={() => handleOnClick(notificationItem.requestId)}
74
+ title={
75
+ <Typography variant="body" size="small" color="$neutral900">
76
+ {i18n.t(notificationItem.event.message)}
77
+ </Typography>
78
+ }
79
+ id={notificationItem.requestId}
80
+ start={
81
+ <Images>
82
+ <div className="from-chain-token">
83
+ <ChainToken
84
+ tokenImage={fromToken ? fromToken.image : ''}
85
+ chainImage={fromBlockchain ? fromBlockchain.logo : ''}
86
+ size="small"
87
+ />
88
+ </div>
89
+ <div className="to-chain-token">
90
+ <ChainToken
91
+ tokenImage={toToken ? toToken.image : ''}
92
+ chainImage={toBlockchain ? toBlockchain.logo : ''}
93
+ size="small"
94
+ />
95
+ </div>
96
+ </Images>
97
+ }
98
+ end={<ChevronRightIcon size={12} color="gray" />}
99
+ />
100
+ );
101
+ })}
102
+ </List>
103
+ ) : (
104
+ <NotificationNotFound />
105
+ )}
106
+ </Container>
107
+ );
108
+ }
@@ -0,0 +1,17 @@
1
+ import { i18n } from '@lingui/core';
2
+ import { Divider, NoNotificationIcon, Typography } from '@rango-dev/ui';
3
+ import React from 'react';
4
+
5
+ import { NotFoundContainer } from './NotificationContent.styles';
6
+
7
+ export function NotificationNotFound() {
8
+ return (
9
+ <NotFoundContainer>
10
+ <NoNotificationIcon color="secondary" size={26} />
11
+ <Divider size={12} />
12
+ <Typography variant="body" size="medium" color="neutral900">
13
+ {i18n.t('You have no notification')}
14
+ </Typography>
15
+ </NotFoundContainer>
16
+ );
17
+ }
@@ -0,0 +1 @@
1
+ export { NotificationContent } from './NotificationContent';
@@ -0,0 +1,28 @@
1
+ import { styled } from '@rango-dev/ui';
2
+
3
+ export const Alerts = styled('div', {
4
+ width: '100%',
5
+ paddingTop: '$10',
6
+ });
7
+
8
+ export const Flex = styled('div', {
9
+ display: 'flex',
10
+ flexDirection: 'column',
11
+ alignItems: 'flex-start',
12
+ gap: 10,
13
+ width: '100%',
14
+ });
15
+
16
+ export const Item = styled('div', {
17
+ display: 'flex',
18
+ padding: '$5 0',
19
+ justifyContent: 'space-between',
20
+ alignItems: 'center',
21
+ width: '100%',
22
+ });
23
+
24
+ export const Action = styled('div', {
25
+ padding: '$2',
26
+ alignSelf: 'flex-start',
27
+ cursor: 'pointer',
28
+ });