@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,7 +4,7 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
4
4
  component?: import("react").ElementType<any> | undefined;
5
5
  ref?: import("react").Ref<unknown> | undefined;
6
6
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
7
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
7
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
8
8
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
9
9
  }, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
10
10
  connected?: boolean | undefined;
@@ -19,7 +19,7 @@ export declare const TextSecondary: import("@emotion/styled").StyledComponent<im
19
19
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
20
20
  variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
21
21
  variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
22
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "key" | keyof import("react").HTMLAttributes<HTMLSpanElement>> & {
22
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
23
23
  ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
24
24
  }, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
25
25
  connected?: boolean | undefined;
@@ -30,6 +30,6 @@ export declare const TokenDivider: import("@emotion/styled").StyledComponent<imp
30
30
  component?: import("react").ElementType<any> | undefined;
31
31
  ref?: import("react").Ref<unknown> | undefined;
32
32
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
33
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
33
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
34
34
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
35
35
  }, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -7,24 +7,23 @@ const hooks_1 = require("../../hooks");
7
7
  const SmallAvatar_1 = require("../SmallAvatar");
8
8
  const TokenAvatar_style_1 = require("./TokenAvatar.style");
9
9
  const TokenAvatarFallback = ({ token, isLoading, sx }) => {
10
- const { chain } = (0, hooks_1.useChain)(token === null || token === void 0 ? void 0 : token.chainId);
11
- const { token: chainToken, isLoading: isLoadingToken } = (0, hooks_1.useToken)(token === null || token === void 0 ? void 0 : token.chainId, token === null || token === void 0 ? void 0 : token.address);
12
- return ((0, jsx_runtime_1.jsx)(exports.TokenAvatarBase, { token: chainToken !== null && chainToken !== void 0 ? chainToken : token, isLoading: isLoading || isLoadingToken, chain: chain, sx: sx }));
10
+ const { chain } = (0, hooks_1.useChain)(token?.chainId);
11
+ const { token: chainToken, isLoading: isLoadingToken } = (0, hooks_1.useToken)(token?.chainId, token?.address);
12
+ return ((0, jsx_runtime_1.jsx)(exports.TokenAvatarBase, { token: chainToken ?? token, isLoading: isLoading || isLoadingToken, chain: chain, sx: sx }));
13
13
  };
14
14
  exports.TokenAvatarFallback = TokenAvatarFallback;
15
15
  const TokenAvatarBase = ({ token, chain, isLoading, sx }) => {
16
- var _a;
17
- return ((0, jsx_runtime_1.jsx)(material_1.Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain && !isLoading ? ((0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] }))) : ((0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatarSkeleton, {})), sx: sx }, { children: isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 32, height: 32, variant: "circular" })) : ((0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: token === null || token === void 0 ? void 0 : token.logoURI, alt: token === null || token === void 0 ? void 0 : token.symbol }, { children: (_a = token === null || token === void 0 ? void 0 : token.symbol) === null || _a === void 0 ? void 0 : _a[0] }))) })));
16
+ return ((0, jsx_runtime_1.jsx)(material_1.Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain && !isLoading ? ((0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, { src: chain.logoURI, alt: chain.name, children: chain.name[0] })) : ((0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatarSkeleton, {})), sx: sx, children: isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 32, height: 32, variant: "circular" })) : ((0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token?.logoURI, alt: token?.symbol, children: token?.symbol?.[0] })) }));
18
17
  };
19
18
  exports.TokenAvatarBase = TokenAvatarBase;
20
19
  const TokenAvatar = ({ token, chain, isLoading, sx }) => {
21
- if (!chain || !(token === null || token === void 0 ? void 0 : token.logoURI)) {
20
+ if (!chain || !token?.logoURI) {
22
21
  return (0, jsx_runtime_1.jsx)(exports.TokenAvatarFallback, { token: token, isLoading: isLoading, sx: sx });
23
22
  }
24
23
  return ((0, jsx_runtime_1.jsx)(exports.TokenAvatarBase, { token: token, chain: chain, isLoading: isLoading, sx: sx }));
25
24
  };
26
25
  exports.TokenAvatar = TokenAvatar;
27
26
  const TokenAvatarDefault = ({ sx }) => {
28
- return ((0, jsx_runtime_1.jsx)(material_1.Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: (0, jsx_runtime_1.jsx)(TokenAvatar_style_1.AvatarDefaultBadge, { width: 16, height: 16 }), sx: sx }, { children: (0, jsx_runtime_1.jsx)(TokenAvatar_style_1.AvatarDefault, { width: 32, height: 32 }) })));
27
+ return ((0, jsx_runtime_1.jsx)(material_1.Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: (0, jsx_runtime_1.jsx)(TokenAvatar_style_1.AvatarDefaultBadge, { width: 16, height: 16 }), sx: sx, children: (0, jsx_runtime_1.jsx)(TokenAvatar_style_1.AvatarDefault, { width: 32, height: 32 }) }));
29
28
  };
30
29
  exports.TokenAvatarDefault = TokenAvatarDefault;
@@ -5,7 +5,7 @@ export declare const AvatarDefault: import("@emotion/styled").StyledComponent<im
5
5
  component?: import("react").ElementType<any> | undefined;
6
6
  ref?: import("react").Ref<unknown> | undefined;
7
7
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
8
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
8
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
9
9
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
10
10
  }, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
11
11
  export declare const AvatarDefaultBadge: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
@@ -13,6 +13,6 @@ export declare const AvatarDefaultBadge: import("@emotion/styled").StyledCompone
13
13
  component?: import("react").ElementType<any> | undefined;
14
14
  ref?: import("react").Ref<unknown> | undefined;
15
15
  sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
16
- } & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
16
+ } & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
17
17
  ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
18
18
  }, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -11,7 +11,6 @@ const TokenNotFound_1 = require("./TokenNotFound");
11
11
  const useTokenSelect_1 = require("./useTokenSelect");
12
12
  const VirtualizedTokenList_1 = require("./VirtualizedTokenList");
13
13
  const TokenList = ({ formType, height, onClick, }) => {
14
- var _a, _b;
15
14
  const parentRef = (0, react_1.useRef)(null);
16
15
  const { account } = (0, providers_1.useWallet)();
17
16
  const [selectedChainId] = (0, react_hook_form_1.useWatch)({
@@ -19,8 +18,8 @@ const TokenList = ({ formType, height, onClick, }) => {
19
18
  });
20
19
  const [tokenSearchFilter] = (0, hooks_1.useDebouncedWatch)([providers_1.SwapFormKey.TokenSearchFilter], 320);
21
20
  const { tokens: chainTokens, tokensWithBalance, isLoading: isTokensLoading, isBalanceLoading, featuredTokens, } = (0, hooks_1.useTokenBalances)(selectedChainId);
22
- let filteredTokens = ((_a = tokensWithBalance !== null && tokensWithBalance !== void 0 ? tokensWithBalance : chainTokens) !== null && _a !== void 0 ? _a : []);
23
- const searchFilter = (_b = tokenSearchFilter === null || tokenSearchFilter === void 0 ? void 0 : tokenSearchFilter.toUpperCase()) !== null && _b !== void 0 ? _b : '';
21
+ let filteredTokens = (tokensWithBalance ?? chainTokens ?? []);
22
+ const searchFilter = tokenSearchFilter?.toUpperCase() ?? '';
24
23
  filteredTokens = tokenSearchFilter
25
24
  ? filteredTokens.filter((token) => token.name.toUpperCase().includes(searchFilter) ||
26
25
  token.symbol.toUpperCase().includes(searchFilter) ||
@@ -38,6 +37,6 @@ const TokenList = ({ formType, height, onClick, }) => {
38
37
  ? [searchedToken]
39
38
  : filteredTokens;
40
39
  const handleTokenClick = (0, useTokenSelect_1.useTokenSelect)(formType, onClick);
41
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ ref: parentRef, style: { height, overflow: 'auto' } }, { children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] })));
40
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] }));
42
41
  };
43
42
  exports.TokenList = TokenList;
@@ -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 ListItem: import("@emotion/styled").StyledComponent<{
@@ -33,6 +33,6 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
33
33
  slots?: {
34
34
  root?: import("react").ElementType<any> | undefined;
35
35
  } | undefined;
36
- } & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "key" | keyof import("react").LiHTMLAttributes<HTMLLIElement>> & {
36
+ } & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
37
37
  ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
38
38
  }, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "divider" | "components" | "componentsProps" | "slotProps" | "slots" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
@@ -5,16 +5,12 @@ const material_1 = require("@mui/material");
5
5
  const ListItemSecondaryAction_1 = require("@mui/material/ListItemSecondaryAction");
6
6
  const ListItemText_1 = require("@mui/material/ListItemText");
7
7
  const styles_1 = require("@mui/material/styles");
8
- const utils_1 = require("../../utils");
9
- exports.ListItemButton = (0, styles_1.styled)(material_1.ListItemButton)(({ theme }) => ({
10
- borderRadius: theme.shape.borderRadius,
8
+ const ListItemButton_1 = require("../ListItemButton");
9
+ exports.ListItemButton = (0, styles_1.styled)(ListItemButton_1.ListItemButton)(({ theme }) => ({
11
10
  paddingLeft: theme.spacing(1.5),
12
11
  paddingRight: theme.spacing(1.5),
13
12
  height: 64,
14
13
  width: '100%',
15
- '&:hover': {
16
- backgroundColor: (0, utils_1.getContrastAlphaColor)(theme, '4%'),
17
- },
18
14
  }));
19
15
  exports.ListItem = (0, styles_1.styled)(material_1.ListItem)(({ theme }) => ({
20
16
  position: 'absolute',
@@ -8,31 +8,31 @@ const react_i18next_1 = require("react-i18next");
8
8
  const utils_1 = require("../../utils");
9
9
  const TokenList_style_1 = require("./TokenList.style");
10
10
  exports.TokenListItem = (0, react_1.memo)(({ onClick, size, start, token, showBalance, isBalanceLoading, startAdornment, endAdornment, }) => {
11
- const handleClick = () => onClick === null || onClick === void 0 ? void 0 : onClick(token.address);
12
- return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, Object.assign({ disablePadding: true, style: {
11
+ const handleClick = () => onClick?.(token.address);
12
+ return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, { disablePadding: true, style: {
13
13
  height: `${size}px`,
14
14
  transform: `translateY(${start}px)`,
15
- } }, { children: [startAdornment, (0, jsx_runtime_1.jsx)(exports.TokenListItemButton, { token: token, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] })));
15
+ }, children: [startAdornment, (0, jsx_runtime_1.jsx)(exports.TokenListItemButton, { token: token, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] }));
16
16
  });
17
17
  const TokenListItemButton = ({ onClick, token, showBalance, isBalanceLoading, }) => {
18
18
  const { t } = (0, react_i18next_1.useTranslation)();
19
19
  const tokenPrice = (0, utils_1.formatTokenPrice)(token.amount, token.priceUSD);
20
- return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, Object.assign({ onClick: onClick, dense: true, disableRipple: true }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, Object.assign({ src: token.logoURI, alt: token.symbol }, { children: token.symbol[0] })) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: { textAlign: 'right' } }, { children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ variant: "body1", noWrap: true }, { children: t('format.number', {
20
+ return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItemButton, { onClick: onClick, dense: true, disableRipple: true, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
21
21
  value: token.amount,
22
- }) }))) : null, tokenPrice ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD }, { children: t(`format.currency`, {
22
+ }) })) : null, tokenPrice ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
23
23
  value: tokenPrice,
24
- }) }))) : null] })))) : null] })));
24
+ }) })) : null] }))) : null] }));
25
25
  };
26
26
  exports.TokenListItemButton = TokenListItemButton;
27
27
  const TokenListItemSkeleton = () => {
28
- return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, Object.assign({ secondaryAction: (0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {}), disablePadding: true, sx: { position: 'relative', flexDirection: 'row', alignItems: 'center' } }, { children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32, sx: { marginLeft: 1.5, marginRight: 2 } }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 20 }), secondary: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 20 }) })] })));
28
+ return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, { secondaryAction: (0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {}), disablePadding: true, sx: { position: 'relative', flexDirection: 'row', alignItems: 'center' }, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "circular", width: 32, height: 32, sx: { marginLeft: 1.5, marginRight: 2 } }) }), (0, jsx_runtime_1.jsx)(material_1.ListItemText, { primary: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 20 }), secondary: (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 96, height: 20 }) })] }));
29
29
  };
30
30
  exports.TokenListItemSkeleton = TokenListItemSkeleton;
31
31
  const TokenAmountSkeleton = () => {
32
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
32
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
33
33
  display: 'flex',
34
34
  flexDirection: 'column',
35
35
  alignItems: 'flex-end',
36
- } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 56, height: 24 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 18 })] })));
36
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 56, height: 24 }), (0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 18 })] }));
37
37
  };
38
38
  exports.TokenAmountSkeleton = TokenAmountSkeleton;
@@ -9,21 +9,20 @@ const react_i18next_1 = require("react-i18next");
9
9
  const hooks_1 = require("../../hooks");
10
10
  const providers_1 = require("../../providers");
11
11
  const TokenNotFound = ({ formType }) => {
12
- var _a;
13
12
  const { t } = (0, react_i18next_1.useTranslation)();
14
13
  const [selectedChainId] = (0, react_hook_form_1.useWatch)({
15
14
  name: [providers_1.SwapFormKeyHelper.getChainKey(formType)],
16
15
  });
17
16
  const { getChainById } = (0, hooks_1.useChains)();
18
- return ((0, jsx_runtime_1.jsxs)(material_1.Box, Object.assign({ sx: {
17
+ return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
19
18
  display: 'flex',
20
19
  justifyContent: 'center',
21
20
  alignItems: 'center',
22
21
  flexDirection: 'column',
23
22
  flex: 1,
24
23
  padding: 3,
25
- } }, { children: [(0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 48, lineHeight: 1 }, { children: (0, jsx_runtime_1.jsx)(icons_material_1.SearchOff, { fontSize: "inherit" }) })), (0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, px: 2 }, { children: t('swap.info.message.emptyTokenList', {
26
- chainName: (_a = getChainById(selectedChainId)) === null || _a === void 0 ? void 0 : _a.name,
27
- }) }))] })));
24
+ }, children: [(0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 48, lineHeight: 1, children: (0, jsx_runtime_1.jsx)(icons_material_1.SearchOff, { fontSize: "inherit" }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, px: 2, children: t('swap.info.message.emptyTokenList', {
25
+ chainName: getChainById(selectedChainId)?.name,
26
+ }) })] }));
28
27
  };
29
28
  exports.TokenNotFound = TokenNotFound;
@@ -10,7 +10,7 @@ const TokenListItem_1 = require("./TokenListItem");
10
10
  const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef, chainId, isLoading, isBalanceLoading, showBalance, showFeatured, onClick, }) => {
11
11
  const { t } = (0, react_i18next_1.useTranslation)();
12
12
  const hasFeaturedTokens = !!featuredTokensLength && showFeatured;
13
- const featuredTokensLastIndex = (featuredTokensLength !== null && featuredTokensLength !== void 0 ? featuredTokensLength : 0) - 1;
13
+ const featuredTokensLastIndex = (featuredTokensLength ?? 0) - 1;
14
14
  const tokensLastIndex = tokens.length - 1;
15
15
  const { getVirtualItems, getTotalSize, scrollToIndex } = (0, react_virtual_1.useVirtualizer)({
16
16
  count: tokens.length,
@@ -18,25 +18,24 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
18
18
  overscan: 10,
19
19
  paddingEnd: 12,
20
20
  estimateSize: (index) => {
21
- var _a, _b;
22
21
  // heigth of TokenListItem
23
22
  let size = 64;
24
23
  if (!hasFeaturedTokens) {
25
24
  return size;
26
25
  }
27
- if (index === 0 && ((_a = tokens[index]) === null || _a === void 0 ? void 0 : _a.featured)) {
26
+ if (index === 0 && tokens[index]?.featured) {
28
27
  // height of startAdornment
29
28
  size += 24;
30
29
  }
31
30
  if (index === featuredTokensLastIndex &&
32
31
  index !== tokensLastIndex &&
33
- ((_b = tokens[index]) === null || _b === void 0 ? void 0 : _b.featured)) {
32
+ tokens[index]?.featured) {
34
33
  // height of endAdornment
35
34
  size += 32;
36
35
  }
37
36
  return size;
38
37
  },
39
- getItemKey: (index) => { var _a; return (_a = tokens[index].address) !== null && _a !== void 0 ? _a : index; },
38
+ getItemKey: (index) => tokens[index].address ?? index,
40
39
  });
41
40
  (0, react_1.useEffect)(() => {
42
41
  if (getVirtualItems().length) {
@@ -44,16 +43,16 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
44
43
  }
45
44
  }, [scrollToIndex, chainId, getVirtualItems]);
46
45
  if (isLoading) {
47
- return ((0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ disablePadding: true }, { children: Array.from({ length: 3 }).map((_, index) => (
46
+ return ((0, jsx_runtime_1.jsx)(material_1.List, { disablePadding: true, children: Array.from({ length: 3 }).map((_, index) => (
48
47
  // eslint-disable-next-line react/no-array-index-key
49
- (0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItemSkeleton, {}, index))) })));
48
+ (0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItemSkeleton, {}, index))) }));
50
49
  }
51
- return ((0, jsx_runtime_1.jsx)(material_1.List, Object.assign({ style: { height: getTotalSize() }, disablePadding: true }, { children: getVirtualItems().map((item) => {
50
+ return ((0, jsx_runtime_1.jsx)(material_1.List, { style: { height: getTotalSize() }, disablePadding: true, children: getVirtualItems().map((item) => {
52
51
  const token = tokens[item.index];
53
- return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25 }, { children: t('swap.featuredTokens') }))) : null, endAdornment: hasFeaturedTokens &&
52
+ return ((0, jsx_runtime_1.jsx)(TokenListItem_1.TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('swap.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
54
53
  token.featured &&
55
54
  item.index === featuredTokensLastIndex &&
56
- item.index !== tokensLastIndex ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25 }, { children: t('swap.otherTokens') }))) : null }, item.key));
57
- }) })));
55
+ item.index !== tokensLastIndex ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('swap.otherTokens') })) : null }, item.key));
56
+ }) }));
58
57
  };
59
58
  exports.VirtualizedTokenList = VirtualizedTokenList;
@@ -11,7 +11,7 @@ const useTokenSelect = (formType, onClick) => {
11
11
  return (0, react_1.useCallback)((tokenAddress, chainId) => {
12
12
  onChange(tokenAddress);
13
13
  onBlur();
14
- const selectedChainId = chainId !== null && chainId !== void 0 ? chainId : getValues(providers_1.SwapFormKeyHelper.getChainKey(formType));
14
+ const selectedChainId = chainId ?? getValues(providers_1.SwapFormKeyHelper.getChainKey(formType));
15
15
  // Set chain again to trigger URL builder update
16
16
  setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
17
17
  shouldDirty: true,
@@ -30,7 +30,7 @@ const useTokenSelect = (formType, onClick) => {
30
30
  shouldTouch: true,
31
31
  });
32
32
  }
33
- onClick === null || onClick === void 0 ? void 0 : onClick();
33
+ onClick?.();
34
34
  }, [formType, getValues, onBlur, onChange, onClick, setValue]);
35
35
  };
36
36
  exports.useTokenSelect = useTokenSelect;
package/cjs/config/env.js CHANGED
@@ -2,5 +2,5 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.env = void 0;
4
4
  exports.env = {
5
- LIFI_API_URL: 'https://li.quest/v1/', // 'https://developkub.li.finance/v1/',
5
+ LIFI_API_URL: 'https://li.quest/v1/', // 'https://develop.li.quest/v1/',
6
6
  };
@@ -1,23 +1,14 @@
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.initSentry = void 0;
13
4
  const version_1 = require("./version");
14
5
  let sentryLoaded = false;
15
- const initSentry = (enabled) => __awaiter(void 0, void 0, void 0, function* () {
6
+ const initSentry = async (enabled) => {
16
7
  if (process.env.NODE_ENV === 'development') {
17
8
  return;
18
9
  }
19
10
  if (enabled || sentryLoaded) {
20
- const [Sentry, { CaptureConsole }, { BrowserTracing }] = yield Promise.all([
11
+ const [Sentry, { CaptureConsole }, { BrowserTracing }] = await Promise.all([
21
12
  Promise.resolve().then(() => require('@sentry/react')),
22
13
  Promise.resolve().then(() => require('@sentry/integrations')),
23
14
  Promise.resolve().then(() => require('@sentry/tracing')),
@@ -38,5 +29,5 @@ const initSentry = (enabled) => __awaiter(void 0, void 0, void 0, function* () {
38
29
  });
39
30
  sentryLoaded = true;
40
31
  }
41
- });
32
+ };
42
33
  exports.initSentry = initSentry;
@@ -45,10 +45,12 @@ const shape = {
45
45
  borderRadiusSecondary: 8,
46
46
  };
47
47
  const createTheme = (mode, theme = {}) => {
48
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p, _q, _r, _s, _t, _u, _v, _w;
49
- const primaryMainColor = (_c = (_b = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) !== null && _c !== void 0 ? _c : palette.primary.main;
50
- const primaryLightColor = (0, styles_1.lighten)((_f = (_e = (_d = theme.palette) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : palette.primary.main, 0.5);
51
- const primaryDarkColor = (0, styles_1.darken)((_j = (_h = (_g = theme.palette) === null || _g === void 0 ? void 0 : _g.primary) === null || _h === void 0 ? void 0 : _h.main) !== null && _j !== void 0 ? _j : palette.primary.main, 0.2);
48
+ const primaryMainColor = theme.palette?.primary?.main ??
49
+ palette.primary.main;
50
+ const primaryLightColor = (0, styles_1.lighten)(theme.palette?.primary?.main ??
51
+ palette.primary.main, 0.5);
52
+ const primaryDarkColor = (0, styles_1.darken)(theme.palette?.primary?.main ??
53
+ palette.primary.main, 0.2);
52
54
  const contrastButtonColor = (0, styles_1.getContrastRatio)(colors_1.common.white, primaryMainColor) >= 3
53
55
  ? colors_1.common.white
54
56
  : colors_1.common.black;
@@ -56,17 +58,33 @@ const createTheme = (mode, theme = {}) => {
56
58
  ? colors_1.common.white
57
59
  : colors_1.common.black;
58
60
  return (0, styles_1.createTheme)({
59
- typography: Object.assign({ fontFamily: 'Inter var, Inter, sans-serif' }, theme.typography),
60
- palette: Object.assign(Object.assign(Object.assign(Object.assign({ mode }, palette), (mode === 'light' ? paletteLight : paletteDark)), theme.palette), { primary: {
61
+ typography: {
62
+ fontFamily: 'Inter var, Inter, sans-serif',
63
+ ...theme.typography,
64
+ },
65
+ palette: {
66
+ mode,
67
+ ...palette,
68
+ ...(mode === 'light' ? paletteLight : paletteDark),
69
+ ...theme.palette,
70
+ primary: {
61
71
  main: primaryMainColor,
62
72
  light: primaryLightColor,
63
73
  dark: primaryDarkColor,
64
- }, secondary: {
65
- main: (_m = (_l = (_k = theme.palette) === null || _k === void 0 ? void 0 : _k.secondary) === null || _l === void 0 ? void 0 : _l.main) !== null && _m !== void 0 ? _m : palette.secondary.main,
66
- light: (0, styles_1.lighten)((_q = (_p = (_o = theme.palette) === null || _o === void 0 ? void 0 : _o.secondary) === null || _p === void 0 ? void 0 : _p.main) !== null && _q !== void 0 ? _q : palette.secondary.main, 0.5),
67
- dark: (0, styles_1.darken)((_t = (_s = (_r = theme.palette) === null || _r === void 0 ? void 0 : _r.secondary) === null || _s === void 0 ? void 0 : _s.main) !== null && _t !== void 0 ? _t : palette.secondary.main, 0.2),
68
- } }),
69
- shape: Object.assign(Object.assign({}, shape), theme.shape),
74
+ },
75
+ secondary: {
76
+ main: theme.palette?.secondary?.main ??
77
+ palette.secondary.main,
78
+ light: (0, styles_1.lighten)(theme.palette?.secondary?.main ??
79
+ palette.secondary.main, 0.5),
80
+ dark: (0, styles_1.darken)(theme.palette?.secondary?.main ??
81
+ palette.secondary.main, 0.2),
82
+ },
83
+ },
84
+ shape: {
85
+ ...shape,
86
+ ...theme.shape,
87
+ },
70
88
  breakpoints: {
71
89
  values: {
72
90
  xs: 0,
@@ -79,7 +97,14 @@ const createTheme = (mode, theme = {}) => {
79
97
  components: {
80
98
  MuiScopedCssBaseline: {
81
99
  styleOverrides: {
82
- root: Object.assign(Object.assign({ fontFamily: 'Inter, sans-serif' }, theme.typography), { '@supports (font-variation-settings: normal)': Object.assign({ fontFamily: 'Inter var, sans-serif' }, theme.typography) }),
100
+ root: {
101
+ fontFamily: 'Inter, sans-serif',
102
+ ...theme.typography,
103
+ '@supports (font-variation-settings: normal)': {
104
+ fontFamily: 'Inter var, sans-serif',
105
+ ...theme.typography,
106
+ },
107
+ },
83
108
  },
84
109
  },
85
110
  MuiButton: {
@@ -88,7 +113,7 @@ const createTheme = (mode, theme = {}) => {
88
113
  },
89
114
  styleOverrides: {
90
115
  root: {
91
- borderRadius: (_v = (_u = theme.shape) === null || _u === void 0 ? void 0 : _u.borderRadiusSecondary) !== null && _v !== void 0 ? _v : shape.borderRadiusSecondary,
116
+ borderRadius: theme.shape?.borderRadiusSecondary ?? shape.borderRadiusSecondary,
92
117
  textTransform: 'none',
93
118
  fontSize: '1rem',
94
119
  [`&.Mui-disabled, &.Mui-disabled:hover`]: {
@@ -145,12 +170,15 @@ const createTheme = (mode, theme = {}) => {
145
170
  },
146
171
  },
147
172
  },
148
- MuiAvatar: Object.assign({ styleOverrides: {
173
+ MuiAvatar: {
174
+ styleOverrides: {
149
175
  root: {
150
176
  height: 32,
151
177
  width: 32,
152
178
  },
153
- } }, (_w = theme.components) === null || _w === void 0 ? void 0 : _w.MuiAvatar),
179
+ },
180
+ ...theme.components?.MuiAvatar,
181
+ },
154
182
  MuiListItemAvatar: {
155
183
  styleOverrides: {
156
184
  root: {
@@ -1,2 +1,2 @@
1
1
  export declare const name = "@lifi/widget";
2
- export declare const version = "1.31.0";
2
+ export declare const version = "1.32.0";
@@ -2,4 +2,4 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.version = exports.name = void 0;
4
4
  exports.name = '@lifi/widget';
5
- exports.version = '1.31.0';
5
+ exports.version = '1.32.0';
@@ -6,7 +6,7 @@ const useChains_1 = require("./useChains");
6
6
  const useChain = (chainId) => {
7
7
  const { chains, isLoading } = (0, useChains_1.useChains)();
8
8
  const chain = (0, react_1.useMemo)(() => {
9
- const chain = chains === null || chains === void 0 ? void 0 : chains.find((chain) => chain.id === chainId);
9
+ const chain = chains?.find((chain) => chain.id === chainId);
10
10
  return chain;
11
11
  }, [chainId, chains]);
12
12
  return {
@@ -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.useChains = void 0;
13
4
  const react_query_1 = require("@tanstack/react-query");
@@ -20,8 +11,8 @@ const useChains = () => {
20
11
  const lifi = (0, providers_1.useLiFi)();
21
12
  const { getValues, setValue } = (0, react_hook_form_1.useFormContext)();
22
13
  const initializeChains = (0, stores_1.useChainOrderStore)((state) => state.initializeChains);
23
- const { data, isLoading } = (0, react_query_1.useQuery)(['chains'], () => __awaiter(void 0, void 0, void 0, function* () {
24
- const availableChains = yield lifi.getChains();
14
+ const { data, isLoading } = (0, react_query_1.useQuery)(['chains'], async () => {
15
+ const availableChains = await lifi.getChains();
25
16
  const filteredChains = availableChains.filter((chain) => (0, providers_1.isItemAllowed)(chain.id, chains, disabledChains));
26
17
  const chainOrder = initializeChains(filteredChains.map((chain) => chain.id));
27
18
  const [fromChainValue, toChainValue] = getValues([
@@ -35,17 +26,17 @@ const useChains = () => {
35
26
  setValue(providers_1.SwapFormKey.ToChain, chainOrder[0]);
36
27
  }
37
28
  return { availableChains, filteredChains };
38
- }), {
29
+ }, {
39
30
  refetchInterval: 180000,
40
31
  staleTime: 180000,
41
32
  });
42
33
  const getChainById = (0, react_1.useCallback)((chainId) => {
43
- const chain = data === null || data === void 0 ? void 0 : data.availableChains.find((chain) => chain.id === chainId);
34
+ const chain = data?.availableChains.find((chain) => chain.id === chainId);
44
35
  // if (!chain) {
45
36
  // throw new Error('Chain not found or chainId is invalid.');
46
37
  // }
47
38
  return chain;
48
39
  }, [data]);
49
- return { chains: data === null || data === void 0 ? void 0 : data.filteredChains, getChainById, isLoading };
40
+ return { chains: data?.filteredChains, getChainById, isLoading };
50
41
  };
51
42
  exports.useChains = useChains;
@@ -31,11 +31,10 @@ exports.useContentHeight = useContentHeight;
31
31
  const useSetContentHeight = (ref) => {
32
32
  const elementId = (0, useDefaultElementId_1.useDefaultElementId)();
33
33
  (0, react_1.useLayoutEffect)(() => {
34
- var _a;
35
34
  const scrollableContainer = (0, useScrollableContainer_1.getScrollableContainer)(elementId);
36
35
  if (!scrollableContainer ||
37
36
  !ref.current ||
38
- ((_a = ref.current) === null || _a === void 0 ? void 0 : _a.clientHeight) <= (scrollableContainer === null || scrollableContainer === void 0 ? void 0 : scrollableContainer.clientHeight)) {
37
+ ref.current?.clientHeight <= scrollableContainer?.clientHeight) {
39
38
  return;
40
39
  }
41
40
  scrollableContainer.style.height = `${ref.current.clientHeight}px`;
@@ -5,9 +5,6 @@ const react_1 = require("react");
5
5
  const providers_1 = require("../providers");
6
6
  const useFeaturedTokens = (selectedChainId) => {
7
7
  const { featuredTokens, tokens } = (0, providers_1.useWidgetConfig)();
8
- return (0, react_1.useMemo)(() => {
9
- var _a;
10
- return [...((_a = tokens === null || tokens === void 0 ? void 0 : tokens.featured) !== null && _a !== void 0 ? _a : []), ...(featuredTokens !== null && featuredTokens !== void 0 ? featuredTokens : [])].filter((token) => token.chainId === selectedChainId);
11
- }, [featuredTokens, selectedChainId, tokens === null || tokens === void 0 ? void 0 : tokens.featured]);
8
+ return (0, react_1.useMemo)(() => [...(tokens?.featured ?? []), ...(featuredTokens ?? [])].filter((token) => token.chainId === selectedChainId), [featuredTokens, selectedChainId, tokens?.featured]);
12
9
  };
13
10
  exports.useFeaturedTokens = useFeaturedTokens;