@lifi/widget 3.6.1 → 3.7.0-beta.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 (233) hide show
  1. package/AppProvider.tsx +4 -4
  2. package/AppRoutes.tsx +2 -14
  3. package/CHANGELOG.md +0 -7
  4. package/_esm/AppProvider.js +1 -1
  5. package/_esm/AppProvider.js.map +1 -1
  6. package/_esm/AppRoutes.js +2 -9
  7. package/_esm/AppRoutes.js.map +1 -1
  8. package/_esm/components/ActiveTransactions/ActiveTransactions.style.js +1 -1
  9. package/_esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
  10. package/_esm/components/AmountInput/AmountInputEndAdornment.js +1 -3
  11. package/_esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
  12. package/_esm/components/Avatar/AccountAvatar.d.ts +1 -1
  13. package/_esm/components/Avatar/AccountAvatar.js +1 -1
  14. package/_esm/components/Avatar/AccountAvatar.js.map +1 -1
  15. package/_esm/components/Avatar/Avatar.d.ts +1 -0
  16. package/_esm/components/Avatar/Avatar.js +7 -4
  17. package/_esm/components/Avatar/Avatar.js.map +1 -1
  18. package/_esm/components/Avatar/Avatar.style.d.ts +6 -3
  19. package/_esm/components/Avatar/Avatar.style.js +19 -6
  20. package/_esm/components/Avatar/Avatar.style.js.map +1 -1
  21. package/_esm/components/Avatar/SmallAvatar.d.ts +4 -0
  22. package/_esm/components/Avatar/SmallAvatar.js +12 -0
  23. package/_esm/components/Avatar/SmallAvatar.js.map +1 -0
  24. package/_esm/components/Avatar/TokenAvatar.js +1 -1
  25. package/_esm/components/Avatar/TokenAvatar.js.map +1 -1
  26. package/_esm/components/BaseTransactionButton/BaseTransactionButton.js +3 -5
  27. package/_esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
  28. package/_esm/components/ChainSelect/useChainSelect.js +5 -1
  29. package/_esm/components/ChainSelect/useChainSelect.js.map +1 -1
  30. package/_esm/components/FeeBreakdownTooltip.js +4 -1
  31. package/_esm/components/FeeBreakdownTooltip.js.map +1 -1
  32. package/_esm/components/Header/EVMDisconnectIconButton.js +5 -4
  33. package/_esm/components/Header/EVMDisconnectIconButton.js.map +1 -1
  34. package/_esm/components/Header/NavigationHeader.js +1 -1
  35. package/_esm/components/Header/NavigationHeader.js.map +1 -1
  36. package/_esm/components/Header/UTXODisconnectIconButton.d.ts +4 -0
  37. package/_esm/components/Header/UTXODisconnectIconButton.js +13 -0
  38. package/_esm/components/Header/UTXODisconnectIconButton.js.map +1 -0
  39. package/_esm/components/Header/WalletHeader.js +5 -9
  40. package/_esm/components/Header/WalletHeader.js.map +1 -1
  41. package/_esm/components/Header/WalletMenu.js +10 -15
  42. package/_esm/components/Header/WalletMenu.js.map +1 -1
  43. package/_esm/components/Header/WalletMenu.style.js +5 -1
  44. package/_esm/components/Header/WalletMenu.style.js.map +1 -1
  45. package/_esm/components/Routes/RoutesExpanded.js +1 -1
  46. package/_esm/components/Routes/RoutesExpanded.js.map +1 -1
  47. package/_esm/components/SendToWallet/SendToWalletButton.js +1 -1
  48. package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  49. package/_esm/components/StepActions/StepActions.js +1 -1
  50. package/_esm/components/StepActions/StepActions.js.map +1 -1
  51. package/_esm/components/Tabs/Tabs.style.d.ts +1 -1
  52. package/_esm/components/Token/Token.js +1 -1
  53. package/_esm/components/Token/Token.js.map +1 -1
  54. package/_esm/components/TokenList/TokenList.js +1 -1
  55. package/_esm/components/TokenList/TokenList.js.map +1 -1
  56. package/_esm/components/TokenList/TokenListItem.js +11 -5
  57. package/_esm/components/TokenList/TokenListItem.js.map +1 -1
  58. package/_esm/components/TokenList/VirtualizedTokenList.js +1 -1
  59. package/_esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
  60. package/_esm/components/TokenList/types.d.ts +3 -3
  61. package/_esm/components/TokenRate/TokenRate.js +2 -2
  62. package/_esm/components/TokenRate/TokenRate.js.map +1 -1
  63. package/_esm/config/version.d.ts +1 -1
  64. package/_esm/config/version.js +1 -1
  65. package/_esm/config/version.js.map +1 -1
  66. package/_esm/hooks/useAvailableChains.d.ts +2 -1
  67. package/_esm/hooks/useAvailableChains.js +9 -8
  68. package/_esm/hooks/useAvailableChains.js.map +1 -1
  69. package/_esm/hooks/useChains.d.ts +4 -3
  70. package/_esm/hooks/useChains.js +5 -3
  71. package/_esm/hooks/useChains.js.map +1 -1
  72. package/_esm/hooks/useFromTokenSufficiency.js +1 -1
  73. package/_esm/hooks/useFromTokenSufficiency.js.map +1 -1
  74. package/_esm/hooks/useGasSufficiency.js +3 -3
  75. package/_esm/hooks/useGasSufficiency.js.map +1 -1
  76. package/_esm/hooks/useProcessMessage.js +4 -0
  77. package/_esm/hooks/useProcessMessage.js.map +1 -1
  78. package/_esm/hooks/useRouteExecution.js +1 -1
  79. package/_esm/hooks/useRouteExecution.js.map +1 -1
  80. package/_esm/hooks/useRoutes.js +1 -1
  81. package/_esm/hooks/useRoutes.js.map +1 -1
  82. package/_esm/hooks/useTokenBalance.js +1 -1
  83. package/_esm/hooks/useTokenBalance.js.map +1 -1
  84. package/_esm/hooks/useTokenBalances.js +1 -1
  85. package/_esm/hooks/useTokenBalances.js.map +1 -1
  86. package/_esm/hooks/useTokens.js +1 -1
  87. package/_esm/hooks/useTokens.js.map +1 -1
  88. package/_esm/hooks/useTransactionDetails.js +1 -1
  89. package/_esm/hooks/useTransactionDetails.js.map +1 -1
  90. package/_esm/hooks/useTransactionHistory.js +1 -1
  91. package/_esm/hooks/useTransactionHistory.js.map +1 -1
  92. package/_esm/i18n/en.json +3 -4
  93. package/_esm/index.d.ts +0 -2
  94. package/_esm/index.js +0 -2
  95. package/_esm/index.js.map +1 -1
  96. package/_esm/pages/RoutesPage/RoutesPage.js +1 -1
  97. package/_esm/pages/RoutesPage/RoutesPage.js.map +1 -1
  98. package/_esm/pages/SendToWallet/ConnectedWalletsPage.js +1 -1
  99. package/_esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -1
  100. package/_esm/pages/SendToWallet/SendToWalletPage.js +1 -1
  101. package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  102. package/_esm/providers/I18nProvider/types.d.ts +2 -2
  103. package/_esm/providers/WalletProvider/SDKProviders.js +15 -7
  104. package/_esm/providers/WalletProvider/SDKProviders.js.map +1 -1
  105. package/_esm/providers/WalletProvider/UTXOBaseProvider.d.ts +2 -0
  106. package/_esm/providers/WalletProvider/UTXOBaseProvider.js +17 -0
  107. package/_esm/providers/WalletProvider/UTXOBaseProvider.js.map +1 -0
  108. package/_esm/providers/WalletProvider/UTXOExternalContext.d.ts +1 -0
  109. package/_esm/providers/WalletProvider/UTXOExternalContext.js +3 -0
  110. package/_esm/providers/WalletProvider/UTXOExternalContext.js.map +1 -0
  111. package/_esm/providers/WalletProvider/UTXOProvider.d.ts +3 -0
  112. package/_esm/providers/WalletProvider/UTXOProvider.js +18 -0
  113. package/_esm/providers/WalletProvider/UTXOProvider.js.map +1 -0
  114. package/_esm/providers/WalletProvider/WalletProvider.d.ts +1 -0
  115. package/_esm/providers/WalletProvider/WalletProvider.js +14 -1
  116. package/_esm/providers/WalletProvider/WalletProvider.js.map +1 -1
  117. package/_esm/providers/WalletProvider/useHasExternalWalletProvider.d.ts +1 -1
  118. package/_esm/providers/WalletProvider/useHasExternalWalletProvider.js +8 -3
  119. package/_esm/providers/WalletProvider/useHasExternalWalletProvider.js.map +1 -1
  120. package/_esm/providers/WidgetProvider/WidgetProvider.js +2 -1
  121. package/_esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
  122. package/_esm/providers/WidgetProvider/types.d.ts +0 -2
  123. package/_esm/stores/form/FormUpdater.js +1 -1
  124. package/_esm/stores/form/FormUpdater.js.map +1 -1
  125. package/_esm/stores/form/types.d.ts +4 -4
  126. package/_esm/stores/routes/useExecutingRoutesIds.js +1 -1
  127. package/_esm/stores/routes/useExecutingRoutesIds.js.map +1 -1
  128. package/_esm/themes/createTheme.js +2 -1
  129. package/_esm/themes/createTheme.js.map +1 -1
  130. package/_esm/types/events.d.ts +6 -0
  131. package/_esm/types/events.js +3 -0
  132. package/_esm/types/events.js.map +1 -1
  133. package/_esm/utils/chainType.js +2 -3
  134. package/_esm/utils/chainType.js.map +1 -1
  135. package/_esm/utils/fees.js +9 -5
  136. package/_esm/utils/fees.js.map +1 -1
  137. package/_esm/utils/format.js +1 -1
  138. package/_esm/utils/format.js.map +1 -1
  139. package/_esm/utils/navigationRoutes.d.ts +0 -1
  140. package/_esm/utils/navigationRoutes.js +0 -3
  141. package/_esm/utils/navigationRoutes.js.map +1 -1
  142. package/_esm/utils/wallet.js +1 -1
  143. package/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
  144. package/components/AmountInput/AmountInputEndAdornment.tsx +1 -5
  145. package/components/Avatar/AccountAvatar.tsx +2 -2
  146. package/components/Avatar/Avatar.style.tsx +20 -7
  147. package/components/Avatar/Avatar.tsx +12 -4
  148. package/components/Avatar/SmallAvatar.tsx +16 -0
  149. package/components/Avatar/TokenAvatar.tsx +1 -1
  150. package/components/BaseTransactionButton/BaseTransactionButton.tsx +3 -5
  151. package/components/ChainSelect/useChainSelect.ts +10 -1
  152. package/components/FeeBreakdownTooltip.tsx +4 -1
  153. package/components/Header/EVMDisconnectIconButton.tsx +5 -5
  154. package/components/Header/NavigationHeader.tsx +1 -1
  155. package/components/Header/UTXODisconnectIconButton.tsx +24 -0
  156. package/components/Header/WalletHeader.tsx +11 -12
  157. package/components/Header/WalletMenu.style.tsx +5 -1
  158. package/components/Header/WalletMenu.tsx +23 -24
  159. package/components/Routes/RoutesExpanded.tsx +1 -2
  160. package/components/SendToWallet/SendToWalletButton.tsx +1 -1
  161. package/components/StepActions/StepActions.tsx +1 -1
  162. package/components/Token/Token.tsx +1 -1
  163. package/components/TokenList/TokenList.tsx +1 -1
  164. package/components/TokenList/TokenListItem.tsx +15 -7
  165. package/components/TokenList/VirtualizedTokenList.tsx +1 -1
  166. package/components/TokenList/types.ts +3 -3
  167. package/components/TokenRate/TokenRate.tsx +2 -2
  168. package/config/version.ts +1 -1
  169. package/hooks/useAvailableChains.ts +9 -10
  170. package/hooks/useChains.ts +6 -3
  171. package/hooks/useFromTokenSufficiency.ts +1 -1
  172. package/hooks/useGasSufficiency.ts +5 -3
  173. package/hooks/useProcessMessage.ts +4 -0
  174. package/hooks/useRouteExecution.ts +1 -1
  175. package/hooks/useRoutes.ts +1 -1
  176. package/hooks/useTokenBalance.ts +1 -1
  177. package/hooks/useTokenBalances.ts +1 -1
  178. package/hooks/useTokens.ts +2 -1
  179. package/hooks/useTransactionDetails.ts +1 -1
  180. package/hooks/useTransactionHistory.ts +1 -1
  181. package/i18n/en.json +3 -4
  182. package/index.ts +0 -2
  183. package/package.json +5 -5
  184. package/pages/RoutesPage/RoutesPage.tsx +1 -1
  185. package/pages/SendToWallet/ConnectedWalletsPage.tsx +2 -2
  186. package/pages/SendToWallet/SendToWalletPage.tsx +1 -1
  187. package/providers/I18nProvider/types.ts +2 -2
  188. package/providers/WalletProvider/SDKProviders.tsx +25 -7
  189. package/providers/WalletProvider/UTXOBaseProvider.tsx +28 -0
  190. package/providers/WalletProvider/UTXOExternalContext.ts +3 -0
  191. package/providers/WalletProvider/UTXOProvider.tsx +26 -0
  192. package/providers/WalletProvider/WalletProvider.tsx +24 -3
  193. package/providers/WalletProvider/useHasExternalWalletProvider.ts +11 -5
  194. package/providers/WidgetProvider/WidgetProvider.tsx +2 -1
  195. package/providers/WidgetProvider/types.ts +0 -2
  196. package/stores/form/FormUpdater.tsx +1 -1
  197. package/stores/form/types.ts +4 -4
  198. package/stores/routes/useExecutingRoutesIds.ts +1 -1
  199. package/themes/createTheme.ts +3 -1
  200. package/types/events.ts +6 -0
  201. package/utils/chainType.ts +2 -3
  202. package/utils/fees.ts +15 -13
  203. package/utils/format.ts +1 -1
  204. package/utils/navigationRoutes.ts +0 -3
  205. package/utils/wallet.ts +1 -1
  206. package/_esm/components/SmallAvatar.d.ts +0 -10
  207. package/_esm/components/SmallAvatar.js +0 -19
  208. package/_esm/components/SmallAvatar.js.map +0 -1
  209. package/_esm/hooks/useAccount.d.ts +0 -45
  210. package/_esm/hooks/useAccount.js +0 -56
  211. package/_esm/hooks/useAccount.js.map +0 -1
  212. package/_esm/hooks/useWallets.d.ts +0 -6
  213. package/_esm/hooks/useWallets.js +0 -80
  214. package/_esm/hooks/useWallets.js.map +0 -1
  215. package/_esm/pages/SelectWalletPage/EVMListItemButton.d.ts +0 -9
  216. package/_esm/pages/SelectWalletPage/EVMListItemButton.js +0 -39
  217. package/_esm/pages/SelectWalletPage/EVMListItemButton.js.map +0 -1
  218. package/_esm/pages/SelectWalletPage/SVMListItemButton.d.ts +0 -6
  219. package/_esm/pages/SelectWalletPage/SVMListItemButton.js +0 -32
  220. package/_esm/pages/SelectWalletPage/SVMListItemButton.js.map +0 -1
  221. package/_esm/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
  222. package/_esm/pages/SelectWalletPage/SelectWalletPage.js +0 -41
  223. package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +0 -1
  224. package/_esm/utils/svm.d.ts +0 -1
  225. package/_esm/utils/svm.js +0 -11
  226. package/_esm/utils/svm.js.map +0 -1
  227. package/components/SmallAvatar.tsx +0 -25
  228. package/hooks/useAccount.ts +0 -109
  229. package/hooks/useWallets.ts +0 -147
  230. package/pages/SelectWalletPage/EVMListItemButton.tsx +0 -74
  231. package/pages/SelectWalletPage/SVMListItemButton.tsx +0 -47
  232. package/pages/SelectWalletPage/SelectWalletPage.tsx +0 -90
  233. package/utils/svm.ts +0 -10
@@ -7,7 +7,6 @@ export const navigationRoutes = {
7
7
  fromToken: 'from-token',
8
8
  languages: 'languages',
9
9
  routes: 'routes',
10
- selectWallet: 'select-wallet',
11
10
  settings: 'settings',
12
11
  toChain: 'to-chain',
13
12
  toToken: 'to-token',
@@ -29,7 +28,6 @@ export const stickyHeaderRoutes = [
29
28
  navigationRoutes.fromChain,
30
29
  navigationRoutes.home,
31
30
  navigationRoutes.routes,
32
- navigationRoutes.selectWallet,
33
31
  navigationRoutes.settings,
34
32
  navigationRoutes.toChain,
35
33
  navigationRoutes.toTokenNative,
@@ -50,7 +48,6 @@ export const backButtonRoutes = [
50
48
  navigationRoutes.fromChain,
51
49
  navigationRoutes.fromToken,
52
50
  navigationRoutes.routes,
53
- navigationRoutes.selectWallet,
54
51
  navigationRoutes.settings,
55
52
  navigationRoutes.toChain,
56
53
  navigationRoutes.toToken,
@@ -1 +1 @@
1
- {"version":3,"file":"navigationRoutes.js","sourceRoot":"","sources":["../../utils/navigationRoutes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,GAAG;IACT,kBAAkB,EAAE,qBAAqB;IACzC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,YAAY,EAAE,eAAe;IAC7B,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,UAAU;IACnB,aAAa,EAAE,iBAAiB;IAChC,kBAAkB,EAAE,qBAAqB;IACzC,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,YAAY,EAAE,gBAAgB;IAC9B,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,gBAAgB;IAC/B,gBAAgB,EAAE,mBAAmB;IACrC,iBAAiB,EAAE,oBAAoB;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,IAAI;IACrB,gBAAgB,CAAC,MAAM;IACvB,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,QAAQ;IACzB,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,oBAAoB;IACrC,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,gBAAgB;IACjC,gBAAgB,CAAC,iBAAiB;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,MAAM;IACvB,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,QAAQ;IACzB,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,oBAAoB;IACrC,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,gBAAgB;IACjC,gBAAgB,CAAC,iBAAiB;CACnC,CAAC"}
1
+ {"version":3,"file":"navigationRoutes.js","sourceRoot":"","sources":["../../utils/navigationRoutes.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,GAAG;IACT,kBAAkB,EAAE,qBAAqB;IACzC,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,WAAW;IACtB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,YAAY;IACvB,SAAS,EAAE,WAAW;IACtB,MAAM,EAAE,QAAQ;IAChB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,UAAU;IACnB,OAAO,EAAE,UAAU;IACnB,aAAa,EAAE,iBAAiB;IAChC,kBAAkB,EAAE,qBAAqB;IACzC,oBAAoB,EAAE,uBAAuB;IAC7C,kBAAkB,EAAE,qBAAqB;IACzC,YAAY,EAAE,gBAAgB;IAC9B,SAAS,EAAE,WAAW;IACtB,aAAa,EAAE,gBAAgB;IAC/B,gBAAgB,EAAE,mBAAmB;IACrC,iBAAiB,EAAE,oBAAoB;CACxC,CAAC;AAEF,MAAM,CAAC,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAEtE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,IAAI;IACrB,gBAAgB,CAAC,MAAM;IACvB,gBAAgB,CAAC,QAAQ;IACzB,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,oBAAoB;IACrC,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,gBAAgB;IACjC,gBAAgB,CAAC,iBAAiB;CACnC,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,MAAM;IACvB,gBAAgB,CAAC,QAAQ;IACzB,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,OAAO;IACxB,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,oBAAoB;IACrC,gBAAgB,CAAC,kBAAkB;IACnC,gBAAgB,CAAC,YAAY;IAC7B,gBAAgB,CAAC,SAAS;IAC1B,gBAAgB,CAAC,aAAa;IAC9B,gBAAgB,CAAC,gBAAgB;IACjC,gBAAgB,CAAC,iBAAiB;CACnC,CAAC"}
@@ -1,4 +1,4 @@
1
1
  export const shortenAddress = (address) => address
2
- ? `${address.substring(0, 5)}...${address.substring(address.length - 4)}`
2
+ ? `${address.substring(0, 7)}...${address.substring(address.length - 5)}`
3
3
  : null;
4
4
  //# sourceMappingURL=wallet.js.map
@@ -20,7 +20,7 @@ export const ListItemButton = styled(MuiListItemButton)(({ theme }) => ({
20
20
  export const ListItem = styled(MuiListItem, {
21
21
  shouldForwardProp: (prop) => prop !== 'disableRipple',
22
22
  })(({ theme }) => ({
23
- padding: theme.spacing(0, 1.5),
23
+ padding: theme.spacing(0, 2),
24
24
  [`.${listItemSecondaryActionClasses.root}`]: {
25
25
  right: theme.spacing(3),
26
26
  },
@@ -32,11 +32,7 @@ export const AmountInputEndAdornment = ({ formType }: FormTypeProps) => {
32
32
  }
33
33
  const chain = getChainById(chainId);
34
34
  let maxAmount = token.amount;
35
- if (
36
- chain?.nativeToken.address === tokenAddress &&
37
- data?.available &&
38
- data?.recommended
39
- ) {
35
+ if (chain?.nativeToken.address === tokenAddress && data?.recommended) {
40
36
  const recommendedAmount = BigInt(data.recommended.amount) / 2n;
41
37
  if (token.amount > recommendedAmount) {
42
38
  maxAmount = token.amount - recommendedAmount;
@@ -1,15 +1,15 @@
1
+ import type { Account } from '@lifi/wallet-management';
1
2
  import { getConnectorIcon } from '@lifi/wallet-management';
2
3
  import { Wallet } from '@mui/icons-material';
3
4
  import { Badge } from '@mui/material';
4
- import type { Account } from '../../hooks/useAccount.js';
5
5
  import { useChain } from '../../hooks/useChain.js';
6
6
  import type { ToAddress } from '../../types/widget.js';
7
- import { SmallAvatar } from '../SmallAvatar.js';
8
7
  import {
9
8
  AvatarDefault,
10
9
  AvatarDefaultBadge,
11
10
  AvatarMasked,
12
11
  } from './Avatar.style.js';
12
+ import { SmallAvatar } from './SmallAvatar.js';
13
13
 
14
14
  interface AccountAvatarProps {
15
15
  chainId?: number;
@@ -3,7 +3,6 @@ import {
3
3
  AvatarGroup,
4
4
  Box,
5
5
  Avatar as MuiAvatar,
6
- Skeleton,
7
6
  avatarClasses,
8
7
  badgeClasses,
9
8
  styled,
@@ -14,17 +13,20 @@ export const AvatarMasked = styled(MuiAvatar)(({ theme }) => ({
14
13
  mask: avatarMask16,
15
14
  }));
16
15
 
17
- export const AvatarSkeleton = styled(Skeleton)(({ theme }) => ({
18
- mask: avatarMask16,
19
- }));
20
-
21
16
  export const TokenAvatarGroup = styled(AvatarGroup)(({ theme }) => ({
22
17
  [`& .${badgeClasses.badge}:last-child .${avatarClasses.root}`]: {
23
- marginLeft: theme.spacing(-1),
24
18
  boxSizing: 'border-box',
25
19
  },
20
+ [`& .${avatarClasses.root}`]: {
21
+ border: 'none',
22
+ marginLeft: 0,
23
+ },
24
+ [`& .${badgeClasses.root}:first-child`]: {
25
+ marginLeft: theme.spacing(-1),
26
+ border: 'none',
27
+ },
26
28
  [`& .${badgeClasses.root}:last-child`]: {
27
- marginLeft: theme.spacing(1),
29
+ border: 'none',
28
30
  },
29
31
  }));
30
32
 
@@ -57,3 +59,14 @@ export const AvatarDefaultBadge = styled(Box)(({ theme }) => {
57
59
  width: 16,
58
60
  };
59
61
  });
62
+
63
+ export const AvatarSkeletonContainer = styled(Box)(({ theme }) => ({
64
+ background: theme.palette.background.paper,
65
+ borderRadius: '50%',
66
+ }));
67
+
68
+ export const AvatarSkeletonMaskedContainer = styled(Box)(({ theme }) => ({
69
+ background: theme.palette.background.paper,
70
+ borderRadius: '50%',
71
+ mask: avatarMask16,
72
+ }));
@@ -1,11 +1,11 @@
1
1
  import type { SxProps, Theme } from '@mui/material';
2
- import { Badge } from '@mui/material';
3
- import { SmallAvatarSkeleton } from '../SmallAvatar.js';
2
+ import { Badge, Skeleton } from '@mui/material';
4
3
  import {
5
4
  AvatarDefault,
6
5
  AvatarDefaultBadge,
7
- AvatarSkeleton,
6
+ AvatarSkeletonMaskedContainer,
8
7
  } from './Avatar.style.js';
8
+ import { SmallAvatarSkeleton } from './SmallAvatar.js';
9
9
 
10
10
  export const AvatarBadgedDefault: React.FC<{
11
11
  sx?: SxProps<Theme>;
@@ -32,7 +32,15 @@ export const AvatarBadgedSkeleton: React.FC<{
32
32
  badgeContent={<SmallAvatarSkeleton />}
33
33
  sx={sx}
34
34
  >
35
- <AvatarSkeleton width={40} height={40} variant="circular" />
35
+ <AvatarSkeleton />
36
36
  </Badge>
37
37
  );
38
38
  };
39
+
40
+ export const AvatarSkeleton = () => {
41
+ return (
42
+ <AvatarSkeletonMaskedContainer>
43
+ <Skeleton width={40} height={40} variant="circular" />
44
+ </AvatarSkeletonMaskedContainer>
45
+ );
46
+ };
@@ -0,0 +1,16 @@
1
+ import { Avatar, Skeleton, styled } from '@mui/material';
2
+ import { AvatarSkeletonContainer } from './Avatar.style.js';
3
+
4
+ export const SmallAvatar = styled(Avatar)(({ theme }) => ({
5
+ background: theme.palette.background.paper,
6
+ width: 16,
7
+ height: 16,
8
+ }));
9
+
10
+ export const SmallAvatarSkeleton = () => {
11
+ return (
12
+ <AvatarSkeletonContainer>
13
+ <Skeleton width={16} height={16} variant="circular" />
14
+ </AvatarSkeletonContainer>
15
+ );
16
+ };
@@ -3,9 +3,9 @@ import type { SxProps, Theme } from '@mui/material';
3
3
  import { Badge } from '@mui/material';
4
4
  import { useChain } from '../../hooks/useChain.js';
5
5
  import { useToken } from '../../hooks/useToken.js';
6
- import { SmallAvatar } from '../SmallAvatar.js';
7
6
  import { AvatarBadgedSkeleton } from './Avatar.js';
8
7
  import { AvatarDefaultBadge, AvatarMasked } from './Avatar.style.js';
8
+ import { SmallAvatar } from './SmallAvatar.js';
9
9
 
10
10
  export const TokenAvatar: React.FC<{
11
11
  token?: StaticToken;
@@ -1,11 +1,9 @@
1
+ import { useAccount, useWalletMenu } from '@lifi/wallet-management';
1
2
  import { LoadingButton } from '@mui/lab';
2
3
  import { useTranslation } from 'react-i18next';
3
- import { useNavigate } from 'react-router-dom';
4
- import { useAccount } from '../../hooks/useAccount.js';
5
4
  import { useChain } from '../../hooks/useChain.js';
6
5
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
7
6
  import { useFieldValues } from '../../stores/form/useFieldValues.js';
8
- import { navigationRoutes } from '../../utils/navigationRoutes.js';
9
7
  import type { BaseTransactionButtonProps } from './types.js';
10
8
 
11
9
  export const BaseTransactionButton: React.FC<BaseTransactionButtonProps> = ({
@@ -15,8 +13,8 @@ export const BaseTransactionButton: React.FC<BaseTransactionButtonProps> = ({
15
13
  loading,
16
14
  }) => {
17
15
  const { t } = useTranslation();
18
- const navigate = useNavigate();
19
16
  const { walletConfig } = useWidgetConfig();
17
+ const { openWalletMenu } = useWalletMenu();
20
18
  const [fromChainId] = useFieldValues('fromChain');
21
19
  const { chain } = useChain(fromChainId);
22
20
  const { account } = useAccount({ chainType: chain?.chainType });
@@ -27,7 +25,7 @@ export const BaseTransactionButton: React.FC<BaseTransactionButtonProps> = ({
27
25
  } else if (walletConfig?.onConnect) {
28
26
  walletConfig.onConnect();
29
27
  } else {
30
- navigate(navigationRoutes.selectWallet);
28
+ openWalletMenu();
31
29
  }
32
30
  };
33
31
 
@@ -2,6 +2,7 @@ import type { EVMChain } from '@lifi/sdk';
2
2
  import { useChains } from '../../hooks/useChains.js';
3
3
  import { useSwapOnly } from '../../hooks/useSwapOnly.js';
4
4
  import { useToAddressReset } from '../../hooks/useToAddressReset.js';
5
+ import { useHasExternalWalletProvider } from '../../providers/WalletProvider/useHasExternalWalletProvider.js';
5
6
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
6
7
  import { useChainOrder } from '../../stores/chains/useChainOrder.js';
7
8
  import type { FormType } from '../../stores/form/types.js';
@@ -15,7 +16,15 @@ export const useChainSelect = (formType: FormType) => {
15
16
  const chainKey = FormKeyHelper.getChainKey(formType);
16
17
  const { onChange } = useFieldController({ name: chainKey });
17
18
  const { setFieldValue, getFieldValues } = useFieldActions();
18
- const { chains, isLoading, getChainById } = useChains(formType);
19
+ const { hasExternalProvider, availableChainTypes } =
20
+ useHasExternalWalletProvider();
21
+ const { chains, isLoading, getChainById } = useChains(
22
+ formType,
23
+ formType === 'from' && hasExternalProvider
24
+ ? availableChainTypes
25
+ : undefined,
26
+ );
27
+
19
28
  const [chainOrder, setChainOrder] = useChainOrder(formType);
20
29
  const swapOnly = useSwapOnly();
21
30
  const { tryResetToAddress } = useToAddressReset();
@@ -54,7 +54,10 @@ export const getFeeBreakdownTypography = (
54
54
  key={`${fee.token.address}${index}`}
55
55
  >
56
56
  {t(`format.currency`, { value: fee.amountUSD })} (
57
- {parseFloat(formatUnits(fee.amount, fee.token.decimals))?.toFixed(9)}{' '}
57
+ {t(`format.number`, {
58
+ value: parseFloat(formatUnits(fee.amount, fee.token.decimals)),
59
+ maximumFractionDigits: Math.min(fee.token.decimals, 9),
60
+ })}{' '}
58
61
  {fee.token.symbol})
59
62
  </Typography>
60
63
  ));
@@ -1,21 +1,21 @@
1
1
  import { PowerSettingsNewRounded } from '@mui/icons-material';
2
2
  import { IconButton } from '@mui/material';
3
3
  import type { Connector } from 'wagmi';
4
- import { useDisconnect } from 'wagmi';
4
+ import { useConfig } from 'wagmi';
5
+ import { disconnect } from 'wagmi/actions';
5
6
 
6
7
  export const EVMDisconnectIconButton = ({
7
8
  connector,
8
9
  }: {
9
10
  connector?: Connector;
10
11
  }) => {
11
- const { disconnect } = useDisconnect();
12
-
12
+ const config = useConfig();
13
13
  return (
14
14
  <IconButton
15
15
  size="medium"
16
- onClick={(e) => {
16
+ onClick={async (e) => {
17
17
  e.stopPropagation();
18
- disconnect({ connector });
18
+ await disconnect(config, { connector });
19
19
  }}
20
20
  >
21
21
  <PowerSettingsNewRounded />
@@ -1,6 +1,6 @@
1
+ import { useAccount } from '@lifi/wallet-management';
1
2
  import { Box, Typography } from '@mui/material';
2
3
  import { Route, Routes, useLocation } from 'react-router-dom';
3
- import { useAccount } from '../../hooks/useAccount.js';
4
4
  import { useNavigateBack } from '../../hooks/useNavigateBack.js';
5
5
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
6
6
  import { useHeaderStore } from '../../stores/header/useHeaderStore.js';
@@ -0,0 +1,24 @@
1
+ import { useConfig } from '@lifi/wallet-management';
2
+ import { PowerSettingsNewRounded } from '@mui/icons-material';
3
+ import { IconButton } from '@mui/material';
4
+ import type { Connector } from 'wagmi';
5
+ import { disconnect } from 'wagmi/actions';
6
+
7
+ export const UTXODisconnectIconButton = ({
8
+ connector,
9
+ }: {
10
+ connector?: Connector;
11
+ }) => {
12
+ const config = useConfig();
13
+ return (
14
+ <IconButton
15
+ size="medium"
16
+ onClick={async (e) => {
17
+ e.stopPropagation();
18
+ await disconnect(config, { connector });
19
+ }}
20
+ >
21
+ <PowerSettingsNewRounded />
22
+ </IconButton>
23
+ );
24
+ };
@@ -1,18 +1,19 @@
1
- import { getConnectorIcon } from '@lifi/wallet-management';
1
+ import type { Account } from '@lifi/wallet-management';
2
+ import {
3
+ getConnectorIcon,
4
+ useAccount,
5
+ useWalletMenu,
6
+ } from '@lifi/wallet-management';
2
7
  import { ExpandMore, Wallet } from '@mui/icons-material';
3
8
  import { Avatar, Badge } from '@mui/material';
4
9
  import { useState } from 'react';
5
10
  import { useTranslation } from 'react-i18next';
6
- import { useLocation, useNavigate } from 'react-router-dom';
7
- import type { Account } from '../../hooks/useAccount.js';
8
- import { useAccount } from '../../hooks/useAccount.js';
9
11
  import { useChain } from '../../hooks/useChain.js';
10
12
  import { useHasExternalWalletProvider } from '../../providers/WalletProvider/useHasExternalWalletProvider.js';
11
13
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
12
14
  import { HiddenUI } from '../../types/widget.js';
13
- import { navigationRoutes } from '../../utils/navigationRoutes.js';
14
15
  import { shortenAddress } from '../../utils/wallet.js';
15
- import { SmallAvatar } from '../SmallAvatar.js';
16
+ import { SmallAvatar } from '../Avatar/SmallAvatar.js';
16
17
  import { CloseDrawerButton } from './CloseDrawerButton.js';
17
18
  import {
18
19
  DrawerWalletContainer,
@@ -70,16 +71,16 @@ export const WalletMenuButton: React.FC = () => {
70
71
 
71
72
  const ConnectButton = () => {
72
73
  const { t } = useTranslation();
73
- const { pathname } = useLocation();
74
74
  const { walletConfig, subvariant, variant } = useWidgetConfig();
75
- const navigate = useNavigate();
75
+ const { openWalletMenu } = useWalletMenu();
76
76
  const connect = async () => {
77
77
  if (walletConfig?.onConnect) {
78
78
  walletConfig.onConnect();
79
79
  return;
80
80
  }
81
- navigate(navigationRoutes.selectWallet);
81
+ openWalletMenu();
82
82
  };
83
+
83
84
  return (
84
85
  <WalletButton
85
86
  subvariant={subvariant}
@@ -91,9 +92,7 @@ const ConnectButton = () => {
91
92
  <Wallet sx={{ marginLeft: -0.25 }} />
92
93
  ) : undefined
93
94
  }
94
- onClick={
95
- !pathname.includes(navigationRoutes.selectWallet) ? connect : undefined
96
- }
95
+ onClick={connect}
97
96
  >
98
97
  {t(`button.connectWallet`)}
99
98
  </WalletButton>
@@ -17,11 +17,15 @@ export const WalletMenuContainer = styled(MuiMenu)(({ theme }) => ({
17
17
  },
18
18
  [`& .${menuItemClasses.root}`]: {
19
19
  borderRadius: theme.shape.borderRadiusSecondary,
20
- padding: theme.spacing(1, 2, 1, 1),
20
+ padding: theme.spacing(1, 0, 1, 1),
21
21
  [`& .${svgIconClasses.root}`]: {
22
22
  fontSize: 20,
23
23
  color: theme.palette.text.primary,
24
24
  },
25
+ ':hover': {
26
+ background: 'none',
27
+ cursor: 'default',
28
+ },
25
29
  },
26
30
  },
27
31
  }));
@@ -1,5 +1,9 @@
1
1
  import { ChainType } from '@lifi/sdk';
2
- import { getConnectorIcon } from '@lifi/wallet-management';
2
+ import {
3
+ getConnectorIcon,
4
+ useAccount,
5
+ useWalletMenu,
6
+ } from '@lifi/wallet-management';
3
7
  import {
4
8
  ContentCopyRounded,
5
9
  OpenInNewRounded,
@@ -14,25 +18,22 @@ import {
14
18
  MenuItem,
15
19
  } from '@mui/material';
16
20
  import { useTranslation } from 'react-i18next';
17
- import { useLocation, useNavigate } from 'react-router-dom';
18
- import { useAccount } from '../../hooks/useAccount.js';
19
21
  import { useAvailableChains } from '../../hooks/useAvailableChains.js';
20
22
  import { useExplorer } from '../../hooks/useExplorer.js';
21
- import { navigationRoutes } from '../../utils/navigationRoutes.js';
22
23
  import { shortenAddress } from '../../utils/wallet.js';
23
24
  import { AvatarMasked } from '../Avatar/Avatar.style.js';
24
- import { SmallAvatar } from '../SmallAvatar.js';
25
+ import { SmallAvatar } from '../Avatar/SmallAvatar.js';
25
26
  import { EVMDisconnectIconButton } from './EVMDisconnectIconButton.js';
26
27
  import { SVMDisconnectIconButton } from './SVMDisconnectIconButton.js';
28
+ import { UTXODisconnectIconButton } from './UTXODisconnectIconButton.js';
27
29
 
28
30
  export const WalletMenu = ({ onClose }: { onClose: () => void }) => {
29
31
  const { t } = useTranslation();
30
- const navigate = useNavigate();
31
- const { pathname } = useLocation();
32
32
  const { accounts } = useAccount();
33
33
  const { getChainById } = useAvailableChains();
34
+ const { openWalletMenu } = useWalletMenu();
34
35
  const connect = async () => {
35
- navigate(navigationRoutes.selectWallet);
36
+ openWalletMenu();
36
37
  onClose();
37
38
  };
38
39
  const { getAddressLink } = useExplorer();
@@ -49,7 +50,7 @@ export const WalletMenu = ({ onClose }: { onClose: () => void }) => {
49
50
  };
50
51
 
51
52
  return (
52
- <MenuItem key={account.address}>
53
+ <MenuItem key={account.address} disableTouchRipple>
53
54
  <Box flex={1} display="flex" alignItems="center">
54
55
  {chain?.logoURI ? (
55
56
  <Badge
@@ -82,7 +83,7 @@ export const WalletMenu = ({ onClose }: { onClose: () => void }) => {
82
83
  )}
83
84
  {walletAddress}
84
85
  </Box>
85
- <Box ml={1}>
86
+ <Box ml={2}>
86
87
  <IconButton size="medium" onClick={handleCopyAddress}>
87
88
  <ContentCopyRounded />
88
89
  </IconButton>
@@ -103,26 +104,24 @@ export const WalletMenu = ({ onClose }: { onClose: () => void }) => {
103
104
  <EVMDisconnectIconButton connector={account.connector} />
104
105
  ) : account.chainType === ChainType.SVM ? (
105
106
  <SVMDisconnectIconButton />
107
+ ) : account.chainType === ChainType.UTXO ? (
108
+ <UTXODisconnectIconButton connector={account.connector} />
106
109
  ) : null}
107
110
  </Box>
108
111
  </MenuItem>
109
112
  );
110
113
  })}
111
114
  </Box>
112
- {!pathname.includes(navigationRoutes.selectWallet) ? (
113
- <Button
114
- onClick={connect}
115
- fullWidth
116
- startIcon={<PowerSettingsNewRounded />}
117
- sx={{
118
- marginTop: 1,
119
- }}
120
- >
121
- {accounts.length > 1
122
- ? t(`button.changeWallet`)
123
- : t(`button.connectWallet`)}
124
- </Button>
125
- ) : null}
115
+ <Button
116
+ onClick={connect}
117
+ fullWidth
118
+ startIcon={<PowerSettingsNewRounded />}
119
+ sx={{
120
+ marginTop: 1,
121
+ }}
122
+ >
123
+ {t(`button.connectAnotherWallet`)}
124
+ </Button>
126
125
  </>
127
126
  );
128
127
  };
@@ -1,11 +1,10 @@
1
- /* eslint-disable react/no-array-index-key */
2
1
  import type { Route } from '@lifi/sdk';
2
+ import { useAccount } from '@lifi/wallet-management';
3
3
  import { Collapse, Grow, Stack, Typography } from '@mui/material';
4
4
  import { useEffect, useRef } from 'react';
5
5
  import { useTranslation } from 'react-i18next';
6
6
  import type { RouteObject } from 'react-router-dom';
7
7
  import { useRoutes as useDOMRoutes, useNavigate } from 'react-router-dom';
8
- import { useAccount } from '../../hooks/useAccount.js';
9
8
  import { useRoutes } from '../../hooks/useRoutes.js';
10
9
  import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js';
11
10
  import { useWidgetEvents } from '../../hooks/useWidgetEvents.js';
@@ -1,9 +1,9 @@
1
+ import { useAccount } from '@lifi/wallet-management';
1
2
  import { CloseRounded } from '@mui/icons-material';
2
3
  import { Box, Collapse } from '@mui/material';
3
4
  import { useEffect, useRef, type MouseEventHandler } from 'react';
4
5
  import { useTranslation } from 'react-i18next';
5
6
  import { useNavigate } from 'react-router-dom';
6
- import { useAccount } from '../../hooks/useAccount.js';
7
7
  import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js';
8
8
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
9
9
  import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js';
@@ -18,8 +18,8 @@ import { LiFiToolLogo } from '../../icons/lifi.js';
18
18
  import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
19
19
  import { HiddenUI } from '../../types/widget.js';
20
20
  import { formatTokenAmount } from '../../utils/format.js';
21
+ import { SmallAvatar } from '../Avatar/SmallAvatar.js';
21
22
  import { CardIconButton } from '../Card/CardIconButton.js';
22
- import { SmallAvatar } from '../SmallAvatar.js';
23
23
  import {
24
24
  StepAvatar,
25
25
  StepConnector,
@@ -8,8 +8,8 @@ import { useChain } from '../../hooks/useChain.js';
8
8
  import { useToken } from '../../hooks/useToken.js';
9
9
  import { formatTokenAmount, formatTokenPrice } from '../../utils/format.js';
10
10
  import { AvatarBadgedSkeleton } from '../Avatar/Avatar.js';
11
+ import { SmallAvatar } from '../Avatar/SmallAvatar.js';
11
12
  import { TokenAvatar } from '../Avatar/TokenAvatar.js';
12
- import { SmallAvatar } from '../SmallAvatar.js';
13
13
  import { TextFitter } from '../TextFitter/TextFitter.js';
14
14
  import { TextSecondary, TextSecondaryContainer } from './Token.style.js';
15
15
 
@@ -1,6 +1,6 @@
1
+ import { useAccount } from '@lifi/wallet-management';
1
2
  import { Box } from '@mui/material';
2
3
  import type { FC } from 'react';
3
- import { useAccount } from '../../hooks/useAccount.js';
4
4
  import { useChain } from '../../hooks/useChain.js';
5
5
  import { useDebouncedWatch } from '../../hooks/useDebouncedWatch.js';
6
6
  import { useTokenBalances } from '../../hooks/useTokenBalances.js';
@@ -1,3 +1,4 @@
1
+ import { ChainType } from '@lifi/sdk';
1
2
  import { OpenInNewRounded } from '@mui/icons-material';
2
3
  import {
3
4
  Avatar,
@@ -26,7 +27,7 @@ export const TokenListItem: React.FC<TokenListItemProps> = ({
26
27
  start,
27
28
  token,
28
29
  chain,
29
- showBalance,
30
+ accountAddress,
30
31
  isBalanceLoading,
31
32
  startAdornment,
32
33
  endAdornment,
@@ -46,7 +47,7 @@ export const TokenListItem: React.FC<TokenListItemProps> = ({
46
47
  <TokenListItemButton
47
48
  token={token}
48
49
  chain={chain}
49
- showBalance={showBalance}
50
+ accountAddress={accountAddress}
50
51
  isBalanceLoading={isBalanceLoading}
51
52
  onClick={handleClick}
52
53
  />
@@ -59,7 +60,7 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
59
60
  onClick,
60
61
  token,
61
62
  chain,
62
- showBalance,
63
+ accountAddress,
63
64
  isBalanceLoading,
64
65
  }) => {
65
66
  const { t } = useTranslation();
@@ -75,8 +76,15 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
75
76
  const timeoutId = useRef<ReturnType<typeof setTimeout>>();
76
77
  const [showAddress, setShowAddress] = useState(false);
77
78
 
79
+ const tokenAddress =
80
+ chain?.chainType === ChainType.UTXO ? accountAddress : token.address;
81
+
78
82
  const onMouseEnter = () => {
79
- timeoutId.current = setTimeout(() => setShowAddress(true), 350);
83
+ timeoutId.current = setTimeout(() => {
84
+ if (tokenAddress) {
85
+ setShowAddress(true);
86
+ }
87
+ }, 350);
80
88
  };
81
89
 
82
90
  const onMouseLeave = () => {
@@ -128,12 +136,12 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
128
136
  >
129
137
  <Box display="flex">
130
138
  <Box display="flex" alignItems="center" pt={0.125}>
131
- {shortenAddress(token.address)}
139
+ {shortenAddress(tokenAddress)}
132
140
  </Box>
133
141
  <IconButton
134
142
  size="small"
135
143
  LinkComponent={Link}
136
- href={getAddressLink(token.address, chain)}
144
+ href={getAddressLink(tokenAddress!, chain)}
137
145
  target="_blank"
138
146
  rel="nofollow noreferrer"
139
147
  onClick={(e) => e.stopPropagation()}
@@ -145,7 +153,7 @@ export const TokenListItemButton: React.FC<TokenListItemButtonProps> = ({
145
153
  </Box>
146
154
  }
147
155
  />
148
- {showBalance ? (
156
+ {accountAddress ? (
149
157
  isBalanceLoading ? (
150
158
  <TokenAmountSkeleton />
151
159
  ) : (
@@ -127,7 +127,7 @@ export const VirtualizedTokenList: FC<VirtualizedTokenListProps> = ({
127
127
  token={currentToken}
128
128
  chain={chain}
129
129
  isBalanceLoading={isBalanceLoading}
130
- showBalance={account.isConnected}
130
+ accountAddress={account.address}
131
131
  startAdornment={
132
132
  startAdornmentLabel ? (
133
133
  <Typography