@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.
- package/README.md +2 -1
- package/dist/esm/AppDrawer.js +7 -6
- package/dist/esm/AppDrawer.js.map +1 -1
- package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js +5 -3
- package/dist/esm/components/ActiveTransactions/ActiveTransactionItem.js.map +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.js +1 -1
- package/dist/esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/dist/esm/components/BottomSheet/BottomSheet.js +2 -2
- package/dist/esm/components/BottomSheet/BottomSheet.js.map +1 -1
- package/dist/esm/components/Card/CardIconButton.d.ts +1 -1
- package/dist/esm/components/Dialog.d.ts +10 -2
- package/dist/esm/components/Dialog.js +10 -10
- package/dist/esm/components/Dialog.js.map +1 -1
- package/dist/esm/components/Header/BackButton.js +1 -1
- package/dist/esm/components/Header/BackButton.js.map +1 -1
- package/dist/esm/components/Header/CloseDrawerButton.js +1 -1
- package/dist/esm/components/Header/CloseDrawerButton.js.map +1 -1
- package/dist/esm/components/Header/DisconnectIconButton.js +1 -1
- package/dist/esm/components/Header/DisconnectIconButton.js.map +1 -1
- package/dist/esm/components/Header/SettingsButton.js +1 -1
- package/dist/esm/components/Header/SettingsButton.js.map +1 -1
- package/dist/esm/components/Header/TransactionHistoryButton.js +1 -1
- package/dist/esm/components/Header/TransactionHistoryButton.js.map +1 -1
- package/dist/esm/components/Header/WalletHeader.js +2 -1
- package/dist/esm/components/Header/WalletHeader.js.map +1 -1
- package/dist/esm/components/Header/WalletMenu.js +3 -1
- package/dist/esm/components/Header/WalletMenu.js.map +1 -1
- package/dist/esm/components/Messages/AccountNotDeployedMessage.js +1 -1
- package/dist/esm/components/Messages/AccountNotDeployedMessage.js.map +1 -1
- package/dist/esm/components/Messages/FundsSufficiencyMessage.js +1 -1
- package/dist/esm/components/Messages/FundsSufficiencyMessage.js.map +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.js +1 -1
- package/dist/esm/components/Messages/GasRefuelMessage.js.map +1 -1
- package/dist/esm/components/Messages/GasSufficiencyMessage.js +1 -1
- package/dist/esm/components/Messages/GasSufficiencyMessage.js.map +1 -1
- package/dist/esm/components/Messages/ToAddressRequiredMessage.js +1 -1
- package/dist/esm/components/Messages/ToAddressRequiredMessage.js.map +1 -1
- package/dist/esm/components/NotFound.js +1 -1
- package/dist/esm/components/NotFound.js.map +1 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js +2 -1
- package/dist/esm/components/ReverseTokensButton/ReverseTokensButton.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCard.js +2 -1
- package/dist/esm/components/RouteCard/RouteCard.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js +2 -1
- package/dist/esm/components/RouteCard/RouteCardEssentials.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js +1 -1
- package/dist/esm/components/RouteCard/RouteCardEssentialsExpanded.js.map +1 -1
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js +1 -1
- package/dist/esm/components/RouteCard/RouteNotFoundCard.js.map +1 -1
- package/dist/esm/components/Routes/Routes.js +1 -1
- package/dist/esm/components/Routes/Routes.js.map +1 -1
- package/dist/esm/components/Search/SearchInput.js +1 -1
- package/dist/esm/components/Search/SearchInput.js.map +1 -1
- package/dist/esm/components/Search/SearchNotFound.js +1 -1
- package/dist/esm/components/Search/SearchNotFound.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletExpandButton.js.map +1 -1
- package/dist/esm/components/Step/CircularProgress.js +4 -1
- package/dist/esm/components/Step/CircularProgress.js.map +1 -1
- package/dist/esm/components/Step/DestinationWalletAddress.js +2 -1
- package/dist/esm/components/Step/DestinationWalletAddress.js.map +1 -1
- package/dist/esm/components/Step/StepProcess.js +1 -1
- package/dist/esm/components/Step/StepProcess.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.js +3 -1
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.d.ts +1 -1
- package/dist/esm/components/Timer/StepTimer.js +69 -31
- package/dist/esm/components/Timer/StepTimer.js.map +1 -1
- package/dist/esm/components/Timer/TimerContent.js +1 -1
- package/dist/esm/components/Timer/TimerContent.js.map +1 -1
- package/dist/esm/components/TokenList/TokenList.style.d.ts +2 -2
- package/dist/esm/components/TokenList/TokenListItem.js +1 -1
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +3 -3
- package/dist/esm/components/TransactionDetails.js +3 -1
- package/dist/esm/components/TransactionDetails.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/timer/time.d.ts +19 -0
- package/dist/esm/hooks/timer/time.js +25 -0
- package/dist/esm/hooks/timer/time.js.map +1 -0
- package/dist/esm/hooks/timer/useInterval.d.ts +1 -1
- package/dist/esm/hooks/timer/useInterval.js +3 -3
- package/dist/esm/hooks/timer/useInterval.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.d.ts +10 -10
- package/dist/esm/hooks/timer/useTimer.js +31 -24
- package/dist/esm/hooks/timer/useTimer.js.map +1 -1
- package/dist/esm/hooks/timer/validate.d.ts +2 -0
- package/dist/esm/hooks/timer/validate.js +15 -0
- package/dist/esm/hooks/timer/validate.js.map +1 -0
- package/dist/esm/hooks/useSetContentHeight.d.ts +2 -2
- package/dist/esm/hooks/useSetContentHeight.js.map +1 -1
- package/dist/esm/i18n/bn.json +35 -17
- package/dist/esm/i18n/de.json +36 -18
- package/dist/esm/i18n/es.json +65 -47
- package/dist/esm/i18n/fr.json +40 -22
- package/dist/esm/i18n/hi.json +27 -9
- package/dist/esm/i18n/id.json +68 -50
- package/dist/esm/i18n/it.json +36 -18
- package/dist/esm/i18n/ja.json +40 -22
- package/dist/esm/i18n/ko.json +38 -20
- package/dist/esm/i18n/pt.json +42 -24
- package/dist/esm/i18n/th.json +40 -22
- package/dist/esm/i18n/tr.json +52 -34
- package/dist/esm/i18n/uk.json +43 -25
- package/dist/esm/i18n/vi.json +40 -22
- package/dist/esm/i18n/zh.json +43 -25
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js +1 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.js.map +1 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +1 -1
- package/dist/esm/pages/ActiveTransactionsPage/ActiveTransactionsPage.js.map +1 -1
- package/dist/esm/pages/LanguagesPage.js +1 -1
- package/dist/esm/pages/LanguagesPage.js.map +1 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js +4 -1
- package/dist/esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +3 -1
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js +5 -1
- package/dist/esm/pages/SendToWallet/BookmarksPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +2 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js +4 -1
- package/dist/esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js +6 -1
- package/dist/esm/pages/SendToWallet/RecentWalletsPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js +3 -1
- package/dist/esm/pages/SendToWallet/SendToConfiguredWalletPage.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js +4 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js +2 -1
- package/dist/esm/pages/SettingsPage/BridgeAndExchangeSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/GasPriceSettings.js +1 -1
- package/dist/esm/pages/SettingsPage/GasPriceSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/LanguageSetting.js +1 -1
- package/dist/esm/pages/SettingsPage/LanguageSetting.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.js +1 -1
- package/dist/esm/pages/SettingsPage/ResetSettingsButton.js.map +1 -1
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js +1 -1
- package/dist/esm/pages/SettingsPage/RoutePrioritySettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +2 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.js +3 -1
- package/dist/esm/pages/SettingsPage/ThemeSettings.js.map +1 -1
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js +2 -1
- package/dist/esm/pages/TransactionDetailsPage/TransferIdCard.js.map +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js +1 -1
- package/dist/esm/pages/TransactionHistoryPage/TransactionHistoryEmpty.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +2 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js +1 -1
- package/dist/esm/pages/TransactionPage/ExchangeRateBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +4 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js +1 -1
- package/dist/esm/pages/TransactionPage/TokenValueBottomSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.js +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/dist/esm/types/widget.d.ts +4 -4
- package/dist/esm/types/widget.js.map +1 -1
- package/package.json +8 -8
- package/package.json.tmp +7 -7
- package/src/AppDrawer.tsx +9 -7
- package/src/components/ActiveTransactions/ActiveTransactionItem.tsx +5 -3
- package/src/components/Avatar/AccountAvatar.tsx +1 -1
- package/src/components/BottomSheet/BottomSheet.tsx +1 -2
- package/src/components/Dialog.tsx +10 -12
- package/src/components/Header/BackButton.tsx +1 -1
- package/src/components/Header/CloseDrawerButton.tsx +1 -1
- package/src/components/Header/DisconnectIconButton.tsx +1 -1
- package/src/components/Header/SettingsButton.tsx +1 -1
- package/src/components/Header/TransactionHistoryButton.tsx +1 -1
- package/src/components/Header/WalletHeader.tsx +2 -1
- package/src/components/Header/WalletMenu.tsx +3 -5
- package/src/components/Messages/AccountNotDeployedMessage.tsx +1 -1
- package/src/components/Messages/FundsSufficiencyMessage.tsx +1 -1
- package/src/components/Messages/GasRefuelMessage.tsx +1 -1
- package/src/components/Messages/GasSufficiencyMessage.tsx +1 -1
- package/src/components/Messages/ToAddressRequiredMessage.tsx +1 -1
- package/src/components/NotFound.tsx +1 -1
- package/src/components/ReverseTokensButton/ReverseTokensButton.tsx +2 -1
- package/src/components/RouteCard/RouteCard.tsx +2 -1
- package/src/components/RouteCard/RouteCardEssentials.tsx +2 -1
- package/src/components/RouteCard/RouteCardEssentialsExpanded.tsx +1 -1
- package/src/components/RouteCard/RouteNotFoundCard.tsx +1 -1
- package/src/components/Routes/Routes.tsx +1 -1
- package/src/components/Search/SearchInput.tsx +1 -1
- package/src/components/Search/SearchNotFound.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletButton.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletExpandButton.tsx +1 -1
- package/src/components/Step/CircularProgress.tsx +4 -6
- package/src/components/Step/DestinationWalletAddress.tsx +2 -1
- package/src/components/Step/StepProcess.tsx +1 -1
- package/src/components/StepActions/StepActions.tsx +3 -1
- package/src/components/Timer/StepTimer.tsx +97 -38
- package/src/components/Timer/TimerContent.tsx +1 -1
- package/src/components/TokenList/TokenListItem.tsx +1 -1
- package/src/components/TokenList/types.ts +3 -3
- package/src/components/TransactionDetails.tsx +3 -5
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/time.ts +49 -0
- package/src/hooks/timer/useInterval.ts +4 -4
- package/src/hooks/timer/useTimer.ts +49 -35
- package/src/hooks/timer/validate.ts +15 -0
- package/src/hooks/useSetContentHeight.ts +2 -2
- package/src/i18n/bn.json +35 -17
- package/src/i18n/de.json +36 -18
- package/src/i18n/es.json +65 -47
- package/src/i18n/fr.json +40 -22
- package/src/i18n/hi.json +27 -9
- package/src/i18n/id.json +68 -50
- package/src/i18n/it.json +36 -18
- package/src/i18n/ja.json +40 -22
- package/src/i18n/ko.json +38 -20
- package/src/i18n/pt.json +42 -24
- package/src/i18n/th.json +40 -22
- package/src/i18n/tr.json +52 -34
- package/src/i18n/uk.json +43 -25
- package/src/i18n/vi.json +40 -22
- package/src/i18n/zh.json +43 -25
- package/src/pages/ActiveTransactionsPage/ActiveTransactionsEmpty.tsx +1 -1
- package/src/pages/ActiveTransactionsPage/ActiveTransactionsPage.tsx +1 -1
- package/src/pages/LanguagesPage.tsx +1 -1
- package/src/pages/SelectEnabledToolsPage.tsx +4 -6
- package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +6 -8
- package/src/pages/SendToWallet/BookmarksPage.tsx +5 -7
- package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +4 -3
- package/src/pages/SendToWallet/ConnectedWalletsPage.tsx +4 -6
- package/src/pages/SendToWallet/RecentWalletsPage.tsx +6 -8
- package/src/pages/SendToWallet/SendToConfiguredWalletPage.tsx +3 -5
- package/src/pages/SendToWallet/SendToWalletPage.tsx +4 -6
- package/src/pages/SettingsPage/BridgeAndExchangeSettings.tsx +2 -1
- package/src/pages/SettingsPage/GasPriceSettings.tsx +1 -1
- package/src/pages/SettingsPage/LanguageSetting.tsx +1 -1
- package/src/pages/SettingsPage/ResetSettingsButton.tsx +1 -1
- package/src/pages/SettingsPage/RoutePrioritySettings.tsx +1 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +2 -1
- package/src/pages/SettingsPage/ThemeSettings.tsx +3 -1
- package/src/pages/TransactionDetailsPage/TransferIdCard.tsx +2 -1
- package/src/pages/TransactionHistoryPage/TransactionHistoryEmpty.tsx +1 -1
- package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +4 -3
- package/src/pages/TransactionPage/ExchangeRateBottomSheet.tsx +5 -7
- package/src/pages/TransactionPage/StatusBottomSheet.tsx +4 -6
- package/src/pages/TransactionPage/TokenValueBottomSheet.tsx +3 -3
- package/src/pages/TransactionPage/TransactionPage.tsx +1 -1
- package/src/types/widget.ts +4 -9
- package/dist/esm/components/Timer/RouteTimer.d.ts +0 -4
- package/dist/esm/components/Timer/RouteTimer.js +0 -23
- package/dist/esm/components/Timer/RouteTimer.js.map +0 -1
- package/dist/esm/hooks/timer/useStopwatch.d.ts +0 -16
- package/dist/esm/hooks/timer/useStopwatch.js +0 -41
- package/dist/esm/hooks/timer/useStopwatch.js.map +0 -1
- package/dist/esm/hooks/timer/utils.d.ts +0 -12
- package/dist/esm/hooks/timer/utils.js +0 -55
- package/dist/esm/hooks/timer/utils.js.map +0 -1
- package/src/components/Timer/RouteTimer.tsx +0 -33
- package/src/hooks/timer/useStopwatch.ts +0 -65
- package/src/hooks/timer/utils.ts +0 -64
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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
|
|
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
|
-
|
|
8
|
-
|
|
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
|
|
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
|
|
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,5 @@
|
|
|
1
|
-
import
|
|
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
|
|
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
|
|
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'
|
|
@@ -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
|
|
80
|
+
<Collapse timeout={225} in={showAll} unmountOnExit mountOnEnter>
|
|
81
81
|
<Box
|
|
82
82
|
sx={{
|
|
83
83
|
mt: 2,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
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,5 +1,5 @@
|
|
|
1
1
|
import { useAccount } from '@lifi/wallet-management'
|
|
2
|
-
import
|
|
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
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
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
|
|
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
|
|
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
|
|
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 {
|
|
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
|
-
|
|
10
|
-
|
|
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
|
-
|
|
13
|
-
|
|
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
|
-
|
|
16
|
-
|
|
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
|
|
24
|
-
|
|
54
|
+
}> = ({ step, hideInProgress }) => {
|
|
55
|
+
const { t, i18n } = useTranslation()
|
|
56
|
+
const [isExpired, setExpired] = useState(false)
|
|
25
57
|
const [isExecutionStarted, setExecutionStarted] = useState(
|
|
26
|
-
() => !!
|
|
58
|
+
() => !!getProgressProcess(step)
|
|
27
59
|
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
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 =
|
|
71
|
+
const executionProcess = getProgressProcess(step)
|
|
37
72
|
if (!executionProcess) {
|
|
38
73
|
return
|
|
39
74
|
}
|
|
40
75
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
76
|
+
if (isExecutionStarted && isExpired) {
|
|
77
|
+
return
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
const isProcessStarted =
|
|
44
81
|
executionProcess.status === 'STARTED' ||
|
|
45
82
|
executionProcess.status === 'PENDING'
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
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 (
|
|
53
|
-
|
|
54
|
-
return
|
|
102
|
+
if (shouldPause) {
|
|
103
|
+
return pause()
|
|
55
104
|
}
|
|
56
|
-
if (
|
|
57
|
-
|
|
58
|
-
reset()
|
|
59
|
-
return
|
|
105
|
+
if (shouldResume) {
|
|
106
|
+
return resume()
|
|
60
107
|
}
|
|
61
|
-
|
|
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 (
|
|
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,11 +1,11 @@
|
|
|
1
1
|
import type { ExtendedChain } from '@lifi/sdk'
|
|
2
2
|
import type { Account } from '@lifi/wallet-management'
|
|
3
|
-
import type { MouseEventHandler,
|
|
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:
|
|
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:
|
|
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
|
-
|
|
5
|
-
|
|
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'
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '3.
|
|
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
|
|
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
|
-
|
|
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
|
-
|
|
17
|
+
callbackRef?.current?.()
|
|
18
18
|
}, delay)
|
|
19
19
|
return () => clearInterval(interval)
|
|
20
20
|
}, [delay])
|