@rango-dev/widget-embedded 0.17.1-next.8 → 0.18.0

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 (361) hide show
  1. package/CHANGELOG.md +116 -0
  2. package/dist/QueueManager.d.ts +3 -1
  3. package/dist/QueueManager.d.ts.map +1 -1
  4. package/dist/components/AppRouter.d.ts.map +1 -1
  5. package/dist/components/AppRoutes.d.ts.map +1 -1
  6. package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -1
  7. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +1 -1
  8. package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
  9. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +690 -61
  10. package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
  11. package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
  12. package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
  13. package/dist/components/Layout/Layout.d.ts.map +1 -1
  14. package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
  15. package/dist/components/Layout/Layout.types.d.ts +2 -2
  16. package/dist/components/Layout/Layout.types.d.ts.map +1 -1
  17. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
  18. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
  19. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
  20. package/dist/components/NoResult/NoResult.d.ts.map +1 -1
  21. package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
  22. package/dist/components/Quote/Quote.d.ts.map +1 -1
  23. package/dist/components/Quote/Quote.styles.d.ts +793 -5
  24. package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
  25. package/dist/components/Quote/Quote.types.d.ts +0 -1
  26. package/dist/components/Quote/Quote.types.d.ts.map +1 -1
  27. package/dist/components/Quote/QuoteSummary.styles.d.ts +157 -0
  28. package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
  29. package/dist/components/Quote/index.d.ts +0 -1
  30. package/dist/components/Quote/index.d.ts.map +1 -1
  31. package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts.map +1 -0
  32. package/dist/components/{Quote → QuoteSkeleton}/QuoteSkeleton.styles.d.ts +314 -0
  33. package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -0
  34. package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts.map +1 -0
  35. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts +4 -0
  36. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +1 -0
  37. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +1571 -0
  38. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -0
  39. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts +6 -0
  40. package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts.map +1 -0
  41. package/dist/components/QuoteSkeleton/StepSkeleton.d.ts +4 -0
  42. package/dist/components/QuoteSkeleton/StepSkeleton.d.ts.map +1 -0
  43. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +786 -0
  44. package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -0
  45. package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts +4 -0
  46. package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts.map +1 -0
  47. package/dist/components/QuoteSkeleton/index.d.ts +4 -0
  48. package/dist/components/QuoteSkeleton/index.d.ts.map +1 -0
  49. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
  50. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
  51. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
  52. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
  53. package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
  54. package/dist/components/Slippage/Slippage.d.ts.map +1 -1
  55. package/dist/components/Slippage/Slippage.styles.d.ts +158 -0
  56. package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
  57. package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
  58. package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
  59. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
  60. package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
  61. package/dist/components/SwapDetails/SwapDetails.styles.d.ts +628 -0
  62. package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
  63. package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
  64. package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
  65. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
  66. package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
  67. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
  68. package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
  69. package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
  70. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +157 -0
  71. package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
  72. package/dist/components/TokenList/TokenList.d.ts.map +1 -1
  73. package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
  74. package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
  75. package/dist/components/TokenList/TokenList.styles.d.ts +1100 -1
  76. package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
  77. package/dist/components/TokenList/TokenList.types.d.ts +4 -9
  78. package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
  79. package/dist/components/TokenList/index.d.ts +0 -1
  80. package/dist/components/TokenList/index.d.ts.map +1 -1
  81. package/dist/components/UpdateUrl.d.ts.map +1 -1
  82. package/dist/constants/errors.d.ts.map +1 -1
  83. package/dist/constants/index.d.ts +1 -0
  84. package/dist/constants/index.d.ts.map +1 -1
  85. package/dist/constants/navigationRoutes.d.ts +1 -2
  86. package/dist/constants/navigationRoutes.d.ts.map +1 -1
  87. package/dist/constants/searchParams.d.ts +2 -1
  88. package/dist/constants/searchParams.d.ts.map +1 -1
  89. package/dist/containers/App/App.d.ts +3 -0
  90. package/dist/containers/App/App.d.ts.map +1 -0
  91. package/dist/containers/App/App.styles.d.ts +158 -0
  92. package/dist/containers/App/App.styles.d.ts.map +1 -0
  93. package/dist/containers/App/index.d.ts +2 -0
  94. package/dist/containers/App/index.d.ts.map +1 -0
  95. package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
  96. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
  97. package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
  98. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
  99. package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
  100. package/dist/containers/Wallets/Wallets.d.ts +6 -0
  101. package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
  102. package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
  103. package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
  104. package/dist/containers/Wallets/index.d.ts +2 -0
  105. package/dist/containers/Wallets/index.d.ts.map +1 -0
  106. package/dist/containers/Widget/Widget.d.ts +5 -0
  107. package/dist/containers/Widget/Widget.d.ts.map +1 -0
  108. package/dist/containers/Widget/Widget.types.d.ts +5 -0
  109. package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
  110. package/dist/containers/Widget/index.d.ts +3 -0
  111. package/dist/containers/Widget/index.d.ts.map +1 -0
  112. package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
  113. package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
  114. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
  115. package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
  116. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
  117. package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
  118. package/dist/containers/WidgetInfo/index.d.ts +2 -0
  119. package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
  120. package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
  121. package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
  122. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
  123. package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
  124. package/dist/containers/WidgetProvider/index.d.ts +2 -0
  125. package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
  126. package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
  127. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
  128. package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
  129. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
  130. package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
  131. package/dist/hooks/useForceAutoConnect.d.ts +2 -0
  132. package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
  133. package/dist/hooks/useLanguage.d.ts +1 -1
  134. package/dist/hooks/useLanguage.d.ts.map +1 -1
  135. package/dist/hooks/useNavigateBack.d.ts +1 -3
  136. package/dist/hooks/useNavigateBack.d.ts.map +1 -1
  137. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
  138. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
  139. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
  140. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
  141. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
  142. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
  143. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
  144. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
  145. package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
  146. package/dist/hooks/useSwapInput.d.ts.map +1 -1
  147. package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
  148. package/dist/hooks/useTheme.d.ts +1 -1
  149. package/dist/hooks/useTheme.d.ts.map +1 -1
  150. package/dist/index.d.ts +20 -8
  151. package/dist/index.d.ts.map +1 -1
  152. package/dist/index.js +1 -1
  153. package/dist/index.js.map +4 -4
  154. package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
  155. package/dist/pages/HistoryPage.d.ts.map +1 -1
  156. package/dist/pages/Home.d.ts.map +1 -1
  157. package/dist/pages/LanguagePage.d.ts.map +1 -1
  158. package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
  159. package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
  160. package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
  161. package/dist/pages/SettingsPage.d.ts.map +1 -1
  162. package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
  163. package/dist/pages/ThemePage.d.ts.map +1 -1
  164. package/dist/pages/WalletsPage.d.ts.map +1 -1
  165. package/dist/store/AppStore.d.ts +37 -1
  166. package/dist/store/AppStore.d.ts.map +1 -1
  167. package/dist/store/app.d.ts +39 -2
  168. package/dist/store/app.d.ts.map +1 -1
  169. package/dist/store/notification.d.ts +4 -3
  170. package/dist/store/notification.d.ts.map +1 -1
  171. package/dist/store/quote.d.ts +9 -9
  172. package/dist/store/quote.d.ts.map +1 -1
  173. package/dist/store/slices/config.d.ts.map +1 -1
  174. package/dist/store/slices/data.d.ts +2 -2
  175. package/dist/store/slices/data.d.ts.map +1 -1
  176. package/dist/store/slices/settings.d.ts +39 -0
  177. package/dist/store/slices/settings.d.ts.map +1 -0
  178. package/dist/store/ui.d.ts +2 -1
  179. package/dist/store/ui.d.ts.map +1 -1
  180. package/dist/store/wallets.d.ts +9 -5
  181. package/dist/store/wallets.d.ts.map +1 -1
  182. package/dist/types/config.d.ts +36 -3
  183. package/dist/types/config.d.ts.map +1 -1
  184. package/dist/types/swap.d.ts +4 -14
  185. package/dist/types/swap.d.ts.map +1 -1
  186. package/dist/types/wallets.d.ts +15 -1
  187. package/dist/types/wallets.d.ts.map +1 -1
  188. package/dist/utils/colors.d.ts.map +1 -1
  189. package/dist/utils/configs.d.ts +1 -0
  190. package/dist/utils/configs.d.ts.map +1 -1
  191. package/dist/utils/meta.d.ts +2 -1
  192. package/dist/utils/meta.d.ts.map +1 -1
  193. package/dist/utils/providers.d.ts +2 -2
  194. package/dist/utils/providers.d.ts.map +1 -1
  195. package/dist/utils/queue.d.ts +2 -2
  196. package/dist/utils/queue.d.ts.map +1 -1
  197. package/dist/utils/quote.d.ts +1 -1
  198. package/dist/utils/quote.d.ts.map +1 -1
  199. package/dist/utils/settings.d.ts +4 -1
  200. package/dist/utils/settings.d.ts.map +1 -1
  201. package/dist/utils/swap.d.ts +13 -5
  202. package/dist/utils/swap.d.ts.map +1 -1
  203. package/dist/utils/time.d.ts +1 -1
  204. package/dist/utils/time.d.ts.map +1 -1
  205. package/dist/utils/wallets.d.ts +7 -8
  206. package/dist/utils/wallets.d.ts.map +1 -1
  207. package/package.json +12 -10
  208. package/src/QueueManager.tsx +4 -3
  209. package/src/components/AppRouter.tsx +5 -27
  210. package/src/components/AppRoutes.tsx +54 -33
  211. package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
  212. package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +1 -1
  213. package/src/components/BlockchainsSection/BlockchainsSection.tsx +19 -10
  214. package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +29 -10
  215. package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +15 -7
  216. package/src/components/ConfirmWalletsModal/WalletList.tsx +3 -3
  217. package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
  218. package/src/components/Layout/Layout.styles.ts +2 -0
  219. package/src/components/Layout/Layout.tsx +20 -7
  220. package/src/components/Layout/Layout.types.ts +2 -2
  221. package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +65 -61
  222. package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +28 -34
  223. package/src/components/NoResult/NoResult.helpers.ts +12 -12
  224. package/src/components/NoResult/NoResult.tsx +2 -5
  225. package/src/components/NotificationContent/NotificationContent.tsx +2 -1
  226. package/src/components/Quote/Quote.styles.ts +49 -12
  227. package/src/components/Quote/Quote.tsx +107 -38
  228. package/src/components/Quote/Quote.types.ts +0 -1
  229. package/src/components/Quote/QuoteSummary.styles.ts +9 -8
  230. package/src/components/Quote/QuoteSummary.tsx +2 -2
  231. package/src/components/Quote/index.ts +0 -1
  232. package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +42 -0
  233. package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +30 -0
  234. package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +57 -0
  235. package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +76 -0
  236. package/src/components/QuoteSkeleton/QuoteSummarySkeleton.types.ts +6 -0
  237. package/src/components/QuoteSkeleton/StepSkeleton.styles.ts +33 -0
  238. package/src/components/QuoteSkeleton/StepSkeleton.tsx +44 -0
  239. package/src/components/QuoteSkeleton/StepSkeleton.types.ts +1 -0
  240. package/src/components/QuoteSkeleton/index.ts +3 -0
  241. package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
  242. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
  243. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
  244. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
  245. package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
  246. package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
  247. package/src/components/Slippage/Slippage.styles.ts +15 -5
  248. package/src/components/Slippage/Slippage.tsx +11 -10
  249. package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -8
  250. package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
  251. package/src/components/SwapDetails/SwapDetails.styles.ts +36 -33
  252. package/src/components/SwapDetails/SwapDetails.tsx +28 -39
  253. package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
  254. package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
  255. package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
  256. package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +14 -8
  257. package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
  258. package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
  259. package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
  260. package/src/components/SwapsGroup/SwapsGroup.styles.ts +10 -1
  261. package/src/components/SwapsGroup/SwapsGroup.tsx +3 -5
  262. package/src/components/TokenList/TokenList.helpers.ts +2 -2
  263. package/src/components/TokenList/TokenList.styles.ts +74 -38
  264. package/src/components/TokenList/TokenList.tsx +30 -20
  265. package/src/components/TokenList/TokenList.types.ts +4 -10
  266. package/src/components/TokenList/index.ts +0 -1
  267. package/src/components/UpdateUrl.tsx +4 -5
  268. package/src/constants/errors.ts +9 -5
  269. package/src/constants/index.ts +1 -0
  270. package/src/constants/navigationRoutes.ts +7 -8
  271. package/src/constants/searchParams.ts +1 -0
  272. package/src/containers/App/App.styles.ts +18 -0
  273. package/src/containers/App/App.tsx +52 -0
  274. package/src/containers/App/index.ts +1 -0
  275. package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
  276. package/src/containers/QuoteInfo/QuoteInfo.tsx +46 -44
  277. package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
  278. package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +25 -31
  279. package/src/containers/Wallets/Wallets.types.ts +12 -0
  280. package/src/containers/Wallets/index.ts +1 -0
  281. package/src/containers/Widget/Widget.tsx +19 -0
  282. package/src/containers/Widget/Widget.types.ts +5 -0
  283. package/src/containers/Widget/index.ts +2 -0
  284. package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
  285. package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
  286. package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
  287. package/src/containers/WidgetInfo/index.ts +1 -0
  288. package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
  289. package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
  290. package/src/containers/WidgetProvider/index.ts +1 -0
  291. package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
  292. package/src/hooks/useConfirmSwap/useConfirmSwap.ts +21 -20
  293. package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
  294. package/src/hooks/useForceAutoConnect.ts +27 -0
  295. package/src/hooks/useLanguage.ts +4 -5
  296. package/src/hooks/useNavigateBack.ts +3 -52
  297. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
  298. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
  299. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
  300. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
  301. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
  302. package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
  303. package/src/hooks/useSwapInput.ts +86 -28
  304. package/src/hooks/useSyncStoresWithConfig.ts +18 -5
  305. package/src/hooks/useTheme.ts +4 -5
  306. package/src/index.ts +53 -5
  307. package/src/pages/ConfirmSwapPage.tsx +61 -33
  308. package/src/pages/HistoryPage.tsx +2 -7
  309. package/src/pages/Home.tsx +55 -81
  310. package/src/pages/LanguagePage.tsx +0 -5
  311. package/src/pages/LiquiditySourcePage.tsx +3 -7
  312. package/src/pages/SelectBlockchainPage.tsx +26 -18
  313. package/src/pages/SelectSwapItemsPage.tsx +13 -26
  314. package/src/pages/SettingsPage.tsx +26 -17
  315. package/src/pages/SwapDetailsPage.tsx +3 -4
  316. package/src/pages/ThemePage.tsx +2 -7
  317. package/src/pages/WalletsPage.tsx +5 -8
  318. package/src/services/httpService.ts +1 -1
  319. package/src/store/AppStore.tsx +7 -1
  320. package/src/store/app.ts +31 -5
  321. package/src/store/quote.ts +3 -4
  322. package/src/store/slices/config.ts +1 -0
  323. package/src/store/slices/data.ts +10 -6
  324. package/src/store/slices/settings.ts +168 -0
  325. package/src/store/wallets.ts +57 -29
  326. package/src/types/config.ts +48 -3
  327. package/src/types/swap.ts +4 -13
  328. package/src/types/wallets.ts +18 -1
  329. package/src/utils/colors.ts +2 -1
  330. package/src/utils/configs.ts +2 -1
  331. package/src/utils/date.ts +1 -1
  332. package/src/utils/meta.ts +8 -1
  333. package/src/utils/providers.ts +8 -5
  334. package/src/utils/queue.ts +2 -2
  335. package/src/utils/quote.ts +7 -7
  336. package/src/utils/settings.ts +11 -5
  337. package/src/utils/swap.ts +46 -40
  338. package/src/utils/time.ts +1 -1
  339. package/src/utils/wallets.ts +127 -144
  340. package/dist/Wallets.d.ts +0 -18
  341. package/dist/Wallets.d.ts.map +0 -1
  342. package/dist/Widget.d.ts +0 -9
  343. package/dist/Widget.d.ts.map +0 -1
  344. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +0 -4
  345. package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +0 -1
  346. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +0 -4
  347. package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +0 -1
  348. package/dist/components/Quote/QuoteSkeleton.d.ts.map +0 -1
  349. package/dist/components/Quote/QuoteSkeleton.styles.d.ts.map +0 -1
  350. package/dist/components/Quote/QuoteSkeleton.types.d.ts.map +0 -1
  351. package/dist/store/settings.d.ts +0 -82
  352. package/dist/store/settings.d.ts.map +0 -1
  353. package/src/Widget.tsx +0 -106
  354. package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +0 -41
  355. package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +0 -3
  356. package/src/components/Quote/QuoteSkeleton.styles.ts +0 -110
  357. package/src/components/Quote/QuoteSkeleton.tsx +0 -108
  358. package/src/store/settings.ts +0 -161
  359. /package/dist/components/{Quote → QuoteSkeleton}/QuoteSkeleton.d.ts +0 -0
  360. /package/dist/components/{Quote → QuoteSkeleton}/QuoteSkeleton.types.d.ts +0 -0
  361. /package/src/components/{Quote → QuoteSkeleton}/QuoteSkeleton.types.ts +0 -0
package/src/utils/swap.ts CHANGED
@@ -1,16 +1,13 @@
1
1
  /* eslint-disable @typescript-eslint/no-magic-numbers */
2
2
  import type { FetchStatus } from '../store/slices/data';
3
- import type { ConnectedWallet } from '../store/wallets';
4
3
  import type {
5
4
  ConvertedToken,
5
+ QuoteError,
6
+ QuoteWarning,
6
7
  RecommendedSlippages,
7
8
  SwapButtonState,
8
9
  Wallet,
9
10
  } from '../types';
10
- import type {
11
- PendingSwap,
12
- PendingSwapStep,
13
- } from '@rango-dev/queue-manager-rango-preset';
14
11
  import type { WalletType } from '@rango-dev/wallets-shared';
15
12
  import type {
16
13
  BestRouteRequest,
@@ -20,10 +17,11 @@ import type {
20
17
  SwapResult,
21
18
  Token,
22
19
  } from 'rango-sdk';
20
+ import type { PendingSwap, PendingSwapStep } from 'rango-types';
23
21
 
24
22
  import { i18n } from '@lingui/core';
25
- import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
26
23
  import BigNumber from 'bignumber.js';
24
+ import { PendingSwapNetworkStatus } from 'rango-types';
27
25
 
28
26
  import { isValidAddress } from '../components/ConfirmWalletsModal/ConfirmWallets.helpers';
29
27
  import { errorMessages } from '../constants/errors';
@@ -35,11 +33,11 @@ import {
35
33
  TOKEN_AMOUNT_MAX_DECIMALS,
36
34
  TOKEN_AMOUNT_MIN_DECIMALS,
37
35
  } from '../constants/routing';
38
- import { ButtonState } from '../types';
39
36
 
40
37
  import { removeDuplicateFrom } from './common';
38
+ import { getBlockchainShortNameFor } from './meta';
41
39
  import { numberToString } from './numbers';
42
- import { getRequiredBalanceOfWallet } from './quote';
40
+ import { getPriceImpact, getRequiredBalanceOfWallet } from './quote';
43
41
  import { getRequiredChains } from './wallets';
44
42
 
45
43
  export function getOutputRatio(
@@ -179,63 +177,70 @@ export function getLimitErrorMessage(quote: BestRouteResponse): {
179
177
  return { swap, fromAmountRangeError, recommendation };
180
178
  }
181
179
 
182
- export function getSwapButtonState(
183
- loadingMetaStatus: FetchStatus,
184
- connectedWallets: ConnectedWallet[],
185
- loading: boolean,
186
- quote: BestRouteResponse | null,
187
- hasLimitError: boolean,
188
- highValueLoss: boolean,
189
- priceImpactCanNotBeComputed: boolean,
190
- needsToWarnEthOnPath: boolean,
191
- inputAmount: string
192
- ): SwapButtonState {
193
- if (loadingMetaStatus !== 'success') {
180
+ export function getSwapButtonState(params: {
181
+ fetchMetaStatus: FetchStatus;
182
+ anyWalletConnected: boolean;
183
+ fetchingQuote: boolean;
184
+ inputAmount: string;
185
+ quote: BestRouteResponse | null;
186
+ warning: QuoteWarning | null;
187
+ error: QuoteError | null;
188
+ needsToWarnEthOnPath: boolean;
189
+ }): SwapButtonState {
190
+ const {
191
+ fetchMetaStatus,
192
+ anyWalletConnected,
193
+ fetchingQuote,
194
+ inputAmount,
195
+ quote,
196
+ warning,
197
+ error,
198
+ needsToWarnEthOnPath,
199
+ } = params;
200
+ if (fetchMetaStatus !== 'success') {
194
201
  return {
195
202
  title: swapButtonTitles().connectWallet,
196
- state: ButtonState.WAITFORCONNECTING,
203
+ action: 'connect-wallet',
197
204
  disabled: true,
198
205
  };
199
206
  }
200
- if (connectedWallets.length == 0) {
207
+ if (!anyWalletConnected) {
201
208
  return {
202
209
  title: swapButtonTitles().connectWallet,
203
- state: ButtonState.WAITFORCONNECTING,
210
+ action: 'connect-wallet',
204
211
  disabled: false,
205
212
  };
206
213
  }
207
214
  if (
208
- loading ||
215
+ fetchingQuote ||
209
216
  !quote ||
210
217
  !quote.result ||
211
- hasLimitError ||
218
+ error ||
212
219
  !inputAmount ||
213
220
  inputAmount === '0'
214
221
  ) {
215
222
  return {
216
223
  title: swapButtonTitles().swap,
224
+ action: 'confirm-swap',
217
225
  disabled: true,
218
- state: ButtonState.SWAP,
219
226
  };
220
- } else if (highValueLoss || priceImpactCanNotBeComputed) {
227
+ } else if (warning) {
221
228
  return {
222
229
  title: swapButtonTitles().swapAnyway,
230
+ action: 'confirm-warning',
223
231
  disabled: false,
224
- hasWarning: true,
225
- state: ButtonState.NEEDTOCONFIRM,
226
232
  };
227
233
  } else if (needsToWarnEthOnPath) {
228
234
  return {
229
235
  title: swapButtonTitles().ethWarning,
236
+ action: 'confirm-warning',
230
237
  disabled: false,
231
- hasWarning: true,
232
- state: ButtonState.WARNING,
233
238
  };
234
239
  }
235
240
  return {
236
241
  title: swapButtonTitles().swap,
242
+ action: 'confirm-swap',
237
243
  disabled: false,
238
- state: ButtonState.SWAP,
239
244
  };
240
245
  }
241
246
 
@@ -359,7 +364,7 @@ export function checkSlippageWarnings(
359
364
  quote.result?.swaps.forEach((swap, index) => {
360
365
  if (
361
366
  swap.recommendedSlippage?.slippage &&
362
- parseInt(swap.recommendedSlippage?.slippage) > userSlippage
367
+ parseFloat(swap.recommendedSlippage.slippage) > userSlippage
363
368
  ) {
364
369
  recommendedSlippages.set(index, swap.recommendedSlippage.slippage);
365
370
  }
@@ -590,10 +595,7 @@ export function isOutputAmountChangedALot(
590
595
  if (!oldOutputAmount || !newOutputAmount) {
591
596
  return false;
592
597
  }
593
- const percentageChange = getPercentageChange(
594
- oldOutputAmount,
595
- newOutputAmount
596
- );
598
+ const percentageChange = getPriceImpact(oldOutputAmount, newOutputAmount);
597
599
  if (!percentageChange) {
598
600
  return true;
599
601
  }
@@ -601,9 +603,10 @@ export function isOutputAmountChangedALot(
601
603
  return percentageChange <= -1;
602
604
  }
603
605
 
604
- export function getBalanceWarnings(
606
+ export function generateBalanceWarnings(
605
607
  quote: BestRouteResponse,
606
- selectedWallets: Wallet[]
608
+ selectedWallets: Wallet[],
609
+ blockchains: BlockchainMeta[]
607
610
  ) {
608
611
  const fee = quote.validationStatus;
609
612
  const requiredWallets = getRequiredChains(quote);
@@ -648,7 +651,10 @@ export function getBalanceWarnings(
648
651
  symbol,
649
652
  reason,
650
653
  currentAmount,
651
- blockchain: asset.asset.blockchain,
654
+ blockchain: getBlockchainShortNameFor(
655
+ asset.asset.blockchain,
656
+ blockchains
657
+ ),
652
658
  },
653
659
  });
654
660
  return warningMessage;
package/src/utils/time.ts CHANGED
@@ -1,4 +1,4 @@
1
- import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
1
+ import type { PendingSwap } from 'rango-types';
2
2
 
3
3
  import { i18n } from '@lingui/core';
4
4
 
@@ -1,8 +1,8 @@
1
- import type { TokenWithBalance } from '../components/TokenList';
2
1
  import type { ConnectedWallet, TokenBalance } from '../store/wallets';
3
- import type { Wallet } from '../types';
2
+ import type { Balance, TokenHash, TokensBalance, Wallet } from '../types';
4
3
  import type { WalletInfo as ModalWalletInfo } from '@rango-dev/ui';
5
4
  import type {
5
+ Asset,
6
6
  Network,
7
7
  WalletInfo,
8
8
  WalletState,
@@ -29,6 +29,12 @@ import BigNumber from 'bignumber.js';
29
29
  import { isCosmosBlockchain } from 'rango-types';
30
30
 
31
31
  import { ZERO } from '../constants/numbers';
32
+ import {
33
+ BALANCE_MAX_DECIMALS,
34
+ BALANCE_MIN_DECIMALS,
35
+ USD_VALUE_MAX_DECIMALS,
36
+ USD_VALUE_MIN_DECIMALS,
37
+ } from '../constants/routing';
32
38
  import { EXCLUDED_WALLETS } from '../constants/wallets';
33
39
 
34
40
  import { numberToString } from './numbers';
@@ -218,43 +224,6 @@ export function getRequiredChains(quote: BestRouteResponse | null) {
218
224
 
219
225
  type Blockchain = { name: string; accounts: ConnectedWallet[] };
220
226
 
221
- export function getBalanceFromWallet(
222
- connectedWallets: ConnectedWallet[],
223
- chain: string,
224
- symbol: string,
225
- address: string | null
226
- ): TokenBalance | null {
227
- if (connectedWallets.length === 0) {
228
- return null;
229
- }
230
-
231
- const selectedChainWallets = connectedWallets.filter(
232
- (wallet) => wallet.chain === chain
233
- );
234
- if (selectedChainWallets.length === 0) {
235
- return null;
236
- }
237
-
238
- return (
239
- selectedChainWallets
240
- .map(
241
- (wallet) =>
242
- wallet.balances?.find(
243
- (balance) =>
244
- (address !== null && balance.address === address) ||
245
- (address === null &&
246
- balance.address === address &&
247
- balance.symbol === symbol)
248
- ) || null
249
- )
250
- .filter((balance) => balance !== null)
251
- .sort(
252
- (a, b) => parseFloat(b?.amount || '0') - parseFloat(a?.amount || '1')
253
- )
254
- .find(() => true) || null
255
- );
256
- }
257
-
258
227
  export function isAccountAndWalletMatched(
259
228
  account: Wallet,
260
229
  connectedWallet: ConnectedWallet
@@ -348,30 +317,6 @@ function numberWithThousandSeparator(number: string | number): string {
348
317
  return parts.join('.');
349
318
  }
350
319
 
351
- export const sortTokens = (tokens: TokenWithBalance[]): TokenWithBalance[] => {
352
- const walletConnected = !!tokens.some((token) => token.balance);
353
- if (!walletConnected) {
354
- return tokens
355
- .filter((token) => !token.address)
356
- .concat(
357
- tokens.filter((token) => token.address && !token.isSecondaryCoin),
358
- tokens.filter((token) => token.isSecondaryCoin)
359
- );
360
- }
361
-
362
- return tokens
363
- .filter((token) => !!token.balance)
364
- .sort(
365
- (tokenA, tokenB) =>
366
- parseFloat(tokenB.balance?.usdValue || '0') -
367
- parseFloat(tokenA.balance?.usdValue || '0')
368
- )
369
- .concat(
370
- tokens.filter((token) => !token.balance && !token.isSecondaryCoin),
371
- tokens.filter((token) => !token.balance && token.isSecondaryCoin)
372
- );
373
- };
374
-
375
320
  export const getUsdPrice = (
376
321
  blockchain: string,
377
322
  symbol: string,
@@ -415,98 +360,87 @@ export const getKeplrCompatibleConnectedWallets = (
415
360
  );
416
361
  };
417
362
 
418
- export function getTokensWithBalance(
419
- tokens: TokenWithBalance[],
420
- connectedWallets: ConnectedWallet[]
421
- ): TokenWithBalance[] {
422
- return tokens.map(({ balance, ...otherProps }) => {
423
- const tokenAmount = numberToString(
424
- new BigNumber(
425
- getBalanceFromWallet(
426
- connectedWallets,
427
- otherProps.blockchain,
428
- otherProps.symbol,
429
- otherProps.address
430
- )?.amount || ZERO
431
- )
432
- );
433
-
434
- let tokenUsdValue = '';
435
- if (otherProps.usdPrice) {
436
- tokenUsdValue = numberToString(
437
- new BigNumber(
438
- getBalanceFromWallet(
439
- connectedWallets,
440
- otherProps.blockchain,
441
- otherProps.symbol,
442
- otherProps.address
443
- )?.amount || ZERO
444
- ).multipliedBy(otherProps.usdPrice)
445
- );
446
- }
363
+ export function formatBalance(balance: Balance | null): Balance | null {
364
+ const formattedBalance: Balance | null = balance
365
+ ? {
366
+ ...balance,
367
+ amount: numberToString(
368
+ balance.amount,
369
+ BALANCE_MIN_DECIMALS,
370
+ BALANCE_MAX_DECIMALS
371
+ ),
372
+ usdValue: numberToString(
373
+ balance.usdValue,
374
+ USD_VALUE_MIN_DECIMALS,
375
+ USD_VALUE_MAX_DECIMALS
376
+ ),
377
+ }
378
+ : null;
447
379
 
448
- return {
449
- ...otherProps,
450
- ...(tokenAmount !== '0' && {
451
- balance: { amount: tokenAmount, usdValue: tokenUsdValue },
452
- }),
453
- };
454
- });
380
+ return formattedBalance;
455
381
  }
456
382
 
457
- export function getTokensBalanceFromWalletAndSort(
458
- tokens: TokenWithBalance[],
459
- connectedWallets: ConnectedWallet[]
460
- ) {
461
- const list =
462
- connectedWallets.length > 0
463
- ? getTokensWithBalance(tokens, connectedWallets)
464
- : tokens;
465
- list.sort((tokenA, tokenB) => {
466
- if (tokenA.balance?.usdValue && tokenB.balance?.usdValue) {
467
- return (
468
- parseFloat(tokenB.balance.usdValue) -
469
- parseFloat(tokenA.balance.usdValue)
470
- );
471
- }
472
-
473
- if (!tokenA.balance?.usdValue && tokenB.balance?.usdValue) {
474
- return 1;
475
- }
383
+ function sortTokensByBalance(
384
+ token1Balance: Balance | null,
385
+ token2Balance: Balance | null
386
+ ): number {
387
+ if (token1Balance?.usdValue && token2Balance?.usdValue) {
388
+ return (
389
+ parseFloat(token2Balance.usdValue) - parseFloat(token1Balance.usdValue)
390
+ );
391
+ }
476
392
 
477
- if (tokenA.balance?.usdValue && !tokenB.balance?.usdValue) {
478
- return -1;
479
- }
393
+ if (!token1Balance?.usdValue && token2Balance?.usdValue) {
394
+ return 1;
395
+ }
480
396
 
481
- if (!tokenA.balance?.usdValue && !tokenB.balance?.usdValue) {
482
- return (
483
- parseFloat(tokenB.balance?.amount || '0') -
484
- parseFloat(tokenA.balance?.amount || '0')
485
- );
486
- }
397
+ if (token1Balance?.usdValue && !token2Balance?.usdValue) {
398
+ return -1;
399
+ }
487
400
 
488
- return 0;
489
- });
401
+ if (!token1Balance?.usdValue && !token2Balance?.usdValue) {
402
+ return (
403
+ parseFloat(token2Balance?.amount || '0') -
404
+ parseFloat(token1Balance?.amount || '0')
405
+ );
406
+ }
490
407
 
491
- return list;
408
+ return 0;
492
409
  }
493
410
 
494
- export function getSortedTokens(
495
- chain: BlockchainMeta | null,
496
- tokens: Token[],
497
- connectedWallets: ConnectedWallet[],
498
- otherChainTokens: TokenWithBalance[]
499
- ): TokenWithBalance[] {
500
- const fromChainEqualsToToBlockchain =
501
- chain?.name === otherChainTokens[0]?.name;
502
- if (fromChainEqualsToToBlockchain) {
503
- return otherChainTokens;
411
+ function sortTokensByPinnedToken(
412
+ token1: Token,
413
+ token2: Token,
414
+ isTokenPinned: (token: Token) => boolean
415
+ ): number {
416
+ const isToken1Pinned = isTokenPinned(token1);
417
+ const isToken2Pinned = isTokenPinned(token2);
418
+
419
+ if (isToken1Pinned === isToken2Pinned) {
420
+ return 0;
504
421
  }
422
+ if (isToken1Pinned) {
423
+ return -1;
424
+ }
425
+ return 1;
426
+ }
427
+ export function sortTokens(
428
+ tokens: Token[],
429
+ getBalanceFor: (token: Token) => Balance | null,
430
+ isTokenPinned: (token: Token) => boolean
431
+ ) {
432
+ tokens.sort((token1, token2) => {
433
+ const token1Balance = getBalanceFor(token1);
434
+ const token2Balance = getBalanceFor(token2);
435
+ // Check pinned tokens
436
+ const isTokenPin = sortTokensByPinnedToken(token1, token2, isTokenPinned);
437
+
438
+ return isTokenPin !== 0
439
+ ? isTokenPin
440
+ : sortTokensByBalance(token1Balance, token2Balance);
441
+ });
505
442
 
506
- const filteredTokens = tokens.filter(
507
- (token) => token.blockchain === chain?.name
508
- );
509
- return sortTokens(getTokensWithBalance(filteredTokens, connectedWallets));
443
+ return tokens;
510
444
  }
511
445
 
512
446
  export function tokensAreEqual(
@@ -568,3 +502,52 @@ export function getAddress({
568
502
  connectedWallet.chain === chain
569
503
  )?.address;
570
504
  }
505
+
506
+ export function createTokenHash(token: Asset): TokenHash {
507
+ return `${token.blockchain}-${token.symbol}-${token.address ?? ''}`;
508
+ }
509
+
510
+ export function makeTokensBalance(connectedWallets: ConnectedWallet[]) {
511
+ return connectedWallets
512
+ .flatMap((wallet) => wallet.balances)
513
+ .reduce((balances: TokensBalance, balance) => {
514
+ const currentBalance = {
515
+ amount: balance?.amount ?? '',
516
+ decimals: balance?.decimal ?? 0,
517
+ usdValue: balance?.usdPrice
518
+ ? new BigNumber(balance?.usdPrice ?? ZERO)
519
+ .multipliedBy(balance?.amount)
520
+ .toString()
521
+ : '',
522
+ };
523
+
524
+ const tokenHash = balance
525
+ ? createTokenHash({
526
+ symbol: balance.symbol,
527
+ blockchain: balance.chain,
528
+ address: balance.address,
529
+ })
530
+ : null;
531
+
532
+ const prevBalance = tokenHash ? balances[tokenHash] : null;
533
+
534
+ const shouldUpdateBalance =
535
+ tokenHash &&
536
+ (!prevBalance ||
537
+ (prevBalance && prevBalance.amount < currentBalance.amount));
538
+
539
+ if (shouldUpdateBalance) {
540
+ balances[tokenHash] = currentBalance;
541
+ }
542
+
543
+ return balances;
544
+ }, {});
545
+ }
546
+
547
+ export const isFetchingBalance = (
548
+ connectedWallets: ConnectedWallet[],
549
+ blockchain: string
550
+ ) =>
551
+ !!connectedWallets.find(
552
+ (wallet) => wallet.chain === blockchain && wallet.loading
553
+ );
package/dist/Wallets.d.ts DELETED
@@ -1,18 +0,0 @@
1
- import type { WidgetConfig } from './types';
2
- import type { ProvidersOptions } from './utils/providers';
3
- import type { EventHandler } from '@rango-dev/wallets-react';
4
- import type { PropsWithChildren } from 'react';
5
- import React from 'react';
6
- type OnConnectHandler = (key: string) => void;
7
- interface WidgetContextInterface {
8
- onConnectWallet(handler: OnConnectHandler): void;
9
- }
10
- export declare const WidgetContext: React.Context<WidgetContextInterface>;
11
- export declare function WidgetWallets(props: PropsWithChildren<{
12
- providers: WidgetConfig['wallets'];
13
- options?: ProvidersOptions;
14
- onUpdateState?: EventHandler;
15
- config: WidgetConfig;
16
- }>): React.JSX.Element;
17
- export {};
18
- //# sourceMappingURL=Wallets.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Wallets.d.ts","sourceRoot":"","sources":["../src/Wallets.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAE7D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAI/C,OAAO,KAA2C,MAAM,OAAO,CAAC;AAUhE,KAAK,gBAAgB,GAAG,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;AAC9C,UAAU,sBAAsB;IAC9B,eAAe,CAAC,OAAO,EAAE,gBAAgB,GAAG,IAAI,CAAC;CAClD;AAED,eAAO,MAAM,aAAa,uCAIxB,CAAC;AA4FH,wBAAgB,aAAa,CAC3B,KAAK,EAAE,iBAAiB,CAAC;IACvB,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,CAAC;IACnC,OAAO,CAAC,EAAE,gBAAgB,CAAC;IAC3B,aAAa,CAAC,EAAE,YAAY,CAAC;IAC7B,MAAM,EAAE,YAAY,CAAC;CACtB,CAAC,qBAQH"}
package/dist/Widget.d.ts DELETED
@@ -1,9 +0,0 @@
1
- import type { WidgetConfig } from './types';
2
- import type { PropsWithChildren } from 'react';
3
- import React from 'react';
4
- export type WidgetProps = {
5
- config?: WidgetConfig;
6
- };
7
- export declare function Main(): React.JSX.Element;
8
- export declare function Widget(props: PropsWithChildren<WidgetProps>): React.JSX.Element;
9
- //# sourceMappingURL=Widget.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"Widget.d.ts","sourceRoot":"","sources":["../src/Widget.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,OAAO,CAAC;AAG/C,OAAO,KAAmD,MAAM,OAAO,CAAC;AAiCxE,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,CAAC,EAAE,YAAY,CAAC;CACvB,CAAC;AAEF,wBAAgB,IAAI,sBA+CnB;AAED,wBAAgB,MAAM,CAAC,KAAK,EAAE,iBAAiB,CAAC,WAAW,CAAC,qBAc3D"}
@@ -1,4 +0,0 @@
1
- import type { StepSkeletonPropsTypes } from './LoadingSwapDetails.types';
2
- import React from 'react';
3
- export declare function LoadingSwapDetailStep(props: StepSkeletonPropsTypes): React.JSX.Element;
4
- //# sourceMappingURL=LoadingSwapDetailStep.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingSwapDetailStep.d.ts","sourceRoot":"","sources":["../../../src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAGzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,sBAAsB,qBAiClE"}
@@ -1,4 +0,0 @@
1
- export interface StepSkeletonPropsTypes {
2
- extraInfo?: boolean;
3
- }
4
- //# sourceMappingURL=LoadingSwapDetails.types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LoadingSwapDetails.types.d.ts","sourceRoot":"","sources":["../../../src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,sBAAsB;IACrC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuoteSkeleton.d.ts","sourceRoot":"","sources":["../../../src/components/Quote/QuoteSkeleton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGvD,OAAO,KAAK,MAAM,OAAO,CAAC;AAmC1B,wBAAgB,aAAa,CAAC,KAAK,EAAE,SAAS,qBAqE7C"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuoteSkeleton.styles.d.ts","sourceRoot":"","sources":["../../../src/components/Quote/QuoteSkeleton.styles.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DA4FpB,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;+DAaxB,CAAC"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"QuoteSkeleton.types.d.ts","sourceRoot":"","sources":["../../../src/components/Quote/QuoteSkeleton.types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,SAAS,GAAG;IACtB,IAAI,EAAE,OAAO,GAAG,WAAW,GAAG,cAAc,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,GAAG,CAAC,EAAE,OAAO,CAAC;CACf,CAAC"}
@@ -1,82 +0,0 @@
1
- import type { SwapperMeta } from 'rango-sdk';
2
- import { type Language } from '@rango-dev/ui';
3
- export type ThemeMode = 'auto' | 'dark' | 'light';
4
- export interface SettingsState {
5
- /** Keeping a history of blockchains that user has selected (in Swap process) */
6
- preferredBlockchains: string[];
7
- slippage: number;
8
- customSlippage: number | null;
9
- infiniteApprove: boolean;
10
- disabledLiquiditySources: string[];
11
- theme: ThemeMode;
12
- language: Language;
13
- affiliateRef: string | null;
14
- affiliatePercent: number | null;
15
- affiliateWallets: {
16
- [key: string]: string;
17
- } | null;
18
- setSlippage: (slippage: number) => void;
19
- setCustomSlippage: (customSlippage: number | null) => void;
20
- toggleInfiniteApprove: () => void;
21
- toggleLiquiditySource: (name: string) => void;
22
- setTheme: (theme: ThemeMode) => void;
23
- setLanguage: (language: Language) => void;
24
- toggleAllLiquiditySources: (swappers: SwapperMeta[], shouldReset?: boolean) => void;
25
- setAffiliateRef: (affiliateRef: string | null) => void;
26
- setAffiliatePercent: (affiliatePercent: number | null) => void;
27
- setAffiliateWallets: (affiliateWallets: {
28
- [key: string]: string;
29
- } | null) => void;
30
- addPreferredBlockchain: (blockchain: string) => void;
31
- }
32
- export declare const useSettingsStore: {
33
- (): SettingsState;
34
- <U>(selector: (state: SettingsState) => U, equals?: ((a: U, b: U) => boolean) | undefined): U;
35
- } & Omit<Omit<import("zustand").StoreApi<SettingsState>, "persist"> & {
36
- persist: {
37
- setOptions: (options: Partial<import("zustand/middleware").PersistOptions<SettingsState, SettingsState>>) => void;
38
- clearStorage: () => void;
39
- rehydrate: () => void | Promise<void>;
40
- hasHydrated: () => boolean;
41
- onHydrate: (fn: (state: SettingsState) => void) => () => void;
42
- onFinishHydration: (fn: (state: SettingsState) => void) => () => void;
43
- getOptions: () => Partial<import("zustand/middleware").PersistOptions<SettingsState, SettingsState>>;
44
- };
45
- }, "subscribe"> & {
46
- subscribe: {
47
- (listener: (selectedState: SettingsState, previousSelectedState: SettingsState) => void): () => void;
48
- <U_1>(selector: (state: SettingsState) => U_1, listener: (selectedState: U_1, previousSelectedState: U_1) => void, options?: {
49
- equalityFn?: ((a: U_1, b: U_1) => boolean) | undefined;
50
- fireImmediately?: boolean | undefined;
51
- } | undefined): () => void;
52
- };
53
- } & {
54
- use: {
55
- preferredBlockchains: () => string[];
56
- slippage: () => number;
57
- customSlippage: () => number | null;
58
- infiniteApprove: () => boolean;
59
- disabledLiquiditySources: () => string[];
60
- theme: () => ThemeMode;
61
- language: () => "en" | "es" | "ja" | "fr";
62
- affiliateRef: () => string | null;
63
- affiliatePercent: () => number | null;
64
- affiliateWallets: () => {
65
- [key: string]: string;
66
- } | null;
67
- setSlippage: () => (slippage: number) => void;
68
- setCustomSlippage: () => (customSlippage: number | null) => void;
69
- toggleInfiniteApprove: () => () => void;
70
- toggleLiquiditySource: () => (name: string) => void;
71
- setTheme: () => (theme: ThemeMode) => void;
72
- setLanguage: () => (language: Language) => void;
73
- toggleAllLiquiditySources: () => (swappers: SwapperMeta[], shouldReset?: boolean) => void;
74
- setAffiliateRef: () => (affiliateRef: string | null) => void;
75
- setAffiliatePercent: () => (affiliatePercent: number | null) => void;
76
- setAffiliateWallets: () => (affiliateWallets: {
77
- [key: string]: string;
78
- } | null) => void;
79
- addPreferredBlockchain: () => (blockchain: string) => void;
80
- };
81
- };
82
- //# sourceMappingURL=settings.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/store/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAE7C,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,eAAe,CAAC;AAW9C,MAAM,MAAM,SAAS,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,CAAC;AAElD,MAAM,WAAW,aAAa;IAC5B,gFAAgF;IAChF,oBAAoB,EAAE,MAAM,EAAE,CAAC;IAC/B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAC9B,eAAe,EAAE,OAAO,CAAC;IACzB,wBAAwB,EAAE,MAAM,EAAE,CAAC;IACnC,KAAK,EAAE,SAAS,CAAC;IACjB,QAAQ,EAAE,QAAQ,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,gBAAgB,EAAE,MAAM,GAAG,IAAI,CAAC;IAChC,gBAAgB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,CAAC;IAEnD,WAAW,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IACxC,iBAAiB,EAAE,CAAC,cAAc,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC3D,qBAAqB,EAAE,MAAM,IAAI,CAAC;IAClC,qBAAqB,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAC9C,QAAQ,EAAE,CAAC,KAAK,EAAE,SAAS,KAAK,IAAI,CAAC;IACrC,WAAW,EAAE,CAAC,QAAQ,EAAE,QAAQ,KAAK,IAAI,CAAC;IAC1C,yBAAyB,EAAE,CACzB,QAAQ,EAAE,WAAW,EAAE,EACvB,WAAW,CAAC,EAAE,OAAO,KAClB,IAAI,CAAC;IACV,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IACvD,mBAAmB,EAAE,CAAC,gBAAgB,EAAE,MAAM,GAAG,IAAI,KAAK,IAAI,CAAC;IAC/D,mBAAmB,EAAE,CACnB,gBAAgB,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,GAAG,IAAI,KAC/C,IAAI,CAAC;IACV,sBAAsB,EAAE,CAAC,UAAU,EAAE,MAAM,KAAK,IAAI,CAAC;CACtD;AAED,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sCAlBH,MAAM,KAAK,IAAI;kDACH,MAAM,GAAG,IAAI,KAAK,IAAI;2CAC7B,IAAI;4CACH,MAAM,KAAK,IAAI;gCAC3B,SAAS,KAAK,IAAI;sCACZ,QAAQ,KAAK,IAAI;oDAE7B,WAAW,EAAE,gBACT,OAAO,KAClB,IAAI;8CACuB,MAAM,GAAG,IAAI,KAAK,IAAI;sDACd,MAAM,GAAG,IAAI,KAAK,IAAI;;;qBAGzD,IAAI;mDAC4B,MAAM,KAAK,IAAI;;CAqHrD,CAAC"}