@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
@@ -1,35 +1,26 @@
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.useTokenSearch = void 0;
13
4
  const react_query_1 = require("@tanstack/react-query");
14
5
  const providers_1 = require("../providers");
15
- const useTokenSearch = (chainId, token, enabled) => {
6
+ const useTokenSearch = (chainId, tokenQuery, enabled) => {
16
7
  const lifi = (0, providers_1.useLiFi)();
17
8
  const queryClient = (0, react_query_1.useQueryClient)();
18
- const { data, isLoading } = (0, react_query_1.useQuery)(['token-search', chainId, token], ({ queryKey: [, chainId, token], signal }) => __awaiter(void 0, void 0, void 0, function* () {
19
- const data = yield lifi.getToken(chainId, token, {
9
+ const { data, isLoading } = (0, react_query_1.useQuery)(['token-search', chainId, tokenQuery], async ({ queryKey: [, chainId, tokenQuery], signal }) => {
10
+ const token = await lifi.getToken(chainId, tokenQuery, {
20
11
  signal,
21
12
  });
22
- if (data) {
23
- queryClient.setQueriesData(['tokens', chainId], (tokens) => {
24
- if (!(tokens === null || tokens === void 0 ? void 0 : tokens.some((token) => token.address === data.address))) {
25
- tokens === null || tokens === void 0 ? void 0 : tokens.push(data);
13
+ if (token) {
14
+ queryClient.setQueriesData(['tokens'], (data) => {
15
+ if (!data?.tokens[chainId].some((t) => t.address === token.address)) {
16
+ data?.tokens[chainId].push(token);
26
17
  }
27
- return tokens;
28
- });
18
+ return data;
19
+ }, { updatedAt: Date.now() });
29
20
  }
30
- return data;
31
- }), {
32
- enabled: Boolean(chainId && token && enabled),
21
+ return token;
22
+ }, {
23
+ enabled: Boolean(chainId && tokenQuery && enabled),
33
24
  retry: false,
34
25
  });
35
26
  return {
@@ -1,5 +1,5 @@
1
1
  import type { Token } from '../types';
2
2
  export declare const useTokens: (selectedChainId?: number) => {
3
- tokens: Token[] | undefined;
3
+ tokens: Token[];
4
4
  isLoading: boolean;
5
5
  };
@@ -1,63 +1,61 @@
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.useTokens = void 0;
13
4
  const react_query_1 = require("@tanstack/react-query");
5
+ const react_1 = require("react");
14
6
  const providers_1 = require("../providers");
15
7
  const useChains_1 = require("./useChains");
16
8
  const useFeaturedTokens_1 = require("./useFeaturedTokens");
17
9
  const useTokens = (selectedChainId) => {
18
- var _a, _b, _c, _d;
19
10
  const lifi = (0, providers_1.useLiFi)();
11
+ const { data, isLoading, dataUpdatedAt } = (0, react_query_1.useQuery)(['tokens'], () => lifi.getTokens());
20
12
  const { getChainById, isLoading: isSupportedChainsLoading } = (0, useChains_1.useChains)();
21
13
  const featuredTokens = (0, useFeaturedTokens_1.useFeaturedTokens)(selectedChainId);
22
- const { tokens, chains, disabledChains } = (0, providers_1.useWidgetConfig)();
23
- const { data, isLoading } = (0, react_query_1.useQuery)([
24
- 'tokens',
25
- selectedChainId,
26
- featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.length,
27
- (_a = tokens === null || tokens === void 0 ? void 0 : tokens.allow) === null || _a === void 0 ? void 0 : _a.length,
28
- (_b = tokens === null || tokens === void 0 ? void 0 : tokens.deny) === null || _b === void 0 ? void 0 : _b.length,
29
- (_c = chains === null || chains === void 0 ? void 0 : chains.allow) === null || _c === void 0 ? void 0 : _c.length,
30
- (_d = chains === null || chains === void 0 ? void 0 : chains.deny) === null || _d === void 0 ? void 0 : _d.length,
31
- ], () => __awaiter(void 0, void 0, void 0, function* () {
32
- var _e, _f, _g, _h, _j;
14
+ const { tokens: configTokens, chains: configChains, disabledChains, } = (0, providers_1.useWidgetConfig)();
15
+ const tokens = (0, react_1.useMemo)(() => {
16
+ if (isSupportedChainsLoading) {
17
+ return [];
18
+ }
33
19
  const chainAllowed = selectedChainId &&
34
20
  getChainById(selectedChainId) &&
35
- (0, providers_1.isItemAllowed)(selectedChainId, chains, disabledChains);
21
+ (0, providers_1.isItemAllowed)(selectedChainId, configChains, disabledChains);
36
22
  if (!chainAllowed) {
37
23
  return [];
38
24
  }
39
- let filteredTokens = (_e = tokens === null || tokens === void 0 ? void 0 : tokens.allow) === null || _e === void 0 ? void 0 : _e.filter((token) => token.chainId === selectedChainId);
40
- if (!(filteredTokens === null || filteredTokens === void 0 ? void 0 : filteredTokens.length)) {
41
- const data = yield lifi.getTokens({ chains: [selectedChainId] });
42
- filteredTokens = (_f = data.tokens) === null || _f === void 0 ? void 0 : _f[selectedChainId];
25
+ let filteredTokens = configTokens?.allow?.filter((token) => token.chainId === selectedChainId);
26
+ if (!filteredTokens?.length) {
27
+ filteredTokens = data?.tokens[selectedChainId];
43
28
  }
44
- const deniedTokenAddresses = (_g = tokens === null || tokens === void 0 ? void 0 : tokens.deny) === null || _g === void 0 ? void 0 : _g.filter((token) => token.chainId === selectedChainId).map((token) => token.address);
45
- if (deniedTokenAddresses === null || deniedTokenAddresses === void 0 ? void 0 : deniedTokenAddresses.length) {
46
- filteredTokens = filteredTokens === null || filteredTokens === void 0 ? void 0 : filteredTokens.filter((token) => !deniedTokenAddresses.includes(token.address));
29
+ const deniedTokenAddresses = configTokens?.deny
30
+ ?.filter((token) => token.chainId === selectedChainId)
31
+ .map((token) => token.address);
32
+ if (deniedTokenAddresses?.length) {
33
+ filteredTokens = filteredTokens?.filter((token) => !deniedTokenAddresses.includes(token.address));
47
34
  }
48
- const featuredTokenAddresses = new Set(featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.map((token) => token.address));
49
- return [
50
- ...((_h = featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.map((token) => {
35
+ const featuredTokenAddresses = new Set(featuredTokens?.map((token) => token.address));
36
+ const tokens = [
37
+ ...(featuredTokens?.map((token) => {
51
38
  token.featured = true;
52
39
  return token;
53
- })) !== null && _h !== void 0 ? _h : []),
54
- ...((_j = filteredTokens === null || filteredTokens === void 0 ? void 0 : filteredTokens.filter((token) => !featuredTokenAddresses.has(token.address))) !== null && _j !== void 0 ? _j : []),
40
+ }) ?? []),
41
+ ...(filteredTokens?.filter((token) => !featuredTokenAddresses.has(token.address)) ?? []),
55
42
  ];
56
- }), {
57
- enabled: !isSupportedChainsLoading,
58
- });
43
+ return tokens;
44
+ // eslint-disable-next-line react-hooks/exhaustive-deps
45
+ }, [
46
+ isSupportedChainsLoading,
47
+ selectedChainId,
48
+ getChainById,
49
+ configChains,
50
+ disabledChains,
51
+ configTokens?.allow,
52
+ configTokens?.deny,
53
+ featuredTokens,
54
+ data,
55
+ dataUpdatedAt,
56
+ ]);
59
57
  return {
60
- tokens: data,
58
+ tokens,
61
59
  isLoading,
62
60
  };
63
61
  };
@@ -1,13 +1,4 @@
1
- import type { Bridge, Exchange } from '@lifi/sdk';
2
- interface WidgetBridge extends Omit<Bridge, 'key'> {
3
- key: string;
4
- }
5
- type FormattedTool<T, K extends keyof T> = Record<string, Pick<T, K>>;
1
+ import type { ToolsResponse } from '@lifi/sdk';
6
2
  export declare const useTools: () => {
7
- tools: import("@lifi/sdk").ToolsResponse | undefined;
8
- formattedTools: {
9
- bridges: FormattedTool<WidgetBridge, "key" | "name" | "logoURI"> | undefined;
10
- exchanges: FormattedTool<Exchange, "key" | "name" | "logoURI"> | undefined;
11
- };
3
+ tools: ToolsResponse | undefined;
12
4
  };
13
- export {};
@@ -2,36 +2,27 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.useTools = void 0;
4
4
  const react_query_1 = require("@tanstack/react-query");
5
- const react_1 = require("react");
6
5
  const providers_1 = require("../providers");
7
6
  const stores_1 = require("../stores");
8
7
  const useTools = () => {
9
8
  const lifi = (0, providers_1.useLiFi)();
10
9
  const { bridges, exchanges } = (0, providers_1.useWidgetConfig)();
11
10
  const settingsStoreContext = (0, stores_1.useSettingsStoreContext)();
12
- const { data } = (0, react_query_1.useQuery)(['tools'], () => lifi.getTools(), {
11
+ const { data } = (0, react_query_1.useQuery)(['tools'], async () => {
12
+ const tools = await lifi.getTools();
13
+ return {
14
+ bridges: tools.bridges.filter((bridge) => (0, providers_1.isItemAllowed)(bridge.key, bridges)),
15
+ exchanges: tools.exchanges.filter((exchange) => (0, providers_1.isItemAllowed)(exchange.key, exchanges)),
16
+ };
17
+ }, {
13
18
  onSuccess(data) {
14
19
  const { initializeTools } = settingsStoreContext.getState();
15
- initializeTools('Bridges', data.bridges
16
- .filter((bridge) => (0, providers_1.isItemAllowed)(bridge.key, bridges))
17
- .map((bridge) => bridge.key));
18
- initializeTools('Exchanges', data.exchanges
19
- .filter((exchange) => (0, providers_1.isItemAllowed)(exchange.key, exchanges))
20
- .map((exchange) => exchange.key));
20
+ initializeTools('Bridges', data.bridges.map((bridge) => bridge.key));
21
+ initializeTools('Exchanges', data.exchanges.map((exchange) => exchange.key));
21
22
  },
22
23
  refetchInterval: 180000,
23
24
  staleTime: 180000,
24
25
  });
25
- const formattedTools = (0, react_1.useMemo)(() => ({
26
- bridges: data === null || data === void 0 ? void 0 : data.bridges.reduce((bridges, bridge) => {
27
- bridges[bridge.key] = bridge;
28
- return bridges;
29
- }, {}),
30
- exchanges: data === null || data === void 0 ? void 0 : data.exchanges.reduce((exchanges, exchange) => {
31
- exchanges[exchange.key] = exchange;
32
- return exchanges;
33
- }, {}),
34
- }), [data === null || data === void 0 ? void 0 : data.bridges, data === null || data === void 0 ? void 0 : data.exchanges]);
35
- return { tools: data, formattedTools };
26
+ return { tools: data };
36
27
  };
37
28
  exports.useTools = useTools;
package/cjs/i18n/en.json CHANGED
@@ -6,7 +6,6 @@
6
6
  "contactSupport": "Contact support",
7
7
  "continue": "Continue",
8
8
  "copyAddress": "Copy address",
9
- "viewOnExplorer": "View on explorer",
10
9
  "dark": "Dark",
11
10
  "delete": "Delete",
12
11
  "disconnect": "Disconnect",
@@ -19,6 +18,8 @@
19
18
  "ok": "Ok",
20
19
  "okay": "Okay",
21
20
  "removeSwap": "Remove swap",
21
+ "reset": "Reset",
22
+ "resetSettings": "Reset settings",
22
23
  "restartSwap": "Restart swap",
23
24
  "reviewGasSwap": "Review gas swap",
24
25
  "reviewSwap": "Review swap",
@@ -27,7 +28,8 @@
27
28
  "startGasSwap": "Start gas swap",
28
29
  "startSwap": "Start swap",
29
30
  "swap": "Swap",
30
- "tryAgain": "Try again"
31
+ "tryAgain": "Try again",
32
+ "viewOnExplorer": "View on explorer"
31
33
  },
32
34
  "format": {
33
35
  "currency": "{{value, currency(currency: USD)}}",
@@ -201,7 +203,8 @@
201
203
  "highValueLoss": "The value of the received tokens is significantly lower than the swapped tokens and transaction cost.",
202
204
  "insufficientFunds": "You don't have enough funds to execute the swap.",
203
205
  "insufficientGas": "You need to add at least:",
204
- "rateChanged": "The exchange rate has changed. By continuing the swap, you'll accept the new rate."
206
+ "rateChanged": "The exchange rate has changed. By continuing the swap, you'll accept the new rate.",
207
+ "resetSettings": "This will reset your route priority, slippage, gas price, enabled bridges and exchanges."
205
208
  },
206
209
  "title": {
207
210
  "deleteActiveSwaps": "Delete all active swaps?",
@@ -209,7 +212,8 @@
209
212
  "deleteSwapHistory": "Delete swap history?",
210
213
  "highValueLoss": "High value loss",
211
214
  "insufficientGas": "Insufficient gas",
212
- "rateChanged": "Rate changed"
215
+ "rateChanged": "Rate changed",
216
+ "resetSettings": "Reset settings?"
213
217
  }
214
218
  }
215
219
  },
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LiFiFullLogo = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const LiFiFullLogo = (props) => ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: "84", height: "32", viewBox: "0 0 84 32", fill: "inherit", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M50.6689 20.5714H42.6849V8H39V24H50.6689V20.5714Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M53.0717 24H56.7566V8H53.0717V24Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M59.5088 24H63.0117V20.48H59.5088V24Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M69.4396 17.76H77.1506V14.6057H69.4396V11.2457H77.8103V8H65.7547V24H69.4396V17.76Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M80.3151 24H84V8H80.3151V24Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M14.6163 21.6947L5.1336 23.89C4.78772 23.9766 4.52832 24.3232 4.52832 24.6698V31.1978C4.52832 31.7467 4.96066 32.0933 5.50829 31.9777L18.7379 28.9159C19.2856 28.8004 19.5162 28.2805 19.2856 27.7894L16.8933 22.8501C16.5186 22.0702 16.8933 21.2614 17.7291 21.0881L26.376 19.0084C26.9813 18.864 27.5001 18.2285 27.5001 17.593V11.5561C27.5001 11.0073 27.0677 10.6318 26.5201 10.7762L14.0398 13.7514C13.2616 13.9247 12.9157 14.6757 13.2616 15.3978L15.4521 19.9327C15.8268 20.7126 15.4521 21.4925 14.6163 21.6947Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.36225 5.3748L10.841 10.4585C11.1581 11.1229 10.841 11.8161 10.1204 11.9606L5.53762 13.0293C4.96116 13.1737 4.5 13.7514 4.5 14.3291V19.7884C4.5 20.7127 5.24939 21.2904 6.1429 21.0882L10.4087 20.1061C10.9851 19.9906 11.4463 19.384 11.4463 18.8063L11.4751 13.2026C11.4751 12.4227 12.1092 11.6428 12.8586 11.4695L26.8376 8.11886C27.1835 8.03221 27.4429 7.68559 27.4429 7.33897V0.810981C27.4429 0.262168 27.0106 -0.113336 26.4629 0.0310883L8.90988 4.24829C8.36225 4.36383 8.13167 4.88375 8.36225 5.3748Z" })] })));
5
+ const LiFiFullLogo = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "84", height: "32", viewBox: "0 0 84 32", fill: "inherit", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M50.6689 20.5714H42.6849V8H39V24H50.6689V20.5714Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M53.0717 24H56.7566V8H53.0717V24Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M59.5088 24H63.0117V20.48H59.5088V24Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M69.4396 17.76H77.1506V14.6057H69.4396V11.2457H77.8103V8H65.7547V24H69.4396V17.76Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M80.3151 24H84V8H80.3151V24Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M14.6163 21.6947L5.1336 23.89C4.78772 23.9766 4.52832 24.3232 4.52832 24.6698V31.1978C4.52832 31.7467 4.96066 32.0933 5.50829 31.9777L18.7379 28.9159C19.2856 28.8004 19.5162 28.2805 19.2856 27.7894L16.8933 22.8501C16.5186 22.0702 16.8933 21.2614 17.7291 21.0881L26.376 19.0084C26.9813 18.864 27.5001 18.2285 27.5001 17.593V11.5561C27.5001 11.0073 27.0677 10.6318 26.5201 10.7762L14.0398 13.7514C13.2616 13.9247 12.9157 14.6757 13.2616 15.3978L15.4521 19.9327C15.8268 20.7126 15.4521 21.4925 14.6163 21.6947Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.36225 5.3748L10.841 10.4585C11.1581 11.1229 10.841 11.8161 10.1204 11.9606L5.53762 13.0293C4.96116 13.1737 4.5 13.7514 4.5 14.3291V19.7884C4.5 20.7127 5.24939 21.2904 6.1429 21.0882L10.4087 20.1061C10.9851 19.9906 11.4463 19.384 11.4463 18.8063L11.4751 13.2026C11.4751 12.4227 12.1092 11.6428 12.8586 11.4695L26.8376 8.11886C27.1835 8.03221 27.4429 7.68559 27.4429 7.33897V0.810981C27.4429 0.262168 27.0106 -0.113336 26.4629 0.0310883L8.90988 4.24829C8.36225 4.36383 8.13167 4.88375 8.36225 5.3748Z" })] }));
6
6
  exports.LiFiFullLogo = LiFiFullLogo;
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LiFiLogo = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const LiFiLogo = (props) => ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: "32", height: "32", viewBox: "0 0 32 32", fill: "inherit", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [(0, jsx_runtime_1.jsx)("path", { d: "M14.6163 21.6947L5.1336 23.89C4.78772 23.9766 4.52832 24.3232 4.52832 24.6698V31.1978C4.52832 31.7467 4.96066 32.0933 5.50829 31.9777L18.7379 28.9159C19.2856 28.8004 19.5162 28.2805 19.2856 27.7894L16.8933 22.8501C16.5186 22.0702 16.8933 21.2614 17.7291 21.0881L26.376 19.0084C26.9813 18.864 27.5001 18.2285 27.5001 17.593V11.5561C27.5001 11.0073 27.0677 10.6318 26.5201 10.7762L14.0398 13.7514C13.2616 13.9247 12.9157 14.6757 13.2616 15.3978L15.4521 19.9327C15.8268 20.7126 15.4521 21.4925 14.6163 21.6947Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.36225 5.3748L10.841 10.4585C11.1581 11.1229 10.841 11.8161 10.1204 11.9606L5.53762 13.0293C4.96116 13.1737 4.5 13.7514 4.5 14.3291V19.7884C4.5 20.7127 5.24939 21.2904 6.1429 21.0882L10.4087 20.1061C10.9851 19.9906 11.4463 19.384 11.4463 18.8063L11.4751 13.2026C11.4751 12.4227 12.1092 11.6428 12.8586 11.4695L26.8376 8.11886C27.1835 8.03221 27.4429 7.68559 27.4429 7.33897V0.810981C27.4429 0.262168 27.0106 -0.113336 26.4629 0.0310883L8.90988 4.24829C8.36225 4.36383 8.13167 4.88375 8.36225 5.3748Z" })] })));
5
+ const LiFiLogo = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "inherit", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("path", { d: "M14.6163 21.6947L5.1336 23.89C4.78772 23.9766 4.52832 24.3232 4.52832 24.6698V31.1978C4.52832 31.7467 4.96066 32.0933 5.50829 31.9777L18.7379 28.9159C19.2856 28.8004 19.5162 28.2805 19.2856 27.7894L16.8933 22.8501C16.5186 22.0702 16.8933 21.2614 17.7291 21.0881L26.376 19.0084C26.9813 18.864 27.5001 18.2285 27.5001 17.593V11.5561C27.5001 11.0073 27.0677 10.6318 26.5201 10.7762L14.0398 13.7514C13.2616 13.9247 12.9157 14.6757 13.2616 15.3978L15.4521 19.9327C15.8268 20.7126 15.4521 21.4925 14.6163 21.6947Z" }), (0, jsx_runtime_1.jsx)("path", { d: "M8.36225 5.3748L10.841 10.4585C11.1581 11.1229 10.841 11.8161 10.1204 11.9606L5.53762 13.0293C4.96116 13.1737 4.5 13.7514 4.5 14.3291V19.7884C4.5 20.7127 5.24939 21.2904 6.1429 21.0882L10.4087 20.1061C10.9851 19.9906 11.4463 19.384 11.4463 18.8063L11.4751 13.2026C11.4751 12.4227 12.1092 11.6428 12.8586 11.4695L26.8376 8.11886C27.1835 8.03221 27.4429 7.68559 27.4429 7.33897V0.810981C27.4429 0.262168 27.0106 -0.113336 26.4629 0.0310883L8.90988 4.24829C8.36225 4.36383 8.13167 4.88375 8.36225 5.3748Z" })] }));
6
6
  exports.LiFiLogo = LiFiLogo;
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.LiFiToolLogo = void 0;
4
4
  const jsx_runtime_1 = require("react/jsx-runtime");
5
- const LiFiToolLogo = (props) => ((0, jsx_runtime_1.jsxs)("svg", Object.assign({ width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg" }, props, { children: [(0, jsx_runtime_1.jsx)("circle", { cx: "16", cy: "16", r: "16", fill: "#F5B5FF" }), (0, jsx_runtime_1.jsx)("path", { d: "M15.5031 19.2031L10.1691 20.4379C9.97453 20.4867 9.82861 20.6816 9.82861 20.8766V24.5486C9.82861 24.8573 10.0718 25.0523 10.3798 24.9873L17.8215 23.265C18.1296 23.2 18.2593 22.9076 18.1296 22.6314L16.7839 19.853C16.5731 19.4143 16.7839 18.9594 17.2541 18.8619L22.1179 17.692C22.4584 17.6108 22.7502 17.2534 22.7502 16.8959V13.5001C22.7502 13.1914 22.507 12.9802 22.199 13.0614L15.1788 14.735C14.7411 14.8324 14.5465 15.2549 14.7411 15.6611L15.9733 18.212C16.184 18.6507 15.9733 19.0893 15.5031 19.2031Z", fill: "black" }), (0, jsx_runtime_1.jsx)("path", { d: "M11.985 10.0233L13.3793 12.8829C13.5577 13.2566 13.3793 13.6466 12.974 13.7278L10.3962 14.329C10.0719 14.4102 9.8125 14.7352 9.8125 15.0601V18.1309C9.8125 18.6509 10.234 18.9758 10.7366 18.8621L13.1361 18.3097C13.4604 18.2447 13.7198 17.9035 13.7198 17.5785L13.736 14.4265C13.736 13.9878 14.0927 13.5491 14.5142 13.4516L22.3774 11.5669C22.572 11.5181 22.7179 11.3231 22.7179 11.1282V7.45618C22.7179 7.14747 22.4747 6.93625 22.1666 7.01749L12.2931 9.38966C11.985 9.45465 11.8553 9.74711 11.985 10.0233Z", fill: "black" })] })));
5
+ const LiFiToolLogo = (props) => ((0, jsx_runtime_1.jsxs)("svg", { width: "32", height: "32", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...props, children: [(0, jsx_runtime_1.jsx)("circle", { cx: "16", cy: "16", r: "16", fill: "#F5B5FF" }), (0, jsx_runtime_1.jsx)("path", { d: "M15.5031 19.2031L10.1691 20.4379C9.97453 20.4867 9.82861 20.6816 9.82861 20.8766V24.5486C9.82861 24.8573 10.0718 25.0523 10.3798 24.9873L17.8215 23.265C18.1296 23.2 18.2593 22.9076 18.1296 22.6314L16.7839 19.853C16.5731 19.4143 16.7839 18.9594 17.2541 18.8619L22.1179 17.692C22.4584 17.6108 22.7502 17.2534 22.7502 16.8959V13.5001C22.7502 13.1914 22.507 12.9802 22.199 13.0614L15.1788 14.735C14.7411 14.8324 14.5465 15.2549 14.7411 15.6611L15.9733 18.212C16.184 18.6507 15.9733 19.0893 15.5031 19.2031Z", fill: "black" }), (0, jsx_runtime_1.jsx)("path", { d: "M11.985 10.0233L13.3793 12.8829C13.5577 13.2566 13.3793 13.6466 12.974 13.7278L10.3962 14.329C10.0719 14.4102 9.8125 14.7352 9.8125 15.0601V18.1309C9.8125 18.6509 10.234 18.9758 10.7366 18.8621L13.1361 18.3097C13.4604 18.2447 13.7198 17.9035 13.7198 17.5785L13.736 14.4265C13.736 13.9878 14.0927 13.5491 14.5142 13.4516L22.3774 11.5669C22.572 11.5181 22.7179 11.3231 22.7179 11.1282V7.45618C22.7179 7.14747 22.4747 6.93625 22.1666 7.01749L12.2931 9.38966C11.985 9.45465 11.8553 9.74711 11.985 10.0233Z", fill: "black" })] }));
6
6
  exports.LiFiToolLogo = LiFiToolLogo;
package/cjs/index.d.ts CHANGED
@@ -2,6 +2,7 @@
2
2
  import './fonts/inter.css';
3
3
  export type { WidgetDrawer } from './AppDrawer';
4
4
  export * from './components/NFT';
5
+ export * from './config/version';
5
6
  export { useWidgetEvents, widgetEvents } from './hooks';
6
7
  export { useWallet } from './providers/WalletProvider';
7
8
  export * from './types';
package/cjs/index.js CHANGED
@@ -17,8 +17,10 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.LiFiWidgetDrawer = exports.LiFiWidget = exports.useWallet = exports.widgetEvents = exports.useWidgetEvents = void 0;
18
18
  const App_1 = require("./App");
19
19
  const AppDrawer_1 = require("./AppDrawer");
20
+ // TODO: remove or make optional
20
21
  require("./fonts/inter.css");
21
22
  __exportStar(require("./components/NFT"), exports);
23
+ __exportStar(require("./config/version"), exports);
22
24
  var hooks_1 = require("./hooks");
23
25
  Object.defineProperty(exports, "useWidgetEvents", { enumerable: true, get: function () { return hooks_1.useWidgetEvents; } });
24
26
  Object.defineProperty(exports, "widgetEvents", { enumerable: true, get: function () { return hooks_1.widgetEvents; } });
@@ -7,13 +7,13 @@ const material_1 = require("@mui/material");
7
7
  const react_i18next_1 = require("react-i18next");
8
8
  const ActiveSwapsEmpty = () => {
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.SwapHoriz, { fontSize: "inherit" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 18, fontWeight: 700 }, { children: t('swap.info.title.emptyActiveSwaps') })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2 }, { children: t('swap.info.message.emptyActiveSwaps') }))] })));
17
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, children: (0, jsx_runtime_1.jsx)(icons_material_1.SwapHoriz, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 18, fontWeight: 700, children: t('swap.info.title.emptyActiveSwaps') }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, children: t('swap.info.message.emptyActiveSwaps') })] }));
18
18
  };
19
19
  exports.ActiveSwapsEmpty = ActiveSwapsEmpty;
@@ -1,2 +1 @@
1
- /// <reference types="react" />
2
1
  export declare const ActiveSwapsPage: () => JSX.Element;
@@ -24,15 +24,15 @@ const ActiveSwapsPage = () => {
24
24
  }, []);
25
25
  (0, react_1.useEffect)(() => {
26
26
  if (executingRoutes.length) {
27
- 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, {}) })));
27
+ 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, {}) }));
28
28
  }
29
29
  }, [executingRoutes.length, toggleDialog]);
30
30
  if (!executingRoutes.length) {
31
31
  return (0, jsx_runtime_1.jsx)(ActiveSwapsEmpty_1.ActiveSwapsEmpty, {});
32
32
  }
33
- 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: {
33
+ return ((0, jsx_runtime_1.jsxs)(material_1.Container, { disableGutters: true, children: [(0, jsx_runtime_1.jsx)(material_1.List, { sx: {
34
34
  paddingLeft: 1.5,
35
35
  paddingRight: 1.5,
36
- } }, { children: executingRoutes.map((routeId) => ((0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwapItem, { routeId: routeId }, routeId))) })), (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.deleteActiveSwaps') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteActiveSwaps') }) }), (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('active'), autoFocus: true }, { children: t('button.delete') }))] })] }))] })));
36
+ }, children: executingRoutes.map((routeId) => ((0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwapItem, { routeId: routeId }, routeId))) }), (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.deleteActiveSwaps') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteActiveSwaps') }) }), (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('active'), autoFocus: true, children: t('button.delete') })] })] })] }));
37
37
  };
38
38
  exports.ActiveSwapsPage = ActiveSwapsPage;
@@ -18,6 +18,6 @@ const MainPage = () => {
18
18
  const expandable = (0, hooks_1.useExpandableVariant)();
19
19
  const { variant } = (0, providers_1.useWidgetConfig)();
20
20
  const nft = variant === 'nft';
21
- return ((0, jsx_runtime_1.jsxs)(MainPage_style_1.FormContainer, Object.assign({ disableGutters: true }, { children: [(0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwaps, { mx: 3, mt: 1, mb: 2 }), nft ? (0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mx: 3, mt: 1, mb: 1 }) : null, (0, jsx_runtime_1.jsx)(SelectChainAndToken_1.SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), !nft ? (0, jsx_runtime_1.jsx)(SwapInput_1.SwapInput, { formType: "from", mx: 3, mb: 3 }) : null, !expandable ? (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutes, { mx: 3, mb: 3 }) : null, (0, jsx_runtime_1.jsx)(GasSufficiencyMessage_1.GasSufficiencyMessage, { mx: 3, mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ mx: 3, mb: 1 }, { children: [(0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWallet, { mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { display: 'flex' } }, { children: [(0, jsx_runtime_1.jsx)(MainSwapButton_1.MainSwapButton, {}), (0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWalletButton, {})] }))] }))] })));
21
+ return ((0, jsx_runtime_1.jsxs)(MainPage_style_1.FormContainer, { disableGutters: true, children: [(0, jsx_runtime_1.jsx)(ActiveSwaps_1.ActiveSwaps, { mx: 3, mt: 1, mb: 2 }), nft ? (0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mx: 3, mt: 1, mb: 1 }) : null, (0, jsx_runtime_1.jsx)(SelectChainAndToken_1.SelectChainAndToken, { mt: 1, mx: 3, mb: 3 }), !nft ? (0, jsx_runtime_1.jsx)(SwapInput_1.SwapInput, { formType: "from", mx: 3, mb: 3 }) : null, !expandable ? (0, jsx_runtime_1.jsx)(SwapRoutes_1.SwapRoutes, { mx: 3, mb: 3 }) : null, (0, jsx_runtime_1.jsx)(GasSufficiencyMessage_1.GasSufficiencyMessage, { mx: 3, mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { mx: 3, mb: 1, children: [(0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWallet, { mb: 3 }), (0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { display: 'flex' }, children: [(0, jsx_runtime_1.jsx)(MainSwapButton_1.MainSwapButton, {}), (0, jsx_runtime_1.jsx)(SendToWallet_1.SendToWalletButton, {})] })] })] }));
22
22
  };
23
23
  exports.MainPage = MainPage;
@@ -6,6 +6,6 @@ export declare const FormContainer: 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.MainSwapButton = void 0;
13
4
  const jsx_runtime_1 = require("react/jsx-runtime");
@@ -22,15 +13,15 @@ const MainSwapButton = () => {
22
13
  const { isValid, isValidating } = (0, react_hook_form_1.useFormState)();
23
14
  const setExecutableRoute = (0, stores_1.useSetExecutableRoute)();
24
15
  const { routes: swapRoutes, isLoading, isFetching } = (0, hooks_1.useSwapRoutes)();
25
- const currentRoute = swapRoutes === null || swapRoutes === void 0 ? void 0 : swapRoutes[0];
26
- const handleClick = () => __awaiter(void 0, void 0, void 0, function* () {
16
+ const currentRoute = swapRoutes?.[0];
17
+ const handleClick = async () => {
27
18
  if (currentRoute) {
28
19
  setExecutableRoute(currentRoute);
29
20
  navigate(utils_1.navigationRoutes.swapExecution, {
30
21
  state: { routeId: currentRoute.id },
31
22
  });
32
23
  }
33
- });
24
+ };
34
25
  return ((0, jsx_runtime_1.jsx)(SwapButton_1.SwapButton, { onClick: handleClick, currentRoute: currentRoute, disabled: currentRoute && (isLoading || isFetching || isValidating || !isValid) }));
35
26
  };
36
27
  exports.MainSwapButton = MainSwapButton;
@@ -1,26 +1,18 @@
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.SelectChainPage = void 0;
13
4
  const jsx_runtime_1 = require("react/jsx-runtime");
14
5
  const material_1 = require("@mui/material");
15
6
  const ChainSelect_1 = require("../../components/ChainSelect");
7
+ const ListItemButton_1 = require("../../components/ListItemButton");
8
+ const ListItemText_1 = require("../../components/ListItemText");
16
9
  const TokenList_1 = require("../../components/TokenList");
17
10
  const hooks_1 = require("../../hooks");
18
- const SelectChainPage_style_1 = require("./SelectChainPage.style");
19
11
  const SelectChainPage = ({ formType, selectNativeToken, }) => {
20
12
  const { navigateBack } = (0, hooks_1.useNavigateBack)();
21
13
  const { chains, setCurrentChain } = (0, ChainSelect_1.useChainSelect)(formType);
22
14
  const selectToken = (0, TokenList_1.useTokenSelect)(formType, navigateBack);
23
- const handleClick = (chain) => __awaiter(void 0, void 0, void 0, function* () {
15
+ const handleClick = async (chain) => {
24
16
  if (selectNativeToken) {
25
17
  selectToken(chain.nativeToken.address, chain.id);
26
18
  }
@@ -28,10 +20,10 @@ const SelectChainPage = ({ formType, selectNativeToken, }) => {
28
20
  setCurrentChain(chain.id);
29
21
  navigateBack();
30
22
  }
31
- });
32
- 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: {
23
+ };
24
+ return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
33
25
  paddingLeft: 1.5,
34
26
  paddingRight: 1.5,
35
- } }, { children: chains === null || chains === void 0 ? void 0 : chains.map((chain) => ((0, jsx_runtime_1.jsxs)(SelectChainPage_style_1.ListItemButton, Object.assign({ onClick: () => handleClick(chain), disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] })) }), (0, jsx_runtime_1.jsx)(SelectChainPage_style_1.ListItemText, { primary: chain.name })] }), chain.id))) })) })));
27
+ }, children: chains?.map((chain) => ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: () => handleClick(chain), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: chain.logoURI, alt: chain.name, children: chain.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: chain.name })] }, chain.id))) }) }));
36
28
  };
37
29
  exports.SelectChainPage = SelectChainPage;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ export declare const SelectEnabledToolsPage: React.FC<{
3
+ type: 'Bridges' | 'Exchanges';
4
+ }>;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.SelectEnabledToolsPage = 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 Header_1 = require("../../components/Header");
8
+ const react_1 = require("react");
9
+ const shallow_1 = require("zustand/shallow");
10
+ const ListItemText_1 = require("../../components/ListItemText");
11
+ const hooks_1 = require("../../hooks");
12
+ const stores_1 = require("../../stores");
13
+ const SelectEnabledToolsPage_style_1 = require("./SelectEnabledToolsPage.style");
14
+ const SelectEnabledToolsPage = ({ type }) => {
15
+ const typeKey = type.toLowerCase();
16
+ const { tools } = (0, hooks_1.useTools)();
17
+ const [enabledTools, setTools] = (0, stores_1.useSettingsStore)((state) => [state[`enabled${type}`], state.setTools], shallow_1.shallow);
18
+ const handleClick = (key) => {
19
+ if (!tools) {
20
+ return;
21
+ }
22
+ const toolKeys = tools[typeKey].map((tool) => tool.key);
23
+ if (enabledTools?.includes(key)) {
24
+ setTools(type, enabledTools.filter((toolKey) => toolKey !== key), toolKeys);
25
+ }
26
+ else {
27
+ setTools(type, [...enabledTools, key], toolKeys);
28
+ }
29
+ };
30
+ (0, react_1.useEffect)(() => {
31
+ const allToolsSelected = tools?.[typeKey].length === enabledTools.length;
32
+ const toggleCheckboxes = () => {
33
+ if (!tools) {
34
+ return;
35
+ }
36
+ const toolKeys = tools[typeKey].map((tool) => tool.key);
37
+ if (allToolsSelected) {
38
+ setTools(type, [], toolKeys);
39
+ }
40
+ else {
41
+ setTools(type, toolKeys, toolKeys);
42
+ }
43
+ };
44
+ return Header_1.useHeaderActionStore.getState().setAction((0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: toggleCheckboxes, children: allToolsSelected ? ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBoxOutlined, {})) : enabledTools.length ? ((0, jsx_runtime_1.jsx)(icons_material_1.IndeterminateCheckBoxOutlined, {})) : ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBoxOutlineBlankOutlined, {})) }));
45
+ }, [enabledTools.length, setTools, tools, type, typeKey]);
46
+ return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
47
+ paddingLeft: 1.5,
48
+ paddingRight: 1.5,
49
+ }, children: tools?.[typeKey].map((tool) => ((0, jsx_runtime_1.jsxs)(SelectEnabledToolsPage_style_1.ListItemButton, { onClick: () => handleClick(tool.key), disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: tool.logoURI, alt: tool.name, children: tool.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: tool.name }), enabledTools?.includes(tool.key) ? ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBox, { color: "primary" })) : ((0, jsx_runtime_1.jsx)(icons_material_1.CheckBoxOutlineBlankOutlined, {}))] }, tool.name))) }) }));
50
+ };
51
+ exports.SelectEnabledToolsPage = SelectEnabledToolsPage;
@@ -0,0 +1,20 @@
1
+ /// <reference types="react" />
2
+ export declare const ListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
3
+ action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
4
+ centerRipple?: boolean | undefined;
5
+ children?: import("react").ReactNode;
6
+ classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
7
+ disabled?: boolean | undefined;
8
+ disableRipple?: boolean | undefined;
9
+ disableTouchRipple?: boolean | undefined;
10
+ focusRipple?: boolean | undefined;
11
+ focusVisibleClassName?: string | undefined;
12
+ LinkComponent?: import("react").ElementType<any> | undefined;
13
+ onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
14
+ sx?: import("@mui/material/styles").SxProps<import("@mui/material/styles").Theme> | undefined;
15
+ tabIndex?: number | undefined;
16
+ TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
17
+ touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
18
+ }, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
19
+ ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
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/styles").Theme>, {}, {}>;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ListItemButton = void 0;
4
+ const styles_1 = require("@mui/material/styles");
5
+ const ListItemButton_1 = require("../../components/ListItemButton");
6
+ exports.ListItemButton = (0, styles_1.styled)(ListItemButton_1.ListItemButton)(({ theme }) => ({
7
+ paddingRight: theme.spacing(1),
8
+ }));
@@ -0,0 +1 @@
1
+ export * from './SelectEnabledToolsPage';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./SelectEnabledToolsPage"), exports);