@rango-dev/widget-embedded 0.12.1-next.0 → 0.12.1-next.10

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 (469) 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/AppRoutes.d.ts +1 -1
  6. package/dist/components/AppRoutes.d.ts.map +1 -1
  7. package/dist/components/BlockchainList/BlockchainList.d.ts +4 -0
  8. package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -0
  9. package/dist/components/BlockchainList/BlockchainList.helpers.d.ts +4 -0
  10. package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -0
  11. package/dist/components/BlockchainList/BlockchainList.styles.d.ts +297 -0
  12. package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -0
  13. package/dist/components/BlockchainList/BlockchainList.types.d.ts +8 -0
  14. package/dist/components/BlockchainList/BlockchainList.types.d.ts.map +1 -0
  15. package/dist/components/BlockchainList/LoadingBlockchainList.d.ts +3 -0
  16. package/dist/components/BlockchainList/LoadingBlockchainList.d.ts.map +1 -0
  17. package/dist/components/BlockchainList/index.d.ts +2 -0
  18. package/dist/components/BlockchainList/index.d.ts.map +1 -0
  19. package/dist/components/BlockchainsChip/BlockchainsChip.d.ts +5 -0
  20. package/dist/components/BlockchainsChip/BlockchainsChip.d.ts.map +1 -0
  21. package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts +151 -0
  22. package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -0
  23. package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts +6 -0
  24. package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +1 -0
  25. package/dist/components/BlockchainsChip/index.d.ts +2 -0
  26. package/dist/components/BlockchainsChip/index.d.ts.map +1 -0
  27. package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts +3 -0
  28. package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts.map +1 -0
  29. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts +4 -0
  30. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -0
  31. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +149 -0
  32. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -0
  33. package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts +9 -0
  34. package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts.map +1 -0
  35. package/dist/components/BlockchainsSection/index.d.ts +2 -0
  36. package/dist/components/BlockchainsSection/index.d.ts.map +1 -0
  37. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +6 -0
  38. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -0
  39. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +2522 -0
  40. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -0
  41. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts +4 -0
  42. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -0
  43. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +11 -0
  44. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -0
  45. package/dist/components/ConfirmWalletsModal/WalletList.d.ts +4 -0
  46. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -0
  47. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +445 -0
  48. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -0
  49. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +12 -0
  50. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -0
  51. package/dist/components/HeaderButtons/BackButton.d.ts +5 -0
  52. package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -0
  53. package/dist/components/HeaderButtons/CancelButton.d.ts +5 -0
  54. package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -0
  55. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +875 -0
  56. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
  57. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +12 -0
  58. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -0
  59. package/dist/components/HeaderButtons/HomeButtons.d.ts +4 -0
  60. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -0
  61. package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts +3 -0
  62. package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -0
  63. package/dist/components/HeaderButtons/WalletButton.d.ts +5 -0
  64. package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -0
  65. package/dist/components/HeaderButtons/index.d.ts +5 -0
  66. package/dist/components/HeaderButtons/index.d.ts.map +1 -0
  67. package/dist/components/Layout/Layout.d.ts +7 -0
  68. package/dist/components/Layout/Layout.d.ts.map +1 -0
  69. package/dist/components/Layout/Layout.styles.d.ts +449 -0
  70. package/dist/components/Layout/Layout.styles.d.ts.map +1 -0
  71. package/dist/components/Layout/Layout.types.d.ts +17 -0
  72. package/dist/components/Layout/Layout.types.d.ts.map +1 -0
  73. package/dist/components/Layout/index.d.ts +2 -0
  74. package/dist/components/Layout/index.d.ts.map +1 -0
  75. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts +3 -0
  76. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts.map +1 -0
  77. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +150 -0
  78. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -0
  79. package/dist/components/LoadingLiquiditySourceList/index.d.ts +2 -0
  80. package/dist/components/LoadingLiquiditySourceList/index.d.ts.map +1 -0
  81. package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
  82. package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
  83. package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
  84. package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
  85. package/dist/components/NoRoutes/NoRoutes.styles.d.ts +445 -0
  86. package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -0
  87. package/dist/components/NoRoutes/NoRoutes.types.d.ts +20 -0
  88. package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
  89. package/dist/components/NoRoutes/index.d.ts +2 -0
  90. package/dist/components/NoRoutes/index.d.ts.map +1 -0
  91. package/dist/components/NotificationContent/NotificationContent.d.ts +3 -0
  92. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -0
  93. package/dist/components/NotificationContent/NotificationContent.styles.d.ts +593 -0
  94. package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -0
  95. package/dist/components/NotificationContent/NotificationNotFound.d.ts +3 -0
  96. package/dist/components/NotificationContent/NotificationNotFound.d.ts.map +1 -0
  97. package/dist/components/NotificationContent/index.d.ts +2 -0
  98. package/dist/components/NotificationContent/index.d.ts.map +1 -0
  99. package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
  100. package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
  101. package/dist/components/RouteErrors/RouteErrors.styles.d.ts +593 -0
  102. package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
  103. package/dist/components/RouteErrors/RouteErrors.types.d.ts +22 -0
  104. package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
  105. package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
  106. package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
  107. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
  108. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
  109. package/dist/components/RouteErrors/index.d.ts +2 -0
  110. package/dist/components/RouteErrors/index.d.ts.map +1 -0
  111. package/dist/components/SearchInput/SearchInput.d.ts +4 -0
  112. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
  113. package/dist/components/SearchInput/SearchInput.styles.d.ts +149 -0
  114. package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
  115. package/dist/components/SearchInput/SearchInput.types.d.ts +10 -0
  116. package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -0
  117. package/dist/components/SearchInput/index.d.ts +2 -0
  118. package/dist/components/SearchInput/index.d.ts.map +1 -0
  119. package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts +4 -0
  120. package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -0
  121. package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +4 -0
  122. package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -0
  123. package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +445 -0
  124. package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -0
  125. package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts +12 -0
  126. package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts.map +1 -0
  127. package/dist/components/SelectableCategoryList/index.d.ts +2 -0
  128. package/dist/components/SelectableCategoryList/index.d.ts.map +1 -0
  129. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +741 -0
  130. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -0
  131. package/dist/components/SettingsContainer/index.d.ts +2 -0
  132. package/dist/components/SettingsContainer/index.d.ts.map +1 -0
  133. package/dist/components/Slippage/Slippage.d.ts +3 -0
  134. package/dist/components/Slippage/Slippage.d.ts.map +1 -0
  135. package/dist/components/Slippage/Slippage.styles.d.ts +593 -0
  136. package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -0
  137. package/dist/components/Slippage/SlippageTooltipContent.d.ts +3 -0
  138. package/dist/components/Slippage/SlippageTooltipContent.d.ts.map +1 -0
  139. package/dist/components/Slippage/index.d.ts +2 -0
  140. package/dist/components/Slippage/index.d.ts.map +1 -0
  141. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts +4 -0
  142. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -0
  143. package/dist/components/SwapDetails/SwapDetails.d.ts +4 -0
  144. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -0
  145. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +15 -0
  146. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
  147. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +1037 -0
  148. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -0
  149. package/dist/components/SwapDetails/SwapDetails.types.d.ts +12 -0
  150. package/dist/components/SwapDetails/SwapDetails.types.d.ts.map +1 -0
  151. package/dist/components/SwapDetails/index.d.ts +2 -0
  152. package/dist/components/SwapDetails/index.d.ts.map +1 -0
  153. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts +4 -0
  154. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -0
  155. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts +4 -0
  156. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -0
  157. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts +4 -0
  158. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -0
  159. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +149 -0
  160. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -0
  161. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +20 -0
  162. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -0
  163. package/dist/components/SwapDetailsAlerts/index.d.ts +3 -0
  164. package/dist/components/SwapDetailsAlerts/index.d.ts.map +1 -0
  165. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts +4 -0
  166. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -0
  167. package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts +4 -0
  168. package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -0
  169. package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts +4 -0
  170. package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -0
  171. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts +4 -0
  172. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -0
  173. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts +4 -0
  174. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -0
  175. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +4 -0
  176. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -0
  177. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +149 -0
  178. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
  179. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +45 -0
  180. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -0
  181. package/dist/components/SwapDetailsModal/index.d.ts +4 -0
  182. package/dist/components/SwapDetailsModal/index.d.ts.map +1 -0
  183. package/dist/components/SwapsGroup/SwapsGroup.d.ts +4 -0
  184. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -0
  185. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +593 -0
  186. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -0
  187. package/dist/components/SwapsGroup/SwapsGroup.types.d.ts +12 -0
  188. package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +1 -0
  189. package/dist/components/SwapsGroup/index.d.ts +2 -0
  190. package/dist/components/SwapsGroup/index.d.ts.map +1 -0
  191. package/dist/components/SwitchFromAndTo.d.ts +1 -1
  192. package/dist/components/SwitchFromAndTo.d.ts.map +1 -1
  193. package/dist/components/TokenList/LoadingTokenList.d.ts +4 -0
  194. package/dist/components/TokenList/LoadingTokenList.d.ts.map +1 -0
  195. package/dist/components/TokenList/TokenList.d.ts +4 -0
  196. package/dist/components/TokenList/TokenList.d.ts.map +1 -0
  197. package/dist/components/TokenList/TokenList.helpers.d.ts +3 -0
  198. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -0
  199. package/dist/components/TokenList/TokenList.styles.d.ts +1334 -0
  200. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
  201. package/dist/components/TokenList/TokenList.types.d.ts +40 -0
  202. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -0
  203. package/dist/components/TokenList/index.d.ts +3 -0
  204. package/dist/components/TokenList/index.d.ts.map +1 -0
  205. package/dist/components/UpdateUrl.d.ts.map +1 -1
  206. package/dist/components/WalletModal/WalletModal.d.ts +4 -0
  207. package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
  208. package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
  209. package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
  210. package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
  211. package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
  212. package/dist/components/WalletModal/WalletModalContent.styles.d.ts +593 -0
  213. package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -0
  214. package/dist/components/WalletModal/index.d.ts +2 -0
  215. package/dist/components/WalletModal/index.d.ts.map +1 -0
  216. package/dist/components/WidgetEvents.d.ts.map +1 -1
  217. package/dist/constants/errors.d.ts +29 -0
  218. package/dist/constants/errors.d.ts.map +1 -1
  219. package/dist/constants/messages.d.ts +7 -0
  220. package/dist/constants/messages.d.ts.map +1 -0
  221. package/dist/constants/navigationRoutes.d.ts +8 -4
  222. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  223. package/dist/constants/routing.d.ts +3 -0
  224. package/dist/constants/routing.d.ts.map +1 -0
  225. package/dist/constants/searchParams.d.ts +2 -2
  226. package/dist/constants/searchParams.d.ts.map +1 -1
  227. package/dist/constants/swapSettings.d.ts.map +1 -1
  228. package/dist/constants/wallets.d.ts +3 -0
  229. package/dist/constants/wallets.d.ts.map +1 -0
  230. package/dist/constants/warnings.d.ts +3 -0
  231. package/dist/constants/warnings.d.ts.map +1 -0
  232. package/dist/hooks/useConfirmSwap.d.ts +14 -6
  233. package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
  234. package/dist/hooks/useFetchBestRoute.d.ts +9 -0
  235. package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
  236. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  237. package/dist/hooks/useSwapInput.d.ts +12 -0
  238. package/dist/hooks/useSwapInput.d.ts.map +1 -0
  239. package/dist/hooks/useTheme.d.ts +3 -26
  240. package/dist/hooks/useTheme.d.ts.map +1 -1
  241. package/dist/hooks/useWalletList.d.ts +20 -0
  242. package/dist/hooks/useWalletList.d.ts.map +1 -0
  243. package/dist/index.js +1 -1
  244. package/dist/index.js.map +4 -4
  245. package/dist/pages/ConfirmSwapPage.d.ts +6 -3
  246. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  247. package/dist/pages/HistoryPage.d.ts.map +1 -1
  248. package/dist/pages/Home.d.ts.map +1 -1
  249. package/dist/pages/LanguagePage.d.ts +3 -0
  250. package/dist/pages/LanguagePage.d.ts.map +1 -0
  251. package/dist/pages/LiquiditySourcePage.d.ts +8 -0
  252. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -0
  253. package/dist/pages/SelectBlockchainPage.d.ts +8 -0
  254. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -0
  255. package/dist/pages/SelectSwapItemsPage.d.ts +11 -0
  256. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -0
  257. package/dist/pages/SettingsPage.d.ts.map +1 -1
  258. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  259. package/dist/pages/ThemePage.d.ts +3 -0
  260. package/dist/pages/ThemePage.d.ts.map +1 -0
  261. package/dist/pages/WalletsPage.d.ts +4 -2
  262. package/dist/pages/WalletsPage.d.ts.map +1 -1
  263. package/dist/store/bestRoute.d.ts +32 -19
  264. package/dist/store/bestRoute.d.ts.map +1 -1
  265. package/dist/store/meta.d.ts +10 -3
  266. package/dist/store/meta.d.ts.map +1 -1
  267. package/dist/store/notification.d.ts +38 -0
  268. package/dist/store/notification.d.ts.map +1 -0
  269. package/dist/store/settings.d.ts +2 -2
  270. package/dist/store/settings.d.ts.map +1 -1
  271. package/dist/store/ui.d.ts +0 -2
  272. package/dist/store/ui.d.ts.map +1 -1
  273. package/dist/store/wallets.d.ts +14 -12
  274. package/dist/store/wallets.d.ts.map +1 -1
  275. package/dist/types/config.d.ts +8 -6
  276. package/dist/types/config.d.ts.map +1 -1
  277. package/dist/types/notification.d.ts +22 -0
  278. package/dist/types/notification.d.ts.map +1 -0
  279. package/dist/types/routing.d.ts +30 -23
  280. package/dist/types/routing.d.ts.map +1 -1
  281. package/dist/types/swap.d.ts +8 -1
  282. package/dist/types/swap.d.ts.map +1 -1
  283. package/dist/utils/common.d.ts +5 -0
  284. package/dist/utils/common.d.ts.map +1 -1
  285. package/dist/utils/date.d.ts +1 -1
  286. package/dist/utils/date.d.ts.map +1 -1
  287. package/dist/utils/meta.d.ts +3 -0
  288. package/dist/utils/meta.d.ts.map +1 -0
  289. package/dist/utils/numbers.d.ts +2 -1
  290. package/dist/utils/numbers.d.ts.map +1 -1
  291. package/dist/utils/routing.d.ts +5 -5
  292. package/dist/utils/routing.d.ts.map +1 -1
  293. package/dist/utils/settings.d.ts +10 -0
  294. package/dist/utils/settings.d.ts.map +1 -0
  295. package/dist/utils/swap.d.ts +28 -13
  296. package/dist/utils/swap.d.ts.map +1 -1
  297. package/dist/utils/wallets.d.ts +20 -14
  298. package/dist/utils/wallets.d.ts.map +1 -1
  299. package/package.json +8 -8
  300. package/src/Wallets.tsx +23 -17
  301. package/src/Widget.tsx +21 -25
  302. package/src/components/AppRoutes.tsx +54 -19
  303. package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
  304. package/src/components/BlockchainList/BlockchainList.styles.ts +18 -0
  305. package/src/components/BlockchainList/BlockchainList.tsx +76 -0
  306. package/src/components/BlockchainList/BlockchainList.types.ts +8 -0
  307. package/src/components/BlockchainList/LoadingBlockchainList.tsx +20 -0
  308. package/src/components/BlockchainList/index.ts +1 -0
  309. package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +30 -0
  310. package/src/components/BlockchainsChip/BlockchainsChip.tsx +15 -0
  311. package/src/components/BlockchainsChip/BlockchainsChip.types.ts +4 -0
  312. package/src/components/BlockchainsChip/index.ts +1 -0
  313. package/src/components/BlockchainsSection/BlockchainSection.helpers.ts +20 -0
  314. package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
  315. package/src/components/BlockchainsSection/BlockchainsSection.tsx +100 -0
  316. package/src/components/BlockchainsSection/BlockchainsSection.types.ts +9 -0
  317. package/src/components/BlockchainsSection/index.ts +1 -0
  318. package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +64 -0
  319. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +169 -0
  320. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +451 -0
  321. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +11 -0
  322. package/src/components/ConfirmWalletsModal/WalletList.styles.ts +34 -0
  323. package/src/components/ConfirmWalletsModal/WalletList.tsx +250 -0
  324. package/src/components/ConfirmWalletsModal/WalletList.type.ts +12 -0
  325. package/src/components/HeaderButtons/BackButton.tsx +16 -0
  326. package/src/components/HeaderButtons/CancelButton.tsx +21 -0
  327. package/src/components/HeaderButtons/HeaderButtons.styles.ts +40 -0
  328. package/src/components/HeaderButtons/HeaderButtons.types.ts +11 -0
  329. package/src/components/HeaderButtons/HomeButtons.tsx +68 -0
  330. package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +21 -0
  331. package/src/components/HeaderButtons/WalletButton.tsx +20 -0
  332. package/src/components/HeaderButtons/index.ts +4 -0
  333. package/src/components/Layout/Layout.styles.ts +51 -0
  334. package/src/components/Layout/Layout.tsx +89 -0
  335. package/src/components/Layout/Layout.types.ts +20 -0
  336. package/src/components/Layout/index.ts +1 -0
  337. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +5 -0
  338. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +23 -0
  339. package/src/components/LoadingLiquiditySourceList/index.ts +1 -0
  340. package/src/components/NoRoutes/NoRoutes.helper.ts +50 -0
  341. package/src/components/NoRoutes/NoRoutes.styles.ts +15 -0
  342. package/src/components/NoRoutes/NoRoutes.tsx +81 -0
  343. package/src/components/NoRoutes/NoRoutes.types.ts +21 -0
  344. package/src/components/NoRoutes/index.ts +1 -0
  345. package/src/components/NotificationContent/NotificationContent.styles.ts +34 -0
  346. package/src/components/NotificationContent/NotificationContent.tsx +112 -0
  347. package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
  348. package/src/components/NotificationContent/index.ts +1 -0
  349. package/src/components/RouteErrors/RouteErrors.styles.ts +27 -0
  350. package/src/components/RouteErrors/RouteErrors.tsx +68 -0
  351. package/src/components/RouteErrors/RouteErrors.types.ts +27 -0
  352. package/src/components/RouteErrors/RouteErrorsModal.tsx +101 -0
  353. package/src/components/RouteErrors/RouteErrorsModalItem.tsx +24 -0
  354. package/src/components/RouteErrors/index.ts +1 -0
  355. package/src/components/SearchInput/SearchInput.styles.ts +9 -0
  356. package/src/components/SearchInput/SearchInput.tsx +51 -0
  357. package/src/components/SearchInput/SearchInput.types.ts +10 -0
  358. package/src/components/SearchInput/index.ts +1 -0
  359. package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +20 -0
  360. package/src/components/SelectableCategoryList/SelectableCategoryList.styles.ts +21 -0
  361. package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +79 -0
  362. package/src/components/SelectableCategoryList/SelectableCategoryList.types.ts +12 -0
  363. package/src/components/SelectableCategoryList/index.ts +1 -0
  364. package/src/components/SettingsContainer/SettingsContainer.style.ts +33 -0
  365. package/src/components/SettingsContainer/index.ts +7 -0
  366. package/src/components/Slippage/Slippage.styles.ts +24 -0
  367. package/src/components/Slippage/Slippage.tsx +90 -0
  368. package/src/components/Slippage/SlippageTooltipContent.tsx +23 -0
  369. package/src/components/Slippage/index.ts +1 -0
  370. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +43 -0
  371. package/src/components/SwapDetails/SwapDetails.helpers.tsx +102 -0
  372. package/src/components/SwapDetails/SwapDetails.styles.ts +76 -0
  373. package/src/components/SwapDetails/SwapDetails.tsx +387 -0
  374. package/src/components/SwapDetails/SwapDetails.types.ts +12 -0
  375. package/src/components/SwapDetails/index.ts +1 -0
  376. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +36 -0
  377. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +55 -0
  378. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +7 -0
  379. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +74 -0
  380. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +28 -0
  381. package/src/components/SwapDetailsAlerts/index.ts +2 -0
  382. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +101 -0
  383. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +34 -0
  384. package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +34 -0
  385. package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +35 -0
  386. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +22 -0
  387. package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +6 -0
  388. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +42 -0
  389. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +53 -0
  390. package/src/components/SwapDetailsModal/index.ts +3 -0
  391. package/src/components/SwapsGroup/SwapsGroup.styles.ts +26 -0
  392. package/src/components/SwapsGroup/SwapsGroup.tsx +125 -0
  393. package/src/components/SwapsGroup/SwapsGroup.types.ts +13 -0
  394. package/src/components/SwapsGroup/index.ts +1 -0
  395. package/src/components/SwitchFromAndTo.tsx +24 -8
  396. package/src/components/TokenList/LoadingTokenList.tsx +34 -0
  397. package/src/components/TokenList/TokenList.helpers.ts +13 -0
  398. package/src/components/TokenList/TokenList.styles.ts +115 -0
  399. package/src/components/TokenList/TokenList.tsx +269 -0
  400. package/src/components/TokenList/TokenList.types.ts +47 -0
  401. package/src/components/TokenList/index.ts +2 -0
  402. package/src/components/UpdateUrl.tsx +40 -22
  403. package/src/components/WalletModal/WalletModal.tsx +20 -0
  404. package/src/components/WalletModal/WalletModal.types.ts +11 -0
  405. package/src/components/WalletModal/WalletModalContent.styles.ts +44 -0
  406. package/src/components/WalletModal/WalletModalContent.tsx +54 -0
  407. package/src/components/WalletModal/index.ts +1 -0
  408. package/src/components/WidgetEvents.tsx +30 -4
  409. package/src/constants/errors.ts +56 -1
  410. package/src/constants/messages.ts +8 -0
  411. package/src/constants/navigationRoutes.ts +8 -4
  412. package/src/constants/routing.ts +2 -0
  413. package/src/constants/searchParams.ts +2 -2
  414. package/src/constants/swapSettings.ts +5 -1
  415. package/src/constants/wallets.ts +3 -0
  416. package/src/constants/warnings.ts +26 -0
  417. package/src/hooks/useConfirmSwap.ts +251 -220
  418. package/src/hooks/useFetchBestRoute.ts +38 -0
  419. package/src/hooks/useNavigateBack.ts +15 -9
  420. package/src/hooks/useSwapInput.ts +102 -0
  421. package/src/hooks/useTheme.ts +59 -60
  422. package/src/hooks/useWalletList.ts +125 -0
  423. package/src/pages/ConfirmSwapPage.tsx +470 -228
  424. package/src/pages/HistoryPage.tsx +104 -15
  425. package/src/pages/Home.tsx +345 -111
  426. package/src/pages/LanguagePage.tsx +83 -0
  427. package/src/pages/LiquiditySourcePage.tsx +160 -0
  428. package/src/pages/SelectBlockchainPage.tsx +77 -0
  429. package/src/pages/SelectSwapItemsPage.tsx +153 -0
  430. package/src/pages/SettingsPage.tsx +144 -72
  431. package/src/pages/SwapDetailsPage.tsx +35 -143
  432. package/src/pages/ThemePage.tsx +96 -0
  433. package/src/pages/WalletsPage.tsx +73 -124
  434. package/src/store/bestRoute.ts +85 -180
  435. package/src/store/meta.ts +23 -3
  436. package/src/store/notification.ts +77 -0
  437. package/src/store/settings.ts +21 -13
  438. package/src/store/ui.ts +1 -5
  439. package/src/store/wallets.ts +92 -76
  440. package/src/types/config.ts +9 -7
  441. package/src/types/notification.ts +33 -0
  442. package/src/types/routing.ts +29 -28
  443. package/src/types/swap.ts +9 -1
  444. package/src/utils/common.ts +53 -3
  445. package/src/utils/date.ts +15 -18
  446. package/src/utils/meta.ts +9 -0
  447. package/src/utils/numbers.ts +63 -18
  448. package/src/utils/routing.ts +30 -14
  449. package/src/utils/settings.ts +57 -0
  450. package/src/utils/swap.ts +166 -95
  451. package/src/utils/wallets.ts +159 -110
  452. package/dist/components/ConfirmSwapErrors.d.ts +0 -4
  453. package/dist/components/ConfirmSwapErrors.d.ts.map +0 -1
  454. package/dist/components/ConfirmSwapWarnings.d.ts +0 -3
  455. package/dist/components/ConfirmSwapWarnings.d.ts.map +0 -1
  456. package/dist/components/Layout.d.ts +0 -7
  457. package/dist/components/Layout.d.ts.map +0 -1
  458. package/dist/pages/LiquiditySourcesPage.d.ts +0 -7
  459. package/dist/pages/LiquiditySourcesPage.d.ts.map +0 -1
  460. package/dist/pages/SelectChainPage.d.ts +0 -8
  461. package/dist/pages/SelectChainPage.d.ts.map +0 -1
  462. package/dist/pages/SelectTokenPage.d.ts +0 -15
  463. package/dist/pages/SelectTokenPage.d.ts.map +0 -1
  464. package/src/components/ConfirmSwapErrors.tsx +0 -34
  465. package/src/components/ConfirmSwapWarnings.tsx +0 -22
  466. package/src/components/Layout.tsx +0 -105
  467. package/src/pages/LiquiditySourcesPage.tsx +0 -63
  468. package/src/pages/SelectChainPage.tsx +0 -42
  469. package/src/pages/SelectTokenPage.tsx +0 -64
@@ -0,0 +1,115 @@
1
+ import { styled, Typography } from '@rango-dev/ui';
2
+
3
+ export const Title = styled('div', {
4
+ display: 'flex',
5
+ alignItems: 'center',
6
+ '._typography': {
7
+ textOverflow: 'ellipsis',
8
+ whiteSpace: 'nowrap',
9
+ maxWidth: 100,
10
+ overflow: 'hidden',
11
+ },
12
+ });
13
+ export const List = styled('ul', {
14
+ minHeight: 280,
15
+ padding: 0,
16
+ margin: 0,
17
+ listStyle: 'none',
18
+ '& li': {
19
+ alignItems: 'none',
20
+ '.description': {
21
+ position: 'relative',
22
+ height: 12,
23
+ width: 150,
24
+ '.token-title': {
25
+ position: 'absolute',
26
+ transform: 'none',
27
+ transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
28
+ bottom: '-8px',
29
+ },
30
+
31
+ '.token-address': {
32
+ transform: 'translateY(12px)',
33
+ visibility: 'hidden',
34
+ '& a': {
35
+ fontSize: '$12',
36
+ lineHeight: '$16',
37
+ color: '$neutral800',
38
+ textDecoration: 'none',
39
+ },
40
+ },
41
+ '.token-name': {
42
+ position: 'absolute',
43
+ transform: 'none',
44
+ transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
45
+ textOverflow: 'ellipsis',
46
+ whiteSpace: 'nowrap',
47
+ maxWidth: 100,
48
+ overflow: 'hidden',
49
+ },
50
+ },
51
+ '&:hover': {
52
+ '.description': {
53
+ '.token-address': {
54
+ position: 'absolute',
55
+ transform: 'none',
56
+ transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
57
+ visibility: 'visible',
58
+ },
59
+ '.token-address-without-name': {
60
+ bottom: '-15px',
61
+ },
62
+ '.token-name': {
63
+ position: 'absolute',
64
+ transform: 'translateY(-12px)',
65
+ visibility: 'hidden',
66
+ },
67
+ '.token-title': {
68
+ position: 'absolute',
69
+ transform: 'translateY(-12px)',
70
+ bottom: '-10px',
71
+ },
72
+ },
73
+ },
74
+ },
75
+ });
76
+
77
+ export const Tag = styled('div', {
78
+ paddingLeft: '$5',
79
+ paddingRight: '$5',
80
+ borderRadius: '$md',
81
+ display: 'flex',
82
+ alignItems: 'center',
83
+ });
84
+
85
+ export const TagTitle = styled(Typography, {});
86
+
87
+ export const BalanceContainer = styled('div', {
88
+ textAlign: 'right',
89
+ });
90
+
91
+ export const End = styled('ul', {
92
+ display: 'flex',
93
+ alignItems: 'end',
94
+ flexDirection: 'column',
95
+ });
96
+
97
+ export const Description = styled('div', {
98
+ display: 'flex',
99
+ alignItems: 'center',
100
+ });
101
+ export const ImageSection = styled('div', {
102
+ position: 'relative',
103
+ '.image-container': {
104
+ borderRadius: '$xm',
105
+ overflow: 'hidden',
106
+ },
107
+ });
108
+ export const Pin = styled('div', {
109
+ position: 'absolute',
110
+ backgroundColor: '$neutral100',
111
+ padding: '$4',
112
+ borderRadius: '50%',
113
+ bottom: -6,
114
+ right: -6,
115
+ });
@@ -0,0 +1,269 @@
1
+ /* eslint-disable @typescript-eslint/no-magic-numbers */
2
+ import type {
3
+ PropTypes,
4
+ RenderDescProps,
5
+ TokenWithBalance,
6
+ } from './TokenList.types';
7
+ import type { CommonProps } from 'react-window';
8
+
9
+ import { i18n } from '@lingui/core';
10
+ import {
11
+ darkTheme,
12
+ Divider,
13
+ ExternalLinkIcon,
14
+ Image,
15
+ ListItemButton,
16
+ NotFound,
17
+ PinIcon,
18
+ Skeleton,
19
+ Typography,
20
+ VirtualizedList,
21
+ } from '@rango-dev/ui';
22
+ import React, { forwardRef, useEffect, useState } from 'react';
23
+
24
+ import { useMetaStore } from '../../store/meta';
25
+ import { useWalletsStore } from '../../store/wallets';
26
+ import { generateRangeColors } from '../../utils/common';
27
+
28
+ import { LoadingTokenList } from './LoadingTokenList';
29
+ import {
30
+ BalanceContainer,
31
+ End,
32
+ ImageSection,
33
+ List,
34
+ Pin,
35
+ Tag,
36
+ TagTitle,
37
+ Title,
38
+ } from './TokenList.styles';
39
+
40
+ const PAGE_SIZE = 20;
41
+
42
+ const renderDesc = (props: RenderDescProps) => {
43
+ const { address, name, url, token, customCssForTag, customCssForTagTitle } =
44
+ props;
45
+ const length = address.length;
46
+
47
+ return (
48
+ <div className="description">
49
+ {name ? (
50
+ <div className="token-name">{name}</div>
51
+ ) : (
52
+ <Title className="token-title">
53
+ <Typography variant="title" size="xmedium">
54
+ {token.symbol}
55
+ </Typography>
56
+ <Divider direction="horizontal" size={4} />
57
+ <Tag css={customCssForTag}>
58
+ <TagTitle variant="body" size="xsmall" css={customCssForTagTitle}>
59
+ {token.blockchain}
60
+ </TagTitle>
61
+ </Tag>
62
+ </Title>
63
+ )}
64
+
65
+ {!!address && (
66
+ <div
67
+ className={`token-address ${!name && 'token-address-without-name'}`}>
68
+ <a
69
+ href={url}
70
+ target="_blank"
71
+ rel="nofollow noreferrer"
72
+ onClick={(e) => e.stopPropagation()}>
73
+ {length > 10
74
+ ? `${address.slice(0, 5)}...${address.slice(length - 6, length)}`
75
+ : address}{' '}
76
+ <ExternalLinkIcon color="gray" size={12} />
77
+ </a>
78
+ </div>
79
+ )}
80
+ </div>
81
+ );
82
+ };
83
+
84
+ export function TokenList(props: PropTypes) {
85
+ const { list, searchedFor = '', onChange } = props;
86
+
87
+ const [tokens, setTokens] = useState<TokenWithBalance[]>(list);
88
+ const loadingStatus = useMetaStore.use.loadingStatus();
89
+ const [hasNextPage, setHasNextPage] = useState<boolean>(true);
90
+ const loadingWallet = useWalletsStore.use.loading();
91
+ const { blockchains } = useMetaStore.use.meta();
92
+
93
+ // eslint-disable-next-line react/display-name
94
+ const innerElementType: React.FC<CommonProps> = forwardRef((render, ref) => {
95
+ return (
96
+ <div
97
+ {...render}
98
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
99
+ ref={ref as any}
100
+ style={{
101
+ ...render.style,
102
+ height: `${parseFloat(render.style?.height as string) + 8 * 2}px`,
103
+ }}
104
+ />
105
+ );
106
+ });
107
+ const loadNextPage = () => {
108
+ setTokens(list.slice(0, tokens.length + PAGE_SIZE));
109
+ };
110
+
111
+ useEffect(() => {
112
+ setHasNextPage(list.length > tokens.length);
113
+ }, [tokens.length]);
114
+
115
+ useEffect(() => {
116
+ setTokens(list.slice(0, PAGE_SIZE));
117
+ }, [list]);
118
+
119
+ const renderList = () => {
120
+ if (!tokens.length && !!searchedFor) {
121
+ return (
122
+ <>
123
+ <Divider size={32} />
124
+ <NotFound
125
+ title={i18n.t('No results found')}
126
+ description={i18n.t('Try using different keywords')}
127
+ />
128
+ </>
129
+ );
130
+ }
131
+ return (
132
+ <VirtualizedList
133
+ Item={({ index, style }) => {
134
+ const address = tokens[index].address || '';
135
+ const blockchain = blockchains.find(
136
+ (blockchain) => blockchain.name === tokens[index].blockchain
137
+ );
138
+ const color = generateRangeColors(
139
+ tokens[index].symbol,
140
+ blockchain?.color || ''
141
+ );
142
+
143
+ const customCssForTag = {
144
+ $$color: color[`${tokens[index].symbol}100`],
145
+ [`.${darkTheme} &`]: {
146
+ $$color: color[`${tokens[index].symbol}900`],
147
+ },
148
+ backgroundColor: '$$color',
149
+ };
150
+
151
+ const customCssForTagTitle = {
152
+ $$color: color[`${tokens[index].symbol}700`],
153
+ [`.${darkTheme} &`]: {
154
+ $$color: color[`${tokens[index].symbol}100`],
155
+ },
156
+ color: '$$color',
157
+ };
158
+
159
+ return (
160
+ <div
161
+ style={{
162
+ ...style,
163
+ paddingRight: 5,
164
+ }}>
165
+ <ListItemButton
166
+ style={{
167
+ height: style?.height,
168
+ }}
169
+ tab-index={index}
170
+ key={`${tokens[index].symbol}${tokens[index].address}`}
171
+ id={`${tokens[index].symbol}${tokens[index].address}`}
172
+ hasDivider
173
+ onClick={() => onChange(tokens[index])}
174
+ start={
175
+ <ImageSection>
176
+ <Image src={tokens[index].image} size={30} />
177
+ {tokens[index].pin && (
178
+ <Pin>
179
+ <PinIcon size={12} color="gray" />
180
+ </Pin>
181
+ )}
182
+ </ImageSection>
183
+ }
184
+ title={
185
+ blockchain?.type === 'COSMOS' ||
186
+ !!tokens[index].name ||
187
+ (!tokens[index].name && !address) ? (
188
+ <Title>
189
+ <Typography variant="title" size="xmedium">
190
+ {tokens[index].symbol}
191
+ </Typography>
192
+ <Divider direction="horizontal" size={4} />
193
+ <Tag css={customCssForTag}>
194
+ <TagTitle
195
+ variant="body"
196
+ size="xsmall"
197
+ css={customCssForTagTitle}>
198
+ {tokens[index].blockchain}
199
+ </TagTitle>
200
+ </Tag>
201
+ </Title>
202
+ ) : undefined
203
+ }
204
+ description={
205
+ !!blockchain?.info &&
206
+ !!address &&
207
+ blockchain.type !== 'COSMOS'
208
+ ? renderDesc({
209
+ address,
210
+ token: tokens[index],
211
+ customCssForTag,
212
+ customCssForTagTitle,
213
+ name: tokens[index].name,
214
+ url: blockchain.info.addressUrl
215
+ .split('{wallet}')
216
+ .join(address),
217
+ })
218
+ : tokens[index].name || undefined
219
+ }
220
+ end={
221
+ loadingWallet ? (
222
+ <End>
223
+ <Skeleton variant="text" size="large" width={70} />
224
+ <Divider size={4} />
225
+ <Skeleton variant="text" size="medium" width={50} />
226
+ </End>
227
+ ) : (
228
+ tokens[index]?.balance && (
229
+ <BalanceContainer>
230
+ <Typography variant="title" size="small">
231
+ {tokens[index].balance?.amount}
232
+ </Typography>
233
+ <div />
234
+ {tokens[index].balance?.usdValue && (
235
+ <Typography
236
+ variant="body"
237
+ color="neutral800"
238
+ size="xsmall">
239
+ {`$${tokens[index].balance?.usdValue}`}
240
+ </Typography>
241
+ )}
242
+ </BalanceContainer>
243
+ )
244
+ )
245
+ }
246
+ />
247
+ </div>
248
+ );
249
+ }}
250
+ hasNextPage={hasNextPage}
251
+ itemCount={tokens.length}
252
+ loadNextPage={loadNextPage}
253
+ innerElementType={innerElementType}
254
+ size={60}
255
+ />
256
+ );
257
+ };
258
+
259
+ return (
260
+ <div>
261
+ <Typography variant="label" size="large">
262
+ {i18n.t('Select Token')}
263
+ </Typography>
264
+ <Divider size={4} />
265
+ {loadingStatus === 'loading' && <LoadingTokenList size={PAGE_SIZE} />}
266
+ {loadingStatus === 'success' && <List>{renderList()}</List>}
267
+ </div>
268
+ );
269
+ }
@@ -0,0 +1,47 @@
1
+ import type { Token } from 'rango-sdk';
2
+
3
+ export interface TokenWithBalance extends Token {
4
+ balance?: {
5
+ amount: string;
6
+ usdValue: string;
7
+ };
8
+ pin?: boolean;
9
+ }
10
+
11
+ export interface PropTypes {
12
+ list: TokenWithBalance[];
13
+ searchedFor?: string;
14
+ onChange: (token: TokenWithBalance) => void;
15
+ }
16
+
17
+ export interface LoadingTokenListProps {
18
+ size: number;
19
+ }
20
+
21
+ export interface RenderDescProps {
22
+ name?: string | null;
23
+ address: string;
24
+ url: string;
25
+ token: TokenWithBalance;
26
+ customCssForTag: TagCSS;
27
+ customCssForTagTitle: TitleCSS;
28
+ }
29
+
30
+ type TagCSS = {
31
+ [x: string]:
32
+ | string
33
+ | {
34
+ $$color: string;
35
+ };
36
+ $$color: string;
37
+ backgroundColor: string;
38
+ };
39
+ type TitleCSS = {
40
+ [x: string]:
41
+ | string
42
+ | {
43
+ $$color: string;
44
+ };
45
+ $$color: string;
46
+ color: string;
47
+ };
@@ -0,0 +1,2 @@
1
+ export { TokenList } from './TokenList';
2
+ export type { TokenWithBalance } from './TokenList.types';
@@ -4,10 +4,11 @@ import {
4
4
  useLocation,
5
5
  useSearchParams,
6
6
  } from 'react-router-dom';
7
+
8
+ import { navigationRoutes } from '../constants/navigationRoutes';
9
+ import { SearchParams } from '../constants/searchParams';
7
10
  import { useBestRouteStore } from '../store/bestRoute';
8
11
  import { useMetaStore } from '../store/meta';
9
- import { SearchParams } from '../constants/searchParams';
10
- import { navigationRoutes } from '../constants/navigationRoutes';
11
12
  import { useUiStore } from '../store/ui';
12
13
  import { searchParamsToToken } from '../utils/routing';
13
14
 
@@ -17,13 +18,13 @@ export function UpdateUrl() {
17
18
  const location = useLocation();
18
19
  const firstRenderSearchParams = useRef(location.search);
19
20
  const searchParamsRef = useRef<Record<string, string>>({});
20
- const fromChain = useBestRouteStore.use.fromChain();
21
- const toChain = useBestRouteStore.use.toChain();
21
+ const fromBlockchain = useBestRouteStore.use.fromBlockchain();
22
+ const toBlockchain = useBestRouteStore.use.toBlockchain();
22
23
  const fromToken = useBestRouteStore.use.fromToken();
23
24
  const toToken = useBestRouteStore.use.toToken();
24
- const setFromChain = useBestRouteStore.use.setFromChain();
25
+ const setFromBlockchain = useBestRouteStore.use.setFromBlockchain();
25
26
  const setFromToken = useBestRouteStore.use.setFromToken();
26
- const setToChain = useBestRouteStore.use.setToChain();
27
+ const setToBlockchain = useBestRouteStore.use.setToBlockchain();
27
28
  const setToToken = useBestRouteStore.use.setToToken();
28
29
  const inputAmount = useBestRouteStore.use.inputAmount();
29
30
  const setInputAmount = useBestRouteStore.use.setInputAmount();
@@ -41,7 +42,9 @@ export function UpdateUrl() {
41
42
  searchParamsRef.current = params;
42
43
  const requestId =
43
44
  location.pathname.split(navigationRoutes.swaps + '/')[1] || null;
44
- if (requestId) setSelectedSwap(requestId);
45
+ if (requestId) {
46
+ setSelectedSwap(requestId);
47
+ }
45
48
  }, []);
46
49
 
47
50
  useEffect(() => {
@@ -59,12 +62,14 @@ export function UpdateUrl() {
59
62
  fromAmount =
60
63
  searchParamsRef.current[SearchParams.FROM_AMOUNT] || inputAmount;
61
64
  } else {
62
- if (location.state === 'redirect') return;
63
- fromChainString = fromChain?.name || '';
65
+ if (location.state === 'redirect') {
66
+ return;
67
+ }
68
+ fromChainString = fromBlockchain?.name || '';
64
69
  fromTokenString =
65
70
  (fromToken?.symbol || '') +
66
71
  (fromToken?.address ? `--${fromToken?.address}` : '');
67
- toChainString = toChain?.name || '';
72
+ toChainString = toBlockchain?.name || '';
68
73
  toTokenString =
69
74
  (toToken?.symbol || '') +
70
75
  (toToken?.address ? `--${toToken?.address}` : '');
@@ -88,7 +93,14 @@ export function UpdateUrl() {
88
93
  );
89
94
  }
90
95
  firstRender.current = false;
91
- }, [location.pathname, inputAmount, fromChain, fromToken, toChain, toToken]);
96
+ }, [
97
+ location.pathname,
98
+ inputAmount,
99
+ fromBlockchain,
100
+ fromToken,
101
+ toBlockchain,
102
+ toToken,
103
+ ]);
92
104
 
93
105
  useEffect(() => {
94
106
  if (loadingStatus === 'success') {
@@ -97,31 +109,37 @@ export function UpdateUrl() {
97
109
  const toChainString = searchParams.get(SearchParams.TO_CHAIN);
98
110
  const toTokenString = searchParams.get(SearchParams.TO_TOKEN);
99
111
  const fromAmount = searchParams.get(SearchParams.FROM_AMOUNT);
100
- const fromChain = blockchains.find(
112
+ const fromBlockchain = blockchains.find(
101
113
  (blockchain) => blockchain.name === fromChainString
102
114
  );
103
115
  const fromToken = searchParamsToToken(
104
116
  tokens,
105
117
  fromTokenString,
106
- fromChain || null
118
+ fromBlockchain || null
107
119
  );
108
- const toChain = blockchains.find(
120
+ const toBlockchain = blockchains.find(
109
121
  (blockchain) => blockchain.name === toChainString
110
122
  );
111
123
  const toToken = searchParamsToToken(
112
124
  tokens,
113
125
  toTokenString,
114
- toChain || null
126
+ toBlockchain || null
115
127
  );
116
- if (!!fromChain) {
117
- setFromChain(fromChain);
118
- if (!!fromToken) setFromToken(fromToken);
128
+ if (!!fromBlockchain) {
129
+ setFromBlockchain(fromBlockchain);
130
+ if (!!fromToken) {
131
+ setFromToken(fromToken);
132
+ }
133
+ }
134
+ if (!!toBlockchain) {
135
+ setToBlockchain(toBlockchain);
136
+ if (!!toToken) {
137
+ setToToken(toToken);
138
+ }
119
139
  }
120
- if (!!toChain) {
121
- setToChain(toChain);
122
- if (!!toToken) setToToken(toToken);
140
+ if (fromAmount) {
141
+ setInputAmount(fromAmount);
123
142
  }
124
- if (fromAmount) setInputAmount(fromAmount);
125
143
  }
126
144
  }, [loadingStatus]);
127
145
 
@@ -0,0 +1,20 @@
1
+ import type { PropTypes } from './WalletModal.types';
2
+
3
+ import { Divider, Modal } from '@rango-dev/ui';
4
+ import React from 'react';
5
+
6
+ import { ModalContent } from './WalletModalContent';
7
+
8
+ export function WalletModal(props: PropTypes) {
9
+ const { open, onClose, ...otherProps } = props;
10
+
11
+ return (
12
+ <Modal
13
+ open={open}
14
+ onClose={onClose}
15
+ container={document.getElementById('swap-box') || document.body}>
16
+ <ModalContent {...otherProps} />
17
+ <Divider direction="vertical" size={32} />
18
+ </Modal>
19
+ );
20
+ }
@@ -0,0 +1,11 @@
1
+ import type { WalletState } from '@rango-dev/ui';
2
+
3
+ export interface PropTypes {
4
+ open: boolean;
5
+ onClose: () => void;
6
+ image: string;
7
+ state: WalletState;
8
+ error?: string;
9
+ }
10
+
11
+ export type ModalContentProps = Pick<PropTypes, 'state' | 'error' | 'image'>;
@@ -0,0 +1,44 @@
1
+ import { keyframes, styled } from '@rango-dev/ui';
2
+
3
+ export const IconContainer = styled('div', {
4
+ borderRadius: '$lg',
5
+ width: '$45',
6
+ height: '$45',
7
+ backgroundColor: '$success300',
8
+ display: 'flex',
9
+ justifyContent: 'center',
10
+ alignItems: 'center',
11
+ });
12
+
13
+ export const LogoContainer = styled('div', {
14
+ position: 'relative',
15
+ });
16
+
17
+ const spin = keyframes({
18
+ '0%': {
19
+ transform: 'rotate(0deg)',
20
+ },
21
+ '100%': {
22
+ transform: 'rotate(360deg)',
23
+ },
24
+ });
25
+
26
+ export const Spinner = styled('div', {
27
+ position: 'absolute',
28
+ border: '2px solid rgba(0, 0, 0, 0.1)',
29
+ borderTop: '2px solid $info500',
30
+ borderRadius: '$lg',
31
+ width: '$45',
32
+ height: '$45',
33
+ animation: `${spin} 1s linear infinite`,
34
+ top: 0,
35
+ bottom: 0,
36
+ right: 0,
37
+ left: 0,
38
+ });
39
+
40
+ export const WalletImageContainer = styled('div', {
41
+ '& img': {
42
+ borderRadius: '50%',
43
+ },
44
+ });
@@ -0,0 +1,54 @@
1
+ import type { ModalContentProps } from './WalletModal.types';
2
+
3
+ import { i18n } from '@lingui/core';
4
+ import { Image, MessageBox, WalletState } from '@rango-dev/ui';
5
+ import React from 'react';
6
+
7
+ import {
8
+ LogoContainer,
9
+ Spinner,
10
+ WalletImageContainer,
11
+ } from './WalletModalContent.styles';
12
+
13
+ export function ModalContent(props: ModalContentProps) {
14
+ const { state, image, error } = props;
15
+ if (state === WalletState.CONNECTED) {
16
+ return (
17
+ <MessageBox
18
+ type="success"
19
+ title={i18n.t('Wallet Connected')}
20
+ description={i18n.t(
21
+ 'Your wallet is connected, you can use it to swap.'
22
+ )}
23
+ />
24
+ );
25
+ }
26
+
27
+ if (error) {
28
+ return (
29
+ <MessageBox
30
+ type="error"
31
+ title={i18n.t('Failed to Connect')}
32
+ description={
33
+ error || i18n.t('Your wallet is not connected. Please try again.')
34
+ }
35
+ />
36
+ );
37
+ }
38
+
39
+ return (
40
+ <MessageBox
41
+ type="loading"
42
+ title={i18n.t('Connecting to your wallet')}
43
+ description={i18n.t('Click connect in your wallet popup.')}
44
+ icon={
45
+ <LogoContainer>
46
+ <WalletImageContainer>
47
+ <Image src={image} size={45} />
48
+ </WalletImageContainer>
49
+ <Spinner />
50
+ </LogoContainer>
51
+ }
52
+ />
53
+ );
54
+ }
@@ -0,0 +1 @@
1
+ export { WalletModal } from './WalletModal';