@lifi/widget 1.31.1 → 1.32.1

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 (441) hide show
  1. package/App.js +4 -16
  2. package/AppDrawer.js +13 -7
  3. package/AppDrawer.style.d.ts +3 -3
  4. package/AppDrawer.style.js +1 -1
  5. package/AppProvider.js +1 -1
  6. package/AppRoutes.js +9 -0
  7. package/cjs/App.js +4 -16
  8. package/cjs/AppDrawer.js +13 -7
  9. package/cjs/AppDrawer.style.d.ts +3 -3
  10. package/cjs/AppDrawer.style.js +1 -1
  11. package/cjs/AppProvider.js +1 -1
  12. package/cjs/AppRoutes.js +9 -0
  13. package/cjs/components/ActiveSwaps/ActiveSwapItem.js +9 -7
  14. package/cjs/components/ActiveSwaps/ActiveSwaps.js +3 -3
  15. package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +5 -5
  16. package/cjs/components/AppContainer.d.ts +2 -2
  17. package/cjs/components/AppContainer.js +1 -1
  18. package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
  19. package/cjs/components/BottomSheet/BottomSheet.js +2 -2
  20. package/cjs/components/Card/Card.d.ts +2 -2
  21. package/cjs/components/Card/CardHeader.d.ts +1 -1
  22. package/cjs/components/Card/CardTitle.d.ts +1 -1
  23. package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
  24. package/cjs/components/ChainSelect/ChainSelect.js +3 -4
  25. package/cjs/components/ChainSelect/ChainSelect.style.d.ts +3 -3
  26. package/cjs/components/ContractComponent/ContractComponent.js +1 -1
  27. package/cjs/components/Dialog.js +1 -1
  28. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +13 -28
  29. package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +1 -1
  30. package/cjs/components/Header/Header.js +1 -1
  31. package/cjs/components/Header/Header.style.d.ts +4 -4
  32. package/cjs/components/Header/NavigationHeader.js +6 -2
  33. package/cjs/components/Header/WalletHeader.js +12 -22
  34. package/cjs/{pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts → components/ListItemButton.d.ts} +1 -2
  35. package/cjs/{pages/SelectWalletPage/SelectWalletPage.style.js → components/ListItemButton.js} +2 -8
  36. package/cjs/components/ListItemText.d.ts +2 -0
  37. package/cjs/{pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js → components/ListItemText.js} +1 -10
  38. package/cjs/components/NFT/NFT.js +2 -14
  39. package/cjs/components/NFT/NFT.style.d.ts +1 -1
  40. package/cjs/components/NotFound.js +2 -2
  41. package/cjs/components/PoweredBy/PoweredBy.js +2 -2
  42. package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  43. package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +5 -17
  44. package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
  45. package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  46. package/cjs/components/Select.js +1 -0
  47. package/cjs/components/SelectChainAndToken.js +4 -4
  48. package/cjs/components/SelectTokenButton/SelectTokenButton.js +2 -2
  49. package/cjs/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  50. package/cjs/components/SendToWallet/SendToWallet.js +9 -19
  51. package/cjs/components/SendToWallet/SendToWallet.style.d.ts +2 -2
  52. package/cjs/components/SendToWallet/SendToWalletButton.js +5 -5
  53. package/cjs/components/SmallAvatar.d.ts +3 -3
  54. package/cjs/components/Step/CircularProgress.d.ts +0 -1
  55. package/cjs/components/Step/CircularProgress.js +2 -2
  56. package/cjs/components/Step/CircularProgress.style.d.ts +1 -1
  57. package/cjs/components/Step/DestinationWalletAddress.js +6 -7
  58. package/cjs/components/Step/GasStepProcess.js +8 -8
  59. package/cjs/components/Step/Step.js +4 -5
  60. package/cjs/components/Step/StepList.d.ts +0 -1
  61. package/cjs/components/Step/StepList.js +8 -4
  62. package/cjs/components/Step/StepProcess.js +3 -3
  63. package/cjs/components/Step/StepProcess.style.d.ts +3 -3
  64. package/cjs/components/Step/StepTimer.js +4 -8
  65. package/cjs/components/StepActions/StepActions.js +20 -37
  66. package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
  67. package/cjs/components/StepDivider/StepDivider.style.d.ts +1 -1
  68. package/cjs/components/SwapButton/SwapButton.js +5 -14
  69. package/cjs/components/SwapInput/FormPriceHelperText.js +6 -6
  70. package/cjs/components/SwapInput/SwapInput.js +4 -16
  71. package/cjs/components/SwapInput/SwapInput.style.d.ts +2 -2
  72. package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +2 -2
  73. package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
  74. package/cjs/components/SwapInput/SwapInputEndAdornment.js +2 -3
  75. package/cjs/components/SwapRouteCard/SwapRouteCard.js +9 -25
  76. package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +3 -3
  77. package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +4 -16
  78. package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.js +2 -2
  79. package/cjs/components/SwapRouteCard/utils.js +1 -1
  80. package/cjs/components/SwapRoutes/SwapRoutes.js +4 -4
  81. package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +5 -5
  82. package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
  83. package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +3 -3
  84. package/cjs/components/TextFitter/TextFitter.js +3 -3
  85. package/cjs/components/Token/Token.js +19 -33
  86. package/cjs/components/Token/Token.style.d.ts +3 -3
  87. package/cjs/components/TokenAvatar/TokenAvatar.js +6 -7
  88. package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
  89. package/cjs/components/TokenList/TokenList.js +3 -4
  90. package/cjs/components/TokenList/TokenList.style.d.ts +3 -3
  91. package/cjs/components/TokenList/TokenList.style.js +2 -6
  92. package/cjs/components/TokenList/TokenListItem.js +9 -9
  93. package/cjs/components/TokenList/TokenNotFound.js +4 -5
  94. package/cjs/components/TokenList/VirtualizedTokenList.js +10 -11
  95. package/cjs/components/TokenList/useTokenSelect.js +2 -2
  96. package/cjs/config/env.js +1 -1
  97. package/cjs/config/sentry.js +3 -12
  98. package/cjs/config/theme.js +44 -16
  99. package/cjs/config/version.d.ts +1 -1
  100. package/cjs/config/version.js +1 -1
  101. package/cjs/hooks/useChain.js +1 -1
  102. package/cjs/hooks/useChains.js +5 -14
  103. package/cjs/hooks/useContentHeight.js +1 -2
  104. package/cjs/hooks/useFeaturedTokens.js +1 -4
  105. package/cjs/hooks/useGasSufficiency.js +28 -34
  106. package/cjs/hooks/useProcessMessage.js +7 -11
  107. package/cjs/hooks/useRouteExecution.js +16 -26
  108. package/cjs/hooks/useSwapRoutes.js +16 -26
  109. package/cjs/hooks/useToken.js +2 -2
  110. package/cjs/hooks/useTokenAddressBalance.js +1 -2
  111. package/cjs/hooks/useTokenBalance.js +24 -27
  112. package/cjs/hooks/useTokenBalances.d.ts +1 -1
  113. package/cjs/hooks/useTokenBalances.js +8 -20
  114. package/cjs/hooks/useTokenSearch.d.ts +1 -1
  115. package/cjs/hooks/useTokenSearch.js +12 -21
  116. package/cjs/hooks/useTokens.d.ts +1 -1
  117. package/cjs/hooks/useTokens.js +36 -38
  118. package/cjs/hooks/useTools.d.ts +2 -11
  119. package/cjs/hooks/useTools.js +11 -21
  120. package/cjs/i18n/en.json +8 -8
  121. package/cjs/i18n/uk.json +8 -8
  122. package/cjs/icons/LiFiFullLogo.js +1 -1
  123. package/cjs/icons/LiFiLogo.js +1 -1
  124. package/cjs/icons/LiFiToolLogo.js +1 -1
  125. package/cjs/index.d.ts +1 -0
  126. package/cjs/index.js +2 -0
  127. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +2 -2
  128. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  129. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +3 -3
  130. package/cjs/pages/MainPage/MainPage.js +1 -1
  131. package/cjs/pages/MainPage/MainPage.style.d.ts +1 -1
  132. package/cjs/pages/MainPage/MainSwapButton.js +3 -12
  133. package/cjs/pages/SelectChainPage/SelectChainPage.js +6 -14
  134. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.d.ts +4 -0
  135. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +51 -0
  136. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +20 -0
  137. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +8 -0
  138. package/cjs/pages/SelectEnabledToolsPage/index.d.ts +1 -0
  139. package/cjs/pages/SelectEnabledToolsPage/index.js +17 -0
  140. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +4 -3
  141. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  142. package/cjs/pages/SelectTokenPage/SearchTokenInput.js +4 -1
  143. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -3
  144. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  145. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +13 -19
  146. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -3
  147. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  148. package/cjs/pages/SettingsPage/EnabledToolsButton.d.ts +4 -0
  149. package/cjs/pages/SettingsPage/EnabledToolsButton.js +25 -0
  150. package/cjs/pages/{SelectChainPage/SelectChainPage.style.d.ts → SettingsPage/EnabledToolsButton.style.d.ts} +1 -1
  151. package/cjs/pages/{SelectChainPage/SelectChainPage.style.js → SettingsPage/EnabledToolsButton.style.js} +7 -10
  152. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  153. package/cjs/pages/SettingsPage/GasPriceSelect.js +1 -1
  154. package/cjs/pages/SettingsPage/LanguageSelect.js +5 -6
  155. package/cjs/pages/SettingsPage/ResetSettingsButton.d.ts +2 -0
  156. package/cjs/pages/SettingsPage/ResetSettingsButton.js +27 -0
  157. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +4 -4
  158. package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
  159. package/cjs/pages/SettingsPage/SettingsPage.js +3 -2
  160. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  161. package/cjs/pages/SettingsPage/ShowDestinationWallet.js +3 -3
  162. package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
  163. package/cjs/pages/SettingsPage/SlippageInput.js +3 -3
  164. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +14 -22
  165. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.style.d.ts +1 -1
  166. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
  167. package/cjs/pages/SwapHistoryPage/SwapHistoryItem.js +9 -7
  168. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  169. package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +21 -26
  170. package/cjs/pages/SwapPage/StartSwapButton.js +1 -1
  171. package/cjs/pages/SwapPage/StatusBottomSheet.js +21 -19
  172. package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +2 -2
  173. package/cjs/pages/SwapPage/SwapPage.js +9 -21
  174. package/cjs/pages/SwapPage/SwapPage.style.d.ts +1 -1
  175. package/cjs/pages/SwapPage/TokenValueBottomSheet.js +8 -9
  176. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +3 -3
  177. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
  178. package/cjs/providers/I18nProvider/I18nProvider.js +7 -8
  179. package/cjs/providers/SDKProvider/SDKProvider.js +15 -4
  180. package/cjs/providers/SwapFormProvider/SwapFormProvider.js +12 -6
  181. package/cjs/providers/SwapFormProvider/URLSearchParamsBuilder.js +3 -12
  182. package/cjs/providers/TelemetryProvider/TelemetryProvider.js +1 -1
  183. package/cjs/providers/ThemeProvider/ThemeProvider.js +2 -2
  184. package/cjs/providers/WalletProvider/WalletProvider.js +30 -39
  185. package/cjs/providers/WidgetProvider/WidgetProvider.js +20 -27
  186. package/cjs/providers/WidgetProvider/utils.js +2 -3
  187. package/cjs/stores/StoreProvider.js +1 -7
  188. package/cjs/stores/chains/index.d.ts +1 -2
  189. package/cjs/stores/chains/index.js +1 -2
  190. package/cjs/stores/chains/useChainOrder.js +2 -2
  191. package/cjs/stores/chains/useChainOrderStore.d.ts +3 -0
  192. package/cjs/stores/chains/{createChainOrderStore.js → useChainOrderStore.js} +3 -4
  193. package/cjs/stores/routes/RouteExecutionStore.js +2 -14
  194. package/cjs/stores/routes/createRouteExecutionStore.js +27 -16
  195. package/cjs/stores/routes/types.d.ts +1 -1
  196. package/cjs/stores/routes/useExecutingRoutesIds.js +2 -5
  197. package/cjs/stores/routes/useRecommendedRouteStore.d.ts +10 -2
  198. package/cjs/stores/routes/useRecommendedRouteStore.js +30 -2
  199. package/cjs/stores/routes/useSwapHistory.js +3 -6
  200. package/cjs/stores/routes/utils.js +4 -4
  201. package/cjs/stores/settings/index.d.ts +1 -1
  202. package/cjs/stores/settings/index.js +1 -1
  203. package/cjs/stores/settings/types.d.ts +6 -6
  204. package/cjs/stores/settings/useAppearance.js +2 -2
  205. package/cjs/stores/settings/useSettings.js +2 -2
  206. package/cjs/stores/settings/useSettingsStore.d.ts +6 -0
  207. package/cjs/stores/settings/{createSettingsStore.js → useSettingsStore.js} +48 -28
  208. package/cjs/utils/colors.js +1 -1
  209. package/cjs/utils/format.js +3 -3
  210. package/cjs/utils/navigationRoutes.d.ts +2 -0
  211. package/cjs/utils/navigationRoutes.js +6 -0
  212. package/components/ActiveSwaps/ActiveSwapItem.js +9 -7
  213. package/components/ActiveSwaps/ActiveSwaps.js +3 -3
  214. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +5 -5
  215. package/components/AppContainer.d.ts +2 -2
  216. package/components/AppContainer.js +1 -1
  217. package/components/BottomSheet/BottomSheet.d.ts +1 -1
  218. package/components/BottomSheet/BottomSheet.js +2 -2
  219. package/components/Card/Card.d.ts +2 -2
  220. package/components/Card/CardHeader.d.ts +1 -1
  221. package/components/Card/CardTitle.d.ts +1 -1
  222. package/components/ChainSelect/ChainSelect.d.ts +0 -1
  223. package/components/ChainSelect/ChainSelect.js +3 -4
  224. package/components/ChainSelect/ChainSelect.style.d.ts +3 -3
  225. package/components/ContractComponent/ContractComponent.js +1 -1
  226. package/components/Dialog.js +1 -1
  227. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +13 -28
  228. package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +1 -1
  229. package/components/Header/Header.js +1 -1
  230. package/components/Header/Header.style.d.ts +4 -4
  231. package/components/Header/NavigationHeader.js +6 -2
  232. package/components/Header/WalletHeader.js +12 -22
  233. package/{pages/SelectChainPage/SelectChainPage.style.d.ts → components/ListItemButton.d.ts} +1 -2
  234. package/components/ListItemButton.js +11 -0
  235. package/components/ListItemText.d.ts +2 -0
  236. package/components/ListItemText.js +8 -0
  237. package/components/NFT/NFT.js +2 -14
  238. package/components/NFT/NFT.style.d.ts +1 -1
  239. package/components/NotFound.js +2 -2
  240. package/components/PoweredBy/PoweredBy.js +2 -2
  241. package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  242. package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +5 -17
  243. package/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
  244. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +2 -2
  245. package/components/Select.js +1 -0
  246. package/components/SelectChainAndToken.js +4 -4
  247. package/components/SelectTokenButton/SelectTokenButton.js +2 -2
  248. package/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  249. package/components/SendToWallet/SendToWallet.js +9 -19
  250. package/components/SendToWallet/SendToWallet.style.d.ts +2 -2
  251. package/components/SendToWallet/SendToWalletButton.js +5 -5
  252. package/components/SmallAvatar.d.ts +3 -3
  253. package/components/Step/CircularProgress.d.ts +0 -1
  254. package/components/Step/CircularProgress.js +2 -2
  255. package/components/Step/CircularProgress.style.d.ts +1 -1
  256. package/components/Step/DestinationWalletAddress.js +6 -7
  257. package/components/Step/GasStepProcess.js +8 -8
  258. package/components/Step/Step.js +4 -5
  259. package/components/Step/StepList.d.ts +0 -1
  260. package/components/Step/StepList.js +8 -4
  261. package/components/Step/StepProcess.js +3 -3
  262. package/components/Step/StepProcess.style.d.ts +3 -3
  263. package/components/Step/StepTimer.js +4 -8
  264. package/components/StepActions/StepActions.js +20 -37
  265. package/components/StepActions/StepActions.style.d.ts +1 -1
  266. package/components/StepDivider/StepDivider.style.d.ts +1 -1
  267. package/components/SwapButton/SwapButton.js +5 -14
  268. package/components/SwapInput/FormPriceHelperText.js +6 -6
  269. package/components/SwapInput/SwapInput.js +4 -16
  270. package/components/SwapInput/SwapInput.style.d.ts +2 -2
  271. package/components/SwapInput/SwapInputAdornment.style.d.ts +2 -2
  272. package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
  273. package/components/SwapInput/SwapInputEndAdornment.js +2 -3
  274. package/components/SwapRouteCard/SwapRouteCard.js +9 -25
  275. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +3 -3
  276. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +4 -16
  277. package/components/SwapRouteCard/SwapRouteNotFoundCard.js +2 -2
  278. package/components/SwapRouteCard/utils.js +1 -1
  279. package/components/SwapRoutes/SwapRoutes.js +4 -4
  280. package/components/SwapRoutes/SwapRoutes.style.d.ts +5 -5
  281. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
  282. package/components/SwapRoutes/SwapRoutesExpanded.js +3 -3
  283. package/components/TextFitter/TextFitter.js +3 -3
  284. package/components/Token/Token.js +19 -33
  285. package/components/Token/Token.style.d.ts +3 -3
  286. package/components/TokenAvatar/TokenAvatar.js +6 -7
  287. package/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
  288. package/components/TokenList/TokenList.js +3 -4
  289. package/components/TokenList/TokenList.style.d.ts +3 -3
  290. package/components/TokenList/TokenList.style.js +3 -7
  291. package/components/TokenList/TokenListItem.js +9 -9
  292. package/components/TokenList/TokenNotFound.js +4 -5
  293. package/components/TokenList/VirtualizedTokenList.js +10 -11
  294. package/components/TokenList/useTokenSelect.js +2 -2
  295. package/config/env.js +1 -1
  296. package/config/sentry.js +3 -12
  297. package/config/theme.js +44 -16
  298. package/config/version.d.ts +1 -1
  299. package/config/version.js +1 -1
  300. package/hooks/useChain.js +1 -1
  301. package/hooks/useChains.js +5 -14
  302. package/hooks/useContentHeight.js +1 -2
  303. package/hooks/useFeaturedTokens.js +1 -4
  304. package/hooks/useGasSufficiency.js +28 -34
  305. package/hooks/useProcessMessage.js +7 -11
  306. package/hooks/useRouteExecution.js +16 -26
  307. package/hooks/useSwapRoutes.js +16 -26
  308. package/hooks/useToken.js +2 -2
  309. package/hooks/useTokenAddressBalance.js +1 -2
  310. package/hooks/useTokenBalance.js +24 -27
  311. package/hooks/useTokenBalances.d.ts +1 -1
  312. package/hooks/useTokenBalances.js +8 -20
  313. package/hooks/useTokenSearch.d.ts +1 -1
  314. package/hooks/useTokenSearch.js +12 -21
  315. package/hooks/useTokens.d.ts +1 -1
  316. package/hooks/useTokens.js +36 -38
  317. package/hooks/useTools.d.ts +2 -11
  318. package/hooks/useTools.js +12 -22
  319. package/i18n/en.json +8 -8
  320. package/i18n/uk.json +8 -8
  321. package/icons/LiFiFullLogo.js +1 -1
  322. package/icons/LiFiLogo.js +1 -1
  323. package/icons/LiFiToolLogo.js +1 -1
  324. package/index.d.ts +1 -0
  325. package/index.js +2 -0
  326. package/package.json +7 -7
  327. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +2 -2
  328. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  329. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +3 -3
  330. package/pages/MainPage/MainPage.js +1 -1
  331. package/pages/MainPage/MainPage.style.d.ts +1 -1
  332. package/pages/MainPage/MainSwapButton.js +3 -12
  333. package/pages/SelectChainPage/SelectChainPage.js +6 -14
  334. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.d.ts +4 -0
  335. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +47 -0
  336. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +20 -0
  337. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +5 -0
  338. package/pages/SelectEnabledToolsPage/index.d.ts +1 -0
  339. package/pages/SelectEnabledToolsPage/index.js +1 -0
  340. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +4 -3
  341. package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  342. package/pages/SelectTokenPage/SearchTokenInput.js +4 -1
  343. package/pages/SelectTokenPage/SelectTokenPage.js +2 -3
  344. package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  345. package/pages/SelectWalletPage/SelectWalletPage.js +13 -19
  346. package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -3
  347. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +2 -2
  348. package/pages/SettingsPage/EnabledToolsButton.d.ts +4 -0
  349. package/pages/SettingsPage/EnabledToolsButton.js +21 -0
  350. package/{cjs/pages/SelectWalletPage/SelectWalletPage.style.d.ts → pages/SettingsPage/EnabledToolsButton.style.d.ts} +1 -1
  351. package/pages/SettingsPage/EnabledToolsButton.style.js +14 -0
  352. package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  353. package/pages/SettingsPage/GasPriceSelect.js +1 -1
  354. package/pages/SettingsPage/LanguageSelect.js +5 -6
  355. package/pages/SettingsPage/ResetSettingsButton.d.ts +2 -0
  356. package/pages/SettingsPage/ResetSettingsButton.js +23 -0
  357. package/pages/SettingsPage/RoutePrioritySelect.js +4 -4
  358. package/pages/SettingsPage/SettingsPage.d.ts +0 -1
  359. package/pages/SettingsPage/SettingsPage.js +3 -2
  360. package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  361. package/pages/SettingsPage/ShowDestinationWallet.js +3 -3
  362. package/pages/SettingsPage/SlippageInput.d.ts +0 -1
  363. package/pages/SettingsPage/SlippageInput.js +3 -3
  364. package/pages/SwapDetailsPage/SwapDetailsPage.js +14 -22
  365. package/pages/SwapDetailsPage/SwapDetailsPage.style.d.ts +1 -1
  366. package/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
  367. package/pages/SwapHistoryPage/SwapHistoryItem.js +9 -7
  368. package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  369. package/pages/SwapPage/ExchangeRateBottomSheet.js +21 -26
  370. package/pages/SwapPage/StartSwapButton.js +1 -1
  371. package/pages/SwapPage/StatusBottomSheet.js +21 -19
  372. package/pages/SwapPage/StatusBottomSheet.style.d.ts +2 -2
  373. package/pages/SwapPage/SwapPage.js +9 -21
  374. package/pages/SwapPage/SwapPage.style.d.ts +1 -1
  375. package/pages/SwapPage/TokenValueBottomSheet.js +8 -9
  376. package/pages/SwapRoutesPage/SwapRoutesPage.js +3 -3
  377. package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
  378. package/providers/I18nProvider/I18nProvider.js +7 -8
  379. package/providers/SDKProvider/SDKProvider.js +15 -4
  380. package/providers/SwapFormProvider/SwapFormProvider.js +12 -6
  381. package/providers/SwapFormProvider/URLSearchParamsBuilder.js +3 -12
  382. package/providers/TelemetryProvider/TelemetryProvider.js +1 -1
  383. package/providers/ThemeProvider/ThemeProvider.js +2 -2
  384. package/providers/WalletProvider/WalletProvider.js +30 -39
  385. package/providers/WidgetProvider/WidgetProvider.js +22 -29
  386. package/providers/WidgetProvider/utils.js +2 -3
  387. package/stores/StoreProvider.js +2 -8
  388. package/stores/chains/index.d.ts +1 -2
  389. package/stores/chains/index.js +1 -2
  390. package/stores/chains/useChainOrder.js +1 -1
  391. package/stores/chains/useChainOrderStore.d.ts +3 -0
  392. package/stores/chains/{createChainOrderStore.js → useChainOrderStore.js} +2 -2
  393. package/stores/routes/RouteExecutionStore.js +2 -14
  394. package/stores/routes/createRouteExecutionStore.js +27 -16
  395. package/stores/routes/types.d.ts +1 -1
  396. package/stores/routes/useExecutingRoutesIds.js +2 -5
  397. package/stores/routes/useRecommendedRouteStore.d.ts +10 -2
  398. package/stores/routes/useRecommendedRouteStore.js +25 -1
  399. package/stores/routes/useSwapHistory.js +3 -6
  400. package/stores/routes/utils.js +4 -4
  401. package/stores/settings/index.d.ts +1 -1
  402. package/stores/settings/index.js +1 -1
  403. package/stores/settings/types.d.ts +6 -6
  404. package/stores/settings/useAppearance.js +1 -1
  405. package/stores/settings/useSettings.js +1 -1
  406. package/stores/settings/useSettingsStore.d.ts +6 -0
  407. package/stores/settings/{createSettingsStore.js → useSettingsStore.js} +46 -26
  408. package/tsconfig.cjs.tsbuildinfo +1 -1
  409. package/utils/colors.js +1 -1
  410. package/utils/format.js +3 -3
  411. package/utils/navigationRoutes.d.ts +2 -0
  412. package/utils/navigationRoutes.js +6 -0
  413. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -2
  414. package/cjs/pages/SettingsPage/AdvancedPreferences.js +0 -24
  415. package/cjs/pages/SettingsPage/EnabledBridgesSelect.d.ts +0 -2
  416. package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +0 -24
  417. package/cjs/pages/SettingsPage/EnabledExchangesSelect.d.ts +0 -2
  418. package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +0 -24
  419. package/cjs/stores/chains/ChainOrderStore.d.ts +0 -9
  420. package/cjs/stores/chains/ChainOrderStore.js +0 -44
  421. package/cjs/stores/chains/createChainOrderStore.d.ts +0 -4
  422. package/cjs/stores/settings/SettingsStore.d.ts +0 -11
  423. package/cjs/stores/settings/SettingsStore.js +0 -58
  424. package/cjs/stores/settings/createSettingsStore.d.ts +0 -5
  425. package/pages/SelectChainPage/SelectChainPage.style.js +0 -17
  426. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts +0 -21
  427. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +0 -17
  428. package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +0 -21
  429. package/pages/SelectWalletPage/SelectWalletPage.style.js +0 -17
  430. package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -2
  431. package/pages/SettingsPage/AdvancedPreferences.js +0 -20
  432. package/pages/SettingsPage/EnabledBridgesSelect.d.ts +0 -2
  433. package/pages/SettingsPage/EnabledBridgesSelect.js +0 -20
  434. package/pages/SettingsPage/EnabledExchangesSelect.d.ts +0 -2
  435. package/pages/SettingsPage/EnabledExchangesSelect.js +0 -20
  436. package/stores/chains/ChainOrderStore.d.ts +0 -9
  437. package/stores/chains/ChainOrderStore.js +0 -38
  438. package/stores/chains/createChainOrderStore.d.ts +0 -4
  439. package/stores/settings/SettingsStore.d.ts +0 -11
  440. package/stores/settings/SettingsStore.js +0 -51
  441. package/stores/settings/createSettingsStore.d.ts +0 -5
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.SwapStepDetailsLabel = exports.CrossStepDetailsLabel = exports.CustomStepDetailsLabel = exports.StepDetailsContent = exports.StepActions = void 0;
15
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -22,9 +11,7 @@ const providers_1 = require("../../providers");
22
11
  const utils_1 = require("../../utils");
23
12
  const SmallAvatar_1 = require("../SmallAvatar");
24
13
  const StepActions_style_1 = require("./StepActions.style");
25
- const StepActions = (_a) => {
26
- var _b, _c;
27
- var { step, dense } = _a, other = __rest(_a, ["step", "dense"]);
14
+ const StepActions = ({ step, dense, ...other }) => {
28
15
  const { variant, contractTool } = (0, providers_1.useWidgetConfig)();
29
16
  const StepDetailsLabel = step.tool === 'custom' && variant === 'nft'
30
17
  ? exports.CustomStepDetailsLabel
@@ -33,9 +20,9 @@ const StepActions = (_a) => {
33
20
  step.includedSteps.some((step) => step.type === 'cross'))
34
21
  ? exports.CrossStepDetailsLabel
35
22
  : exports.SwapStepDetailsLabel;
36
- const isFullView = !dense && ((_b = step.includedSteps) === null || _b === void 0 ? void 0 : _b.length) > 1;
23
+ const isFullView = !dense && step.includedSteps?.length > 1;
37
24
  const customStep = variant === 'nft'
38
- ? (_c = step.includedSteps) === null || _c === void 0 ? void 0 : _c.find((step) => step.type === 'custom')
25
+ ? step.includedSteps?.find((step) => step.type === 'custom')
39
26
  : undefined;
40
27
  if (customStep && contractTool) {
41
28
  const toolDetails = {
@@ -50,26 +37,24 @@ const StepActions = (_a) => {
50
37
  }
51
38
  // eslint-disable-next-line react/no-unstable-nested-components
52
39
  const StepIconComponent = ({ icon }) => {
53
- var _a;
54
- const tool = (_a = step.includedSteps) === null || _a === void 0 ? void 0 : _a[Number(icon) - 1];
55
- return tool ? ((0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, Object.assign({ src: tool.toolDetails.logoURI, alt: tool.toolDetails.name, sx: {
40
+ const tool = step.includedSteps?.[Number(icon) - 1];
41
+ return tool ? ((0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, { src: tool.toolDetails.logoURI, alt: tool.toolDetails.name, sx: {
56
42
  boxSizing: 'content-box',
57
- } }, { children: tool.toolDetails.name[0] }))) : null;
43
+ }, children: tool.toolDetails.name[0] })) : null;
58
44
  };
59
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({}, other, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mb: isFullView ? 1.5 : 0 }, { children: [(0, jsx_runtime_1.jsx)(StepActions_style_1.StepAvatar, Object.assign({ variant: "circular", src: step.type !== 'lifi' ? step.toolDetails.logoURI : undefined, alt: step.toolDetails.name }, { children: step.type === 'lifi' ? (0, jsx_runtime_1.jsx)(icons_1.LiFiToolLogo, {}) : step.toolDetails.name[0] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ ml: 2, fontSize: 18, fontWeight: "500", textTransform: "capitalize" }, { children: step.type === 'lifi'
45
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ...other, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, mb: isFullView ? 1.5 : 0, children: [(0, jsx_runtime_1.jsx)(StepActions_style_1.StepAvatar, { variant: "circular", src: step.type !== 'lifi' ? step.toolDetails.logoURI : undefined, alt: step.toolDetails.name, children: step.type === 'lifi' ? (0, jsx_runtime_1.jsx)(icons_1.LiFiToolLogo, {}) : step.toolDetails.name[0] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { ml: 2, fontSize: 18, fontWeight: "500", textTransform: "capitalize", children: step.type === 'lifi'
60
46
  ? 'LI.FI Smart Contract'
61
- : step.toolDetails.name }))] })), isFullView ? ((0, jsx_runtime_1.jsx)(material_1.Stepper, Object.assign({ orientation: "vertical", connector: (0, jsx_runtime_1.jsx)(StepActions_style_1.StepConnector, {}), activeStep: -1 }, { children: step.includedSteps.map((step, i) => ((0, jsx_runtime_1.jsxs)(material_1.Step, Object.assign({ expanded: true }, { children: [(0, jsx_runtime_1.jsx)(StepActions_style_1.StepLabel, Object.assign({ StepIconComponent: StepIconComponent }, { children: step.type === 'custom' && variant === 'nft' ? ((0, jsx_runtime_1.jsx)(exports.CustomStepDetailsLabel, { step: step, variant: variant })) : step.type === 'cross' || step.type === 'lifi' ? ((0, jsx_runtime_1.jsx)(exports.CrossStepDetailsLabel, { step: step })) : ((0, jsx_runtime_1.jsx)(exports.SwapStepDetailsLabel, { step: step })) })), (0, jsx_runtime_1.jsx)(StepActions_style_1.StepContent, { children: (0, jsx_runtime_1.jsx)(exports.StepDetailsContent, { step: step, variant: variant }) })] }), step.id))) }))) : ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ml: 6 }, { children: [(0, jsx_runtime_1.jsx)(StepDetailsLabel, { step: step, variant: variant === 'nft' ? variant : undefined }), (0, jsx_runtime_1.jsx)(exports.StepDetailsContent, { step: step, variant: variant })] })))] })));
47
+ : step.toolDetails.name })] }), isFullView ? ((0, jsx_runtime_1.jsx)(material_1.Stepper, { orientation: "vertical", connector: (0, jsx_runtime_1.jsx)(StepActions_style_1.StepConnector, {}), activeStep: -1, children: step.includedSteps.map((step, i) => ((0, jsx_runtime_1.jsxs)(material_1.Step, { expanded: true, children: [(0, jsx_runtime_1.jsx)(StepActions_style_1.StepLabel, { StepIconComponent: StepIconComponent, children: step.type === 'custom' && variant === 'nft' ? ((0, jsx_runtime_1.jsx)(exports.CustomStepDetailsLabel, { step: step, variant: variant })) : step.type === 'cross' || step.type === 'lifi' ? ((0, jsx_runtime_1.jsx)(exports.CrossStepDetailsLabel, { step: step })) : ((0, jsx_runtime_1.jsx)(exports.SwapStepDetailsLabel, { step: step })) }), (0, jsx_runtime_1.jsx)(StepActions_style_1.StepContent, { children: (0, jsx_runtime_1.jsx)(exports.StepDetailsContent, { step: step, variant: variant }) })] }, step.id))) })) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { ml: 6, children: [(0, jsx_runtime_1.jsx)(StepDetailsLabel, { step: step, variant: variant === 'nft' ? variant : undefined }), (0, jsx_runtime_1.jsx)(exports.StepDetailsContent, { step: step, variant: variant })] }))] }));
62
48
  };
63
49
  exports.StepActions = StepActions;
64
50
  const StepDetailsContent = ({ step, variant }) => {
65
- var _a, _b, _c, _d, _e, _f, _g, _h;
66
51
  const { t } = (0, react_i18next_1.useTranslation)();
67
- return ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontSize: 12, fontWeight: "500", color: "text.secondary", alignItems: "center", display: "flex" }, { children: [t('format.number', {
52
+ return ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", alignItems: "center", display: "flex", children: [t('format.number', {
68
53
  value: (0, utils_1.formatTokenAmount)(step.estimate.fromAmount, step.action.fromToken.decimals),
69
54
  }), ' ', step.action.fromToken.symbol, !((step.type === 'custom' || step.tool === 'custom') &&
70
55
  variant === 'nft') ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(icons_material_1.ArrowForward, { sx: { fontSize: 18, paddingX: 0.5 } }), t('format.number', {
71
- value: (0, utils_1.formatTokenAmount)((_b = (_a = step.execution) === null || _a === void 0 ? void 0 : _a.toAmount) !== null && _b !== void 0 ? _b : step.estimate.toAmount, (_e = (_d = (_c = step.execution) === null || _c === void 0 ? void 0 : _c.toToken) === null || _d === void 0 ? void 0 : _d.decimals) !== null && _e !== void 0 ? _e : step.action.toToken.decimals),
72
- }), ' ', (_h = (_g = (_f = step.execution) === null || _f === void 0 ? void 0 : _f.toToken) === null || _g === void 0 ? void 0 : _g.symbol) !== null && _h !== void 0 ? _h : step.action.toToken.symbol] })) : null] })));
56
+ value: (0, utils_1.formatTokenAmount)(step.execution?.toAmount ?? step.estimate.toAmount, step.execution?.toToken?.decimals ?? step.action.toToken.decimals),
57
+ }), ' ', step.execution?.toToken?.symbol ?? step.action.toToken.symbol] })) : null] }));
73
58
  };
74
59
  exports.StepDetailsContent = StepDetailsContent;
75
60
  const CustomStepDetailsLabel = ({ step, variant, }) => {
@@ -77,29 +62,27 @@ const CustomStepDetailsLabel = ({ step, variant, }) => {
77
62
  if (!variant) {
78
63
  return null;
79
64
  }
80
- return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, fontWeight: "500", color: "text.secondary" }, { children: t(`swap.${variant}StepDetails`, {
65
+ return ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", children: t(`swap.${variant}StepDetails`, {
81
66
  tool: step.toolDetails.name,
82
- }) })));
67
+ }) }));
83
68
  };
84
69
  exports.CustomStepDetailsLabel = CustomStepDetailsLabel;
85
70
  const CrossStepDetailsLabel = ({ step }) => {
86
- var _a, _b;
87
71
  const { t } = (0, react_i18next_1.useTranslation)();
88
72
  const { getChainById } = (0, hooks_1.useChains)();
89
- return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, fontWeight: "500", color: "text.secondary" }, { children: t('swap.crossStepDetails', {
90
- from: (_a = getChainById(step.action.fromChainId)) === null || _a === void 0 ? void 0 : _a.name,
91
- to: (_b = getChainById(step.action.toChainId)) === null || _b === void 0 ? void 0 : _b.name,
73
+ return ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", children: t('swap.crossStepDetails', {
74
+ from: getChainById(step.action.fromChainId)?.name,
75
+ to: getChainById(step.action.toChainId)?.name,
92
76
  tool: step.toolDetails.name,
93
- }) })));
77
+ }) }));
94
78
  };
95
79
  exports.CrossStepDetailsLabel = CrossStepDetailsLabel;
96
80
  const SwapStepDetailsLabel = ({ step }) => {
97
- var _a;
98
81
  const { t } = (0, react_i18next_1.useTranslation)();
99
82
  const { getChainById } = (0, hooks_1.useChains)();
100
- return ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12, fontWeight: "500", color: "text.secondary" }, { children: t('swap.swapStepDetails', {
101
- chain: (_a = getChainById(step.action.fromChainId)) === null || _a === void 0 ? void 0 : _a.name,
83
+ return ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", children: t('swap.swapStepDetails', {
84
+ chain: getChainById(step.action.fromChainId)?.name,
102
85
  tool: step.toolDetails.name,
103
- }) })));
86
+ }) }));
104
87
  };
105
88
  exports.SwapStepDetailsLabel = SwapStepDetailsLabel;
@@ -15,6 +15,6 @@ export declare const StepAvatar: import("@emotion/styled").StyledComponent<{
15
15
  srcSet?: string | undefined;
16
16
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
17
17
  variant?: "square" | "circular" | "rounded" | undefined;
18
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
18
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
19
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
20
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | "alt" | "imgProps" | "sizes" | "src" | "srcSet"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -6,6 +6,6 @@ export declare const Container: import("@emotion/styled").StyledComponent<{
6
6
  fixed?: boolean | undefined;
7
7
  maxWidth?: false | import("@mui/material").Breakpoint | undefined;
8
8
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
9
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
9
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
10
10
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
11
11
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "maxWidth" | "fixed" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,13 +1,4 @@
1
1
  "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
2
  Object.defineProperty(exports, "__esModule", { value: true });
12
3
  exports.SwapButton = void 0;
13
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -21,19 +12,19 @@ const SwapButton = ({ onClick, currentRoute, text, disabled, loading, }) => {
21
12
  const navigate = (0, react_router_dom_1.useNavigate)();
22
13
  const { variant, walletManagement } = (0, providers_1.useWidgetConfig)();
23
14
  const { account, connect } = (0, providers_1.useWallet)();
24
- const handleSwapButtonClick = () => __awaiter(void 0, void 0, void 0, function* () {
15
+ const handleSwapButtonClick = async () => {
25
16
  if (!account.isActive) {
26
17
  if (walletManagement) {
27
- yield connect();
18
+ await connect();
28
19
  }
29
20
  else {
30
21
  navigate(utils_1.navigationRoutes.selectWallet);
31
22
  }
32
23
  }
33
24
  else {
34
- onClick === null || onClick === void 0 ? void 0 : onClick();
25
+ onClick?.();
35
26
  }
36
- });
27
+ };
37
28
  const getButtonText = () => {
38
29
  if (account.isActive) {
39
30
  if (!currentRoute) {
@@ -48,6 +39,6 @@ const SwapButton = ({ onClick, currentRoute, text, disabled, loading, }) => {
48
39
  }
49
40
  return t(`button.connectWallet`);
50
41
  };
51
- return ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, Object.assign({ variant: "contained", color: "primary", onClick: handleSwapButtonClick, disabled: disabled, loading: loading, loadingPosition: "center", fullWidth: true }, { children: getButtonText() })));
42
+ return ((0, jsx_runtime_1.jsx)(lab_1.LoadingButton, { variant: "contained", color: "primary", onClick: handleSwapButtonClick, disabled: disabled, loading: loading, loadingPosition: "center", fullWidth: true, children: getButtonText() }));
52
43
  };
53
44
  exports.SwapButton = SwapButton;
@@ -18,14 +18,14 @@ const FormPriceHelperText = ({ formType, }) => {
18
18
  ],
19
19
  });
20
20
  const { token, isLoading } = (0, hooks_1.useTokenAddressBalance)(chainId, tokenAddress);
21
- const fromAmountTokenPrice = (0, utils_1.formatTokenPrice)(amount, token === null || token === void 0 ? void 0 : token.priceUSD);
22
- return ((0, jsx_runtime_1.jsxs)(material_1.FormHelperText, Object.assign({ component: "div", sx: { display: 'flex', justifyContent: 'space-between', margin: 0 } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ color: fromAmountTokenPrice ? 'text.secondary' : 'grey.600', fontWeight: 400, fontSize: 12, marginLeft: 8, lineHeight: 1.3334, flex: 1, sx: {
21
+ const fromAmountTokenPrice = (0, utils_1.formatTokenPrice)(amount, token?.priceUSD);
22
+ return ((0, jsx_runtime_1.jsxs)(material_1.FormHelperText, { component: "div", sx: { display: 'flex', justifyContent: 'space-between', margin: 0 }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { color: fromAmountTokenPrice ? 'text.secondary' : 'grey.600', fontWeight: 400, fontSize: 12, marginLeft: 8, lineHeight: 1.3334, flex: 1, sx: {
23
23
  wordBreak: 'break-word',
24
24
  overflowWrap: 'break-word',
25
- } }, { children: t(`format.currency`, {
25
+ }, children: t(`format.currency`, {
26
26
  value: fromAmountTokenPrice,
27
- }) })), isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 16, sx: { borderRadius: 0.25 } })) : (token === null || token === void 0 ? void 0 : token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 400, fontSize: 12, color: "text.secondary", lineHeight: 1.3334, pl: 0.25 }, { children: `/ ${t(`format.number`, {
28
- value: token === null || token === void 0 ? void 0 : token.amount,
29
- })}` }))) : null] })));
27
+ }) }), isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 16, sx: { borderRadius: 0.25 } })) : token?.amount ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", lineHeight: 1.3334, pl: 0.25, children: `/ ${t(`format.number`, {
28
+ value: token?.amount,
29
+ })}` })) : null] }));
30
30
  };
31
31
  exports.FormPriceHelperText = FormPriceHelperText;
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.SwapInput = void 0;
15
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -25,8 +14,7 @@ const FormPriceHelperText_1 = require("./FormPriceHelperText");
25
14
  const SwapInput_style_1 = require("./SwapInput.style");
26
15
  const SwapInputEndAdornment_1 = require("./SwapInputEndAdornment");
27
16
  const SwapInputStartAdornment_1 = require("./SwapInputStartAdornment");
28
- const SwapInput = (_a) => {
29
- var { formType } = _a, props = __rest(_a, ["formType"]);
17
+ const SwapInput = ({ formType, ...props }) => {
30
18
  const { t } = (0, react_i18next_1.useTranslation)();
31
19
  const amountKey = providers_1.SwapFormKeyHelper.getAmountKey(formType);
32
20
  const { field: { onChange, onBlur, value }, } = (0, react_hook_form_1.useController)({
@@ -45,9 +33,9 @@ const SwapInput = (_a) => {
45
33
  onChange(formattedAmount);
46
34
  onBlur();
47
35
  };
48
- const disabled = disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.FromAmount);
49
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.fromAmount') }), (0, jsx_runtime_1.jsxs)(SwapInput_style_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(SwapInput_style_1.Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment: (0, jsx_runtime_1.jsx)(SwapInputStartAdornment_1.SwapInputStartAdornment, { formType: formType }), endAdornment: !disabled ? ((0, jsx_runtime_1.jsx)(SwapInputEndAdornment_1.SwapInputEndAdornment, { formType: formType })) : undefined, inputProps: {
36
+ const disabled = disabledUI?.includes(types_1.DisabledUI.FromAmount);
37
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { ...props, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.fromAmount') }), (0, jsx_runtime_1.jsxs)(SwapInput_style_1.FormControl, { fullWidth: true, children: [(0, jsx_runtime_1.jsx)(SwapInput_style_1.Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment: (0, jsx_runtime_1.jsx)(SwapInputStartAdornment_1.SwapInputStartAdornment, { formType: formType }), endAdornment: !disabled ? ((0, jsx_runtime_1.jsx)(SwapInputEndAdornment_1.SwapInputEndAdornment, { formType: formType })) : undefined, inputProps: {
50
38
  inputMode: 'decimal',
51
- }, onChange: handleChange, onBlur: handleBlur, value: value, name: amountKey, disabled: disabled, required: true }), (0, jsx_runtime_1.jsx)(FormPriceHelperText_1.FormPriceHelperText, { formType: formType })] })), (0, jsx_runtime_1.jsx)(FitInputText_1.FitInputText, { ref: ref, formType: formType })] })));
39
+ }, onChange: handleChange, onBlur: handleBlur, value: value, name: amountKey, disabled: disabled, required: true }), (0, jsx_runtime_1.jsx)(FormPriceHelperText_1.FormPriceHelperText, { formType: formType })] }), (0, jsx_runtime_1.jsx)(FitInputText_1.FitInputText, { ref: ref, formType: formType })] }));
52
40
  };
53
41
  exports.SwapInput = SwapInput;
@@ -4,7 +4,7 @@ export declare const minInputFontSize = 14;
4
4
  export declare const FormControl: import("@emotion/styled").StyledComponent<{
5
5
  children?: import("react").ReactNode;
6
6
  classes?: Partial<import("@mui/material").FormControlClasses> | undefined;
7
- color?: "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
7
+ color?: "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
8
8
  disabled?: boolean | undefined;
9
9
  error?: boolean | undefined;
10
10
  fullWidth?: boolean | undefined;
@@ -15,7 +15,7 @@ export declare const FormControl: import("@emotion/styled").StyledComponent<{
15
15
  size?: "small" | "medium" | undefined;
16
16
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
17
17
  variant?: "outlined" | "filled" | "standard" | undefined;
18
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
18
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
19
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
20
20
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "children" | "disabled" | "sx" | "margin" | "fullWidth" | "size" | "variant" | "error" | "required" | "focused" | "hiddenLabel"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
21
  export declare const Input: import("@emotion/styled").StyledComponent<import("@mui/material").InputBaseProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -2,7 +2,7 @@
2
2
  export declare const Button: import("@emotion/styled").StyledComponent<{
3
3
  children?: import("react").ReactNode;
4
4
  classes?: Partial<import("@mui/material").ButtonClasses> | undefined;
5
- color?: "inherit" | "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
5
+ color?: "inherit" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
6
6
  disabled?: boolean | undefined;
7
7
  disableElevation?: boolean | undefined;
8
8
  disableFocusRipple?: boolean | undefined;
@@ -29,6 +29,6 @@ export declare const Button: import("@emotion/styled").StyledComponent<{
29
29
  tabIndex?: number | undefined;
30
30
  TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
31
31
  touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
32
- }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
32
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
33
33
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
34
34
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "href" | "disableElevation" | "disableFocusRipple" | "endIcon" | "fullWidth" | "size" | "startIcon" | "variant"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  import type { SwapFormTypeProps } from '../../providers';
3
2
  export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
@@ -19,11 +19,10 @@ const SwapInputEndAdornment = ({ formType }) => {
19
19
  });
20
20
  const { token, isLoading } = (0, hooks_1.useTokenAddressBalance)(chainId, tokenAddress);
21
21
  const handleMax = () => {
22
- var _a;
23
- setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), (_a = token === null || token === void 0 ? void 0 : token.amount) !== null && _a !== void 0 ? _a : '', {
22
+ setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), token?.amount ?? '', {
24
23
  shouldTouch: true,
25
24
  });
26
25
  };
27
- return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 46, height: 24, sx: { borderRadius: 0.5 } })) : formType === 'from' && (token === null || token === void 0 ? void 0 : token.amount) ? ((0, jsx_runtime_1.jsx)(SwapInputAdornment_style_1.Button, Object.assign({ onClick: handleMax }, { children: t('button.max') }))) : null })));
26
+ return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 46, height: 24, sx: { borderRadius: 0.5 } })) : formType === 'from' && token?.amount ? ((0, jsx_runtime_1.jsx)(SwapInputAdornment_style_1.Button, { onClick: handleMax, children: t('button.max') })) : null }));
28
27
  };
29
28
  exports.SwapInputEndAdornment = SwapInputEndAdornment;
@@ -1,15 +1,4 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.SwapRouteCardEssentials = exports.SwapRouteCard = void 0;
15
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -23,14 +12,12 @@ const StepActions_1 = require("../StepActions");
23
12
  const Token_1 = require("../Token");
24
13
  const SwapRouteCard_style_1 = require("./SwapRouteCard.style");
25
14
  const utils_1 = require("./utils");
26
- const SwapRouteCard = (_a) => {
27
- var _b;
28
- var { route, active, variant = 'default', expanded } = _a, other = __rest(_a, ["route", "active", "variant", "expanded"]);
15
+ const SwapRouteCard = ({ route, active, variant = 'default', expanded, ...other }) => {
29
16
  const { t } = (0, react_i18next_1.useTranslation)();
30
17
  const { variant: widgetVariant, useRecommendedRoute } = (0, providers_1.useWidgetConfig)();
31
18
  const [cardExpanded, setCardExpanded] = (0, react_1.useState)(variant === 'default' || expanded);
32
19
  const alternativeTag = t(`swap.tags.ALTERNATIVE`);
33
- const label = ((_b = route.tags) === null || _b === void 0 ? void 0 : _b.length)
20
+ const label = route.tags?.length
34
21
  ? t(`swap.tags.${route.tags[0]}`)
35
22
  : alternativeTag;
36
23
  const handleExpand = (e) => {
@@ -38,24 +25,21 @@ const SwapRouteCard = (_a) => {
38
25
  setCardExpanded((expanded) => !expanded);
39
26
  };
40
27
  const token = widgetVariant === 'nft'
41
- ? Object.assign(Object.assign({}, route.fromToken), { amount: route.fromAmount }) : Object.assign(Object.assign({}, route.toToken), { amount: route.toAmount });
42
- const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ flex: 1 }, { children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.Label, Object.assign({ active: active !== null && active !== void 0 ? active : label !== alternativeTag }, { children: label })), variant === 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route })) : null] }))) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, step: variant === 'stretched' ? route.steps[0] : undefined, disableDescription: variant === 'dense' && widgetVariant !== 'refuel' }), variant === 'stretched' && !expanded ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconButton, Object.assign({ onClick: handleExpand, size: "small" }, { children: cardExpanded ? (0, jsx_runtime_1.jsx)(icons_material_1.ExpandLess, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}) }))) : null] })), (0, jsx_runtime_1.jsx)(material_1.Collapse, Object.assign({ timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true }, { children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) })), variant !== 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route, dense: true })) : null] })));
43
- return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, Object.assign({ dense: variant === 'dense', variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true }, other, { children: cardContent })));
28
+ ? { ...route.fromToken, amount: route.fromAmount }
29
+ : { ...route.toToken, amount: route.toAmount };
30
+ const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2, children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.Label, { active: active ?? label !== alternativeTag, children: label }), variant === 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route })) : null] })) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: token, step: variant === 'stretched' ? route.steps[0] : undefined, disableDescription: variant === 'dense' && widgetVariant !== 'refuel' }), variant === 'stretched' && !expanded ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_style_1.IconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(icons_material_1.ExpandLess, {}) : (0, jsx_runtime_1.jsx)(icons_material_1.ExpandMore, {}) })) : null] }), (0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: route.steps.map((step) => ((0, jsx_runtime_1.jsx)(StepActions_1.StepActions, { step: step, mt: 2 }, step.id))) }), variant !== 'stretched' ? ((0, jsx_runtime_1.jsx)(exports.SwapRouteCardEssentials, { route: route, dense: true })) : null] }));
31
+ return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { dense: variant === 'dense', variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true, ...other, children: cardContent }));
44
32
  };
45
33
  exports.SwapRouteCard = SwapRouteCard;
46
34
  const SwapRouteCardEssentials = ({ route, dense }) => {
47
- var _a;
48
35
  const { t } = (0, react_i18next_1.useTranslation)();
49
36
  const executionTimeMinutes = Math.ceil(route.steps
50
37
  .map((step) => step.estimate.executionDuration)
51
38
  .reduce((duration, x) => duration + x, 0) / 60);
52
- const gasCostUSD = parseFloat((_a = route.gasCostUSD) !== null && _a !== void 0 ? _a : '') || 0.01;
39
+ const gasCostUSD = parseFloat(route.gasCostUSD ?? '') || 0.01;
53
40
  const gasCosts = (0, utils_1.getGasCostsBreakdown)(route);
54
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: dense ? 'space-between' : 'flex-end', flex: 1, pl: dense ? 0 : 2, mt: dense ? 2 : 0 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ component: "span" }, { children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas) => {
55
- var _a;
56
- return ((0, jsx_runtime_1.jsxs)(material_1.Typography, Object.assign({ fontSize: 11 }, { children: [(_a = gas.amount) === null || _a === void 0 ? void 0 : _a.toFixed(6), " ", gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }), `${gas.token.address}${gas.token.symbol}`));
57
- })] })), placement: "top", enterDelay: 400, arrow: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center", mr: dense ? 0 : 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ lineHeight: 0, mr: 0.5, color: "grey.500" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.EvStationOutlined, { fontSize: dense ? 'medium' : 'small' }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1 }, { children: t(`format.currency`, { value: gasCostUSD }) }))] })) })), (0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: t(`tooltip.estimatedTime`), placement: "top", enterDelay: 400, arrow: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center", mr: dense ? 0 : 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ lineHeight: 0, mr: 0.5, color: "grey.500" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.AccessTime, { fontSize: dense ? 'medium' : 'small' }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1 }, { children: t('swap.estimatedTime', {
41
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: dense ? 'space-between' : 'flex-end', flex: 1, pl: dense ? 0 : 2, mt: dense ? 2 : 0, children: [(0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: (0, jsx_runtime_1.jsxs)(material_1.Box, { component: "span", children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas) => ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 11, children: [gas.amount?.toFixed(6), " ", gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }, `${gas.token.address}${gas.token.symbol}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: (0, jsx_runtime_1.jsx)(icons_material_1.EvStationOutlined, { fontSize: dense ? 'medium' : 'small' }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, { value: gasCostUSD }) })] }) }), (0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`tooltip.estimatedTime`), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: (0, jsx_runtime_1.jsx)(icons_material_1.AccessTime, { fontSize: dense ? 'medium' : 'small' }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t('swap.estimatedTime', {
58
42
  value: executionTimeMinutes,
59
- }) }))] })) })), !dense ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, Object.assign({ title: t(`tooltip.numberOfSteps`), placement: "top", enterDelay: 400, arrow: true }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ lineHeight: 0, mr: 0.5, color: "grey.500" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.LayersOutlined, { fontSize: dense ? 'medium' : 'small' }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1 }, { children: route.steps.length }))] })) }))) : null] })));
43
+ }) })] }) }), !dense ? ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: t(`tooltip.numberOfSteps`), placement: "top", enterDelay: 400, arrow: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { lineHeight: 0, mr: 0.5, color: "grey.500", children: (0, jsx_runtime_1.jsx)(icons_material_1.LayersOutlined, { fontSize: dense ? 'medium' : 'small' }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: route.steps.length })] }) })) : null] }));
60
44
  };
61
45
  exports.SwapRouteCardEssentials = SwapRouteCardEssentials;
@@ -9,7 +9,7 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
9
9
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
10
10
  variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
11
11
  variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
12
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
12
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
13
13
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
14
14
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
15
15
  active?: boolean | undefined;
@@ -17,7 +17,7 @@ export declare const Label: import("@emotion/styled").StyledComponent<import("@m
17
17
  export declare const IconButton: import("@emotion/styled").StyledComponent<{
18
18
  children?: import("react").ReactNode;
19
19
  classes?: Partial<import("@mui/material").IconButtonClasses> | undefined;
20
- color?: "inherit" | "default" | "success" | "warning" | "error" | "info" | "primary" | "secondary" | undefined;
20
+ color?: "inherit" | "default" | "success" | "warning" | "error" | "primary" | "secondary" | "info" | undefined;
21
21
  disabled?: boolean | undefined;
22
22
  disableFocusRipple?: boolean | undefined;
23
23
  edge?: false | "end" | "start" | undefined;
@@ -39,7 +39,7 @@ export declare const IconButton: import("@emotion/styled").StyledComponent<{
39
39
  tabIndex?: number | undefined;
40
40
  TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
41
41
  touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
42
- }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
42
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
43
43
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
44
44
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
45
45
  active?: boolean | undefined;
@@ -1,27 +1,15 @@
1
1
  "use strict";
2
- var __rest = (this && this.__rest) || function (s, e) {
3
- var t = {};
4
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
- t[p] = s[p];
6
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
- t[p[i]] = s[p[i]];
10
- }
11
- return t;
12
- };
13
2
  Object.defineProperty(exports, "__esModule", { value: true });
14
3
  exports.SwapRouteCardSkeleton = void 0;
15
4
  const jsx_runtime_1 = require("react/jsx-runtime");
16
5
  const material_1 = require("@mui/material");
17
6
  const providers_1 = require("../../providers");
18
7
  const Card_1 = require("../Card");
19
- const SwapRouteCardSkeleton = (_a) => {
20
- var { variant } = _a, other = __rest(_a, ["variant"]);
8
+ const SwapRouteCardSkeleton = ({ variant, ...other }) => {
21
9
  const { variant: widgetVariant, useRecommendedRoute } = (0, providers_1.useWidgetConfig)();
22
- const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ flex: 1 }, { children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 118, height: 24, sx: (theme) => ({
10
+ const cardContent = ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, children: [widgetVariant !== 'refuel' && !useRecommendedRoute ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", justifyContent: "space-between", alignItems: "center", mb: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 118, height: 24, sx: (theme) => ({
23
11
  borderRadius: `${theme.shape.borderRadiusSecondary}px`,
24
- }) }), variant === 'stretched' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 52, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 44, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 32, height: 24 })] }))) : null] }))) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mr: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }) })), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 32 })] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ml: 6, display: "flex", alignItems: "center" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 102, height: 16, sx: { borderRadius: 0.5 } }), variant === 'stretched' ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 72, height: 16, sx: { marginLeft: 1 } })) : null] }))] }), variant !== 'stretched' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mt: 2, display: "flex", justifyContent: "space-between" }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 })] }))) : null] })));
25
- return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, Object.assign({ dense: variant === 'dense', indented: true }, other, { children: cardContent })));
12
+ }) }), variant === 'stretched' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 52, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 44, height: 24, sx: { marginRight: 2 } }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 32, height: 24 })] })) : null] })) : null, (0, jsx_runtime_1.jsxs)(material_1.Box, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { mr: 2, children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32 }) }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 32 })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { ml: 6, display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 102, height: 16, sx: { borderRadius: 0.5 } }), variant === 'stretched' ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 72, height: 16, sx: { marginLeft: 1 } })) : null] })] }), variant !== 'stretched' ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { mt: 2, display: "flex", justifyContent: "space-between", children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 24 })] })) : null] }));
13
+ return widgetVariant === 'refuel' ? (cardContent) : ((0, jsx_runtime_1.jsx)(Card_1.Card, { dense: variant === 'dense', indented: true, ...other, children: cardContent }));
26
14
  };
27
15
  exports.SwapRouteCardSkeleton = SwapRouteCardSkeleton;
@@ -7,12 +7,12 @@ const material_1 = require("@mui/material");
7
7
  const react_i18next_1 = require("react-i18next");
8
8
  const SwapRouteNotFoundCard = () => {
9
9
  const { t } = (0, react_i18next_1.useTranslation)();
10
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
10
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
11
11
  display: 'flex',
12
12
  alignItems: 'center',
13
13
  justifyContent: 'center',
14
14
  flexDirection: 'column',
15
15
  flex: 1,
16
- }, py: 1.625 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 48 }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.Route, { fontSize: "inherit" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: 700 }, { children: t('swap.info.title.routeNotFound') })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2 }, { children: t('swap.info.message.routeNotFound') }))] })));
16
+ }, py: 1.625, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, children: (0, jsx_runtime_1.jsx)(icons_material_1.Route, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: 700, children: t('swap.info.title.routeNotFound') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('swap.info.message.routeNotFound') })] }));
17
17
  };
18
18
  exports.SwapRouteNotFoundCard = SwapRouteNotFoundCard;
@@ -8,7 +8,7 @@ const getGasCostsBreakdown = (route) => {
8
8
  const { token } = step.estimate.gasCosts[0];
9
9
  const gasCostAmount = step.estimate.gasCosts
10
10
  .reduce((amount, gasCost) => amount.plus((0, big_js_1.default)(gasCost.amount || 0)), (0, big_js_1.default)(0))
11
- .div(Math.pow(10, token.decimals));
11
+ .div(10 ** token.decimals);
12
12
  const gasCostAmountUSD = step.estimate.gasCosts.reduce((amount, gasCost) => amount + parseFloat(gasCost.amountUSD || '0'), 0);
13
13
  const groupedGasCost = groupedGasCosts[token.chainId];
14
14
  const amount = groupedGasCost
@@ -21,7 +21,7 @@ const SwapRoutes = (props) => {
21
21
  const navigate = (0, react_router_dom_1.useNavigate)();
22
22
  const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
23
23
  const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = (0, hooks_1.useSwapRoutes)();
24
- const currentRoute = routes === null || routes === void 0 ? void 0 : routes[0];
24
+ const currentRoute = routes?.[0];
25
25
  (0, useSetRecommendedRoute_1.useSetRecommendedRoute)(currentRoute, isFetching);
26
26
  if (!currentRoute && !isLoading && !isFetching && !isFetched) {
27
27
  return null;
@@ -31,16 +31,16 @@ const SwapRoutes = (props) => {
31
31
  };
32
32
  const routeNotFound = !currentRoute && !isLoading && !isFetching;
33
33
  const onlyRecommendedRoute = variant === 'refuel' || useRecommendedRoute;
34
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({}, props, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.routes') }), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: {
34
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { ...props, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.routes') }), (0, jsx_runtime_1.jsx)(ProgressToNextUpdate_1.ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: {
35
35
  position: 'absolute',
36
36
  top: 8,
37
37
  right: 8,
38
- } }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex' } }, { children: [(0, jsx_runtime_1.jsx)(SwapRoutes_style_1.Stack, Object.assign({ direction: "row", spacing: 2, my: 2, ml: 2, mr: onlyRecommendedRoute || routeNotFound ? 2 : 1, sx: {
38
+ } }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(SwapRoutes_style_1.Stack, { direction: "row", spacing: 2, my: 2, ml: 2, mr: onlyRecommendedRoute || routeNotFound ? 2 : 1, sx: {
39
39
  borderRightWidth: !onlyRecommendedRoute &&
40
40
  !routeNotFound &&
41
41
  (isFetching || (routes && routes.length > 1))
42
42
  ? 1
43
43
  : 0,
44
- } }, { children: isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: !onlyRecommendedRoute ? '80%' : '100%', variant: "dense" }), !onlyRecommendedRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", variant: "dense" })) : null] })) : !currentRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: !onlyRecommendedRoute && routes.length > 1 ? '80%' : '100%', route: currentRoute, variant: "dense", active: true }), !onlyRecommendedRoute && routes.length > 1 ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: "80%", route: routes[1], variant: "dense", pointerEvents: "none" })) : null] })) })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: !onlyRecommendedRoute && !routeNotFound ? ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ py: 1, pr: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ onClick: handleCardClick, size: "medium", disabled: isValidating || !isValid }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) })) }))) : null }))] }))] })));
44
+ }, children: isLoading ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: !onlyRecommendedRoute ? '80%' : '100%', variant: "dense" }), !onlyRecommendedRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCardSkeleton, { minWidth: "80%", variant: "dense" })) : null] })) : !currentRoute ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteNotFoundCard, {})) : ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: !onlyRecommendedRoute && routes.length > 1 ? '80%' : '100%', route: currentRoute, variant: "dense", active: true }), !onlyRecommendedRoute && routes.length > 1 ? ((0, jsx_runtime_1.jsx)(SwapRouteCard_1.SwapRouteCard, { minWidth: "80%", route: routes[1], variant: "dense", pointerEvents: "none" })) : null] })) }), (0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, children: !onlyRecommendedRoute && !routeNotFound ? ((0, jsx_runtime_1.jsx)(material_1.Box, { py: 1, pr: 1, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { onClick: handleCardClick, size: "medium", disabled: isValidating || !isValid, children: (0, jsx_runtime_1.jsx)(icons_material_1.KeyboardArrowRight, {}) }) })) : null })] })] }));
45
45
  };
46
46
  exports.SwapRoutes = SwapRoutes;