@lifi/widget 3.18.4 → 3.19.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 (260) hide show
  1. package/README.md +2 -1
  2. package/dist/esm/AppDrawer.js +7 -6
  3. package/dist/esm/AppDrawer.js.map +1 -1
  4. package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js +5 -3
  5. package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js.map +1 -1
  6. package/dist/esm/components/Avatar/AccountAvatar.js +1 -1
  7. package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
  8. package/dist/esm/components/BottomSheet/BottomSheet.js +2 -2
  9. package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
  10. package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
  11. package/dist/esm/components/Dialog.d.ts +10 -2
  12. package/dist/esm/components/Dialog.js +10 -10
  13. package/dist/esm/components/Dialog.js.map +1 -1
  14. package/dist/esm/components/Header/BackButton.js +1 -1
  15. package/dist/esm/components/Header/BackButton.js.map +1 -1
  16. package/dist/esm/components/Header/CloseDrawerButton.js +1 -1
  17. package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
  18. package/dist/esm/components/Header/DisconnectIconButton.js +1 -1
  19. package/dist/esm/components/Header/DisconnectIconButton.js.map +1 -1
  20. package/dist/esm/components/Header/SettingsButton.js +1 -1
  21. package/dist/esm/components/Header/SettingsButton.js.map +1 -1
  22. package/dist/esm/components/Header/TransactionHistoryButton.js +1 -1
  23. package/dist/esm/components/Header/TransactionHistoryButton.js.map +1 -1
  24. package/dist/esm/components/Header/WalletHeader.js +2 -1
  25. package/dist/esm/components/Header/WalletHeader.js.map +1 -1
  26. package/dist/esm/components/Header/WalletMenu.js +3 -1
  27. package/dist/esm/components/Header/WalletMenu.js.map +1 -1
  28. package/dist/esm/components/Messages/AccountNotDeployedMessage.js +1 -1
  29. package/dist/esm/components/Messages/AccountNotDeployedMessage.js.map +1 -1
  30. package/dist/esm/components/Messages/FundsSufficiencyMessage.js +1 -1
  31. package/dist/esm/components/Messages/FundsSufficiencyMessage.js.map +1 -1
  32. package/dist/esm/components/Messages/GasRefuelMessage.js +1 -1
  33. package/dist/esm/components/Messages/GasRefuelMessage.js.map +1 -1
  34. package/dist/esm/components/Messages/GasSufficiencyMessage.js +1 -1
  35. package/dist/esm/components/Messages/GasSufficiencyMessage.js.map +1 -1
  36. package/dist/esm/components/Messages/ToAddressRequiredMessage.js +1 -1
  37. package/dist/esm/components/Messages/ToAddressRequiredMessage.js.map +1 -1
  38. package/dist/esm/components/NotFound.js +1 -1
  39. package/dist/esm/components/NotFound.js.map +1 -1
  40. package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +2 -1
  41. package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
  42. package/dist/esm/components/RouteCard/RouteCard.js +2 -1
  43. package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
  44. package/dist/esm/components/RouteCard/RouteCardEssentials.js +2 -1
  45. package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
  46. package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js +1 -1
  47. package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js.map +1 -1
  48. package/dist/esm/components/RouteCard/RouteNotFoundCard.js +1 -1
  49. package/dist/esm/components/RouteCard/RouteNotFoundCard.js.map +1 -1
  50. package/dist/esm/components/Routes/Routes.js +1 -1
  51. package/dist/esm/components/Routes/Routes.js.map +1 -1
  52. package/dist/esm/components/Search/SearchInput.js +1 -1
  53. package/dist/esm/components/Search/SearchInput.js.map +1 -1
  54. package/dist/esm/components/Search/SearchNotFound.js +1 -1
  55. package/dist/esm/components/Search/SearchNotFound.js.map +1 -1
  56. package/dist/esm/components/SendToWallet/SendToWalletButton.js +1 -1
  57. package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
  58. package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js +1 -1
  59. package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
  60. package/dist/esm/components/Step/CircularProgress.js +4 -1
  61. package/dist/esm/components/Step/CircularProgress.js.map +1 -1
  62. package/dist/esm/components/Step/DestinationWalletAddress.js +2 -1
  63. package/dist/esm/components/Step/DestinationWalletAddress.js.map +1 -1
  64. package/dist/esm/components/Step/StepProcess.js +1 -1
  65. package/dist/esm/components/Step/StepProcess.js.map +1 -1
  66. package/dist/esm/components/StepActions/StepActions.js +3 -1
  67. package/dist/esm/components/StepActions/StepActions.js.map +1 -1
  68. package/dist/esm/components/Tabs/Tabs.style.d.ts +1 -1
  69. package/dist/esm/components/Timer/StepTimer.js +69 -31
  70. package/dist/esm/components/Timer/StepTimer.js.map +1 -1
  71. package/dist/esm/components/Timer/TimerContent.js +1 -1
  72. package/dist/esm/components/Timer/TimerContent.js.map +1 -1
  73. package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -2
  74. package/dist/esm/components/TokenList/TokenListItem.js +1 -1
  75. package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
  76. package/dist/esm/components/TokenList/types.d.ts +3 -3
  77. package/dist/esm/components/TransactionDetails.js +3 -1
  78. package/dist/esm/components/TransactionDetails.js.map +1 -1
  79. package/dist/esm/config/version.d.ts +1 -1
  80. package/dist/esm/config/version.js +1 -1
  81. package/dist/esm/config/version.js.map +1 -1
  82. package/dist/esm/hooks/timer/time.d.ts +19 -0
  83. package/dist/esm/hooks/timer/time.js +25 -0
  84. package/dist/esm/hooks/timer/time.js.map +1 -0
  85. package/dist/esm/hooks/timer/useInterval.d.ts +1 -1
  86. package/dist/esm/hooks/timer/useInterval.js +3 -3
  87. package/dist/esm/hooks/timer/useInterval.js.map +1 -1
  88. package/dist/esm/hooks/timer/useTimer.d.ts +10 -10
  89. package/dist/esm/hooks/timer/useTimer.js +31 -24
  90. package/dist/esm/hooks/timer/useTimer.js.map +1 -1
  91. package/dist/esm/hooks/timer/validate.d.ts +2 -0
  92. package/dist/esm/hooks/timer/validate.js +15 -0
  93. package/dist/esm/hooks/timer/validate.js.map +1 -0
  94. package/dist/esm/hooks/useSetContentHeight.d.ts +2 -2
  95. package/dist/esm/hooks/useSetContentHeight.js.map +1 -1
  96. package/dist/esm/i18n/bn.json +35 -17
  97. package/dist/esm/i18n/de.json +36 -18
  98. package/dist/esm/i18n/es.json +65 -47
  99. package/dist/esm/i18n/fr.json +40 -22
  100. package/dist/esm/i18n/hi.json +27 -9
  101. package/dist/esm/i18n/id.json +68 -50
  102. package/dist/esm/i18n/it.json +36 -18
  103. package/dist/esm/i18n/ja.json +40 -22
  104. package/dist/esm/i18n/ko.json +38 -20
  105. package/dist/esm/i18n/pt.json +42 -24
  106. package/dist/esm/i18n/th.json +40 -22
  107. package/dist/esm/i18n/tr.json +52 -34
  108. package/dist/esm/i18n/uk.json +43 -25
  109. package/dist/esm/i18n/vi.json +40 -22
  110. package/dist/esm/i18n/zh.json +43 -25
  111. package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js +1 -1
  112. package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js.map +1 -1
  113. package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +1 -1
  114. package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
  115. package/dist/esm/pages/LanguagesPage.js +1 -1
  116. package/dist/esm/pages/LanguagesPage.js.map +1 -1
  117. package/dist/esm/pages/SelectEnabledToolsPage.js +4 -1
  118. package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
  119. package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +3 -1
  120. package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
  121. package/dist/esm/pages/SendToWallet/BookmarksPage.js +5 -1
  122. package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
  123. package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +2 -1
  124. package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
  125. package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js +4 -1
  126. package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -1
  127. package/dist/esm/pages/SendToWallet/RecentWalletsPage.js +6 -1
  128. package/dist/esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -1
  129. package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js +3 -1
  130. package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js.map +1 -1
  131. package/dist/esm/pages/SendToWallet/SendToWalletPage.js +4 -1
  132. package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
  133. package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -1
  134. package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
  135. package/dist/esm/pages/SettingsPage/GasPriceSettings.js +1 -1
  136. package/dist/esm/pages/SettingsPage/GasPriceSettings.js.map +1 -1
  137. package/dist/esm/pages/SettingsPage/LanguageSetting.js +1 -1
  138. package/dist/esm/pages/SettingsPage/LanguageSetting.js.map +1 -1
  139. package/dist/esm/pages/SettingsPage/ResetSettingsButton.js +1 -1
  140. package/dist/esm/pages/SettingsPage/ResetSettingsButton.js.map +1 -1
  141. package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +1 -1
  142. package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
  143. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +2 -1
  144. package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
  145. package/dist/esm/pages/SettingsPage/ThemeSettings.js +3 -1
  146. package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
  147. package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js +2 -1
  148. package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js.map +1 -1
  149. package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js +1 -1
  150. package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js.map +1 -1
  151. package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +2 -1
  152. package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
  153. package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +1 -1
  154. package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
  155. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +4 -1
  156. package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
  157. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +1 -1
  158. package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
  159. package/dist/esm/pages/TransactionPage/TransactionPage.js +1 -1
  160. package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
  161. package/dist/esm/types/widget.d.ts +4 -4
  162. package/dist/esm/types/widget.js.map +1 -1
  163. package/package.json +8 -8
  164. package/package.json.tmp +7 -7
  165. package/src/AppDrawer.tsx +9 -7
  166. package/src/components/ActiveTransactions/ActiveTransactionItem.tsx +5 -3
  167. package/src/components/Avatar/AccountAvatar.tsx +1 -1
  168. package/src/components/BottomSheet/BottomSheet.tsx +1 -2
  169. package/src/components/Dialog.tsx +10 -12
  170. package/src/components/Header/BackButton.tsx +1 -1
  171. package/src/components/Header/CloseDrawerButton.tsx +1 -1
  172. package/src/components/Header/DisconnectIconButton.tsx +1 -1
  173. package/src/components/Header/SettingsButton.tsx +1 -1
  174. package/src/components/Header/TransactionHistoryButton.tsx +1 -1
  175. package/src/components/Header/WalletHeader.tsx +2 -1
  176. package/src/components/Header/WalletMenu.tsx +3 -5
  177. package/src/components/Messages/AccountNotDeployedMessage.tsx +1 -1
  178. package/src/components/Messages/FundsSufficiencyMessage.tsx +1 -1
  179. package/src/components/Messages/GasRefuelMessage.tsx +1 -1
  180. package/src/components/Messages/GasSufficiencyMessage.tsx +1 -1
  181. package/src/components/Messages/ToAddressRequiredMessage.tsx +1 -1
  182. package/src/components/NotFound.tsx +1 -1
  183. package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +2 -1
  184. package/src/components/RouteCard/RouteCard.tsx +2 -1
  185. package/src/components/RouteCard/RouteCardEssentials.tsx +2 -1
  186. package/src/components/RouteCard/RouteCardEssentialsExpanded.tsx +1 -1
  187. package/src/components/RouteCard/RouteNotFoundCard.tsx +1 -1
  188. package/src/components/Routes/Routes.tsx +1 -1
  189. package/src/components/Search/SearchInput.tsx +1 -1
  190. package/src/components/Search/SearchNotFound.tsx +1 -1
  191. package/src/components/SendToWallet/SendToWalletButton.tsx +1 -1
  192. package/src/components/SendToWallet/SendToWalletExpandButton.tsx +1 -1
  193. package/src/components/Step/CircularProgress.tsx +4 -6
  194. package/src/components/Step/DestinationWalletAddress.tsx +2 -1
  195. package/src/components/Step/StepProcess.tsx +1 -1
  196. package/src/components/StepActions/StepActions.tsx +3 -1
  197. package/src/components/Timer/StepTimer.tsx +97 -38
  198. package/src/components/Timer/TimerContent.tsx +1 -1
  199. package/src/components/TokenList/TokenListItem.tsx +1 -1
  200. package/src/components/TokenList/types.ts +3 -3
  201. package/src/components/TransactionDetails.tsx +3 -5
  202. package/src/config/version.ts +1 -1
  203. package/src/hooks/timer/time.ts +49 -0
  204. package/src/hooks/timer/useInterval.ts +4 -4
  205. package/src/hooks/timer/useTimer.ts +49 -35
  206. package/src/hooks/timer/validate.ts +15 -0
  207. package/src/hooks/useSetContentHeight.ts +2 -2
  208. package/src/i18n/bn.json +35 -17
  209. package/src/i18n/de.json +36 -18
  210. package/src/i18n/es.json +65 -47
  211. package/src/i18n/fr.json +40 -22
  212. package/src/i18n/hi.json +27 -9
  213. package/src/i18n/id.json +68 -50
  214. package/src/i18n/it.json +36 -18
  215. package/src/i18n/ja.json +40 -22
  216. package/src/i18n/ko.json +38 -20
  217. package/src/i18n/pt.json +42 -24
  218. package/src/i18n/th.json +40 -22
  219. package/src/i18n/tr.json +52 -34
  220. package/src/i18n/uk.json +43 -25
  221. package/src/i18n/vi.json +40 -22
  222. package/src/i18n/zh.json +43 -25
  223. package/src/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.tsx +1 -1
  224. package/src/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +1 -1
  225. package/src/pages/LanguagesPage.tsx +1 -1
  226. package/src/pages/SelectEnabledToolsPage.tsx +4 -6
  227. package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +6 -8
  228. package/src/pages/SendToWallet/BookmarksPage.tsx +5 -7
  229. package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +4 -3
  230. package/src/pages/SendToWallet/ConnectedWalletsPage.tsx +4 -6
  231. package/src/pages/SendToWallet/RecentWalletsPage.tsx +6 -8
  232. package/src/pages/SendToWallet/SendToConfiguredWalletPage.tsx +3 -5
  233. package/src/pages/SendToWallet/SendToWalletPage.tsx +4 -6
  234. package/src/pages/SettingsPage/BridgeAndExchangeSettings.tsx +2 -1
  235. package/src/pages/SettingsPage/GasPriceSettings.tsx +1 -1
  236. package/src/pages/SettingsPage/LanguageSetting.tsx +1 -1
  237. package/src/pages/SettingsPage/ResetSettingsButton.tsx +1 -1
  238. package/src/pages/SettingsPage/RoutePrioritySettings.tsx +1 -1
  239. package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +2 -1
  240. package/src/pages/SettingsPage/ThemeSettings.tsx +3 -1
  241. package/src/pages/TransactionDetailsPage/TransferIdCard.tsx +2 -1
  242. package/src/pages/TransactionHistoryPage/TransactionHistoryEmpty.tsx +1 -1
  243. package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +4 -3
  244. package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +5 -7
  245. package/src/pages/TransactionPage/StatusBottomSheet.tsx +4 -6
  246. package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +3 -3
  247. package/src/pages/TransactionPage/TransactionPage.tsx +1 -1
  248. package/src/types/widget.ts +4 -9
  249. package/dist/esm/components/Timer/RouteTimer.d.ts +0 -4
  250. package/dist/esm/components/Timer/RouteTimer.js +0 -23
  251. package/dist/esm/components/Timer/RouteTimer.js.map +0 -1
  252. package/dist/esm/hooks/timer/useStopwatch.d.ts +0 -16
  253. package/dist/esm/hooks/timer/useStopwatch.js +0 -41
  254. package/dist/esm/hooks/timer/useStopwatch.js.map +0 -1
  255. package/dist/esm/hooks/timer/utils.d.ts +0 -12
  256. package/dist/esm/hooks/timer/utils.js +0 -55
  257. package/dist/esm/hooks/timer/utils.js.map +0 -1
  258. package/src/components/Timer/RouteTimer.tsx +0 -33
  259. package/src/hooks/timer/useStopwatch.ts +0 -65
  260. package/src/hooks/timer/utils.ts +0 -64
@@ -1,4 +1,4 @@
1
- import { Settings } from '@mui/icons-material'
1
+ import Settings from '@mui/icons-material/Settings'
2
2
  import { Tooltip } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { useNavigateBack } from '../../hooks/useNavigateBack.js'
@@ -1,4 +1,4 @@
1
- import { ReceiptLong } from '@mui/icons-material'
1
+ import ReceiptLong from '@mui/icons-material/ReceiptLong'
2
2
  import { IconButton, Tooltip } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { useNavigateBack } from '../../hooks/useNavigateBack.js'
@@ -4,7 +4,8 @@ import {
4
4
  useAccount,
5
5
  useWalletMenu,
6
6
  } from '@lifi/wallet-management'
7
- import { ExpandMore, Wallet } from '@mui/icons-material'
7
+ import ExpandMore from '@mui/icons-material/ExpandMore'
8
+ import Wallet from '@mui/icons-material/Wallet'
8
9
  import { Avatar, Badge } from '@mui/material'
9
10
  import { useState } from 'react'
10
11
  import { useTranslation } from 'react-i18next'
@@ -3,11 +3,9 @@ import {
3
3
  useAccount,
4
4
  useWalletMenu,
5
5
  } from '@lifi/wallet-management'
6
- import {
7
- ContentCopyRounded,
8
- OpenInNewRounded,
9
- PowerSettingsNewRounded,
10
- } from '@mui/icons-material'
6
+ import ContentCopyRounded from '@mui/icons-material/ContentCopyRounded'
7
+ import OpenInNewRounded from '@mui/icons-material/OpenInNewRounded'
8
+ import PowerSettingsNewRounded from '@mui/icons-material/PowerSettingsNewRounded'
11
9
  import { Avatar, Badge, Box, Button, IconButton, MenuItem } from '@mui/material'
12
10
  import { useTranslation } from 'react-i18next'
13
11
  import { useAvailableChains } from '../../hooks/useAvailableChains.js'
@@ -1,4 +1,4 @@
1
- import { WarningRounded } from '@mui/icons-material'
1
+ import WarningRounded from '@mui/icons-material/WarningRounded'
2
2
  import { type BoxProps, Typography } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { AlertMessage } from './AlertMessage.js'
@@ -1,4 +1,4 @@
1
- import { WarningRounded } from '@mui/icons-material'
1
+ import WarningRounded from '@mui/icons-material/WarningRounded'
2
2
  import { type BoxProps, Typography } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { AlertMessage } from './AlertMessage.js'
@@ -1,4 +1,4 @@
1
- import { EvStation } from '@mui/icons-material'
1
+ import EvStation from '@mui/icons-material/EvStation'
2
2
  import type { BoxProps } from '@mui/material'
3
3
  import { Box, Collapse, Typography } from '@mui/material'
4
4
  import type { ChangeEvent } from 'react'
@@ -1,4 +1,4 @@
1
- import { EvStation } from '@mui/icons-material'
1
+ import EvStation from '@mui/icons-material/EvStation'
2
2
  import { type BoxProps, Typography } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { formatUnits } from 'viem'
@@ -1,4 +1,4 @@
1
- import { Wallet } from '@mui/icons-material'
1
+ import Wallet from '@mui/icons-material/Wallet'
2
2
  import type { BoxProps } from '@mui/material'
3
3
  import { Typography } from '@mui/material'
4
4
  import { useTranslation } from 'react-i18next'
@@ -1,4 +1,4 @@
1
- import { Block } from '@mui/icons-material'
1
+ import Block from '@mui/icons-material/Block'
2
2
  import { Box, Typography } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
 
@@ -1,4 +1,5 @@
1
- import { ArrowDownward, ArrowForward } from '@mui/icons-material'
1
+ import ArrowDownward from '@mui/icons-material/ArrowDownward'
2
+ import ArrowForward from '@mui/icons-material/ArrowForward'
2
3
  import { useAvailableChains } from '../../hooks/useAvailableChains.js'
3
4
  import { useToAddressAutoPopulate } from '../../hooks/useToAddressAutoPopulate.js'
4
5
  import { useToAddressReset } from '../../hooks/useToAddressReset.js'
@@ -1,6 +1,7 @@
1
1
  import type { TokenAmount } from '@lifi/sdk'
2
2
  import { isGaslessStep } from '@lifi/sdk'
3
- import { ExpandLess, ExpandMore } from '@mui/icons-material'
3
+ import ExpandLess from '@mui/icons-material/ExpandLess'
4
+ import ExpandMore from '@mui/icons-material/ExpandMore'
4
5
  import { Box, Collapse } from '@mui/material'
5
6
  import type { MouseEventHandler } from 'react'
6
7
  import { useState } from 'react'
@@ -1,5 +1,6 @@
1
1
  import { isGaslessStep } from '@lifi/sdk'
2
- import { AccessTimeFilled, LocalGasStationRounded } from '@mui/icons-material'
2
+ import AccessTimeFilled from '@mui/icons-material/AccessTimeFilled'
3
+ import LocalGasStationRounded from '@mui/icons-material/LocalGasStationRounded'
3
4
  import { Box, Tooltip, Typography } from '@mui/material'
4
5
  import { useTranslation } from 'react-i18next'
5
6
  import { getAccumulatedFeeCostsBreakdown } from '../../utils/fees.js'
@@ -1,4 +1,4 @@
1
- import { Layers } from '@mui/icons-material'
1
+ import Layers from '@mui/icons-material/Layers'
2
2
  import { Box, Typography } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { IconTypography } from '../IconTypography.js'
@@ -1,4 +1,4 @@
1
- import { Route } from '@mui/icons-material'
1
+ import Route from '@mui/icons-material/Route'
2
2
  import { Box, Typography } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
 
@@ -77,7 +77,7 @@ export const Routes: React.FC<CardProps> = (props) => {
77
77
  <RouteCard route={currentRoute} variant="cardless" active />
78
78
  )}
79
79
 
80
- <Collapse timeout={225} in={showAll} unmountOnExit mountOnEnter appear>
80
+ <Collapse timeout={225} in={showAll} unmountOnExit mountOnEnter>
81
81
  <Box
82
82
  sx={{
83
83
  mt: 2,
@@ -1,4 +1,4 @@
1
- import { Search } from '@mui/icons-material'
1
+ import Search from '@mui/icons-material/Search'
2
2
  import { FormControl, InputAdornment } from '@mui/material'
3
3
  import type { FocusEventHandler, FormEventHandler } from 'react'
4
4
  import { InputCard } from '../../components/Card/InputCard.js'
@@ -1,4 +1,4 @@
1
- import { SearchOff } from '@mui/icons-material'
1
+ import SearchOff from '@mui/icons-material/SearchOff'
2
2
  import {
3
3
  NotFoundContainer,
4
4
  NotFoundIconContainer,
@@ -1,5 +1,5 @@
1
1
  import { useAccount } from '@lifi/wallet-management'
2
- import { CloseRounded } from '@mui/icons-material'
2
+ import CloseRounded from '@mui/icons-material/CloseRounded'
3
3
  import { Box, Collapse } from '@mui/material'
4
4
  import { type MouseEventHandler, useEffect, useRef } from 'react'
5
5
  import { useTranslation } from 'react-i18next'
@@ -1,4 +1,4 @@
1
- import { Wallet } from '@mui/icons-material'
1
+ import Wallet from '@mui/icons-material/Wallet'
2
2
  import { Button, Tooltip } from '@mui/material'
3
3
  import { useTranslation } from 'react-i18next'
4
4
  import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js'
@@ -1,10 +1,8 @@
1
1
  import type { Process } from '@lifi/sdk'
2
- import {
3
- Done,
4
- ErrorRounded,
5
- InfoRounded,
6
- WarningRounded,
7
- } from '@mui/icons-material'
2
+ import Done from '@mui/icons-material/Done'
3
+ import ErrorRounded from '@mui/icons-material/ErrorRounded'
4
+ import InfoRounded from '@mui/icons-material/InfoRounded'
5
+ import WarningRounded from '@mui/icons-material/WarningRounded'
8
6
  import { darken } from '@mui/material'
9
7
  import {
10
8
  CircularIcon,
@@ -1,5 +1,6 @@
1
1
  import type { LiFiStepExtended } from '@lifi/sdk'
2
- import { LinkRounded, Wallet } from '@mui/icons-material'
2
+ import LinkRounded from '@mui/icons-material/LinkRounded'
3
+ import Wallet from '@mui/icons-material/Wallet'
3
4
  import { Box, Link, Typography } from '@mui/material'
4
5
  import { useTranslation } from 'react-i18next'
5
6
  import { CardIconButton } from '../Card/CardIconButton.js'
@@ -1,5 +1,5 @@
1
1
  import type { LiFiStep, Process } from '@lifi/sdk'
2
- import { OpenInNewRounded } from '@mui/icons-material'
2
+ import OpenInNewRounded from '@mui/icons-material/OpenInNewRounded'
3
3
  import { Box, Link, Typography } from '@mui/material'
4
4
  import { useExplorer } from '../../hooks/useExplorer.js'
5
5
  import { useProcessMessage } from '../../hooks/useProcessMessage.js'
@@ -1,6 +1,8 @@
1
1
  import type { LiFiStep, StepExtended } from '@lifi/sdk'
2
2
  import { isGaslessStep } from '@lifi/sdk'
3
- import { ArrowForward, ExpandLess, ExpandMore } from '@mui/icons-material'
3
+ import ArrowForward from '@mui/icons-material/ArrowForward'
4
+ import ExpandLess from '@mui/icons-material/ExpandLess'
5
+ import ExpandMore from '@mui/icons-material/ExpandMore'
4
6
  import type { StepIconProps } from '@mui/material'
5
7
  import {
6
8
  Badge,
@@ -1,66 +1,123 @@
1
1
  import type { LiFiStepExtended } from '@lifi/sdk'
2
2
  import { useEffect, useState } from 'react'
3
3
  import { useTranslation } from 'react-i18next'
4
- import { useStopwatch } from '../../hooks/timer/useStopwatch.js'
5
- import { useSettings } from '../../stores/settings/useSettings.js'
4
+ import { useTimer } from '../../hooks/timer/useTimer.js'
6
5
  import { formatTimer } from '../../utils/timer.js'
7
6
  import { TimerContent } from './TimerContent.js'
8
7
 
9
- const getFirstExecutionProcess = (step: LiFiStepExtended) =>
10
- step.execution?.process.at(0)
8
+ /**
9
+ * Finds the most recent process that is either a SWAP, CROSS_CHAIN, or RECEIVING_CHAIN.
10
+ * Includes RECEIVING_CHAIN to track the complete transaction lifecycle for UI updates.
11
+ */
12
+ const getProgressProcess = (step: LiFiStepExtended) =>
13
+ step.execution?.process.findLast(
14
+ (process) =>
15
+ process.type === 'SWAP' ||
16
+ process.type === 'CROSS_CHAIN' ||
17
+ process.type === 'RECEIVING_CHAIN'
18
+ )
11
19
 
12
- const getExecutionProcess = (step: LiFiStepExtended) =>
13
- step.execution?.process.at(-1)
20
+ /**
21
+ * Finds the most recent SWAP or CROSS_CHAIN process, excluding RECEIVING_CHAIN.
22
+ * Expiry time is based on when the active transaction started, not the receiving phase.
23
+ */
24
+ const getExpiryProcess = (step: LiFiStepExtended) =>
25
+ step.execution?.process.findLast(
26
+ (process) => process.type === 'SWAP' || process.type === 'CROSS_CHAIN'
27
+ )
14
28
 
15
- const getStartTimestamp = (step: LiFiStepExtended) =>
16
- new Date(getFirstExecutionProcess(step)?.startedAt ?? Date.now())
29
+ /**
30
+ * Calculates expiry timestamp based on process start time, estimated duration, and pause time.
31
+ * Pause time is added when action is required (usually for signature requests).
32
+ */
33
+ const getExpiryTimestamp = (step: LiFiStepExtended) => {
34
+ const lastProcess = getExpiryProcess(step)
35
+ let timeInPause = 0
36
+ if (lastProcess?.actionRequiredAt) {
37
+ const actionDoneAt =
38
+ lastProcess.pendingAt ?? lastProcess.doneAt ?? Date.now()
39
+ timeInPause = new Date(
40
+ actionDoneAt - lastProcess.actionRequiredAt
41
+ ).getTime()
42
+ }
43
+ const expiry = new Date(
44
+ (lastProcess?.startedAt ?? Date.now()) +
45
+ step.estimate.executionDuration * 1000 +
46
+ timeInPause
47
+ )
48
+ return expiry
49
+ }
17
50
 
18
51
  export const StepTimer: React.FC<{
19
52
  step: LiFiStepExtended
20
53
  hideInProgress?: boolean
21
- }> = ({ step }) => {
22
- const { i18n } = useTranslation()
23
- const { language } = useSettings(['language'])
24
-
54
+ }> = ({ step, hideInProgress }) => {
55
+ const { t, i18n } = useTranslation()
56
+ const [isExpired, setExpired] = useState(false)
25
57
  const [isExecutionStarted, setExecutionStarted] = useState(
26
- () => !!getExecutionProcess(step)
58
+ () => !!getProgressProcess(step)
27
59
  )
28
-
29
- const { seconds, minutes, days, hours, isRunning, pause, reset, start } =
30
- useStopwatch({
31
- autoStart: true,
32
- offsetTimestamp: getStartTimestamp(step),
60
+ const [expiryTimestamp, setExpiryTimestamp] = useState(() =>
61
+ getExpiryTimestamp(step)
62
+ )
63
+ const { days, hours, minutes, seconds, isRunning, pause, resume, restart } =
64
+ useTimer({
65
+ autoStart: false,
66
+ expiryTimestamp,
67
+ onExpire: () => setExpired(true),
33
68
  })
34
69
 
35
70
  useEffect(() => {
36
- const executionProcess = getExecutionProcess(step)
71
+ const executionProcess = getProgressProcess(step)
37
72
  if (!executionProcess) {
38
73
  return
39
74
  }
40
75
 
41
- const shouldRestart =
42
- executionProcess.status === 'FAILED' || executionProcess.status === 'DONE'
43
- const shouldStart =
76
+ if (isExecutionStarted && isExpired) {
77
+ return
78
+ }
79
+
80
+ const isProcessStarted =
44
81
  executionProcess.status === 'STARTED' ||
45
82
  executionProcess.status === 'PENDING'
46
- const shouldResume = executionProcess.status === 'PENDING'
47
- if (isExecutionStarted && shouldRestart) {
48
- setExecutionStarted(false)
49
- pause()
50
- return
83
+
84
+ const shouldRestart = !isExecutionStarted && isProcessStarted && !isRunning
85
+
86
+ const shouldPause =
87
+ isExecutionStarted &&
88
+ executionProcess.status === 'ACTION_REQUIRED' &&
89
+ isRunning
90
+
91
+ const shouldStop =
92
+ isExecutionStarted && executionProcess.status === 'FAILED'
93
+
94
+ const shouldResume = isExecutionStarted && isProcessStarted && !isRunning
95
+
96
+ if (shouldRestart) {
97
+ const newExpiryTimestamp = getExpiryTimestamp(step)
98
+ setExecutionStarted(true)
99
+ setExpiryTimestamp(newExpiryTimestamp)
100
+ return restart(newExpiryTimestamp, true)
51
101
  }
52
- if (isExecutionStarted && !isRunning && shouldResume) {
53
- start()
54
- return
102
+ if (shouldPause) {
103
+ return pause()
55
104
  }
56
- if (!isExecutionStarted && shouldStart) {
57
- setExecutionStarted(true)
58
- reset()
59
- return
105
+ if (shouldResume) {
106
+ return resume()
60
107
  }
61
- }, [isExecutionStarted, isRunning, pause, reset, start, step])
108
+ if (shouldStop) {
109
+ setExecutionStarted(false)
110
+ setExpired(false)
111
+ }
112
+ }, [isExecutionStarted, isExpired, isRunning, pause, restart, resume, step])
113
+
114
+ const isTimerExpired = isExpired || (!minutes && !seconds)
62
115
 
63
- if (step.execution?.status === 'DONE') {
116
+ if (
117
+ step.execution?.status === 'DONE' ||
118
+ step.execution?.status === 'FAILED' ||
119
+ (isTimerExpired && hideInProgress)
120
+ ) {
64
121
  return null
65
122
  }
66
123
 
@@ -80,10 +137,12 @@ export const StepTimer: React.FC<{
80
137
  )
81
138
  }
82
139
 
83
- return (
140
+ return isTimerExpired ? (
141
+ t('main.inProgress')
142
+ ) : (
84
143
  <TimerContent>
85
144
  {formatTimer({
86
- locale: language,
145
+ locale: i18n.language,
87
146
  days,
88
147
  hours,
89
148
  minutes,
@@ -1,4 +1,4 @@
1
- import { AccessTimeFilled } from '@mui/icons-material'
1
+ import AccessTimeFilled from '@mui/icons-material/AccessTimeFilled'
2
2
  import { Tooltip } from '@mui/material'
3
3
  import { Box } from '@mui/system'
4
4
  import type { FC, PropsWithChildren } from 'react'
@@ -1,5 +1,5 @@
1
1
  import { ChainType } from '@lifi/sdk'
2
- import { OpenInNewRounded } from '@mui/icons-material'
2
+ import OpenInNewRounded from '@mui/icons-material/OpenInNewRounded'
3
3
  import {
4
4
  Avatar,
5
5
  Box,
@@ -1,11 +1,11 @@
1
1
  import type { ExtendedChain } from '@lifi/sdk'
2
2
  import type { Account } from '@lifi/wallet-management'
3
- import type { MouseEventHandler, MutableRefObject } from 'react'
3
+ import type { MouseEventHandler, RefObject } from 'react'
4
4
  import type { FormType } from '../../stores/form/types.js'
5
5
  import type { TokenAmount } from '../../types/token.js'
6
6
 
7
7
  export interface TokenListProps {
8
- parentRef: MutableRefObject<HTMLElement | null>
8
+ parentRef: RefObject<HTMLElement | null>
9
9
  formType: FormType
10
10
  height: number
11
11
  onClick?(): void
@@ -14,7 +14,7 @@ export interface TokenListProps {
14
14
  export interface VirtualizedTokenListProps {
15
15
  account: Account
16
16
  tokens: TokenAmount[]
17
- scrollElementRef: MutableRefObject<HTMLElement | null>
17
+ scrollElementRef: RefObject<HTMLElement | null>
18
18
  isLoading: boolean
19
19
  isBalanceLoading: boolean
20
20
  chainId?: number
@@ -1,10 +1,8 @@
1
1
  import type { RouteExtended } from '@lifi/sdk'
2
2
  import { isGaslessStep } from '@lifi/sdk'
3
- import {
4
- ExpandLess,
5
- ExpandMore,
6
- LocalGasStationRounded,
7
- } from '@mui/icons-material'
3
+ import ExpandLess from '@mui/icons-material/ExpandLess'
4
+ import ExpandMore from '@mui/icons-material/ExpandMore'
5
+ import LocalGasStationRounded from '@mui/icons-material/LocalGasStationRounded'
8
6
  import type { CardProps } from '@mui/material'
9
7
  import { Box, Collapse, Tooltip, Typography } from '@mui/material'
10
8
  import { useState } from 'react'
@@ -1,2 +1,2 @@
1
1
  export const name = '@lifi/widget'
2
- export const version = '3.18.4'
2
+ export const version = '3.19.0-beta.0'
@@ -0,0 +1,49 @@
1
+ export type TimeFromMillisecondsType = {
2
+ totalMilliseconds: number
3
+ totalSeconds: number
4
+ milliseconds: number
5
+ seconds: number
6
+ minutes: number
7
+ hours: number
8
+ days: number
9
+ }
10
+
11
+ export type AMPMType = '' | 'pm' | 'am'
12
+
13
+ export type FormattedTimeFromMillisecondsType = {
14
+ milliseconds: number
15
+ seconds: number
16
+ minutes: number
17
+ hours: number
18
+ ampm?: AMPMType
19
+ }
20
+
21
+ export function getTimeFromMilliseconds(
22
+ millisecs: number,
23
+ isCountDown = true
24
+ ): TimeFromMillisecondsType {
25
+ const totalSeconds = isCountDown
26
+ ? Math.ceil(millisecs / 1000)
27
+ : Math.floor(millisecs / 1000)
28
+ const days = Math.floor(totalSeconds / (60 * 60 * 24))
29
+ const hours = Math.floor((totalSeconds % (60 * 60 * 24)) / (60 * 60))
30
+ const minutes = Math.floor((totalSeconds % (60 * 60)) / 60)
31
+ const seconds = Math.floor(totalSeconds % 60)
32
+ const milliseconds = Math.floor(millisecs % 1000)
33
+
34
+ return {
35
+ totalMilliseconds: millisecs,
36
+ totalSeconds,
37
+ milliseconds,
38
+ seconds,
39
+ minutes,
40
+ hours,
41
+ days,
42
+ }
43
+ }
44
+
45
+ export function getMillisecondsFromExpiry(expiry: Date): number {
46
+ const now = new Date().getTime()
47
+ const milliSecondsDistance = expiry?.getTime() - now
48
+ return milliSecondsDistance > 0 ? milliSecondsDistance : 0
49
+ }
@@ -1,11 +1,11 @@
1
1
  import { useEffect, useRef } from 'react'
2
2
 
3
- export function useInterval(callback: () => void, delay: number) {
4
- const callbacRef = useRef<() => void>(null)
3
+ export function useInterval(callback: () => void, delay: number | null) {
4
+ const callbackRef = useRef(callback)
5
5
 
6
6
  // update callback function with current render callback that has access to latest props and state
7
7
  useEffect(() => {
8
- callbacRef.current = callback
8
+ callbackRef.current = callback
9
9
  })
10
10
 
11
11
  useEffect(() => {
@@ -14,7 +14,7 @@ export function useInterval(callback: () => void, delay: number) {
14
14
  }
15
15
 
16
16
  const interval = setInterval(() => {
17
- callbacRef.current?.()
17
+ callbackRef?.current?.()
18
18
  }, delay)
19
19
  return () => clearInterval(interval)
20
20
  }, [delay])