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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (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/AppRouter.d.ts +3 -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/BlockchainSection.helpers.d.ts +3 -0
  22. package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts.map +1 -0
  23. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts +4 -0
  24. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -0
  25. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +154 -0
  26. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -0
  27. package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts +9 -0
  28. package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts.map +1 -0
  29. package/dist/components/BlockchainsSection/index.d.ts +2 -0
  30. package/dist/components/BlockchainsSection/index.d.ts.map +1 -0
  31. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +6 -0
  32. package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -0
  33. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +2599 -0
  34. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -0
  35. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts +4 -0
  36. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -0
  37. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +11 -0
  38. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -0
  39. package/dist/components/ConfirmWalletsModal/WalletList.d.ts +4 -0
  40. package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -0
  41. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +460 -0
  42. package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -0
  43. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +12 -0
  44. package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -0
  45. package/dist/components/HeaderButtons/BackButton.d.ts +5 -0
  46. package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -0
  47. package/dist/components/HeaderButtons/CancelButton.d.ts +5 -0
  48. package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -0
  49. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +616 -0
  50. package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
  51. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +13 -0
  52. package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -0
  53. package/dist/components/HeaderButtons/HomeButtons.d.ts +4 -0
  54. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -0
  55. package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts +3 -0
  56. package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -0
  57. package/dist/components/HeaderButtons/WalletButton.d.ts +5 -0
  58. package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -0
  59. package/dist/components/HeaderButtons/index.d.ts +5 -0
  60. package/dist/components/HeaderButtons/index.d.ts.map +1 -0
  61. package/dist/components/Layout/Layout.d.ts +7 -0
  62. package/dist/components/Layout/Layout.d.ts.map +1 -0
  63. package/dist/components/Layout/Layout.styles.d.ts +464 -0
  64. package/dist/components/Layout/Layout.styles.d.ts.map +1 -0
  65. package/dist/components/Layout/Layout.types.d.ts +17 -0
  66. package/dist/components/Layout/Layout.types.d.ts.map +1 -0
  67. package/dist/components/Layout/index.d.ts +2 -0
  68. package/dist/components/Layout/index.d.ts.map +1 -0
  69. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts +3 -0
  70. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts.map +1 -0
  71. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +155 -0
  72. package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -0
  73. package/dist/components/LoadingLiquiditySourceList/index.d.ts +2 -0
  74. package/dist/components/LoadingLiquiditySourceList/index.d.ts.map +1 -0
  75. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +4 -0
  76. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -0
  77. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts +3 -0
  78. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -0
  79. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +460 -0
  80. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -0
  81. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
  82. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +1 -0
  83. package/dist/components/LoadingSwapDetails/index.d.ts +2 -0
  84. package/dist/components/LoadingSwapDetails/index.d.ts.map +1 -0
  85. package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
  86. package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
  87. package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
  88. package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
  89. package/dist/components/NoRoutes/NoRoutes.styles.d.ts +460 -0
  90. package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -0
  91. package/dist/components/NoRoutes/NoRoutes.types.d.ts +20 -0
  92. package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
  93. package/dist/components/NoRoutes/index.d.ts +2 -0
  94. package/dist/components/NoRoutes/index.d.ts.map +1 -0
  95. package/dist/components/NotificationContent/NotificationContent.d.ts +3 -0
  96. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -0
  97. package/dist/components/NotificationContent/NotificationContent.styles.d.ts +613 -0
  98. package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -0
  99. package/dist/components/NotificationContent/NotificationNotFound.d.ts +3 -0
  100. package/dist/components/NotificationContent/NotificationNotFound.d.ts.map +1 -0
  101. package/dist/components/NotificationContent/index.d.ts +2 -0
  102. package/dist/components/NotificationContent/index.d.ts.map +1 -0
  103. package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
  104. package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
  105. package/dist/components/RouteErrors/RouteErrors.styles.d.ts +613 -0
  106. package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
  107. package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
  108. package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
  109. package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
  110. package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
  111. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
  112. package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
  113. package/dist/components/RouteErrors/index.d.ts +2 -0
  114. package/dist/components/RouteErrors/index.d.ts.map +1 -0
  115. package/dist/components/SearchInput/SearchInput.d.ts +4 -0
  116. package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
  117. package/dist/components/SearchInput/SearchInput.styles.d.ts +154 -0
  118. package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
  119. package/dist/components/SearchInput/SearchInput.types.d.ts +10 -0
  120. package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -0
  121. package/dist/components/SearchInput/index.d.ts +2 -0
  122. package/dist/components/SearchInput/index.d.ts.map +1 -0
  123. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +613 -0
  124. package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -0
  125. package/dist/components/SettingsContainer/index.d.ts +2 -0
  126. package/dist/components/SettingsContainer/index.d.ts.map +1 -0
  127. package/dist/components/Slippage/Slippage.d.ts +3 -0
  128. package/dist/components/Slippage/Slippage.d.ts.map +1 -0
  129. package/dist/components/Slippage/Slippage.styles.d.ts +613 -0
  130. package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -0
  131. package/dist/components/Slippage/SlippageTooltipContent.d.ts +3 -0
  132. package/dist/components/Slippage/SlippageTooltipContent.d.ts.map +1 -0
  133. package/dist/components/Slippage/index.d.ts +2 -0
  134. package/dist/components/Slippage/index.d.ts.map +1 -0
  135. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts +4 -0
  136. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -0
  137. package/dist/components/SwapDetails/SwapDetails.d.ts +4 -0
  138. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -0
  139. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +8 -0
  140. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
  141. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +919 -0
  142. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -0
  143. package/dist/components/SwapDetails/SwapDetails.types.d.ts +12 -0
  144. package/dist/components/SwapDetails/SwapDetails.types.d.ts.map +1 -0
  145. package/dist/components/SwapDetails/index.d.ts +2 -0
  146. package/dist/components/SwapDetails/index.d.ts.map +1 -0
  147. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts +4 -0
  148. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -0
  149. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts +4 -0
  150. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -0
  151. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts +4 -0
  152. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -0
  153. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +154 -0
  154. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -0
  155. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +20 -0
  156. package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -0
  157. package/dist/components/SwapDetailsAlerts/index.d.ts +3 -0
  158. package/dist/components/SwapDetailsAlerts/index.d.ts.map +1 -0
  159. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts +4 -0
  160. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -0
  161. package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts +4 -0
  162. package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -0
  163. package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts +4 -0
  164. package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -0
  165. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts +4 -0
  166. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -0
  167. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts +4 -0
  168. package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -0
  169. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +4 -0
  170. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -0
  171. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +154 -0
  172. package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
  173. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +46 -0
  174. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -0
  175. package/dist/components/SwapDetailsModal/index.d.ts +4 -0
  176. package/dist/components/SwapDetailsModal/index.d.ts.map +1 -0
  177. package/dist/components/SwapsGroup/SwapsGroup.d.ts +4 -0
  178. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -0
  179. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +613 -0
  180. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -0
  181. package/dist/components/SwapsGroup/SwapsGroup.types.d.ts +12 -0
  182. package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +1 -0
  183. package/dist/components/SwapsGroup/index.d.ts +2 -0
  184. package/dist/components/SwapsGroup/index.d.ts.map +1 -0
  185. package/dist/components/SwitchFromAndTo.d.ts +1 -1
  186. package/dist/components/SwitchFromAndTo.d.ts.map +1 -1
  187. package/dist/components/TokenList/LoadingTokenList.d.ts +4 -0
  188. package/dist/components/TokenList/LoadingTokenList.d.ts.map +1 -0
  189. package/dist/components/TokenList/TokenList.d.ts +4 -0
  190. package/dist/components/TokenList/TokenList.d.ts.map +1 -0
  191. package/dist/components/TokenList/TokenList.helpers.d.ts +3 -0
  192. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -0
  193. package/dist/components/TokenList/TokenList.styles.d.ts +1532 -0
  194. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
  195. package/dist/components/TokenList/TokenList.types.d.ts +41 -0
  196. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -0
  197. package/dist/components/TokenList/index.d.ts +3 -0
  198. package/dist/components/TokenList/index.d.ts.map +1 -0
  199. package/dist/components/UpdateUrl.d.ts.map +1 -1
  200. package/dist/components/WalletModal/WalletModal.d.ts +4 -0
  201. package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
  202. package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
  203. package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
  204. package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
  205. package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
  206. package/dist/components/WalletModal/WalletModalContent.styles.d.ts +613 -0
  207. package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -0
  208. package/dist/components/WalletModal/index.d.ts +2 -0
  209. package/dist/components/WalletModal/index.d.ts.map +1 -0
  210. package/dist/components/WidgetEvents.d.ts.map +1 -1
  211. package/dist/constants/errors.d.ts +29 -0
  212. package/dist/constants/errors.d.ts.map +1 -1
  213. package/dist/constants/messages.d.ts +7 -0
  214. package/dist/constants/messages.d.ts.map +1 -0
  215. package/dist/constants/navigationRoutes.d.ts +8 -4
  216. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  217. package/dist/constants/routing.d.ts +13 -0
  218. package/dist/constants/routing.d.ts.map +1 -0
  219. package/dist/constants/searchParams.d.ts +2 -2
  220. package/dist/constants/searchParams.d.ts.map +1 -1
  221. package/dist/constants/swapSettings.d.ts.map +1 -1
  222. package/dist/constants/wallets.d.ts +3 -0
  223. package/dist/constants/wallets.d.ts.map +1 -0
  224. package/dist/constants/warnings.d.ts +3 -0
  225. package/dist/constants/warnings.d.ts.map +1 -0
  226. package/dist/globalStyles.d.ts +1 -1
  227. package/dist/globalStyles.d.ts.map +1 -1
  228. package/dist/hooks/useConfirmSwap.d.ts +14 -6
  229. package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
  230. package/dist/hooks/useFetchBestRoute.d.ts +9 -0
  231. package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
  232. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  233. package/dist/hooks/useSwapInput.d.ts +12 -0
  234. package/dist/hooks/useSwapInput.d.ts.map +1 -0
  235. package/dist/hooks/useTheme.d.ts +3 -29
  236. package/dist/hooks/useTheme.d.ts.map +1 -1
  237. package/dist/hooks/useWalletList.d.ts +20 -0
  238. package/dist/hooks/useWalletList.d.ts.map +1 -0
  239. package/dist/index.js +1 -1
  240. package/dist/index.js.map +4 -4
  241. package/dist/pages/ConfirmSwapPage.d.ts +6 -3
  242. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  243. package/dist/pages/HistoryPage.d.ts.map +1 -1
  244. package/dist/pages/Home.d.ts.map +1 -1
  245. package/dist/pages/LanguagePage.d.ts +3 -0
  246. package/dist/pages/LanguagePage.d.ts.map +1 -0
  247. package/dist/pages/LiquiditySourcePage.d.ts +8 -0
  248. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -0
  249. package/dist/pages/SelectBlockchainPage.d.ts +8 -0
  250. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -0
  251. package/dist/pages/SelectSwapItemsPage.d.ts +11 -0
  252. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -0
  253. package/dist/pages/SettingsPage.d.ts.map +1 -1
  254. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  255. package/dist/pages/ThemePage.d.ts +3 -0
  256. package/dist/pages/ThemePage.d.ts.map +1 -0
  257. package/dist/pages/WalletsPage.d.ts +4 -2
  258. package/dist/pages/WalletsPage.d.ts.map +1 -1
  259. package/dist/store/bestRoute.d.ts +32 -19
  260. package/dist/store/bestRoute.d.ts.map +1 -1
  261. package/dist/store/meta.d.ts +10 -3
  262. package/dist/store/meta.d.ts.map +1 -1
  263. package/dist/store/notification.d.ts +38 -0
  264. package/dist/store/notification.d.ts.map +1 -0
  265. package/dist/store/settings.d.ts +2 -2
  266. package/dist/store/settings.d.ts.map +1 -1
  267. package/dist/store/ui.d.ts +0 -2
  268. package/dist/store/ui.d.ts.map +1 -1
  269. package/dist/store/wallets.d.ts +14 -12
  270. package/dist/store/wallets.d.ts.map +1 -1
  271. package/dist/types/config.d.ts +11 -6
  272. package/dist/types/config.d.ts.map +1 -1
  273. package/dist/types/notification.d.ts +22 -0
  274. package/dist/types/notification.d.ts.map +1 -0
  275. package/dist/types/routing.d.ts +30 -23
  276. package/dist/types/routing.d.ts.map +1 -1
  277. package/dist/types/swap.d.ts +8 -1
  278. package/dist/types/swap.d.ts.map +1 -1
  279. package/dist/utils/common.d.ts +6 -0
  280. package/dist/utils/common.d.ts.map +1 -1
  281. package/dist/utils/configs.d.ts +2 -0
  282. package/dist/utils/configs.d.ts.map +1 -1
  283. package/dist/utils/date.d.ts +1 -1
  284. package/dist/utils/date.d.ts.map +1 -1
  285. package/dist/utils/meta.d.ts +3 -0
  286. package/dist/utils/meta.d.ts.map +1 -0
  287. package/dist/utils/numbers.d.ts +5 -2
  288. package/dist/utils/numbers.d.ts.map +1 -1
  289. package/dist/utils/routing.d.ts +10 -7
  290. package/dist/utils/routing.d.ts.map +1 -1
  291. package/dist/utils/settings.d.ts +10 -0
  292. package/dist/utils/settings.d.ts.map +1 -0
  293. package/dist/utils/swap.d.ts +29 -14
  294. package/dist/utils/swap.d.ts.map +1 -1
  295. package/dist/utils/time.d.ts +2 -2
  296. package/dist/utils/time.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 +92 -28
  302. package/src/components/AppRouter.tsx +35 -6
  303. package/src/components/AppRoutes.tsx +54 -19
  304. package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
  305. package/src/components/BlockchainList/BlockchainList.styles.ts +19 -0
  306. package/src/components/BlockchainList/BlockchainList.tsx +73 -0
  307. package/src/components/BlockchainList/BlockchainList.types.ts +8 -0
  308. package/src/components/BlockchainList/LoadingBlockchainList.tsx +20 -0
  309. package/src/components/BlockchainList/index.ts +1 -0
  310. package/src/components/BlockchainsSection/BlockchainSection.helpers.ts +20 -0
  311. package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
  312. package/src/components/BlockchainsSection/BlockchainsSection.tsx +105 -0
  313. package/src/components/BlockchainsSection/BlockchainsSection.types.ts +9 -0
  314. package/src/components/BlockchainsSection/index.ts +1 -0
  315. package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +86 -0
  316. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +210 -0
  317. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +494 -0
  318. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +11 -0
  319. package/src/components/ConfirmWalletsModal/WalletList.styles.ts +34 -0
  320. package/src/components/ConfirmWalletsModal/WalletList.tsx +294 -0
  321. package/src/components/ConfirmWalletsModal/WalletList.type.ts +12 -0
  322. package/src/components/HeaderButtons/BackButton.tsx +16 -0
  323. package/src/components/HeaderButtons/CancelButton.tsx +21 -0
  324. package/src/components/HeaderButtons/HeaderButtons.styles.ts +40 -0
  325. package/src/components/HeaderButtons/HeaderButtons.types.ts +12 -0
  326. package/src/components/HeaderButtons/HomeButtons.tsx +81 -0
  327. package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +20 -0
  328. package/src/components/HeaderButtons/WalletButton.tsx +23 -0
  329. package/src/components/HeaderButtons/index.ts +4 -0
  330. package/src/components/Layout/Layout.styles.ts +53 -0
  331. package/src/components/Layout/Layout.tsx +74 -0
  332. package/src/components/Layout/Layout.types.ts +20 -0
  333. package/src/components/Layout/index.ts +1 -0
  334. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +5 -0
  335. package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +23 -0
  336. package/src/components/LoadingLiquiditySourceList/index.ts +1 -0
  337. package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
  338. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +78 -0
  339. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +53 -0
  340. package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
  341. package/src/components/LoadingSwapDetails/index.ts +1 -0
  342. package/src/components/NoRoutes/NoRoutes.helper.ts +52 -0
  343. package/src/components/NoRoutes/NoRoutes.styles.ts +15 -0
  344. package/src/components/NoRoutes/NoRoutes.tsx +81 -0
  345. package/src/components/NoRoutes/NoRoutes.types.ts +21 -0
  346. package/src/components/NoRoutes/index.ts +1 -0
  347. package/src/components/NotificationContent/NotificationContent.styles.ts +34 -0
  348. package/src/components/NotificationContent/NotificationContent.tsx +108 -0
  349. package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
  350. package/src/components/NotificationContent/index.ts +1 -0
  351. package/src/components/RouteErrors/RouteErrors.styles.ts +28 -0
  352. package/src/components/RouteErrors/RouteErrors.tsx +79 -0
  353. package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
  354. package/src/components/RouteErrors/RouteErrorsModal.tsx +129 -0
  355. package/src/components/RouteErrors/RouteErrorsModalItem.tsx +24 -0
  356. package/src/components/RouteErrors/index.ts +1 -0
  357. package/src/components/SearchInput/SearchInput.styles.ts +9 -0
  358. package/src/components/SearchInput/SearchInput.tsx +51 -0
  359. package/src/components/SearchInput/SearchInput.types.ts +10 -0
  360. package/src/components/SearchInput/index.ts +1 -0
  361. package/src/components/SettingsContainer/SettingsContainer.style.ts +27 -0
  362. package/src/components/SettingsContainer/index.ts +6 -0
  363. package/src/components/Slippage/Slippage.styles.ts +24 -0
  364. package/src/components/Slippage/Slippage.tsx +94 -0
  365. package/src/components/Slippage/SlippageTooltipContent.tsx +23 -0
  366. package/src/components/Slippage/index.ts +1 -0
  367. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +79 -0
  368. package/src/components/SwapDetails/SwapDetails.helpers.tsx +85 -0
  369. package/src/components/SwapDetails/SwapDetails.styles.ts +72 -0
  370. package/src/components/SwapDetails/SwapDetails.tsx +428 -0
  371. package/src/components/SwapDetails/SwapDetails.types.ts +12 -0
  372. package/src/components/SwapDetails/index.ts +1 -0
  373. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +36 -0
  374. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +55 -0
  375. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +7 -0
  376. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +74 -0
  377. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +28 -0
  378. package/src/components/SwapDetailsAlerts/index.ts +2 -0
  379. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +101 -0
  380. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +34 -0
  381. package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +34 -0
  382. package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +34 -0
  383. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +22 -0
  384. package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +6 -0
  385. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +45 -0
  386. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +54 -0
  387. package/src/components/SwapDetailsModal/index.ts +3 -0
  388. package/src/components/SwapsGroup/SwapsGroup.styles.ts +26 -0
  389. package/src/components/SwapsGroup/SwapsGroup.tsx +126 -0
  390. package/src/components/SwapsGroup/SwapsGroup.types.ts +13 -0
  391. package/src/components/SwapsGroup/index.ts +1 -0
  392. package/src/components/SwitchFromAndTo.tsx +23 -41
  393. package/src/components/TokenList/LoadingTokenList.tsx +34 -0
  394. package/src/components/TokenList/TokenList.helpers.ts +13 -0
  395. package/src/components/TokenList/TokenList.styles.ts +121 -0
  396. package/src/components/TokenList/TokenList.tsx +271 -0
  397. package/src/components/TokenList/TokenList.types.ts +48 -0
  398. package/src/components/TokenList/index.ts +2 -0
  399. package/src/components/UpdateUrl.tsx +40 -22
  400. package/src/components/WalletModal/WalletModal.tsx +20 -0
  401. package/src/components/WalletModal/WalletModal.types.ts +11 -0
  402. package/src/components/WalletModal/WalletModalContent.styles.ts +44 -0
  403. package/src/components/WalletModal/WalletModalContent.tsx +54 -0
  404. package/src/components/WalletModal/index.ts +1 -0
  405. package/src/components/WidgetEvents.tsx +37 -5
  406. package/src/constants/errors.ts +56 -1
  407. package/src/constants/messages.ts +8 -0
  408. package/src/constants/navigationRoutes.ts +8 -4
  409. package/src/constants/routing.ts +17 -0
  410. package/src/constants/searchParams.ts +2 -2
  411. package/src/constants/swapSettings.ts +5 -1
  412. package/src/constants/wallets.ts +3 -0
  413. package/src/constants/warnings.ts +26 -0
  414. package/src/globalStyles.ts +1 -4
  415. package/src/hooks/useConfirmSwap.ts +251 -220
  416. package/src/hooks/useFetchBestRoute.ts +38 -0
  417. package/src/hooks/useNavigateBack.ts +25 -9
  418. package/src/hooks/useSwapInput.ts +116 -0
  419. package/src/hooks/useTheme.ts +35 -74
  420. package/src/hooks/useWalletList.ts +125 -0
  421. package/src/pages/ConfirmSwapPage.tsx +499 -228
  422. package/src/pages/HistoryPage.tsx +104 -15
  423. package/src/pages/Home.tsx +405 -110
  424. package/src/pages/LanguagePage.tsx +83 -0
  425. package/src/pages/LiquiditySourcePage.tsx +159 -0
  426. package/src/pages/SelectBlockchainPage.tsx +81 -0
  427. package/src/pages/SelectSwapItemsPage.tsx +169 -0
  428. package/src/pages/SettingsPage.tsx +165 -72
  429. package/src/pages/SwapDetailsPage.tsx +40 -141
  430. package/src/pages/ThemePage.tsx +96 -0
  431. package/src/pages/WalletsPage.tsx +79 -124
  432. package/src/store/bestRoute.ts +85 -180
  433. package/src/store/meta.ts +23 -3
  434. package/src/store/notification.ts +77 -0
  435. package/src/store/settings.ts +20 -13
  436. package/src/store/ui.ts +1 -5
  437. package/src/store/wallets.ts +92 -76
  438. package/src/types/config.ts +12 -7
  439. package/src/types/notification.ts +33 -0
  440. package/src/types/routing.ts +29 -28
  441. package/src/types/swap.ts +9 -1
  442. package/src/utils/common.ts +56 -3
  443. package/src/utils/configs.ts +3 -0
  444. package/src/utils/date.ts +15 -18
  445. package/src/utils/meta.ts +9 -0
  446. package/src/utils/numbers.ts +66 -20
  447. package/src/utils/routing.ts +105 -27
  448. package/src/utils/settings.ts +57 -0
  449. package/src/utils/swap.ts +244 -117
  450. package/src/utils/time.ts +69 -36
  451. package/src/utils/wallets.ts +165 -116
  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
@@ -1,21 +1,22 @@
1
- import { SelectableWallet } from '@rango-dev/ui';
2
- import { WalletType } from '@rango-dev/wallets-shared';
1
+ import type { Wallet } from '../types';
2
+ import type { WalletType } from '@rango-dev/wallets-shared';
3
+
3
4
  import { create } from 'zustand';
4
5
  import { subscribeWithSelector } from 'zustand/middleware';
5
6
  import { shallow } from 'zustand/shallow';
7
+
6
8
  import { httpService } from '../services/httpService';
7
9
  import {
8
- getRequiredChains,
9
10
  getTokensWithBalance,
10
11
  isAccountAndWalletMatched,
11
12
  makeBalanceFor,
12
13
  resetConnectedWalletState,
13
14
  sortTokens,
14
15
  } from '../utils/wallets';
16
+
15
17
  import { useBestRouteStore } from './bestRoute';
16
18
  import { useMetaStore } from './meta';
17
19
  import createSelectors from './selectors';
18
- import { Wallet } from '../types';
19
20
 
20
21
  export type TokenBalance = {
21
22
  chain: string;
@@ -31,100 +32,107 @@ export type TokenBalance = {
31
32
 
32
33
  export interface ConnectedWallet extends Wallet {
33
34
  balances: TokenBalance[] | null;
35
+ explorerUrl: string | null;
36
+ selected: boolean;
34
37
  loading: boolean;
35
38
  error: boolean;
36
- explorerUrl: string | null;
37
39
  }
38
40
 
39
41
  interface WalletsStore {
40
42
  connectedWallets: ConnectedWallet[];
41
- selectedWallets: Wallet[];
42
43
  customDestination: string;
44
+ loading: boolean;
43
45
  connectWallet: (accounts: Wallet[]) => void;
44
46
  disconnectWallet: (walletType: WalletType) => void;
45
- initSelectedWallets: () => void;
46
- setSelectedWallet: (wallet: SelectableWallet) => void;
47
+ selectWallets: (wallets: { walletType: string; chain: string }[]) => void;
47
48
  clearConnectedWallet: () => void;
48
49
  getWalletsDetails: (accounts: Wallet[], shouldRetry?: boolean) => void;
49
- setCustomDestination: (customDestination: string) => void;
50
50
  }
51
51
 
52
52
  export const useWalletsStore = createSelectors(
53
53
  create<WalletsStore>()(
54
54
  subscribeWithSelector((set, get) => ({
55
55
  connectedWallets: [],
56
- selectedWallets: [],
57
56
  customDestination: '',
57
+ loading: false,
58
58
  connectWallet: (accounts) => {
59
59
  const getWalletsDetails = get().getWalletsDetails;
60
60
  set((state) => ({
61
+ loading: true,
61
62
  connectedWallets: state.connectedWallets
62
63
  .filter((wallet) => wallet.walletType !== accounts[0].walletType)
63
64
  .concat(
64
- accounts.map((account) => ({
65
- balances: [],
66
- address: account.address,
67
- chain: account.chain,
68
- loading: true,
69
- walletType: account.walletType,
70
- error: false,
71
- explorerUrl: null,
72
- }))
65
+ accounts.map((account) => {
66
+ const shouldMarkWalletAsSelected = !state.connectedWallets.find(
67
+ (connectedWallet) =>
68
+ connectedWallet.chain === account.chain &&
69
+ connectedWallet.selected
70
+ );
71
+ return {
72
+ balances: [],
73
+ address: account.address,
74
+ chain: account.chain,
75
+ explorerUrl: null,
76
+ walletType: account.walletType,
77
+ selected: shouldMarkWalletAsSelected,
78
+ loading: true,
79
+ error: false,
80
+ };
81
+ })
73
82
  ),
74
83
  }));
75
84
  getWalletsDetails(accounts);
76
85
  },
77
86
  disconnectWallet: (walletType) => {
78
- set((state) => ({
79
- connectedWallets: state.connectedWallets.filter(
80
- (balance) => balance.walletType !== walletType
81
- ),
82
- selectedWallets: state.selectedWallets.filter(
83
- (wallet) => wallet.walletType != walletType
84
- ),
85
- }));
86
- },
87
- initSelectedWallets: () =>
88
87
  set((state) => {
89
- const requiredChains = getRequiredChains(
90
- useBestRouteStore.getState().bestRoute
91
- );
92
- const connectedWallets = state.connectedWallets;
93
- const selectedWallets: Wallet[] = [];
94
- requiredChains.forEach((chain) => {
95
- const anyWalletSelected = !!state.selectedWallets.find(
96
- (wallet) => wallet.chain === chain
97
- );
98
-
99
- if (!anyWalletSelected) {
100
- const firstWalletWithMatchedChain = connectedWallets.find(
101
- (wallet) => wallet.chain === chain
102
- );
103
- if (!!firstWalletWithMatchedChain)
104
- selectedWallets.push({
105
- address: firstWalletWithMatchedChain.address,
106
- chain: firstWalletWithMatchedChain.chain,
107
- walletType: firstWalletWithMatchedChain.walletType,
108
- });
109
- }
110
- });
88
+ const selectedWallets = state.connectedWallets
89
+ .filter(
90
+ (connectedWallet) =>
91
+ connectedWallet.selected &&
92
+ connectedWallet.walletType !== walletType
93
+ )
94
+ .map((selectedWallet) => selectedWallet.chain);
111
95
  return {
112
- selectedWallets: state.selectedWallets.concat(selectedWallets),
96
+ connectedWallets: state.connectedWallets
97
+ .filter(
98
+ (connectedWallet) => connectedWallet.walletType !== walletType
99
+ )
100
+ .map((connectedWallet) => {
101
+ const anyWalletSelectedForBlockchain = selectedWallets.includes(
102
+ connectedWallet.chain
103
+ );
104
+ if (anyWalletSelectedForBlockchain) {
105
+ return connectedWallet;
106
+ }
107
+ selectedWallets.push(connectedWallet.chain);
108
+ return { ...connectedWallet, selected: true };
109
+ }),
113
110
  };
114
- }),
115
- setSelectedWallet: (wallet) =>
111
+ });
112
+ },
113
+ selectWallets: (wallets) =>
116
114
  set((state) => ({
117
- selectedWallets: state.selectedWallets
118
- .filter((selectedWallet) => selectedWallet.chain !== wallet.chain)
119
- .concat({
120
- chain: wallet.chain,
121
- address: wallet.address,
122
- walletType: wallet.walletType,
123
- }),
124
- })),
125
- setCustomDestination: (customDestination) =>
126
- set(() => ({
127
- customDestination,
115
+ connectedWallets: state.connectedWallets.map((connectedWallet) => {
116
+ const walletSelected = !!wallets.find(
117
+ (wallet) =>
118
+ wallet.chain === connectedWallet.chain &&
119
+ wallet.walletType !== connectedWallet.walletType &&
120
+ connectedWallet.selected
121
+ );
122
+ const walletNotSelected = !!wallets.find(
123
+ (wallet) =>
124
+ wallet.chain === connectedWallet.chain &&
125
+ wallet.walletType === connectedWallet.walletType &&
126
+ !connectedWallet.selected
127
+ );
128
+ if (walletSelected) {
129
+ return { ...connectedWallet, selected: false };
130
+ } else if (walletNotSelected) {
131
+ return { ...connectedWallet, selected: true };
132
+ }
133
+
134
+ return connectedWallet;
135
+ }),
128
136
  })),
129
137
  clearConnectedWallet: () =>
130
138
  set(() => ({
@@ -135,6 +143,7 @@ export const useWalletsStore = createSelectors(
135
143
  const getWalletsDetails = get().getWalletsDetails;
136
144
  const { tokens } = useMetaStore.getState().meta;
137
145
  set((state) => ({
146
+ loading: true,
138
147
  connectedWallets: state.connectedWallets.map((wallet) => {
139
148
  return accounts.find((account) =>
140
149
  isAccountAndWalletMatched(account, wallet)
@@ -149,39 +158,46 @@ export const useWalletsStore = createSelectors(
149
158
  blockchain: chain,
150
159
  }));
151
160
  const response = await httpService().getWalletsDetails(data);
152
- const retrivedBalance = response.wallets;
153
- if (retrivedBalance) {
161
+ const retrievedBalance = response.wallets;
162
+ if (retrievedBalance) {
154
163
  set((state) => ({
164
+ loading: false,
155
165
  connectedWallets: state.connectedWallets.map(
156
166
  (connectedWallet) => {
157
167
  const matchedAccount = accounts.find((account) =>
158
168
  isAccountAndWalletMatched(account, connectedWallet)
159
169
  );
160
- const retrivedBalanceAccount = retrivedBalance.find(
170
+ const retrievedBalanceAccount = retrievedBalance.find(
161
171
  (balance) =>
162
172
  balance.address === connectedWallet.address &&
163
173
  balance.blockChain === connectedWallet.chain
164
174
  );
165
175
  if (
166
- retrivedBalanceAccount?.failed &&
176
+ retrievedBalanceAccount?.failed &&
167
177
  matchedAccount &&
168
178
  shouldRetry
169
179
  ) {
170
180
  getWalletsDetails([matchedAccount], false);
171
181
  }
172
- return matchedAccount && retrivedBalanceAccount
173
- ? makeBalanceFor(
174
- matchedAccount,
175
- retrivedBalanceAccount,
176
- tokens
177
- )
182
+ return matchedAccount && retrievedBalanceAccount
183
+ ? {
184
+ ...connectedWallet,
185
+ explorerUrl: retrievedBalanceAccount.explorerUrl,
186
+ balances: makeBalanceFor(
187
+ retrievedBalanceAccount,
188
+ tokens
189
+ ),
190
+ }
178
191
  : connectedWallet;
179
192
  }
180
193
  ),
181
194
  }));
182
- } else throw new Error('Wallet not found');
195
+ } else {
196
+ throw new Error('Wallet not found');
197
+ }
183
198
  } catch (error) {
184
199
  set((state) => ({
200
+ loading: false,
185
201
  connectedWallets: state.connectedWallets.map((balance) => {
186
202
  return accounts.find((account) =>
187
203
  isAccountAndWalletMatched(account, balance)
@@ -1,7 +1,7 @@
1
- import { Asset } from 'rango-sdk';
2
- import { WalletType } from '@rango-dev/wallets-shared';
3
- import { ProviderInterface } from '@rango-dev/wallets-react';
4
- import { Language } from '@rango-dev/ui';
1
+ import type { Language } from '@rango-dev/ui';
2
+ import type { ProviderInterface } from '@rango-dev/wallets-react';
3
+ import type { WalletType } from '@rango-dev/wallets-shared';
4
+ import type { Asset } from 'rango-sdk';
5
5
 
6
6
  /**
7
7
  * The above type defines a set of optional color properties for a widget.
@@ -13,7 +13,7 @@ import { Language } from '@rango-dev/ui';
13
13
  * @property {string} warning
14
14
  * @property {string} surface
15
15
  * @property {string} neutral
16
-
16
+ *
17
17
  */
18
18
  export type WidgetColors = {
19
19
  background?: string;
@@ -38,6 +38,8 @@ export type WidgetColors = {
38
38
  * border color
39
39
  * @property {number} borderRadius - `borderRadius` is a property of the `WidgetTheme` type that
40
40
  * specifies the radius of the corners of a widget.
41
+ * @property {number} secondaryBorderRadius - `secondaryBorderRadius` is a property of the `WidgetTheme` type that
42
+ * specifies the radius of the buttons of a widget.
41
43
  * @property {number} width - The `width` property is a number that represents the width of the widget.
42
44
  * @property {number} height - The `height` property is a number that specifies the height of the widget.
43
45
  * @property {boolean} singleTheme - The `singleTheme` property is a boolean that specifies the theme is support dark and light or only light.
@@ -47,6 +49,7 @@ export type WidgetTheme = {
47
49
  fontFamily?: string;
48
50
  colors?: { light: WidgetColors; dark: WidgetColors };
49
51
  borderRadius?: number;
52
+ secondaryBorderRadius?: number;
50
53
  width?: number;
51
54
  height?: number;
52
55
  singleTheme?: boolean;
@@ -93,7 +96,7 @@ export type BlockchainAndTokenConfig = {
93
96
  * and theme.
94
97
  *
95
98
  * @property {string} apiKey - The API key used to communicate with Rango API
96
- * @property {WidgeAffiliate} affiliate - If you want to charge users fee per transaction, you should
99
+ * @property {WidgeAffiliate} affiliate - If you want to charge users fee per transaction, you should
97
100
  * pass `WidgetAffiliate` including affiliateRef, affiliatePercent, and affiliateWallets.
98
101
  * @property {number} amount - The default input amount.
99
102
  * @property {BlockchainAndTokenConfig} from - The `from` property is an optional property of type
@@ -121,7 +124,8 @@ export type BlockchainAndTokenConfig = {
121
124
  * that defines the various properties of the theme, such as colors, fonts, and others.
122
125
  * @property {boolean} externalWallets
123
126
  * If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
124
-
127
+ * @property {Asset} pinnedTokens - The `pinnedTokens` property is an optional array of `Asset` objects that
128
+ * you could use to pin tokens of your choice to the top of the token list.
125
129
  */
126
130
  export type WidgetConfig = {
127
131
  apiKey: string;
@@ -137,4 +141,5 @@ export type WidgetConfig = {
137
141
  language?: Language;
138
142
  theme?: WidgetTheme;
139
143
  externalWallets?: boolean;
144
+ pinnedTokens?: Asset[];
140
145
  };
@@ -0,0 +1,33 @@
1
+ import {
2
+ type Route,
3
+ type RouteEvent,
4
+ type Step,
5
+ type StepEvent,
6
+ StepExecutionBlockedEventStatus,
7
+ } from '@rango-dev/queue-manager-rango-preset';
8
+
9
+ type NotificationRoute = {
10
+ from: {
11
+ blockchain: Step['fromBlockchain'];
12
+ tokenSymbol: Step['fromSymbol'];
13
+ tokenAddress: Step['fromSymbolAddress'];
14
+ };
15
+ to: {
16
+ blockchain: Step['toBlockchain'];
17
+ tokenSymbol: Step['toSymbol'];
18
+ tokenAddress: Step['toSymbolAddress'];
19
+ };
20
+ };
21
+
22
+ export type Notification = Pick<Route, 'requestId'> & {
23
+ event: RouteEvent | StepEvent;
24
+ creationTime: number;
25
+ read: boolean;
26
+ route: NotificationRoute;
27
+ };
28
+
29
+ export const validBlockedStatuses: StepExecutionBlockedEventStatus[] = [
30
+ StepExecutionBlockedEventStatus.WAITING_FOR_CHANGE_WALLET_ACCOUNT,
31
+ StepExecutionBlockedEventStatus.WAITING_FOR_NETWORK_CHANGE,
32
+ StepExecutionBlockedEventStatus.WAITING_FOR_WALLET_CONNECT,
33
+ ];
@@ -1,9 +1,10 @@
1
- import { RouteState } from '../store/bestRoute';
2
- import { SettingsState } from '../store/settings';
1
+ /* eslint-disable @typescript-eslint/prefer-enum-initializers */
2
+ import type { RouteState } from '../store/bestRoute';
3
+ import type { SettingsState } from '../store/settings';
3
4
 
4
5
  interface BestRouteStoreParams {
5
- fromChain?: RouteState['fromChain'];
6
- toChain?: RouteState['toChain'];
6
+ fromBlockchain?: RouteState['fromBlockchain'];
7
+ toBlockchain?: RouteState['toBlockchain'];
7
8
  fromToken?: RouteState['fromToken'];
8
9
  toToken?: RouteState['toToken'];
9
10
  inputAmount?: RouteState['inputAmount'];
@@ -32,45 +33,45 @@ export enum ConfirmSwapErrorTypes {
32
33
  NO_ROUTE,
33
34
  ROUTE_UPDATED_WITH_HIGH_VALUE_LOSS,
34
35
  REQUEST_FAILED,
35
- INSUFFICIENT_SLIPPAGE,
36
- INSUFFICIENT_BALANCE,
36
+ REQUEST_CANCELED,
37
37
  }
38
38
 
39
39
  export type ConfirmSwapError =
40
40
  | {
41
- type: ConfirmSwapErrorTypes.REQUEST_FAILED;
42
- status?: number;
43
- }
44
- | {
45
- type: ConfirmSwapErrorTypes.INSUFFICIENT_SLIPPAGE;
46
- minRequiredSlippage: string | null;
41
+ type: ConfirmSwapErrorTypes.NO_ROUTE;
42
+ diagnosisMessage?: string;
47
43
  }
48
- | { type: ConfirmSwapErrorTypes.INSUFFICIENT_BALANCE; messages: string[] }
49
44
  | {
50
- type: Exclude<
51
- ConfirmSwapErrorTypes,
52
- | ConfirmSwapErrorTypes.REQUEST_FAILED
53
- | ConfirmSwapErrorTypes.INSUFFICIENT_SLIPPAGE
54
- | ConfirmSwapErrorTypes.INSUFFICIENT_BALANCE
55
- >;
45
+ type: Exclude<ConfirmSwapErrorTypes, ConfirmSwapErrorTypes.NO_ROUTE>;
56
46
  };
57
47
 
58
- export type ConfirmSwapWarnings =
48
+ export enum RouteWarningType {
49
+ ROUTE_UPDATED,
50
+ ROUTE_SWAPPERS_UPDATED,
51
+ ROUTE_COINS_UPDATED,
52
+ ROUTE_AND_OUTPUT_AMOUNT_UPDATED,
53
+ }
54
+
55
+ export type RouteWarning =
59
56
  | {
60
- type: ConfirmSwapWarningTypes.ROUTE_AND_OUTPUT_AMOUNT_UPDATED;
57
+ type: RouteWarningType.ROUTE_AND_OUTPUT_AMOUNT_UPDATED;
61
58
  newOutputAmount: string;
62
59
  percentageChange: string;
63
60
  }
64
61
  | {
65
62
  type: Exclude<
66
- ConfirmSwapWarningTypes,
67
- ConfirmSwapWarningTypes.ROUTE_AND_OUTPUT_AMOUNT_UPDATED
63
+ RouteWarningType,
64
+ RouteWarningType.ROUTE_AND_OUTPUT_AMOUNT_UPDATED
68
65
  >;
69
66
  };
70
67
 
71
- export enum ConfirmSwapWarningTypes {
72
- ROUTE_UPDATED,
73
- ROUTE_SWAPPERS_UPDATED,
74
- ROUTE_COINS_UPDATED,
75
- ROUTE_AND_OUTPUT_AMOUNT_UPDATED,
68
+ export enum SlippageWarningType {
69
+ INSUFFICIENT_SLIPPAGE,
70
+ HIGH_SLIPPAGE,
76
71
  }
72
+
73
+ export type ConfirmSwapWarnings = {
74
+ route: RouteWarning | null;
75
+ balance: { messages: string[] } | null;
76
+ slippage: { type: SlippageWarningType; slippage: string | null } | null;
77
+ };
package/src/types/swap.ts CHANGED
@@ -1,15 +1,23 @@
1
- import { SwapSavedSettings } from 'rango-types/lib';
1
+ import type { SwapSavedSettings } from 'rango-types/lib';
2
2
 
3
3
  export type PendingSwapSettings = Omit<
4
4
  SwapSavedSettings,
5
5
  'disabledSwappersIds'
6
6
  >;
7
7
 
8
+ export enum ButtonState {
9
+ WAITFORCONNECTING = 'waitForConnecting',
10
+ SWAP = 'swap',
11
+ NEEDTOCONFIRM = 'needToConfirm',
12
+ WARNING = 'warning',
13
+ }
14
+
8
15
  export type SwapButtonState = (
9
16
  | { disabled: true }
10
17
  | { disabled: false; hasWarning?: boolean }
11
18
  ) & {
12
19
  title: string;
20
+ state: ButtonState;
13
21
  };
14
22
 
15
23
  export type ConvertedToken = {
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @typescript-eslint/no-magic-numbers */
1
2
  export function removeDuplicateFrom<T>(array: T[]): T[] {
2
3
  return Array.from(new Set(array));
3
4
  }
@@ -10,9 +11,7 @@ export function areEqual(
10
11
  array1.length === array2.length && array1.every((v, i) => v === array2[i])
11
12
  );
12
13
  }
13
-
14
-
15
-
14
+ // eslint-disable-next-line @typescript-eslint/ban-types
16
15
  export function debounce(fn: Function, time: number) {
17
16
  let timeoutId: ReturnType<typeof setTimeout> | null;
18
17
  return wrapper;
@@ -27,4 +26,58 @@ export function debounce(fn: Function, time: number) {
27
26
  }
28
27
  }
29
28
 
29
+ export function containsText(text: string, searchText: string): boolean {
30
+ // eslint-disable-next-line @typescript-eslint/no-magic-numbers
31
+ return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
32
+ }
33
+
34
+ export const colorShade = (col: string, amt: number) => {
35
+ col = col.replace(/^#/, '');
36
+ if (col.length === 3) {
37
+ col = col[0] + col[0] + col[1] + col[1] + col[2] + col[2];
38
+ }
39
+ let [r, g, b]: any = col.match(/.{2}/g);
40
+ [r, g, b] = [
41
+ parseInt(r, 16) + amt,
42
+ parseInt(g, 16) + amt,
43
+ parseInt(b, 16) + amt,
44
+ ];
45
+
46
+ r = Math.max(Math.min(255, r), 0).toString(16);
47
+ g = Math.max(Math.min(255, g), 0).toString(16);
48
+ b = Math.max(Math.min(255, b), 0).toString(16);
49
+
50
+ const rr = (r.length < 2 ? '0' : '') + r;
51
+ const gg = (g.length < 2 ? '0' : '') + g;
52
+ const bb = (b.length < 2 ? '0' : '') + b;
53
+
54
+ return `#${rr}${gg}${bb}`;
55
+ };
56
+
57
+ export const generateRangeColors = (name: string, color: string) => {
58
+ let colors = { [name]: color };
59
+ for (let i = 1; i < 10; i++) {
60
+ if (i < 5) {
61
+ colors = {
62
+ ...colors,
63
+ [name + i * 100]: colorShade(color, (5 - i) * 32),
64
+ };
65
+ }
66
+ if (i === 5) {
67
+ colors = {
68
+ ...colors,
69
+ [name + i * 100]: color,
70
+ };
71
+ }
72
+ if (i > 5) {
73
+ colors = {
74
+ ...colors,
75
+ [name + i * 100]: colorShade(color, -((i - 5) * 32)),
76
+ };
77
+ }
78
+ }
79
+ return colors;
80
+ };
30
81
 
82
+ export const getContainer = () =>
83
+ document.getElementById('swap-box') as HTMLElement;
@@ -28,3 +28,6 @@ export function initConfig(nextConfigs: Configs) {
28
28
  configs = clonedConfigs;
29
29
  return configs;
30
30
  }
31
+
32
+ export const DEFAULT_PRIMARY_RADIUS = 20;
33
+ export const DEFAULT_SECONDARY_RADIUS = 25;
package/src/utils/date.ts CHANGED
@@ -1,8 +1,9 @@
1
- import { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
1
+ import type { GroupBy } from '../components/SwapsGroup/SwapsGroup.types';
2
+ import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
3
+
2
4
  import dayjs from 'dayjs';
3
- import { GroupBy } from '@rango-dev/ui';
4
5
 
5
- export const groupSwapsByDate: GroupBy = swaps => {
6
+ export const groupSwapsByDate: GroupBy = (swaps) => {
6
7
  const output: Map<
7
8
  string,
8
9
  {
@@ -17,24 +18,17 @@ export const groupSwapsByDate: GroupBy = swaps => {
17
18
  swaps: [],
18
19
  },
19
20
  ],
20
- [
21
- 'week',
22
- {
23
- title: 'This week',
24
- swaps: [],
25
- },
26
- ],
27
21
  [
28
22
  'month',
29
23
  {
30
- title: 'This month',
24
+ title: 'Last month',
31
25
  swaps: [],
32
26
  },
33
27
  ],
34
28
  [
35
29
  'year',
36
30
  {
37
- title: 'This year',
31
+ title: 'Last year',
38
32
  swaps: [],
39
33
  },
40
34
  ],
@@ -48,14 +42,17 @@ export const groupSwapsByDate: GroupBy = swaps => {
48
42
  ]);
49
43
 
50
44
  const now = dayjs();
51
- swaps.forEach(swap => {
45
+ swaps.forEach((swap) => {
52
46
  const swapDate = dayjs(Number(swap.creationTime));
53
- if (now.isSame(swapDate, 'day')) output.get('today')?.swaps.push(swap);
54
- else if (now.isSame(swapDate, 'week')) output.get('week')?.swaps.push(swap);
55
- else if (now.isSame(swapDate, 'month'))
47
+ if (now.isSame(swapDate, 'day')) {
48
+ output.get('today')?.swaps.push(swap);
49
+ } else if (now.isSame(swapDate, 'month')) {
56
50
  output.get('month')?.swaps.push(swap);
57
- else if (now.isSame(swapDate, 'year')) output.get('year')?.swaps.push(swap);
58
- else output.get('history')?.swaps.push(swap);
51
+ } else if (now.isSame(swapDate, 'year')) {
52
+ output.get('year')?.swaps.push(swap);
53
+ } else {
54
+ output.get('history')?.swaps.push(swap);
55
+ }
59
56
  });
60
57
 
61
58
  return Array.from(output.values());
@@ -0,0 +1,9 @@
1
+ import type { BlockchainMeta } from 'rango-sdk';
2
+
3
+ export function getBlockchainDisplayNameFor(
4
+ blockchainName: string,
5
+ blockchains: BlockchainMeta[]
6
+ ): string | undefined {
7
+ return blockchains.find((blockchain) => blockchain.name === blockchainName)
8
+ ?.displayName;
9
+ }