@lifi/widget 3.29.1 → 3.30.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (366) hide show
  1. package/CHANGELOG.md +24 -0
  2. package/dist/esm/AppProvider.d.ts +0 -1
  3. package/dist/esm/AppProvider.js +1 -1
  4. package/dist/esm/AppProvider.js.map +1 -1
  5. package/dist/esm/components/AmountInput/AmountInput.d.ts +0 -9
  6. package/dist/esm/components/AmountInput/AmountInput.js +1 -1
  7. package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
  8. package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +0 -1
  9. package/dist/esm/components/AmountInput/AmountInputAdornment.style.js +1 -6
  10. package/dist/esm/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
  11. package/dist/esm/components/AmountInput/AmountInputEndAdornment.d.ts +1 -1
  12. package/dist/esm/components/AmountInput/AmountInputEndAdornment.js +3 -2
  13. package/dist/esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
  14. package/dist/esm/components/AmountInput/PriceFormHelperText.d.ts +1 -7
  15. package/dist/esm/components/AmountInput/PriceFormHelperText.js +4 -3
  16. package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
  17. package/dist/esm/components/Avatar/Avatar.d.ts +0 -4
  18. package/dist/esm/components/Avatar/Avatar.js +1 -1
  19. package/dist/esm/components/Avatar/Avatar.js.map +1 -1
  20. package/dist/esm/components/Avatar/TokenAvatar.d.ts +0 -15
  21. package/dist/esm/components/Avatar/TokenAvatar.js +2 -2
  22. package/dist/esm/components/Avatar/TokenAvatar.js.map +1 -1
  23. package/dist/esm/components/Card/CardButton.style.d.ts +0 -1
  24. package/dist/esm/components/Card/CardButton.style.js +0 -7
  25. package/dist/esm/components/Card/CardButton.style.js.map +1 -1
  26. package/dist/esm/components/ChainSelect/ChainSelect.js +35 -18
  27. package/dist/esm/components/ChainSelect/ChainSelect.js.map +1 -1
  28. package/dist/esm/components/ChainSelect/useChainSelect.d.ts +1 -1
  29. package/dist/esm/components/ChainSelect/useChainSelect.js +3 -3
  30. package/dist/esm/components/ChainSelect/useChainSelect.js.map +1 -1
  31. package/dist/esm/components/Chains/AllChainsAvatar.d.ts +7 -0
  32. package/dist/esm/components/Chains/AllChainsAvatar.js +77 -0
  33. package/dist/esm/components/Chains/AllChainsAvatar.js.map +1 -0
  34. package/dist/esm/components/Chains/ChainList.d.ts +2 -1
  35. package/dist/esm/components/Chains/ChainList.js +2 -2
  36. package/dist/esm/components/Chains/ChainList.js.map +1 -1
  37. package/dist/esm/components/Chains/ChainSearchInput.js +2 -2
  38. package/dist/esm/components/Chains/ChainSearchInput.js.map +1 -1
  39. package/dist/esm/components/Chains/SelectChainContent.js +1 -1
  40. package/dist/esm/components/Chains/SelectChainContent.js.map +1 -1
  41. package/dist/esm/components/Chains/VirtualizedChainList.d.ts +2 -1
  42. package/dist/esm/components/Chains/VirtualizedChainList.js +42 -10
  43. package/dist/esm/components/Chains/VirtualizedChainList.js.map +1 -1
  44. package/dist/esm/components/FeeBreakdownTooltip.d.ts +2 -3
  45. package/dist/esm/components/FeeBreakdownTooltip.js +1 -1
  46. package/dist/esm/components/FeeBreakdownTooltip.js.map +1 -1
  47. package/dist/esm/components/Header/Header.d.ts +1 -2
  48. package/dist/esm/components/Header/Header.js +1 -1
  49. package/dist/esm/components/Header/Header.js.map +1 -1
  50. package/dist/esm/components/Header/WalletHeader.d.ts +0 -1
  51. package/dist/esm/components/Header/WalletHeader.js +1 -1
  52. package/dist/esm/components/Header/WalletHeader.js.map +1 -1
  53. package/dist/esm/components/RouteCard/RouteCardEssentials.js +1 -1
  54. package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
  55. package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  56. package/dist/esm/components/StepActions/StepActions.d.ts +1 -10
  57. package/dist/esm/components/StepActions/StepActions.js +6 -6
  58. package/dist/esm/components/StepActions/StepActions.js.map +1 -1
  59. package/dist/esm/components/Tabs/Tabs.style.d.ts +0 -1
  60. package/dist/esm/components/Tabs/Tabs.style.js +1 -1
  61. package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
  62. package/dist/esm/components/Timer/TimerContent.js +1 -2
  63. package/dist/esm/components/Timer/TimerContent.js.map +1 -1
  64. package/dist/esm/components/Token/Token.d.ts +0 -2
  65. package/dist/esm/components/Token/Token.js +2 -2
  66. package/dist/esm/components/Token/Token.js.map +1 -1
  67. package/dist/esm/components/TokenList/TokenDetailsSheet.d.ts +1 -5
  68. package/dist/esm/components/TokenList/TokenDetailsSheet.js +4 -2
  69. package/dist/esm/components/TokenList/TokenDetailsSheet.js.map +1 -1
  70. package/dist/esm/components/TokenList/TokenDetailsSheetContent.js +2 -2
  71. package/dist/esm/components/TokenList/TokenDetailsSheetContent.js.map +1 -1
  72. package/dist/esm/components/TokenList/TokenList.js +11 -53
  73. package/dist/esm/components/TokenList/TokenList.js.map +1 -1
  74. package/dist/esm/components/TokenList/TokenListItem.d.ts +1 -4
  75. package/dist/esm/components/TokenList/TokenListItem.js +30 -26
  76. package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
  77. package/dist/esm/components/TokenList/VirtualizedTokenList.js +56 -37
  78. package/dist/esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
  79. package/dist/esm/components/TokenList/types.d.ts +8 -11
  80. package/dist/esm/components/TokenList/useTokenSelect.d.ts +0 -4
  81. package/dist/esm/components/TokenList/useTokenSelect.js +3 -4
  82. package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
  83. package/dist/esm/components/TokenRate/TokenRate.js +1 -3
  84. package/dist/esm/components/TokenRate/TokenRate.js.map +1 -1
  85. package/dist/esm/components/TransactionDetails.js +2 -2
  86. package/dist/esm/components/TransactionDetails.js.map +1 -1
  87. package/dist/esm/config/version.d.ts +1 -1
  88. package/dist/esm/config/version.js +1 -1
  89. package/dist/esm/hooks/timer/time.d.ts +0 -8
  90. package/dist/esm/hooks/timer/time.js.map +1 -1
  91. package/dist/esm/hooks/timer/useTimer.d.ts +3 -2
  92. package/dist/esm/hooks/useAccountsBalancesData.d.ts +6 -0
  93. package/dist/esm/hooks/useAccountsBalancesData.js +64 -0
  94. package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -0
  95. package/dist/esm/hooks/useAvailableChains.d.ts +2 -1
  96. package/dist/esm/hooks/useChain.d.ts +1 -1
  97. package/dist/esm/hooks/useChains.d.ts +1 -1
  98. package/dist/esm/hooks/useExplorer.d.ts +2 -1
  99. package/dist/esm/hooks/useFilteredByTokenBalances.d.ts +9 -0
  100. package/dist/esm/hooks/useFilteredByTokenBalances.js +78 -0
  101. package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -0
  102. package/dist/esm/hooks/useListHeight.d.ts +0 -3
  103. package/dist/esm/hooks/useListHeight.js +2 -3
  104. package/dist/esm/hooks/useListHeight.js.map +1 -1
  105. package/dist/esm/hooks/useRoutes.js +2 -2
  106. package/dist/esm/hooks/useRoutes.js.map +1 -1
  107. package/dist/esm/hooks/useToAddressAutoPopulate.d.ts +2 -1
  108. package/dist/esm/hooks/useToken.d.ts +2 -2
  109. package/dist/esm/hooks/useToken.js +13 -10
  110. package/dist/esm/hooks/useToken.js.map +1 -1
  111. package/dist/esm/hooks/useTokenAddressBalance.d.ts +3 -3
  112. package/dist/esm/hooks/useTokenAddressBalance.js +10 -14
  113. package/dist/esm/hooks/useTokenAddressBalance.js.map +1 -1
  114. package/dist/esm/hooks/useTokenBalances.d.ts +6 -9
  115. package/dist/esm/hooks/useTokenBalances.js +57 -72
  116. package/dist/esm/hooks/useTokenBalances.js.map +1 -1
  117. package/dist/esm/hooks/useTokenBalancesQueries.d.ts +11 -0
  118. package/dist/esm/hooks/useTokenBalancesQueries.js +74 -0
  119. package/dist/esm/hooks/useTokenBalancesQueries.js.map +1 -0
  120. package/dist/esm/hooks/useTokenSearch.js +3 -3
  121. package/dist/esm/hooks/useTokenSearch.js.map +1 -1
  122. package/dist/esm/hooks/useTokens.d.ts +6 -6
  123. package/dist/esm/hooks/useTokens.js +98 -69
  124. package/dist/esm/hooks/useTokens.js.map +1 -1
  125. package/dist/esm/i18n/bn.json +3 -3
  126. package/dist/esm/i18n/de.json +3 -3
  127. package/dist/esm/i18n/en.json +3 -3
  128. package/dist/esm/i18n/es.json +3 -3
  129. package/dist/esm/i18n/fr.json +3 -3
  130. package/dist/esm/i18n/hi.json +3 -3
  131. package/dist/esm/i18n/id.json +3 -3
  132. package/dist/esm/i18n/it.json +3 -3
  133. package/dist/esm/i18n/ja.json +3 -3
  134. package/dist/esm/i18n/ko.json +3 -3
  135. package/dist/esm/i18n/pl.json +3 -3
  136. package/dist/esm/i18n/pt.json +5 -5
  137. package/dist/esm/i18n/th.json +3 -3
  138. package/dist/esm/i18n/tr.json +3 -3
  139. package/dist/esm/i18n/uk.json +3 -3
  140. package/dist/esm/i18n/vi.json +3 -3
  141. package/dist/esm/i18n/zh.json +3 -3
  142. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js +6 -1
  143. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
  144. package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js +2 -4
  145. package/dist/esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
  146. package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
  147. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +27 -17
  148. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
  149. package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +2 -1
  150. package/dist/esm/pages/TransactionPage/StatusBottomSheet.d.ts +0 -5
  151. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +1 -1
  152. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
  153. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +1 -1
  154. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
  155. package/dist/esm/providers/I18nProvider/types.d.ts +4 -3
  156. package/dist/esm/providers/WalletProvider/EVMProvider.d.ts +0 -1
  157. package/dist/esm/providers/WalletProvider/EVMProvider.js +1 -1
  158. package/dist/esm/providers/WalletProvider/EVMProvider.js.map +1 -1
  159. package/dist/esm/providers/WalletProvider/SVMProvider.d.ts +0 -1
  160. package/dist/esm/providers/WalletProvider/SVMProvider.js +1 -1
  161. package/dist/esm/providers/WalletProvider/SVMProvider.js.map +1 -1
  162. package/dist/esm/providers/WalletProvider/SuiProvider.d.ts +0 -1
  163. package/dist/esm/providers/WalletProvider/SuiProvider.js +1 -1
  164. package/dist/esm/providers/WalletProvider/SuiProvider.js.map +1 -1
  165. package/dist/esm/providers/WalletProvider/UTXOProvider.d.ts +0 -1
  166. package/dist/esm/providers/WalletProvider/UTXOProvider.js +1 -1
  167. package/dist/esm/providers/WalletProvider/UTXOProvider.js.map +1 -1
  168. package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +0 -1
  169. package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
  170. package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
  171. package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +1 -2
  172. package/dist/esm/stores/bookmarks/BookmarkStore.js +1 -1
  173. package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
  174. package/dist/esm/stores/chains/ChainOrderStore.d.ts +0 -5
  175. package/dist/esm/stores/chains/ChainOrderStore.js +2 -2
  176. package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
  177. package/dist/esm/stores/chains/createChainOrderStore.d.ts +3 -2
  178. package/dist/esm/stores/chains/createChainOrderStore.js +13 -8
  179. package/dist/esm/stores/chains/createChainOrderStore.js.map +1 -1
  180. package/dist/esm/stores/chains/types.d.ts +4 -1
  181. package/dist/esm/stores/chains/useChainOrder.js +5 -1
  182. package/dist/esm/stores/chains/useChainOrder.js.map +1 -1
  183. package/dist/esm/stores/header/types.d.ts +2 -1
  184. package/dist/esm/stores/header/useHeaderStore.d.ts +1 -4
  185. package/dist/esm/stores/header/useHeaderStore.js +3 -3
  186. package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
  187. package/dist/esm/stores/inputMode/useInputModeStore.d.ts +1 -1
  188. package/dist/esm/stores/routes/RouteExecutionStore.d.ts +2 -2
  189. package/dist/esm/stores/routes/RouteExecutionStore.js +1 -1
  190. package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
  191. package/dist/esm/stores/settings/types.d.ts +3 -3
  192. package/dist/esm/stores/settings/types.js.map +1 -1
  193. package/dist/esm/stores/settings/useSettingsStore.d.ts +1 -2
  194. package/dist/esm/stores/settings/useSettingsStore.js +1 -1
  195. package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
  196. package/dist/esm/stores/settings/useSplitSubvariantStore.d.ts +1 -4
  197. package/dist/esm/stores/settings/useSplitSubvariantStore.js +3 -3
  198. package/dist/esm/stores/settings/useSplitSubvariantStore.js.map +1 -1
  199. package/dist/esm/types/events.d.ts +0 -4
  200. package/dist/esm/types/events.js +0 -4
  201. package/dist/esm/types/events.js.map +1 -1
  202. package/dist/esm/types/token.d.ts +7 -2
  203. package/dist/esm/utils/chainType.d.ts +1 -0
  204. package/dist/esm/utils/chainType.js +2 -0
  205. package/dist/esm/utils/chainType.js.map +1 -1
  206. package/dist/esm/utils/fees.d.ts +1 -4
  207. package/dist/esm/utils/fees.js +3 -3
  208. package/dist/esm/utils/fees.js.map +1 -1
  209. package/dist/esm/utils/format.js +1 -1
  210. package/dist/esm/utils/format.js.map +1 -1
  211. package/dist/esm/utils/navigationRoutes.d.ts +2 -1
  212. package/dist/esm/utils/token.d.ts +8 -0
  213. package/dist/esm/utils/token.js +29 -0
  214. package/dist/esm/utils/token.js.map +1 -0
  215. package/dist/esm/utils/tokenList.d.ts +9 -0
  216. package/dist/esm/utils/tokenList.js +106 -0
  217. package/dist/esm/utils/tokenList.js.map +1 -0
  218. package/package.json +10 -10
  219. package/package.json.tmp +9 -9
  220. package/src/AppProvider.tsx +1 -1
  221. package/src/components/AmountInput/AmountInput.tsx +1 -1
  222. package/src/components/AmountInput/AmountInputAdornment.style.tsx +1 -7
  223. package/src/components/AmountInput/AmountInputEndAdornment.tsx +3 -2
  224. package/src/components/AmountInput/PriceFormHelperText.tsx +4 -3
  225. package/src/components/Avatar/Avatar.tsx +1 -1
  226. package/src/components/Avatar/TokenAvatar.tsx +2 -2
  227. package/src/components/Card/CardButton.style.tsx +0 -8
  228. package/src/components/ChainSelect/ChainSelect.tsx +112 -40
  229. package/src/components/ChainSelect/useChainSelect.ts +3 -3
  230. package/src/components/Chains/AllChainsAvatar.tsx +113 -0
  231. package/src/components/Chains/ChainList.tsx +3 -0
  232. package/src/components/Chains/ChainSearchInput.tsx +2 -2
  233. package/src/components/Chains/SelectChainContent.tsx +1 -0
  234. package/src/components/Chains/VirtualizedChainList.tsx +80 -12
  235. package/src/components/FeeBreakdownTooltip.tsx +2 -5
  236. package/src/components/Header/Header.tsx +1 -1
  237. package/src/components/Header/WalletHeader.tsx +1 -1
  238. package/src/components/RouteCard/RouteCardEssentials.tsx +1 -1
  239. package/src/components/SendToWallet/SendToWalletButton.tsx +0 -1
  240. package/src/components/StepActions/StepActions.tsx +6 -6
  241. package/src/components/Tabs/Tabs.style.tsx +1 -1
  242. package/src/components/Timer/TimerContent.tsx +1 -2
  243. package/src/components/Token/Token.tsx +2 -2
  244. package/src/components/TokenList/TokenDetailsSheet.tsx +4 -9
  245. package/src/components/TokenList/TokenDetailsSheetContent.tsx +2 -6
  246. package/src/components/TokenList/TokenList.tsx +57 -129
  247. package/src/components/TokenList/TokenListItem.tsx +177 -154
  248. package/src/components/TokenList/VirtualizedTokenList.tsx +88 -48
  249. package/src/components/TokenList/types.ts +15 -11
  250. package/src/components/TokenList/useTokenSelect.ts +3 -9
  251. package/src/components/TokenRate/TokenRate.tsx +0 -1
  252. package/src/components/TransactionDetails.tsx +2 -3
  253. package/src/config/version.ts +1 -1
  254. package/src/hooks/timer/time.ts +0 -10
  255. package/src/hooks/timer/useTimer.ts +2 -2
  256. package/src/hooks/useAccountsBalancesData.ts +101 -0
  257. package/src/hooks/useAvailableChains.ts +1 -1
  258. package/src/hooks/useExplorer.ts +1 -1
  259. package/src/hooks/useFilteredByTokenBalances.ts +130 -0
  260. package/src/hooks/useListHeight.ts +2 -3
  261. package/src/hooks/useRoutes.ts +4 -2
  262. package/src/hooks/useToAddressAutoPopulate.ts +1 -1
  263. package/src/hooks/useToken.ts +31 -13
  264. package/src/hooks/useTokenAddressBalance.ts +15 -20
  265. package/src/hooks/useTokenBalances.ts +81 -80
  266. package/src/hooks/useTokenBalancesQueries.ts +94 -0
  267. package/src/hooks/useTokenSearch.ts +4 -7
  268. package/src/hooks/useTokens.ts +153 -87
  269. package/src/i18n/bn.json +3 -3
  270. package/src/i18n/de.json +3 -3
  271. package/src/i18n/en.json +3 -3
  272. package/src/i18n/es.json +3 -3
  273. package/src/i18n/fr.json +3 -3
  274. package/src/i18n/hi.json +3 -3
  275. package/src/i18n/id.json +3 -3
  276. package/src/i18n/it.json +3 -3
  277. package/src/i18n/ja.json +3 -3
  278. package/src/i18n/ko.json +3 -3
  279. package/src/i18n/pl.json +3 -3
  280. package/src/i18n/pt.json +5 -5
  281. package/src/i18n/th.json +3 -3
  282. package/src/i18n/tr.json +3 -3
  283. package/src/i18n/uk.json +3 -3
  284. package/src/i18n/vi.json +3 -3
  285. package/src/i18n/zh.json +3 -3
  286. package/src/pages/SelectTokenPage/SearchTokenInput.tsx +5 -0
  287. package/src/pages/SelectTokenPage/SelectTokenPage.tsx +7 -13
  288. package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +0 -1
  289. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +33 -30
  290. package/src/pages/TransactionPage/RouteTracker.tsx +1 -1
  291. package/src/pages/TransactionPage/StatusBottomSheet.tsx +5 -3
  292. package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +1 -1
  293. package/src/providers/I18nProvider/types.ts +3 -3
  294. package/src/providers/WalletProvider/EVMProvider.tsx +1 -1
  295. package/src/providers/WalletProvider/SVMProvider.tsx +1 -1
  296. package/src/providers/WalletProvider/SuiProvider.tsx +1 -1
  297. package/src/providers/WalletProvider/UTXOProvider.tsx +1 -1
  298. package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
  299. package/src/stores/bookmarks/BookmarkStore.tsx +1 -1
  300. package/src/stores/chains/ChainOrderStore.tsx +3 -7
  301. package/src/stores/chains/createChainOrderStore.ts +17 -8
  302. package/src/stores/chains/types.ts +3 -1
  303. package/src/stores/chains/useChainOrder.ts +5 -1
  304. package/src/stores/header/types.ts +1 -1
  305. package/src/stores/header/useHeaderStore.tsx +3 -3
  306. package/src/stores/inputMode/useInputModeStore.ts +1 -1
  307. package/src/stores/routes/RouteExecutionStore.tsx +4 -3
  308. package/src/stores/settings/types.ts +2 -6
  309. package/src/stores/settings/useSettingsStore.ts +1 -1
  310. package/src/stores/settings/useSplitSubvariantStore.tsx +5 -4
  311. package/src/types/events.ts +0 -4
  312. package/src/types/token.ts +11 -2
  313. package/src/utils/chainType.ts +2 -0
  314. package/src/utils/fees.ts +3 -3
  315. package/src/utils/format.ts +2 -1
  316. package/src/utils/navigationRoutes.ts +1 -1
  317. package/src/utils/token.ts +67 -0
  318. package/src/utils/tokenList.ts +172 -0
  319. package/dist/esm/AppDrawer.style.d.ts +0 -1
  320. package/dist/esm/AppDrawer.style.js +0 -12
  321. package/dist/esm/AppDrawer.style.js.map +0 -1
  322. package/dist/esm/components/Select.d.ts +0 -3
  323. package/dist/esm/components/Select.js +0 -35
  324. package/dist/esm/components/Select.js.map +0 -1
  325. package/dist/esm/components/StepActions/StepFees.d.ts +0 -5
  326. package/dist/esm/components/StepActions/StepFees.js +0 -32
  327. package/dist/esm/components/StepActions/StepFees.js.map +0 -1
  328. package/dist/esm/components/TokenList/utils.d.ts +0 -2
  329. package/dist/esm/components/TokenList/utils.js +0 -35
  330. package/dist/esm/components/TokenList/utils.js.map +0 -1
  331. package/dist/esm/pages/MainPage/MainPage.style.d.ts +0 -1
  332. package/dist/esm/pages/MainPage/MainPage.style.js +0 -8
  333. package/dist/esm/pages/MainPage/MainPage.style.js.map +0 -1
  334. package/dist/esm/pages/SelectNativeTokenPage.d.ts +0 -2
  335. package/dist/esm/pages/SelectNativeTokenPage.js +0 -23
  336. package/dist/esm/pages/SelectNativeTokenPage.js.map +0 -1
  337. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.d.ts +0 -1
  338. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js +0 -6
  339. package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js.map +0 -1
  340. package/dist/esm/pages/SelectTokenPage/types.d.ts +0 -4
  341. package/dist/esm/pages/SelectTokenPage/types.js +0 -6
  342. package/dist/esm/pages/SelectTokenPage/types.js.map +0 -1
  343. package/dist/esm/providers/WidgetProvider/utils.d.ts +0 -5
  344. package/dist/esm/providers/WidgetProvider/utils.js +0 -17
  345. package/dist/esm/providers/WidgetProvider/utils.js.map +0 -1
  346. package/dist/esm/stores/form/useFieldController.d.ts +0 -11
  347. package/dist/esm/stores/form/useFieldController.js +0 -20
  348. package/dist/esm/stores/form/useFieldController.js.map +0 -1
  349. package/dist/esm/stores/form/useValidation.d.ts +0 -2
  350. package/dist/esm/stores/form/useValidation.js +0 -14
  351. package/dist/esm/stores/form/useValidation.js.map +0 -1
  352. package/dist/esm/stores/form/useValidationActions.d.ts +0 -2
  353. package/dist/esm/stores/form/useValidationActions.js +0 -10
  354. package/dist/esm/stores/form/useValidationActions.js.map +0 -1
  355. package/src/AppDrawer.style.tsx +0 -12
  356. package/src/components/Select.tsx +0 -42
  357. package/src/components/StepActions/StepFees.tsx +0 -49
  358. package/src/components/TokenList/utils.ts +0 -42
  359. package/src/pages/MainPage/MainPage.style.tsx +0 -8
  360. package/src/pages/SelectNativeTokenPage.tsx +0 -47
  361. package/src/pages/SelectTokenPage/SearchTokenInput.style.tsx +0 -6
  362. package/src/pages/SelectTokenPage/types.ts +0 -4
  363. package/src/providers/WidgetProvider/utils.ts +0 -26
  364. package/src/stores/form/useFieldController.ts +0 -31
  365. package/src/stores/form/useValidation.ts +0 -15
  366. package/src/stores/form/useValidationActions.ts +0 -12
@@ -1,3 +1,4 @@
1
+ import type { StaticToken } from '@lifi/sdk'
1
2
  import { ChainType } from '@lifi/sdk'
2
3
  import InfoOutlinedIcon from '@mui/icons-material/InfoOutlined'
3
4
  import {
@@ -5,16 +6,18 @@ import {
5
6
  Box,
6
7
  ListItemAvatar,
7
8
  ListItemText,
9
+ listItemSecondaryActionClasses,
8
10
  Skeleton,
9
11
  Slide,
10
12
  Typography,
11
13
  } from '@mui/material'
12
14
  import type { MouseEventHandler } from 'react'
13
- import { memo, useRef, useState } from 'react'
15
+ import { memo, useMemo, useRef, useState } from 'react'
14
16
  import { useTranslation } from 'react-i18next'
15
17
  import { useLongPress } from '../../hooks/useLongPress.js'
16
18
  import { formatTokenAmount, formatTokenPrice } from '../../utils/format.js'
17
19
  import { shortenAddress } from '../../utils/wallet.js'
20
+ import { TokenAvatar } from '../Avatar/TokenAvatar.js'
18
21
  import { ListItemButton } from '../ListItem/ListItemButton.js'
19
22
  import { IconButton, ListItem } from './TokenList.style.js'
20
23
  import type {
@@ -30,17 +33,12 @@ export const TokenListItem: React.FC<TokenListItemProps> = memo(
30
33
  start,
31
34
  token,
32
35
  chain,
33
- accountAddress,
34
36
  isBalanceLoading,
35
37
  startAdornment,
36
38
  endAdornment,
37
39
  selected,
38
40
  onShowTokenDetails,
39
41
  }) => {
40
- const handleClick: MouseEventHandler<HTMLDivElement> = (e) => {
41
- e.stopPropagation()
42
- onClick?.(token.address, chain?.id)
43
- }
44
42
  return (
45
43
  <ListItem
46
44
  style={{
@@ -52,10 +50,9 @@ export const TokenListItem: React.FC<TokenListItemProps> = memo(
52
50
  {startAdornment}
53
51
  <TokenListItemButton
54
52
  token={token}
55
- chain={chain}
56
- accountAddress={accountAddress}
57
53
  isBalanceLoading={isBalanceLoading}
58
- onClick={handleClick}
54
+ onClick={onClick}
55
+ chain={chain}
59
56
  selected={selected}
60
57
  onShowTokenDetails={onShowTokenDetails}
61
58
  />
@@ -65,10 +62,9 @@ export const TokenListItem: React.FC<TokenListItemProps> = memo(
65
62
  }
66
63
  )
67
64
 
68
- export const TokenListItemAvatar: React.FC<TokenListItemAvatarProps> = ({
69
- token,
70
- }) => {
65
+ const TokenListItemAvatar = memo(({ token }: TokenListItemAvatarProps) => {
71
66
  const [isImageLoading, setIsImageLoading] = useState(true)
67
+
72
68
  return (
73
69
  <Avatar
74
70
  src={token.logoURI}
@@ -81,17 +77,23 @@ export const TokenListItemAvatar: React.FC<TokenListItemAvatarProps> = ({
81
77
  {token.symbol?.[0]}
82
78
  </Avatar>
83
79
  )
84
- }
80
+ })
85
81
 
86
82
  interface OpenTokenDetailsButtonProps {
87
83
  tokenAddress: string | undefined
88
84
  withoutContractAddress: boolean
89
- onClick: (tokenAddress: string, withoutContractAddress: boolean) => void
85
+ chainId: number
86
+ onClick: (
87
+ tokenAddress: string,
88
+ withoutContractAddress: boolean,
89
+ chainId: number
90
+ ) => void
90
91
  }
91
92
 
92
93
  const OpenTokenDetailsButton = ({
93
94
  tokenAddress,
94
95
  withoutContractAddress,
96
+ chainId,
95
97
  onClick,
96
98
  }: OpenTokenDetailsButtonProps) => {
97
99
  if (!tokenAddress) {
@@ -103,7 +105,7 @@ const OpenTokenDetailsButton = ({
103
105
  onClick={(e) => {
104
106
  e.stopPropagation()
105
107
  e.currentTarget.blur() // Remove focus to prevent accessibility issues when opening drawer
106
- onClick(tokenAddress, withoutContractAddress)
108
+ onClick(tokenAddress, withoutContractAddress, chainId)
107
109
  }}
108
110
  >
109
111
  <InfoOutlinedIcon />
@@ -111,92 +113,159 @@ const OpenTokenDetailsButton = ({
111
113
  )
112
114
  }
113
115
 
114
- export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
115
- onClick,
116
- token,
117
- chain,
118
- accountAddress,
119
- isBalanceLoading,
120
- selected,
121
- onShowTokenDetails,
122
- }) => {
123
- const { t } = useTranslation()
124
- const container = useRef(null)
125
- const timeoutId = useRef<ReturnType<typeof setTimeout>>(undefined)
126
- const [showAddress, setShowAddress] = useState(false)
116
+ const TokenListItemButton: React.FC<TokenListItemButtonProps> = memo(
117
+ ({
118
+ onClick,
119
+ token,
120
+ chain,
121
+ isBalanceLoading,
122
+ selected,
123
+ onShowTokenDetails,
124
+ }) => {
125
+ const { t } = useTranslation()
126
+ const container = useRef(null)
127
+ const timeoutId = useRef<ReturnType<typeof setTimeout>>(undefined)
128
+ const [showAddress, setShowAddress] = useState(false)
127
129
 
128
- const withoutContractAddress = chain?.chainType === ChainType.UTXO
130
+ const withoutContractAddress = chain?.chainType === ChainType.UTXO
131
+
132
+ const onMouseEnter = () => {
133
+ timeoutId.current = setTimeout(() => {
134
+ if (token.address) {
135
+ setShowAddress(true)
136
+ }
137
+ }, 350)
138
+ }
129
139
 
130
- const onMouseEnter = () => {
131
- timeoutId.current = setTimeout(() => {
132
- if (token.address) {
133
- setShowAddress(true)
140
+ const onMouseLeave = () => {
141
+ clearTimeout(timeoutId.current)
142
+ if (showAddress) {
143
+ setShowAddress(false)
134
144
  }
135
- }, 350)
136
- }
145
+ }
137
146
 
138
- const onMouseLeave = () => {
139
- clearTimeout(timeoutId.current)
140
- if (showAddress) {
141
- setShowAddress(false)
147
+ const handleClick: MouseEventHandler<HTMLDivElement> = (e) => {
148
+ e.stopPropagation()
149
+ onClick?.(token.address, token.chainId)
142
150
  }
143
- }
144
151
 
145
- const tokenAmount = formatTokenAmount(token.amount, token.decimals)
146
- const tokenPrice = formatTokenPrice(
147
- token.amount,
148
- token.priceUSD,
149
- token.decimals
150
- )
152
+ const tokenAmount = useMemo(
153
+ () => formatTokenAmount(token.amount, token.decimals),
154
+ [token.amount, token.decimals]
155
+ )
151
156
 
152
- const longPressEvents = useLongPress(() =>
153
- onShowTokenDetails(token.address, withoutContractAddress)
154
- )
157
+ const tokenPrice = useMemo(
158
+ () => formatTokenPrice(token.amount, token.priceUSD, token.decimals),
159
+ [token.amount, token.priceUSD, token.decimals]
160
+ )
155
161
 
156
- return (
157
- <ListItemButton
158
- onClick={onClick}
159
- onMouseEnter={onMouseEnter}
160
- onMouseLeave={onMouseLeave}
161
- {...longPressEvents}
162
- dense
163
- selected={selected}
164
- sx={{
165
- height: 60,
166
- marginBottom: '4px',
167
- }}
168
- >
169
- <ListItemAvatar>
170
- <TokenListItemAvatar token={token} />
171
- </ListItemAvatar>
172
- <ListItemText
173
- primary={token.symbol}
174
- slotProps={{
175
- secondary: {
176
- component: 'div',
177
- },
162
+ const longPressEvents = useLongPress(() =>
163
+ onShowTokenDetails(token.address, withoutContractAddress, token.chainId)
164
+ )
165
+
166
+ return (
167
+ <ListItemButton
168
+ onClick={handleClick}
169
+ onMouseEnter={onMouseEnter}
170
+ onMouseLeave={onMouseLeave}
171
+ {...longPressEvents}
172
+ dense
173
+ selected={selected}
174
+ sx={{
175
+ height: 60,
176
+ marginBottom: '4px',
178
177
  }}
179
- secondary={
180
- withoutContractAddress ? (
181
- <Box
182
- ref={container}
183
- sx={{
184
- height: 20,
185
- display: 'flex',
186
- }}
187
- >
178
+ >
179
+ <ListItemAvatar>
180
+ {chain ? (
181
+ <TokenAvatar
182
+ token={token as StaticToken}
183
+ chain={chain}
184
+ tokenAvatarSize={40}
185
+ chainAvatarSize={16}
186
+ />
187
+ ) : (
188
+ <TokenListItemAvatar token={token} />
189
+ )}
190
+ </ListItemAvatar>
191
+ <ListItemText
192
+ primary={token.symbol}
193
+ slotProps={{
194
+ secondary: {
195
+ component: 'div',
196
+ },
197
+ }}
198
+ secondary={
199
+ withoutContractAddress ? (
188
200
  <Box
201
+ ref={container}
189
202
  sx={{
190
- pt: 0.25,
203
+ height: 20,
204
+ display: 'flex',
191
205
  }}
192
206
  >
193
- {token.name}
207
+ <Box
208
+ sx={{
209
+ pt: 0.25,
210
+ }}
211
+ >
212
+ {token.name}
213
+ </Box>
214
+ <Box
215
+ sx={{
216
+ position: 'relative',
217
+ }}
218
+ >
219
+ <Slide
220
+ direction="up"
221
+ in={showAddress}
222
+ container={container.current}
223
+ style={{
224
+ position: 'absolute',
225
+ }}
226
+ appear={false}
227
+ mountOnEnter
228
+ >
229
+ <Box
230
+ sx={{
231
+ display: 'flex',
232
+ }}
233
+ >
234
+ <OpenTokenDetailsButton
235
+ tokenAddress={token.address}
236
+ withoutContractAddress={withoutContractAddress}
237
+ chainId={token.chainId}
238
+ onClick={onShowTokenDetails}
239
+ />
240
+ </Box>
241
+ </Slide>
242
+ </Box>
194
243
  </Box>
244
+ ) : (
195
245
  <Box
246
+ ref={container}
196
247
  sx={{
197
248
  position: 'relative',
249
+ height: 20,
198
250
  }}
199
251
  >
252
+ <Slide
253
+ direction="down"
254
+ in={!showAddress}
255
+ container={container.current}
256
+ style={{
257
+ position: 'absolute',
258
+ }}
259
+ appear={false}
260
+ >
261
+ <Box
262
+ sx={{
263
+ pt: 0.25,
264
+ }}
265
+ >
266
+ {token.name}
267
+ </Box>
268
+ </Slide>
200
269
  <Slide
201
270
  direction="up"
202
271
  in={showAddress}
@@ -212,77 +281,28 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
212
281
  display: 'flex',
213
282
  }}
214
283
  >
284
+ <Box
285
+ sx={{
286
+ display: 'flex',
287
+ alignItems: 'center',
288
+ pt: 0.125,
289
+ }}
290
+ >
291
+ {shortenAddress(token.address)}
292
+ </Box>
215
293
  <OpenTokenDetailsButton
216
294
  tokenAddress={token.address}
217
295
  withoutContractAddress={withoutContractAddress}
296
+ chainId={token.chainId}
218
297
  onClick={onShowTokenDetails}
219
298
  />
220
299
  </Box>
221
300
  </Slide>
222
301
  </Box>
223
- </Box>
224
- ) : (
225
- <Box
226
- ref={container}
227
- sx={{
228
- position: 'relative',
229
- height: 20,
230
- }}
231
- >
232
- <Slide
233
- direction="down"
234
- in={!showAddress}
235
- container={container.current}
236
- style={{
237
- position: 'absolute',
238
- }}
239
- appear={false}
240
- >
241
- <Box
242
- sx={{
243
- pt: 0.25,
244
- }}
245
- >
246
- {token.name}
247
- </Box>
248
- </Slide>
249
- <Slide
250
- direction="up"
251
- in={showAddress}
252
- container={container.current}
253
- style={{
254
- position: 'absolute',
255
- }}
256
- appear={false}
257
- mountOnEnter
258
- >
259
- <Box
260
- sx={{
261
- display: 'flex',
262
- }}
263
- >
264
- <Box
265
- sx={{
266
- display: 'flex',
267
- alignItems: 'center',
268
- pt: 0.125,
269
- }}
270
- >
271
- {shortenAddress(token.address)}
272
- </Box>
273
- <OpenTokenDetailsButton
274
- tokenAddress={token.address}
275
- withoutContractAddress={withoutContractAddress}
276
- onClick={onShowTokenDetails}
277
- />
278
- </Box>
279
- </Slide>
280
- </Box>
281
- )
282
- }
283
- />
284
- {accountAddress ? (
285
- isBalanceLoading ? (
302
+ )
303
+ }
304
+ />
305
+ {isBalanceLoading ? (
286
306
  <TokenAmountSkeleton />
287
307
  ) : (
288
308
  <Box sx={{ textAlign: 'right' }}>
@@ -299,7 +319,7 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
299
319
  })}
300
320
  </Typography>
301
321
  ) : null}
302
- {tokenPrice ? (
322
+ {token.amount && token.priceUSD ? (
303
323
  <Typography
304
324
  data-price={token.priceUSD}
305
325
  sx={{
@@ -314,23 +334,26 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
314
334
  </Typography>
315
335
  ) : null}
316
336
  </Box>
317
- )
318
- ) : null}
319
- </ListItemButton>
320
- )
321
- }
337
+ )}
338
+ </ListItemButton>
339
+ )
340
+ }
341
+ )
322
342
 
323
343
  export const TokenListItemSkeleton = () => {
324
344
  return (
325
345
  <ListItem
326
346
  secondaryAction={<TokenAmountSkeleton />}
327
347
  disablePadding
328
- sx={{
348
+ sx={(theme) => ({
329
349
  position: 'relative',
330
350
  flexDirection: 'row',
331
351
  alignItems: 'center',
332
352
  padding: 0,
333
- }}
353
+ [`& .${listItemSecondaryActionClasses.root}`]: {
354
+ right: theme.spacing(1.5),
355
+ },
356
+ })}
334
357
  >
335
358
  <ListItemAvatar>
336
359
  <Skeleton
@@ -348,7 +371,7 @@ export const TokenListItemSkeleton = () => {
348
371
  )
349
372
  }
350
373
 
351
- export const TokenAmountSkeleton: React.FC = () => {
374
+ const TokenAmountSkeleton: React.FC = () => {
352
375
  return (
353
376
  <Box
354
377
  sx={{
@@ -1,8 +1,9 @@
1
1
  import { Typography } from '@mui/material'
2
2
  import { useVirtualizer } from '@tanstack/react-virtual'
3
3
  import type { FC } from 'react'
4
- import { useCallback, useEffect, useRef } from 'react'
4
+ import { useCallback, useEffect, useMemo, useRef } from 'react'
5
5
  import { useTranslation } from 'react-i18next'
6
+ import { useAvailableChains } from '../../hooks/useAvailableChains.js'
6
7
  import type { TokenAmount } from '../../types/token.js'
7
8
  import { TokenDetailsSheet } from './TokenDetailsSheet.js'
8
9
  import { List } from './TokenList.style.js'
@@ -12,50 +13,64 @@ import type {
12
13
  VirtualizedTokenListProps,
13
14
  } from './types.js'
14
15
 
16
+ const tokenItemHeight = 64 // 60 + 4px margin-bottom
17
+
15
18
  export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
16
- account,
17
19
  tokens,
18
20
  scrollElementRef,
19
21
  chainId,
20
- chain,
21
22
  selectedTokenAddress,
22
23
  isLoading,
23
24
  isBalanceLoading,
24
25
  showCategories,
25
26
  onClick,
27
+ isAllNetworks,
26
28
  }) => {
27
29
  const { t } = useTranslation()
28
30
 
31
+ const { chains } = useAvailableChains()
32
+
33
+ // Create Set for O(1) chain lookup instead of O(n) find
34
+ const chainsSet = useMemo(() => {
35
+ if (!chains) {
36
+ return undefined
37
+ }
38
+ return new Map(chains.map((chain) => [chain.id, chain]))
39
+ }, [chains])
40
+
29
41
  const tokenDetailsSheetRef = useRef<TokenDetailsSheetBase>(null)
30
42
 
31
43
  const onShowTokenDetails = useCallback(
32
- (tokenAddress: string, noContractAddress: boolean) => {
33
- tokenDetailsSheetRef.current?.open(tokenAddress, noContractAddress)
44
+ (tokenAddress: string, noContractAddress: boolean, chainId: number) => {
45
+ tokenDetailsSheetRef.current?.open(
46
+ tokenAddress,
47
+ noContractAddress,
48
+ chainId
49
+ )
34
50
  },
35
51
  []
36
52
  )
37
53
 
38
54
  const getItemKey = useCallback(
39
55
  (index: number) => {
40
- return `${tokens[index].address}-${index}`
56
+ const token = tokens[index]
57
+ return `${token.chainId}-${token.address}-${index}`
41
58
  },
42
59
  [tokens]
43
60
  )
44
61
 
45
- const { getVirtualItems, getTotalSize, scrollToIndex } = useVirtualizer({
46
- count: tokens.length,
47
- overscan: 5,
48
- paddingEnd: 12,
49
- getScrollElement: () => scrollElementRef.current,
50
- estimateSize: (index) => {
62
+ const estimateSize = useCallback(
63
+ (index: number) => {
64
+ const currentToken = tokens[index]
65
+
51
66
  // Base size for TokenListItem
52
- let size = 64
67
+ let size = tokenItemHeight
68
+
53
69
  // Early return if categories are not shown
54
70
  if (!showCategories) {
55
71
  return size
56
72
  }
57
73
 
58
- const currentToken = tokens[index]
59
74
  const previousToken = tokens[index - 1]
60
75
 
61
76
  // Adjust size for the first featured token
@@ -75,8 +90,30 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
75
90
 
76
91
  return size
77
92
  },
78
- getItemKey,
79
- })
93
+ [tokens, showCategories]
94
+ )
95
+
96
+ // Chunk the tokens for infinite loading simulation
97
+ const virtualizerConfig = useMemo(
98
+ () => ({
99
+ count: tokens.length,
100
+ overscan: 5,
101
+ getScrollElement: () => scrollElementRef.current,
102
+ estimateSize,
103
+ getItemKey,
104
+ }),
105
+ [tokens.length, estimateSize, getItemKey, scrollElementRef]
106
+ )
107
+
108
+ const { getVirtualItems, getTotalSize, scrollToIndex, measure } =
109
+ useVirtualizer(virtualizerConfig)
110
+
111
+ // Address the issue of disappearing tokens on rerender
112
+ useEffect(() => {
113
+ if (scrollElementRef.current) {
114
+ measure()
115
+ }
116
+ }, [measure, scrollElementRef.current])
80
117
 
81
118
  // biome-ignore lint/correctness/useExhaustiveDependencies: run only when chainId changes
82
119
  useEffect(() => {
@@ -86,17 +123,7 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
86
123
  }
87
124
  // Close the token details sheet when switching the chains
88
125
  tokenDetailsSheetRef.current?.close()
89
- }, [scrollToIndex, chainId, getVirtualItems])
90
-
91
- if (isLoading) {
92
- return (
93
- <List disablePadding>
94
- {Array.from({ length: 3 }).map((_, index) => (
95
- <TokenListItemSkeleton key={index} />
96
- ))}
97
- </List>
98
- )
99
- }
126
+ }, [scrollToIndex, isAllNetworks, chainId, getVirtualItems])
100
127
 
101
128
  return (
102
129
  <>
@@ -109,6 +136,8 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
109
136
  const currentToken = tokens[item.index]
110
137
  const previousToken: TokenAmount | undefined = tokens[item.index - 1]
111
138
 
139
+ const chain = chainsSet?.get(currentToken.chainId)
140
+
112
141
  const isFirstFeaturedToken = currentToken.featured && item.index === 0
113
142
 
114
143
  const isTransitionFromFeaturedTokens =
@@ -129,23 +158,28 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
129
158
  isTransitionFromFeaturedTokens ||
130
159
  (previousToken?.popular && !currentToken.popular)
131
160
 
132
- const startAdornmentLabel = showCategories
133
- ? (() => {
134
- if (isFirstFeaturedToken) {
135
- return t('main.featuredTokens')
136
- }
137
- if (isTransitionToMyTokens) {
138
- return t('main.myTokens')
139
- }
140
- if (isTransitionToPopularTokens) {
141
- return t('main.popularTokens')
142
- }
143
- if (shouldShowAllTokensCategory) {
144
- return t('main.allTokens')
145
- }
146
- return null
147
- })()
148
- : null
161
+ const startAdornmentLabel =
162
+ !isAllNetworks && showCategories
163
+ ? (() => {
164
+ if (isFirstFeaturedToken) {
165
+ return t('main.featuredTokens')
166
+ }
167
+ if (isTransitionToMyTokens) {
168
+ return t('main.myTokens')
169
+ }
170
+ if (isTransitionToPopularTokens) {
171
+ return t('main.popularTokens')
172
+ }
173
+ if (shouldShowAllTokensCategory) {
174
+ return t('main.allTokens')
175
+ }
176
+ return null
177
+ })()
178
+ : null
179
+
180
+ const isSelected =
181
+ selectedTokenAddress === currentToken.address &&
182
+ chainId === currentToken.chainId
149
183
 
150
184
  return (
151
185
  <TokenListItem
@@ -154,11 +188,10 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
154
188
  size={item.size}
155
189
  start={item.start}
156
190
  token={currentToken}
157
- chain={chain}
158
- selected={currentToken.address === selectedTokenAddress}
191
+ chain={isAllNetworks ? chain : undefined}
192
+ selected={isSelected}
159
193
  onShowTokenDetails={onShowTokenDetails}
160
194
  isBalanceLoading={isBalanceLoading}
161
- accountAddress={account.address}
162
195
  startAdornment={
163
196
  startAdornmentLabel ? (
164
197
  <Typography
@@ -179,7 +212,14 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
179
212
  )
180
213
  })}
181
214
  </List>
182
- <TokenDetailsSheet ref={tokenDetailsSheetRef} chainId={chainId} />
215
+ <TokenDetailsSheet ref={tokenDetailsSheetRef} />
216
+ {isLoading && (
217
+ <List disablePadding sx={{ cursor: 'default' }}>
218
+ {Array.from({ length: 3 }).map((_, index) => (
219
+ <TokenListItemSkeleton key={index} />
220
+ ))}
221
+ </List>
222
+ )}
183
223
  </>
184
224
  )
185
225
  }