@lifi/widget 1.31.0 → 1.32.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 (413) hide show
  1. package/App.js +4 -16
  2. package/AppDrawer.js +13 -7
  3. package/AppDrawer.style.d.ts +2 -2
  4. package/AppDrawer.style.js +1 -1
  5. package/AppProvider.js +2 -2
  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 +2 -2
  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 +3 -3
  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 +3 -3
  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 +1 -1
  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 +1 -1
  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 +2 -2
  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 +1 -1
  72. package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  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 +2 -2
  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 +2 -2
  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 +17 -28
  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 +10 -19
  120. package/cjs/i18n/en.json +8 -4
  121. package/cjs/icons/LiFiFullLogo.js +1 -1
  122. package/cjs/icons/LiFiLogo.js +1 -1
  123. package/cjs/icons/LiFiToolLogo.js +1 -1
  124. package/cjs/index.d.ts +1 -0
  125. package/cjs/index.js +2 -0
  126. package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +2 -2
  127. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  128. package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +3 -3
  129. package/cjs/pages/MainPage/MainPage.js +1 -1
  130. package/cjs/pages/MainPage/MainPage.style.d.ts +1 -1
  131. package/cjs/pages/MainPage/MainSwapButton.js +3 -12
  132. package/cjs/pages/SelectChainPage/SelectChainPage.js +6 -14
  133. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.d.ts +4 -0
  134. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +51 -0
  135. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +20 -0
  136. package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +8 -0
  137. package/cjs/pages/SelectEnabledToolsPage/index.d.ts +1 -0
  138. package/cjs/pages/SelectEnabledToolsPage/index.js +17 -0
  139. package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +4 -3
  140. package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  141. package/cjs/pages/SelectTokenPage/SearchTokenInput.js +4 -1
  142. package/cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -3
  143. package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  144. package/cjs/pages/SelectWalletPage/SelectWalletPage.js +13 -19
  145. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -3
  146. package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  147. package/cjs/pages/SettingsPage/EnabledToolsButton.d.ts +4 -0
  148. package/cjs/pages/SettingsPage/EnabledToolsButton.js +25 -0
  149. package/cjs/pages/{SelectChainPage/SelectChainPage.style.d.ts → SettingsPage/EnabledToolsButton.style.d.ts} +1 -1
  150. package/cjs/pages/{SelectChainPage/SelectChainPage.style.js → SettingsPage/EnabledToolsButton.style.js} +7 -10
  151. package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  152. package/cjs/pages/SettingsPage/GasPriceSelect.js +1 -1
  153. package/cjs/pages/SettingsPage/LanguageSelect.js +5 -6
  154. package/cjs/pages/SettingsPage/ResetSettingsButton.d.ts +2 -0
  155. package/cjs/pages/SettingsPage/ResetSettingsButton.js +27 -0
  156. package/cjs/pages/SettingsPage/RoutePrioritySelect.js +4 -4
  157. package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
  158. package/cjs/pages/SettingsPage/SettingsPage.js +3 -2
  159. package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  160. package/cjs/pages/SettingsPage/ShowDestinationWallet.js +3 -3
  161. package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
  162. package/cjs/pages/SettingsPage/SlippageInput.js +3 -3
  163. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +14 -22
  164. package/cjs/pages/SwapDetailsPage/SwapDetailsPage.style.d.ts +1 -1
  165. package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
  166. package/cjs/pages/SwapHistoryPage/SwapHistoryItem.js +9 -7
  167. package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  168. package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +21 -26
  169. package/cjs/pages/SwapPage/StartSwapButton.js +1 -1
  170. package/cjs/pages/SwapPage/StatusBottomSheet.js +21 -19
  171. package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +2 -2
  172. package/cjs/pages/SwapPage/SwapPage.js +9 -21
  173. package/cjs/pages/SwapPage/SwapPage.style.d.ts +1 -1
  174. package/cjs/pages/SwapPage/TokenValueBottomSheet.js +8 -9
  175. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +3 -3
  176. package/cjs/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
  177. package/cjs/providers/I18nProvider/I18nProvider.js +7 -8
  178. package/cjs/providers/SDKProvider/SDKProvider.js +15 -4
  179. package/cjs/providers/SwapFormProvider/SwapFormProvider.js +12 -6
  180. package/cjs/providers/SwapFormProvider/URLSearchParamsBuilder.js +3 -12
  181. package/cjs/providers/TelemetryProvider/TelemetryProvider.js +1 -1
  182. package/cjs/providers/ThemeProvider/ThemeProvider.js +2 -2
  183. package/cjs/providers/WalletProvider/WalletProvider.js +30 -39
  184. package/cjs/providers/WidgetProvider/WidgetProvider.js +18 -23
  185. package/cjs/providers/WidgetProvider/utils.js +2 -3
  186. package/cjs/stores/StoreProvider.js +2 -2
  187. package/cjs/stores/chains/ChainOrderStore.js +2 -14
  188. package/cjs/stores/routes/RouteExecutionStore.js +2 -14
  189. package/cjs/stores/routes/createRouteExecutionStore.js +27 -16
  190. package/cjs/stores/routes/useExecutingRoutesIds.js +2 -5
  191. package/cjs/stores/routes/useSwapHistory.js +3 -6
  192. package/cjs/stores/routes/utils.js +4 -4
  193. package/cjs/stores/settings/SettingsStore.js +10 -20
  194. package/cjs/stores/settings/createSettingsStore.js +29 -25
  195. package/cjs/stores/settings/types.d.ts +6 -6
  196. package/cjs/utils/colors.js +1 -1
  197. package/cjs/utils/format.js +3 -3
  198. package/cjs/utils/index.d.ts +0 -1
  199. package/cjs/utils/index.js +0 -1
  200. package/cjs/utils/navigationRoutes.d.ts +2 -0
  201. package/cjs/utils/navigationRoutes.js +6 -0
  202. package/components/ActiveSwaps/ActiveSwapItem.js +9 -7
  203. package/components/ActiveSwaps/ActiveSwaps.js +3 -3
  204. package/components/ActiveSwaps/ActiveSwaps.style.d.ts +3 -3
  205. package/components/AppContainer.d.ts +2 -2
  206. package/components/AppContainer.js +1 -1
  207. package/components/BottomSheet/BottomSheet.d.ts +1 -1
  208. package/components/BottomSheet/BottomSheet.js +2 -2
  209. package/components/Card/Card.d.ts +2 -2
  210. package/components/Card/CardHeader.d.ts +1 -1
  211. package/components/Card/CardTitle.d.ts +1 -1
  212. package/components/ChainSelect/ChainSelect.d.ts +0 -1
  213. package/components/ChainSelect/ChainSelect.js +3 -4
  214. package/components/ChainSelect/ChainSelect.style.d.ts +3 -3
  215. package/components/ContractComponent/ContractComponent.js +1 -1
  216. package/components/Dialog.js +1 -1
  217. package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +13 -28
  218. package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +1 -1
  219. package/components/Header/Header.js +1 -1
  220. package/components/Header/Header.style.d.ts +3 -3
  221. package/components/Header/NavigationHeader.js +6 -2
  222. package/components/Header/WalletHeader.js +12 -22
  223. package/{pages/SelectChainPage/SelectChainPage.style.d.ts → components/ListItemButton.d.ts} +1 -2
  224. package/components/ListItemButton.js +11 -0
  225. package/components/ListItemText.d.ts +2 -0
  226. package/components/ListItemText.js +8 -0
  227. package/components/NFT/NFT.js +2 -14
  228. package/components/NFT/NFT.style.d.ts +1 -1
  229. package/components/NotFound.js +2 -2
  230. package/components/PoweredBy/PoweredBy.js +2 -2
  231. package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
  232. package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +5 -17
  233. package/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
  234. package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
  235. package/components/Select.js +1 -0
  236. package/components/SelectChainAndToken.js +4 -4
  237. package/components/SelectTokenButton/SelectTokenButton.js +2 -2
  238. package/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
  239. package/components/SendToWallet/SendToWallet.js +9 -19
  240. package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
  241. package/components/SendToWallet/SendToWalletButton.js +5 -5
  242. package/components/SmallAvatar.d.ts +3 -3
  243. package/components/Step/CircularProgress.d.ts +0 -1
  244. package/components/Step/CircularProgress.js +2 -2
  245. package/components/Step/CircularProgress.style.d.ts +1 -1
  246. package/components/Step/DestinationWalletAddress.js +6 -7
  247. package/components/Step/GasStepProcess.js +8 -8
  248. package/components/Step/Step.js +4 -5
  249. package/components/Step/StepList.d.ts +0 -1
  250. package/components/Step/StepList.js +8 -4
  251. package/components/Step/StepProcess.js +3 -3
  252. package/components/Step/StepProcess.style.d.ts +2 -2
  253. package/components/Step/StepTimer.js +4 -8
  254. package/components/StepActions/StepActions.js +20 -37
  255. package/components/StepActions/StepActions.style.d.ts +1 -1
  256. package/components/StepDivider/StepDivider.style.d.ts +1 -1
  257. package/components/SwapButton/SwapButton.js +5 -14
  258. package/components/SwapInput/FormPriceHelperText.js +6 -6
  259. package/components/SwapInput/SwapInput.js +4 -16
  260. package/components/SwapInput/SwapInput.style.d.ts +1 -1
  261. package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
  262. package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
  263. package/components/SwapInput/SwapInputEndAdornment.js +2 -3
  264. package/components/SwapRouteCard/SwapRouteCard.js +9 -25
  265. package/components/SwapRouteCard/SwapRouteCard.style.d.ts +2 -2
  266. package/components/SwapRouteCard/SwapRouteCardSkeleton.js +4 -16
  267. package/components/SwapRouteCard/SwapRouteNotFoundCard.js +2 -2
  268. package/components/SwapRouteCard/utils.js +1 -1
  269. package/components/SwapRoutes/SwapRoutes.js +4 -4
  270. package/components/SwapRoutes/SwapRoutes.style.d.ts +5 -5
  271. package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
  272. package/components/SwapRoutes/SwapRoutesExpanded.js +3 -3
  273. package/components/TextFitter/TextFitter.js +3 -3
  274. package/components/Token/Token.js +19 -33
  275. package/components/Token/Token.style.d.ts +3 -3
  276. package/components/TokenAvatar/TokenAvatar.js +6 -7
  277. package/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
  278. package/components/TokenList/TokenList.js +3 -4
  279. package/components/TokenList/TokenList.style.d.ts +2 -2
  280. package/components/TokenList/TokenList.style.js +3 -7
  281. package/components/TokenList/TokenListItem.js +9 -9
  282. package/components/TokenList/TokenNotFound.js +4 -5
  283. package/components/TokenList/VirtualizedTokenList.js +10 -11
  284. package/components/TokenList/useTokenSelect.js +2 -2
  285. package/config/env.js +1 -1
  286. package/config/sentry.js +3 -12
  287. package/config/theme.js +44 -16
  288. package/config/version.d.ts +1 -1
  289. package/config/version.js +1 -1
  290. package/hooks/useChain.js +1 -1
  291. package/hooks/useChains.js +5 -14
  292. package/hooks/useContentHeight.js +1 -2
  293. package/hooks/useFeaturedTokens.js +1 -4
  294. package/hooks/useGasSufficiency.js +28 -34
  295. package/hooks/useProcessMessage.js +7 -11
  296. package/hooks/useRouteExecution.js +17 -28
  297. package/hooks/useSwapRoutes.js +16 -26
  298. package/hooks/useToken.js +2 -2
  299. package/hooks/useTokenAddressBalance.js +1 -2
  300. package/hooks/useTokenBalance.js +24 -27
  301. package/hooks/useTokenBalances.d.ts +1 -1
  302. package/hooks/useTokenBalances.js +8 -20
  303. package/hooks/useTokenSearch.d.ts +1 -1
  304. package/hooks/useTokenSearch.js +12 -21
  305. package/hooks/useTokens.d.ts +1 -1
  306. package/hooks/useTokens.js +36 -38
  307. package/hooks/useTools.d.ts +2 -11
  308. package/hooks/useTools.js +10 -19
  309. package/i18n/en.json +8 -4
  310. package/icons/LiFiFullLogo.js +1 -1
  311. package/icons/LiFiLogo.js +1 -1
  312. package/icons/LiFiToolLogo.js +1 -1
  313. package/index.d.ts +1 -0
  314. package/index.js +2 -0
  315. package/package.json +9 -9
  316. package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +2 -2
  317. package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
  318. package/pages/ActiveSwapsPage/ActiveSwapsPage.js +3 -3
  319. package/pages/MainPage/MainPage.js +1 -1
  320. package/pages/MainPage/MainPage.style.d.ts +1 -1
  321. package/pages/MainPage/MainSwapButton.js +3 -12
  322. package/pages/SelectChainPage/SelectChainPage.js +6 -14
  323. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.d.ts +4 -0
  324. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +47 -0
  325. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +20 -0
  326. package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +5 -0
  327. package/pages/SelectEnabledToolsPage/index.d.ts +1 -0
  328. package/pages/SelectEnabledToolsPage/index.js +1 -0
  329. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +4 -3
  330. package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
  331. package/pages/SelectTokenPage/SearchTokenInput.js +4 -1
  332. package/pages/SelectTokenPage/SelectTokenPage.js +2 -3
  333. package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  334. package/pages/SelectWalletPage/SelectWalletPage.js +13 -19
  335. package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -3
  336. package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
  337. package/pages/SettingsPage/EnabledToolsButton.d.ts +4 -0
  338. package/pages/SettingsPage/EnabledToolsButton.js +21 -0
  339. package/{cjs/pages/SelectWalletPage/SelectWalletPage.style.d.ts → pages/SettingsPage/EnabledToolsButton.style.d.ts} +1 -1
  340. package/pages/SettingsPage/EnabledToolsButton.style.js +14 -0
  341. package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
  342. package/pages/SettingsPage/GasPriceSelect.js +1 -1
  343. package/pages/SettingsPage/LanguageSelect.js +5 -6
  344. package/pages/SettingsPage/ResetSettingsButton.d.ts +2 -0
  345. package/pages/SettingsPage/ResetSettingsButton.js +23 -0
  346. package/pages/SettingsPage/RoutePrioritySelect.js +4 -4
  347. package/pages/SettingsPage/SettingsPage.d.ts +0 -1
  348. package/pages/SettingsPage/SettingsPage.js +3 -2
  349. package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
  350. package/pages/SettingsPage/ShowDestinationWallet.js +3 -3
  351. package/pages/SettingsPage/SlippageInput.d.ts +0 -1
  352. package/pages/SettingsPage/SlippageInput.js +3 -3
  353. package/pages/SwapDetailsPage/SwapDetailsPage.js +14 -22
  354. package/pages/SwapDetailsPage/SwapDetailsPage.style.d.ts +1 -1
  355. package/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
  356. package/pages/SwapHistoryPage/SwapHistoryItem.js +9 -7
  357. package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
  358. package/pages/SwapPage/ExchangeRateBottomSheet.js +21 -26
  359. package/pages/SwapPage/StartSwapButton.js +1 -1
  360. package/pages/SwapPage/StatusBottomSheet.js +21 -19
  361. package/pages/SwapPage/StatusBottomSheet.style.d.ts +2 -2
  362. package/pages/SwapPage/SwapPage.js +9 -21
  363. package/pages/SwapPage/SwapPage.style.d.ts +1 -1
  364. package/pages/SwapPage/TokenValueBottomSheet.js +8 -9
  365. package/pages/SwapRoutesPage/SwapRoutesPage.js +3 -3
  366. package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
  367. package/providers/I18nProvider/I18nProvider.js +7 -8
  368. package/providers/SDKProvider/SDKProvider.js +15 -4
  369. package/providers/SwapFormProvider/SwapFormProvider.js +12 -6
  370. package/providers/SwapFormProvider/URLSearchParamsBuilder.js +3 -12
  371. package/providers/TelemetryProvider/TelemetryProvider.js +1 -1
  372. package/providers/ThemeProvider/ThemeProvider.js +2 -2
  373. package/providers/WalletProvider/WalletProvider.js +30 -39
  374. package/providers/WidgetProvider/WidgetProvider.js +18 -23
  375. package/providers/WidgetProvider/utils.js +2 -3
  376. package/stores/StoreProvider.js +2 -2
  377. package/stores/chains/ChainOrderStore.js +2 -14
  378. package/stores/routes/RouteExecutionStore.js +2 -14
  379. package/stores/routes/createRouteExecutionStore.js +27 -16
  380. package/stores/routes/useExecutingRoutesIds.js +2 -5
  381. package/stores/routes/useSwapHistory.js +3 -6
  382. package/stores/routes/utils.js +4 -4
  383. package/stores/settings/SettingsStore.js +10 -20
  384. package/stores/settings/createSettingsStore.js +29 -25
  385. package/stores/settings/types.d.ts +6 -6
  386. package/tsconfig.cjs.tsbuildinfo +1 -1
  387. package/utils/colors.js +1 -1
  388. package/utils/format.js +3 -3
  389. package/utils/index.d.ts +0 -1
  390. package/utils/index.js +0 -1
  391. package/utils/navigationRoutes.d.ts +2 -0
  392. package/utils/navigationRoutes.js +6 -0
  393. package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -2
  394. package/cjs/pages/SettingsPage/AdvancedPreferences.js +0 -24
  395. package/cjs/pages/SettingsPage/EnabledBridgesSelect.d.ts +0 -2
  396. package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +0 -24
  397. package/cjs/pages/SettingsPage/EnabledExchangesSelect.d.ts +0 -2
  398. package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +0 -24
  399. package/cjs/utils/deepClone.d.ts +0 -1
  400. package/cjs/utils/deepClone.js +0 -7
  401. package/pages/SelectChainPage/SelectChainPage.style.js +0 -17
  402. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts +0 -21
  403. package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +0 -17
  404. package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +0 -21
  405. package/pages/SelectWalletPage/SelectWalletPage.style.js +0 -17
  406. package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -2
  407. package/pages/SettingsPage/AdvancedPreferences.js +0 -20
  408. package/pages/SettingsPage/EnabledBridgesSelect.d.ts +0 -2
  409. package/pages/SettingsPage/EnabledBridgesSelect.js +0 -20
  410. package/pages/SettingsPage/EnabledExchangesSelect.d.ts +0 -2
  411. package/pages/SettingsPage/EnabledExchangesSelect.js +0 -20
  412. package/utils/deepClone.d.ts +0 -1
  413. package/utils/deepClone.js +0 -3
@@ -4,18 +4,19 @@ exports.SelectNativeTokenPage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
6
  const react_i18next_1 = require("react-i18next");
7
+ const ListItemButton_1 = require("../../components/ListItemButton");
8
+ const ListItemText_1 = require("../../components/ListItemText");
7
9
  const TokenAvatar_1 = require("../../components/TokenAvatar");
8
10
  const TokenList_1 = require("../../components/TokenList");
9
11
  const hooks_1 = require("../../hooks");
10
- const SelectNativeTokenPage_style_1 = require("./SelectNativeTokenPage.style");
11
12
  const SelectNativeTokenPage = ({ formType, }) => {
12
13
  const { t } = (0, react_i18next_1.useTranslation)();
13
14
  const { navigateBack } = (0, hooks_1.useNavigateBack)();
14
15
  const { chains } = (0, hooks_1.useChains)();
15
16
  const selectToken = (0, TokenList_1.useTokenSelect)(formType, navigateBack);
16
- return ((0, jsx_runtime_1.jsx)(material_1.Container, Object.assign({ disableGutters: true }, { children: (0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ sx: {
17
+ return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
17
18
  paddingLeft: 1.5,
18
19
  paddingRight: 1.5,
19
- } }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => ((0, jsx_runtime_1.jsxs)(SelectNativeTokenPage_style_1.ListItemButton, Object.assign({ onClick: () => selectToken(chain.nativeToken.address, chain.id), disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: chain.nativeToken, chain: chain }) }), (0, jsx_runtime_1.jsx)(SelectNativeTokenPage_style_1.ListItemText, { primary: chain.nativeToken.symbol, secondary: t('swap.onChain', { chainName: chain.name }) })] }), chain.id))) })) })));
20
+ }, children: chains?.map((chain) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => selectToken(chain.nativeToken.address, chain.id), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: chain.nativeToken, chain: chain }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: chain.nativeToken.symbol, secondary: t('swap.onChain', { chainName: chain.name }) })] }, chain.id))) }) }));
20
21
  };
21
22
  exports.SelectNativeTokenPage = SelectNativeTokenPage;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const SearchTokenInput: () => JSX.Element;
@@ -16,6 +16,9 @@ const SearchTokenInput = () => {
16
16
  (0, react_1.useEffect)(() => () => {
17
17
  setValue(providers_1.SwapFormKey.TokenSearchFilter, '');
18
18
  }, [setValue]);
19
- return ((0, jsx_runtime_1.jsx)(Card_1.Card, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(SearchTokenInput_style_1.Input, { size: "small", placeholder: t(`swap.tokenSearch`), defaultValue: "", endAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.Search, {}) })), inputProps: Object.assign({ inputMode: 'search' }, register(providers_1.SwapFormKey.TokenSearchFilter)), autoComplete: "off" }) })) }));
19
+ return ((0, jsx_runtime_1.jsx)(Card_1.Card, { children: (0, jsx_runtime_1.jsx)(material_1.FormControl, { fullWidth: true, children: (0, jsx_runtime_1.jsx)(SearchTokenInput_style_1.Input, { size: "small", placeholder: t(`swap.tokenSearch`), defaultValue: "", endAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: (0, jsx_runtime_1.jsx)(icons_material_1.Search, {}) }), inputProps: {
20
+ inputMode: 'search',
21
+ ...register(providers_1.SwapFormKey.TokenSearchFilter),
22
+ }, autoComplete: "off" }) }) }));
20
23
  };
21
24
  exports.SearchTokenInput = SearchTokenInput;
@@ -16,9 +16,8 @@ const SelectTokenPage = ({ formType }) => {
16
16
  const contentHeight = (0, hooks_1.useContentHeight)();
17
17
  const [tokenListHeight, setTokenListHeight] = (0, react_1.useState)(0);
18
18
  (0, react_1.useLayoutEffect)(() => {
19
- var _a, _b;
20
- setTokenListHeight(Math.max(contentHeight - ((_b = (_a = headerRef.current) === null || _a === void 0 ? void 0 : _a.offsetHeight) !== null && _b !== void 0 ? _b : 0), minTokenListHeight));
19
+ setTokenListHeight(Math.max(contentHeight - (headerRef.current?.offsetHeight ?? 0), minTokenListHeight));
21
20
  }, [contentHeight]);
22
- return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ pt: 1, pb: 2, px: 3, ref: headerRef }, { children: [(0, jsx_runtime_1.jsx)(ChainSelect_1.ChainSelect, { formType: formType }), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(SearchTokenInput_1.SearchTokenInput, {}) }))] })), (0, jsx_runtime_1.jsx)(TokenList_1.TokenList, { height: tokenListHeight, onClick: navigateBack, formType: formType })] })));
21
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { disableGutters: true, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { pt: 1, pb: 2, px: 3, ref: headerRef, children: [(0, jsx_runtime_1.jsx)(ChainSelect_1.ChainSelect, { formType: formType }), (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsx)(SearchTokenInput_1.SearchTokenInput, {}) })] }), (0, jsx_runtime_1.jsx)(TokenList_1.TokenList, { height: tokenListHeight, onClick: navigateBack, formType: formType })] }));
23
22
  };
24
23
  exports.SelectTokenPage = SelectTokenPage;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const SelectWalletPage: () => JSX.Element;
@@ -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.SelectWalletPage = void 0;
13
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -16,19 +7,22 @@ const material_1 = require("@mui/material");
16
7
  const react_1 = require("react");
17
8
  const react_i18next_1 = require("react-i18next");
18
9
  const Dialog_1 = require("../../components/Dialog");
10
+ const ListItemButton_1 = require("../../components/ListItemButton");
11
+ const ListItemText_1 = require("../../components/ListItemText");
19
12
  const hooks_1 = require("../../hooks");
20
13
  const providers_1 = require("../../providers");
21
- const SelectWalletPage_style_1 = require("./SelectWalletPage.style");
22
14
  const SelectWalletPage = () => {
23
- var _a;
24
15
  const { t } = (0, react_i18next_1.useTranslation)();
25
16
  const { navigateBack } = (0, hooks_1.useNavigateBack)();
26
17
  const { connect } = (0, providers_1.useWallet)();
27
18
  const [walletIdentity, setWalletIdentity] = (0, react_1.useState)({ show: false });
28
19
  const closeDialog = () => {
29
- setWalletIdentity((state) => (Object.assign(Object.assign({}, state), { show: false })));
20
+ setWalletIdentity((state) => ({
21
+ ...state,
22
+ show: false,
23
+ }));
30
24
  };
31
- const handleConnect = (0, react_1.useCallback)((wallet) => __awaiter(void 0, void 0, void 0, function* () {
25
+ const handleConnect = (0, react_1.useCallback)(async (wallet) => {
32
26
  const { ethereum } = window;
33
27
  const identityCheckPassed = wallet.checkProviderIdentity({
34
28
  provider: ethereum,
@@ -41,13 +35,13 @@ const SelectWalletPage = () => {
41
35
  return;
42
36
  }
43
37
  navigateBack();
44
- yield connect(wallet);
45
- }), [connect, navigateBack]);
46
- return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ sx: {
38
+ await connect(wallet);
39
+ }, [connect, navigateBack]);
40
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { disableGutters: true, children: [(0, jsx_runtime_1.jsx)(material_1.List, { sx: {
47
41
  paddingLeft: 1.5,
48
42
  paddingRight: 1.5,
49
- } }, { children: wallet_management_1.supportedWallets.map((wallet) => ((0, jsx_runtime_1.jsxs)(SelectWalletPage_style_1.ListItemButton, Object.assign({ onClick: () => handleConnect(wallet), disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: wallet.icon.src || wallet.icon, alt: wallet.name }, { children: wallet.name[0] })) }), (0, jsx_runtime_1.jsx)(SelectWalletPage_style_1.ListItemText, { primary: wallet.name })] }), wallet.name))) })), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({ open: walletIdentity.show, onClose: closeDialog }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('wallet.extensionNotFound', {
50
- name: (_a = walletIdentity.wallet) === null || _a === void 0 ? void 0 : _a.name,
51
- }) }) }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", onClick: closeDialog, autoFocus: true }, { children: t('button.ok') })) })] }))] })));
43
+ }, children: wallet_management_1.supportedWallets.map((wallet) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => handleConnect(wallet), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: wallet.icon.src || wallet.icon, alt: wallet.name, children: wallet.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: wallet.name })] }, wallet.name))) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: walletIdentity.show, onClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('wallet.extensionNotFound', {
44
+ name: walletIdentity.wallet?.name,
45
+ }) }) }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: closeDialog, autoFocus: true, children: t('button.ok') }) })] })] }));
52
46
  };
53
47
  exports.SelectWalletPage = SelectWalletPage;
@@ -13,13 +13,13 @@ const ColorSchemeButtonGroup = () => {
13
13
  const { t } = (0, react_i18next_1.useTranslation)();
14
14
  const { disableAppearance, hiddenUI } = (0, providers_1.useWidgetConfig)();
15
15
  const [appearance, setAppearance] = (0, stores_1.useAppearance)();
16
- if (disableAppearance || (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(types_1.HiddenUI.Appearance))) {
16
+ if (disableAppearance || hiddenUI?.includes(types_1.HiddenUI.Appearance)) {
17
17
  return null;
18
18
  }
19
- return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ pb: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.ToggleButtonGroup, Object.assign({ color: "primary", value: appearance, onChange: (_, value) => {
19
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { pb: 2, children: (0, jsx_runtime_1.jsxs)(material_1.ToggleButtonGroup, { color: "primary", value: appearance, onChange: (_, value) => {
20
20
  if (value) {
21
21
  setAppearance(value);
22
22
  }
23
- }, exclusive: true, fullWidth: true }, { children: [(0, jsx_runtime_1.jsxs)(ColorSchemeButtonGroup_style_1.ToggleButton, Object.assign({ value: "light" }, { children: [(0, jsx_runtime_1.jsx)(icons_material_1.LightMode, { sx: { marginRight: 1 } }), t('button.light')] })), (0, jsx_runtime_1.jsxs)(ColorSchemeButtonGroup_style_1.ToggleButton, Object.assign({ value: "dark" }, { children: [(0, jsx_runtime_1.jsx)(icons_material_1.DarkMode, { sx: { marginRight: 1 } }), t('button.dark')] })), (0, jsx_runtime_1.jsxs)(ColorSchemeButtonGroup_style_1.ToggleButton, Object.assign({ value: "auto" }, { children: [(0, jsx_runtime_1.jsx)(icons_material_1.Brightness4, { sx: { marginRight: 1 } }), t('button.auto')] }))] })) })));
23
+ }, exclusive: true, fullWidth: true, children: [(0, jsx_runtime_1.jsxs)(ColorSchemeButtonGroup_style_1.ToggleButton, { value: "light", children: [(0, jsx_runtime_1.jsx)(icons_material_1.LightMode, { sx: { marginRight: 1 } }), t('button.light')] }), (0, jsx_runtime_1.jsxs)(ColorSchemeButtonGroup_style_1.ToggleButton, { value: "dark", children: [(0, jsx_runtime_1.jsx)(icons_material_1.DarkMode, { sx: { marginRight: 1 } }), t('button.dark')] }), (0, jsx_runtime_1.jsxs)(ColorSchemeButtonGroup_style_1.ToggleButton, { value: "auto", children: [(0, jsx_runtime_1.jsx)(icons_material_1.Brightness4, { sx: { marginRight: 1 } }), t('button.auto')] })] }) }));
24
24
  };
25
25
  exports.ColorSchemeButtonGroup = ColorSchemeButtonGroup;
@@ -28,6 +28,6 @@ export declare const ToggleButton: import("@emotion/styled").StyledComponent<{
28
28
  tabIndex?: number | undefined;
29
29
  TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
30
30
  touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
31
- }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "key" | keyof import("react").ButtonHTMLAttributes<HTMLButtonElement>> & {
31
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
32
32
  ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
33
33
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "color" | "children" | "onChange" | "onClick" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "disableFocusRipple" | "fullWidth" | "size" | "value" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const EnabledToolsButton: React.FC<{
3
+ type: 'Bridges' | 'Exchanges';
4
+ }>;
@@ -0,0 +1,25 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.EnabledToolsButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const icons_material_1 = require("@mui/icons-material");
6
+ const material_1 = require("@mui/material");
7
+ const react_i18next_1 = require("react-i18next");
8
+ const react_router_dom_1 = require("react-router-dom");
9
+ const shallow_1 = require("zustand/shallow");
10
+ const stores_1 = require("../../stores");
11
+ const utils_1 = require("../../utils");
12
+ const EnabledToolsButton_style_1 = require("./EnabledToolsButton.style");
13
+ const EnabledToolsButton = ({ type }) => {
14
+ const { t } = (0, react_i18next_1.useTranslation)();
15
+ const navigate = (0, react_router_dom_1.useNavigate)();
16
+ const [enabledTools, tools] = (0, stores_1.useSettingsStore)((state) => {
17
+ const enabledTools = Object.values(state[`_enabled${type}`] ?? {});
18
+ return [enabledTools.filter((tool) => tool).length, enabledTools.length];
19
+ }, shallow_1.shallow);
20
+ const handleClick = () => {
21
+ navigate(utils_1.navigationRoutes[type.toLowerCase()]);
22
+ };
23
+ return ((0, jsx_runtime_1.jsxs)(EnabledToolsButton_style_1.ListItemButton, { onClick: handleClick, disableRipple: true, children: [(0, jsx_runtime_1.jsx)(EnabledToolsButton_style_1.ListItemText, { primary: t(`settings.enabled${type}`) }), (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(EnabledToolsButton_style_1.ListItemText, { primary: `${enabledTools}/${tools}` }), (0, jsx_runtime_1.jsx)(icons_material_1.ChevronRight, {})] })] }));
24
+ };
25
+ exports.EnabledToolsButton = EnabledToolsButton;
@@ -15,7 +15,7 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
15
15
  tabIndex?: number | undefined;
16
16
  TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
17
17
  touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
18
- }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
18
+ }, "classes"> & 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
  }, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
21
21
  export declare const ListItemText: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemTextProps<import("react").ElementType<any>, import("react").ElementType<any>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -4,17 +4,14 @@ exports.ListItemText = exports.ListItemButton = void 0;
4
4
  const material_1 = require("@mui/material");
5
5
  const ListItemText_1 = require("@mui/material/ListItemText");
6
6
  const styles_1 = require("@mui/material/styles");
7
- const utils_1 = require("../../utils");
8
- exports.ListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ theme }) => ({
9
- borderRadius: theme.shape.borderRadius,
10
- paddingLeft: theme.spacing(1.5),
11
- height: 56,
12
- '&:hover': {
13
- backgroundColor: (0, utils_1.getContrastAlphaColor)(theme, '4%'),
14
- },
7
+ const ListItemButton_1 = require("../../components/ListItemButton");
8
+ exports.ListItemButton = (0, styles_1.styled)(ListItemButton_1.ListItemButton)(({ theme }) => ({
9
+ height: 48,
10
+ paddingRight: theme.spacing(0.5),
15
11
  }));
16
- exports.ListItemText = (0, styles_1.styled)(material_1.ListItemText)(({ theme }) => ({
12
+ exports.ListItemText = (0, styles_1.styled)(material_1.ListItemText)({
17
13
  [`.${ListItemText_1.listItemTextClasses.primary}`]: {
18
14
  fontWeight: 400,
15
+ fontSize: '1rem',
19
16
  },
20
- }));
17
+ });
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const GasPriceSelect: () => JSX.Element;
@@ -12,6 +12,6 @@ const GasPriceSelect = () => {
12
12
  const { t } = (0, react_i18next_1.useTranslation)();
13
13
  const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
14
14
  const { gasPrice } = (0, stores_1.useSettings)(['gasPrice']);
15
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ flex: 1 }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.gasPrice.title`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsxs)(Select_1.Select, Object.assign({ MenuProps: { elevation: 2 }, value: gasPrice, onChange: (event) => setValue('gasPrice', event.target.value), IconComponent: icons_material_1.KeyboardArrowDown, dense: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: "slow" }, { children: t(`settings.gasPrice.slow`) })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: "normal" }, { children: t(`settings.gasPrice.normal`) })), (0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: "fast" }, { children: t(`settings.gasPrice.fast`) }))] })) }))] })));
15
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { flex: 1, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.gasPrice.title`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, { fullWidth: true, children: (0, jsx_runtime_1.jsxs)(Select_1.Select, { MenuProps: { elevation: 2 }, value: gasPrice, onChange: (event) => setValue('gasPrice', event.target.value), IconComponent: icons_material_1.KeyboardArrowDown, dense: true, children: [(0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "slow", children: t(`settings.gasPrice.slow`) }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "normal", children: t(`settings.gasPrice.normal`) }), (0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: "fast", children: t(`settings.gasPrice.fast`) })] }) })] }));
16
16
  };
17
17
  exports.GasPriceSelect = GasPriceSelect;
@@ -11,12 +11,11 @@ const providers_1 = require("../../providers");
11
11
  const stores_1 = require("../../stores");
12
12
  const types_1 = require("../../types");
13
13
  const LanguageSelect = () => {
14
- var _a;
15
14
  const { t, i18n } = (0, react_i18next_1.useTranslation)();
16
15
  const { languages, hiddenUI } = (0, providers_1.useWidgetConfig)();
17
16
  const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
18
17
  const { language } = (0, stores_1.useSettings)(['language']);
19
- if (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(types_1.HiddenUI.Language)) {
18
+ if (hiddenUI?.includes(types_1.HiddenUI.Language)) {
20
19
  return null;
21
20
  }
22
21
  const handleChangeLanguage = (event) => {
@@ -30,9 +29,9 @@ const LanguageSelect = () => {
30
29
  }
31
30
  const value = filteredLanguages.includes(language || i18n.resolvedLanguage)
32
31
  ? language || i18n.resolvedLanguage
33
- : (languages === null || languages === void 0 ? void 0 : languages.default) || ((_a = languages === null || languages === void 0 ? void 0 : languages.allow) === null || _a === void 0 ? void 0 : _a[0]);
34
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ mb: 2 }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`language.title`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(Select_1.Select, Object.assign({ MenuProps: { elevation: 2 }, value: value, onChange: handleChangeLanguage, IconComponent: icons_material_1.KeyboardArrowDown, dense: true }, { children: filteredLanguages.map((lng) => {
35
- return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: lng }, { children: t('language.name', { lng }) }), lng));
36
- }) })) }))] })));
32
+ : languages?.default || languages?.allow?.[0];
33
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { mb: 2, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`language.title`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, { fullWidth: true, children: (0, jsx_runtime_1.jsx)(Select_1.Select, { MenuProps: { elevation: 2 }, value: value, onChange: handleChangeLanguage, IconComponent: icons_material_1.KeyboardArrowDown, dense: true, children: filteredLanguages.map((lng) => {
34
+ return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: lng, children: t('language.name', { lng }) }, lng));
35
+ }) }) })] }));
37
36
  };
38
37
  exports.LanguageSelect = LanguageSelect;
@@ -0,0 +1,2 @@
1
+ /// <reference types="react" />
2
+ export declare const ResetSettingsButton: React.FC;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ResetSettingsButton = void 0;
4
+ const jsx_runtime_1 = require("react/jsx-runtime");
5
+ const material_1 = require("@mui/material");
6
+ const react_1 = require("react");
7
+ const react_i18next_1 = require("react-i18next");
8
+ const Dialog_1 = require("../../components/Dialog");
9
+ const hooks_1 = require("../../hooks");
10
+ const stores_1 = require("../../stores");
11
+ const ResetSettingsButton = () => {
12
+ const { t } = (0, react_i18next_1.useTranslation)();
13
+ const { tools } = (0, hooks_1.useTools)();
14
+ const resetSettings = (0, stores_1.useSettingsStore)((state) => state.reset);
15
+ const [open, setOpen] = (0, react_1.useState)(false);
16
+ const toggleDialog = (0, react_1.useCallback)(() => {
17
+ setOpen((open) => !open);
18
+ }, []);
19
+ const handleReset = () => {
20
+ if (tools) {
21
+ resetSettings(tools.bridges.map((tool) => tool.key), tools.exchanges.map((tool) => tool.key));
22
+ }
23
+ toggleDialog();
24
+ };
25
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { px: 3, mt: 1.5, children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, fullWidth: true, children: t('button.resetSettings') }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.resetSettings') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.resetSettings') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleReset, autoFocus: true, children: t('button.reset') })] })] })] }));
26
+ };
27
+ exports.ResetSettingsButton = ResetSettingsButton;
@@ -13,11 +13,11 @@ const RoutePrioritySelect = () => {
13
13
  const { t } = (0, react_i18next_1.useTranslation)();
14
14
  const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
15
15
  const { routePriority } = (0, stores_1.useSettings)(['routePriority']);
16
- const value = routePriority !== null && routePriority !== void 0 ? routePriority : '';
17
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.routePriority`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(Select_1.Select, Object.assign({ MenuProps: { elevation: 2 }, value: value, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: icons_material_1.KeyboardArrowDown, dense: true }, { children: sdk_1.Orders.map((order) => {
16
+ const value = routePriority ?? '';
17
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.routePriority`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, { fullWidth: true, children: (0, jsx_runtime_1.jsx)(Select_1.Select, { MenuProps: { elevation: 2 }, value: value, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: icons_material_1.KeyboardArrowDown, dense: true, children: sdk_1.Orders.map((order) => {
18
18
  const tag = t(`swap.tags.${order.toUpperCase()}`);
19
19
  const tagName = `${tag[0]}${tag.slice(1).toLowerCase()}`;
20
- return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: order }, { children: tagName }), order));
21
- }) })) }))] }));
20
+ return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, { value: order, children: tagName }, order));
21
+ }) }) })] }));
22
22
  };
23
23
  exports.RoutePrioritySelect = RoutePrioritySelect;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const SettingsPage: () => JSX.Element;
@@ -3,14 +3,15 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SettingsPage = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
5
  const material_1 = require("@mui/material");
6
- const AdvancedPreferences_1 = require("./AdvancedPreferences");
7
6
  const ColorSchemeButtonGroup_1 = require("./ColorSchemeButtonGroup");
7
+ const EnabledToolsButton_1 = require("./EnabledToolsButton");
8
8
  const GasPriceSelect_1 = require("./GasPriceSelect");
9
9
  const LanguageSelect_1 = require("./LanguageSelect");
10
+ const ResetSettingsButton_1 = require("./ResetSettingsButton");
10
11
  const RoutePrioritySelect_1 = require("./RoutePrioritySelect");
11
12
  const ShowDestinationWallet_1 = require("./ShowDestinationWallet");
12
13
  const SlippageInput_1 = require("./SlippageInput");
13
14
  const SettingsPage = () => {
14
- return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ px: 3, pt: 1 }, { children: [(0, jsx_runtime_1.jsx)(ColorSchemeButtonGroup_1.ColorSchemeButtonGroup, {}), (0, jsx_runtime_1.jsx)(LanguageSelect_1.LanguageSelect, {}), (0, jsx_runtime_1.jsx)(RoutePrioritySelect_1.RoutePrioritySelect, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' }, mt: 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ pr: 2, flex: 1 }, { children: (0, jsx_runtime_1.jsx)(SlippageInput_1.SlippageInput, {}) })), (0, jsx_runtime_1.jsx)(GasPriceSelect_1.GasPriceSelect, {})] }))] })), (0, jsx_runtime_1.jsx)(ShowDestinationWallet_1.ShowDestinationWallet, {}), (0, jsx_runtime_1.jsx)(AdvancedPreferences_1.AdvancedPreferences, {})] })));
15
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { disableGutters: true, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { px: 3, pt: 1, children: [(0, jsx_runtime_1.jsx)(ColorSchemeButtonGroup_1.ColorSchemeButtonGroup, {}), (0, jsx_runtime_1.jsx)(LanguageSelect_1.LanguageSelect, {}), (0, jsx_runtime_1.jsx)(RoutePrioritySelect_1.RoutePrioritySelect, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, mt: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { pr: 2, flex: 1, children: (0, jsx_runtime_1.jsx)(SlippageInput_1.SlippageInput, {}) }), (0, jsx_runtime_1.jsx)(GasPriceSelect_1.GasPriceSelect, {})] })] }), (0, jsx_runtime_1.jsx)(ShowDestinationWallet_1.ShowDestinationWallet, {}), (0, jsx_runtime_1.jsxs)(material_1.Box, { px: 1.5, children: [(0, jsx_runtime_1.jsx)(EnabledToolsButton_1.EnabledToolsButton, { type: "Bridges" }), (0, jsx_runtime_1.jsx)(EnabledToolsButton_1.EnabledToolsButton, { type: "Exchanges" })] }), (0, jsx_runtime_1.jsx)(ResetSettingsButton_1.ResetSettingsButton, {})] }));
15
16
  };
16
17
  exports.SettingsPage = SettingsPage;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ShowDestinationWallet: () => JSX.Element | null;
@@ -14,17 +14,17 @@ const ShowDestinationWallet = () => {
14
14
  const setSendToWallet = (0, stores_1.useSendToWalletStore)((state) => state.setSendToWallet);
15
15
  const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
16
16
  const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
17
- if (hiddenUI === null || hiddenUI === void 0 ? void 0 : hiddenUI.includes(types_1.HiddenUI.ToAddress)) {
17
+ if (hiddenUI?.includes(types_1.HiddenUI.ToAddress)) {
18
18
  return null;
19
19
  }
20
20
  const onChange = (_, checked) => {
21
21
  setValue('showDestinationWallet', checked);
22
22
  setSendToWallet(false);
23
23
  };
24
- return ((0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ px: 3, pt: 2 }, { children: (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
24
+ return ((0, jsx_runtime_1.jsx)(material_1.Box, { px: 3, pt: 2, pb: 1.5, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
25
25
  display: 'flex',
26
26
  justifyContent: 'space-between',
27
27
  alignItems: 'center',
28
- } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ sx: { display: 'flex', alignItems: 'center' } }, { children: (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "subtitle1", color: "text.primary", lineHeight: "normal" }, { children: t(`settings.showDestinationWallet`) })) })), (0, jsx_runtime_1.jsx)(Switch_1.Switch, { checked: showDestinationWallet, onChange: onChange })] })) })));
28
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle1", color: "text.primary", lineHeight: "normal", children: t(`settings.showDestinationWallet`) }) }), (0, jsx_runtime_1.jsx)(Switch_1.Switch, { checked: showDestinationWallet, onChange: onChange })] }) }));
29
29
  };
30
30
  exports.ShowDestinationWallet = ShowDestinationWallet;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const SlippageInput: () => JSX.Element;
@@ -22,9 +22,9 @@ const SlippageInput = () => {
22
22
  const { value } = event.target;
23
23
  setValue('slippage', (0, utils_1.formatSlippage)(value, defaultValue.current));
24
24
  };
25
- const value = slippage !== null && slippage !== void 0 ? slippage : '';
26
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.slippage`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(Input_1.Input, { size: "small", placeholder: t(`settings.slippage`), endAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: "%" })), autoComplete: "off", inputProps: {
25
+ const value = slippage ?? '';
26
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.slippage`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, { fullWidth: true, children: (0, jsx_runtime_1.jsx)(Input_1.Input, { size: "small", placeholder: t(`settings.slippage`), endAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, { position: "end", children: "%" }), autoComplete: "off", inputProps: {
27
27
  inputMode: 'decimal',
28
- }, onChange: handleChange, onBlur: handleBlur, value: value }) }))] }));
28
+ }, onChange: handleChange, onBlur: handleBlur, value: value }) })] }));
29
29
  };
30
30
  exports.SlippageInput = SlippageInput;
@@ -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.SwapDetailsPage = void 0;
13
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -25,11 +16,10 @@ const hooks_1 = require("../../hooks");
25
16
  const stores_1 = require("../../stores");
26
17
  const SwapDetailsPage_style_1 = require("./SwapDetailsPage.style");
27
18
  const SwapDetailsPage = () => {
28
- var _a, _b, _c, _d, _e, _f;
29
19
  const { t, i18n } = (0, react_i18next_1.useTranslation)();
30
20
  const { navigateBack } = (0, hooks_1.useNavigateBack)();
31
21
  const { state } = (0, react_router_dom_1.useLocation)();
32
- const [routeExecution, deleteRoute] = (0, stores_1.useRouteExecutionStore)((store) => [store.routes[state === null || state === void 0 ? void 0 : state.routeId], store.deleteRoute], shallow_1.shallow);
22
+ const [routeExecution, deleteRoute] = (0, stores_1.useRouteExecutionStore)((store) => [store.routes[state?.routeId], store.deleteRoute], shallow_1.shallow);
33
23
  const [open, setOpen] = (0, react_1.useState)(false);
34
24
  const toggleDialog = (0, react_1.useCallback)(() => {
35
25
  setOpen((open) => !open);
@@ -40,26 +30,28 @@ const SwapDetailsPage = () => {
40
30
  deleteRoute(routeExecution.route.id);
41
31
  }
42
32
  };
43
- let supportId = (_d = (_c = (_b = (_a = routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.steps[0].execution) === null || _a === void 0 ? void 0 : _a.process.find((process) => process.txHash)) === null || _b === void 0 ? void 0 : _b.txHash) !== null && _c !== void 0 ? _c : routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.id) !== null && _d !== void 0 ? _d : '';
33
+ let supportId = routeExecution?.route.steps[0].execution?.process.find((process) => process.txHash)?.txHash ??
34
+ routeExecution?.route.id ??
35
+ '';
44
36
  if (process.env.NODE_ENV === 'development') {
45
- supportId += `_${routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.id}`;
37
+ supportId += `_${routeExecution?.route.id}`;
46
38
  }
47
- const copySupportId = () => __awaiter(void 0, void 0, void 0, function* () {
48
- yield navigator.clipboard.writeText(supportId);
49
- });
39
+ const copySupportId = async () => {
40
+ await navigator.clipboard.writeText(supportId);
41
+ };
50
42
  (0, react_1.useEffect)(() => {
51
- return Header_1.useHeaderActionStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", edge: "end", onClick: toggleDialog }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.DeleteOutline, {}) })));
43
+ return Header_1.useHeaderActionStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: (0, jsx_runtime_1.jsx)(icons_material_1.DeleteOutline, {}) }));
52
44
  }, [toggleDialog]);
53
- const startedAt = new Date((_f = (_e = routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route.steps[0].execution) === null || _e === void 0 ? void 0 : _e.process[0].startedAt) !== null && _f !== void 0 ? _f : 0);
54
- return ((0, jsx_runtime_1.jsxs)(SwapDetailsPage_style_1.Container, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
45
+ const startedAt = new Date(routeExecution?.route.steps[0].execution?.process[0].startedAt ?? 0);
46
+ return ((0, jsx_runtime_1.jsxs)(SwapDetailsPage_style_1.Container, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
55
47
  display: 'flex',
56
48
  flex: 1,
57
49
  justifyContent: 'space-between',
58
- }, pb: 1 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, {
50
+ }, pb: 1, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, {
59
51
  timeStyle: 'short',
60
- }).format(startedAt) }))] })), (0, Step_1.getStepList)(routeExecution === null || routeExecution === void 0 ? void 0 : routeExecution.route), (0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ mt: 2 }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
52
+ }).format(startedAt) })] }), (0, Step_1.getStepList)(routeExecution?.route), (0, jsx_runtime_1.jsxs)(Card_1.Card, { mt: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
61
53
  display: 'flex',
62
54
  flex: 1,
63
- } }, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, Object.assign({ flex: 1 }, { children: t('swap.supportId') })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mr: 1, mt: 1 }, { children: (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", onClick: copySupportId }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, { fontSize: "small" }) })) }))] })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' } }, { children: supportId }))] })), (0, jsx_runtime_1.jsx)(material_1.Box, Object.assign({ mt: 2 }, { children: (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ href: "https://discord.com/channels/849912621360218112/863689862514343946", target: "_blank", rel: "nofollow noreferrer", fullWidth: true }, { children: t('button.contactSupport') })) })), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({ open: open, onClose: toggleDialog }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.deleteSwap') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: toggleDialog }, { children: t('button.cancel') })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", onClick: handleDeleteRoute, autoFocus: true }, { children: t('button.delete') }))] })] }))] }));
55
+ }, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { flex: 1, children: t('swap.supportId') }), (0, jsx_runtime_1.jsx)(material_1.Box, { mr: 1, mt: 1, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: copySupportId, children: (0, jsx_runtime_1.jsx)(icons_material_1.ContentCopy, { fontSize: "small" }) }) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { href: "https://discord.com/channels/849912621360218112/863689862514343946", target: "_blank", rel: "nofollow noreferrer", fullWidth: true, children: t('button.contactSupport') }) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.deleteSwap') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleDeleteRoute, autoFocus: true, children: t('button.delete') })] })] })] }));
64
56
  };
65
57
  exports.SwapDetailsPage = SwapDetailsPage;
@@ -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>, {}, {}>;
@@ -7,13 +7,13 @@ const material_1 = require("@mui/material");
7
7
  const react_i18next_1 = require("react-i18next");
8
8
  const SwapHistoryEmpty = () => {
9
9
  const { t } = (0, react_i18next_1.useTranslation)();
10
- return ((0, jsx_runtime_1.jsxs)(material_1.Container, Object.assign({ sx: {
10
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { sx: {
11
11
  display: 'flex',
12
12
  flex: 1,
13
13
  flexDirection: 'column',
14
14
  alignItems: 'center',
15
15
  justifyContent: 'center',
16
16
  paddingY: 12,
17
- } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 48 }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.ReceiptLongRounded, { fontSize: "inherit" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: 700 }, { children: t('swap.info.title.emptySwapHistory') })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2 }, { children: t('swap.info.message.emptySwapHistory') }))] })));
17
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, children: (0, jsx_runtime_1.jsx)(icons_material_1.ReceiptLongRounded, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: 700, children: t('swap.info.title.emptySwapHistory') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('swap.info.message.emptySwapHistory') })] }));
18
18
  };
19
19
  exports.SwapHistoryEmpty = SwapHistoryEmpty;
@@ -9,7 +9,6 @@ const Card_1 = require("../../components/Card");
9
9
  const Token_1 = require("../../components/Token");
10
10
  const utils_1 = require("../../utils");
11
11
  const SwapHistoryItem = ({ route }) => {
12
- var _a, _b, _c, _d, _e, _f, _g, _h;
13
12
  const { i18n } = (0, react_i18next_1.useTranslation)();
14
13
  const navigate = (0, react_router_dom_1.useNavigate)();
15
14
  const handleClick = () => {
@@ -17,15 +16,18 @@ const SwapHistoryItem = ({ route }) => {
17
16
  state: { routeId: route.id },
18
17
  });
19
18
  };
20
- const startedAt = new Date((_b = (_a = route.steps[0].execution) === null || _a === void 0 ? void 0 : _a.process[0].startedAt) !== null && _b !== void 0 ? _b : 0);
21
- const fromToken = Object.assign(Object.assign({}, route.fromToken), { amount: route.fromAmount });
22
- const toToken = Object.assign(Object.assign({}, ((_e = (_d = (_c = route.steps.at(-1)) === null || _c === void 0 ? void 0 : _c.execution) === null || _d === void 0 ? void 0 : _d.toToken) !== null && _e !== void 0 ? _e : route.toToken)), { amount: (_h = (_g = (_f = route.steps.at(-1)) === null || _f === void 0 ? void 0 : _f.execution) === null || _g === void 0 ? void 0 : _g.toAmount) !== null && _h !== void 0 ? _h : route.toAmount });
23
- return ((0, jsx_runtime_1.jsxs)(Card_1.Card, Object.assign({ onClick: handleClick }, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
19
+ const startedAt = new Date(route.steps[0].execution?.process[0].startedAt ?? 0);
20
+ const fromToken = { ...route.fromToken, amount: route.fromAmount };
21
+ const toToken = {
22
+ ...(route.steps.at(-1)?.execution?.toToken ?? route.toToken),
23
+ amount: route.steps.at(-1)?.execution?.toAmount ?? route.toAmount,
24
+ };
25
+ return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { onClick: handleClick, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
24
26
  display: 'flex',
25
27
  flex: 1,
26
28
  justifyContent: 'space-between',
27
- }, pt: 1.75, px: 2 }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 12 }, { children: new Intl.DateTimeFormat(i18n.language, {
29
+ }, pt: 1.75, px: 2, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, { dateStyle: 'long' }).format(startedAt) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, children: new Intl.DateTimeFormat(i18n.language, {
28
30
  timeStyle: 'short',
29
- }).format(startedAt) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ py: 1 }, { children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: fromToken, px: 2, pt: 1, connected: true }), (0, jsx_runtime_1.jsx)(Token_1.TokenDivider, {}), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: toToken, px: 2, pt: 0.5, pb: 1 })] }))] })));
31
+ }).format(startedAt) })] }), (0, jsx_runtime_1.jsxs)(material_1.Box, { py: 1, children: [(0, jsx_runtime_1.jsx)(Token_1.Token, { token: fromToken, px: 2, pt: 1, connected: true }), (0, jsx_runtime_1.jsx)(Token_1.TokenDivider, {}), (0, jsx_runtime_1.jsx)(Token_1.Token, { token: toToken, px: 2, pt: 0.5, pb: 1 })] })] }));
30
32
  };
31
33
  exports.SwapHistoryItem = SwapHistoryItem;
@@ -25,12 +25,12 @@ const SwapHistoryPage = () => {
25
25
  }, []);
26
26
  (0, react_1.useEffect)(() => {
27
27
  if (swaps.length) {
28
- return Header_1.useHeaderActionStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ size: "medium", edge: "end", onClick: toggleDialog }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.DeleteOutline, {}) })));
28
+ return Header_1.useHeaderActionStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: toggleDialog, children: (0, jsx_runtime_1.jsx)(icons_material_1.DeleteOutline, {}) }));
29
29
  }
30
30
  }, [swaps.length, toggleDialog]);
31
31
  if (!swaps.length) {
32
32
  return (0, jsx_runtime_1.jsx)(SwapHistoryEmpty_1.SwapHistoryEmpty, {});
33
33
  }
34
- return ((0, jsx_runtime_1.jsxs)(material_1.Container, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, Object.assign({ spacing: 2, mt: 1 }, { children: swaps.length ? (swaps.map(({ route }) => ((0, jsx_runtime_1.jsx)(SwapHistoryItem_1.SwapHistoryItem, { route: route }, route.id)))) : ((0, jsx_runtime_1.jsx)(SwapHistoryEmpty_1.SwapHistoryEmpty, {})) })), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, Object.assign({ open: open, onClose: toggleDialog }, { children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.deleteSwapHistory') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ onClick: toggleDialog }, { children: t('button.cancel') })), (0, jsx_runtime_1.jsx)(material_1.Button, Object.assign({ variant: "contained", onClick: () => deleteRoutes('completed'), autoFocus: true }, { children: t('button.delete') }))] })] }))] }));
34
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { children: [(0, jsx_runtime_1.jsx)(material_1.Stack, { spacing: 2, mt: 1, children: swaps.length ? (swaps.map(({ route }) => ((0, jsx_runtime_1.jsx)(SwapHistoryItem_1.SwapHistoryItem, { route: route }, route.id)))) : ((0, jsx_runtime_1.jsx)(SwapHistoryEmpty_1.SwapHistoryEmpty, {})) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.deleteSwapHistory') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: () => deleteRoutes('completed'), autoFocus: true, children: t('button.delete') })] })] })] }));
35
35
  };
36
36
  exports.SwapHistoryPage = SwapHistoryPage;