@lifi/widget 3.30.0 → 3.30.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/esm/AppProvider.d.ts +0 -1
- package/dist/esm/AppProvider.js +1 -1
- package/dist/esm/AppProvider.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInput.d.ts +0 -9
- package/dist/esm/components/AmountInput/AmountInput.js +1 -1
- package/dist/esm/components/AmountInput/AmountInput.js.map +1 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.d.ts +0 -1
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js +1 -6
- package/dist/esm/components/AmountInput/AmountInputAdornment.style.js.map +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.d.ts +0 -6
- package/dist/esm/components/AmountInput/PriceFormHelperText.js +1 -1
- package/dist/esm/components/AmountInput/PriceFormHelperText.js.map +1 -1
- package/dist/esm/components/Avatar/Avatar.d.ts +0 -4
- package/dist/esm/components/Avatar/Avatar.js +1 -1
- package/dist/esm/components/Avatar/Avatar.js.map +1 -1
- package/dist/esm/components/Avatar/TokenAvatar.d.ts +0 -15
- package/dist/esm/components/Avatar/TokenAvatar.js +2 -2
- package/dist/esm/components/Avatar/TokenAvatar.js.map +1 -1
- package/dist/esm/components/Card/CardButton.style.d.ts +0 -1
- package/dist/esm/components/Card/CardButton.style.js +0 -7
- package/dist/esm/components/Card/CardButton.style.js.map +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.d.ts +2 -3
- package/dist/esm/components/FeeBreakdownTooltip.js +1 -1
- package/dist/esm/components/FeeBreakdownTooltip.js.map +1 -1
- package/dist/esm/components/Header/Header.d.ts +1 -2
- package/dist/esm/components/Header/Header.js +1 -1
- package/dist/esm/components/Header/Header.js.map +1 -1
- package/dist/esm/components/Header/WalletHeader.d.ts +0 -1
- package/dist/esm/components/Header/WalletHeader.js +1 -1
- package/dist/esm/components/Header/WalletHeader.js.map +1 -1
- package/dist/esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.d.ts +1 -10
- package/dist/esm/components/StepActions/StepActions.js +6 -6
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/components/Tabs/Tabs.style.d.ts +0 -1
- package/dist/esm/components/Tabs/Tabs.style.js +1 -1
- package/dist/esm/components/Tabs/Tabs.style.js.map +1 -1
- package/dist/esm/components/Timer/TimerContent.js +1 -2
- package/dist/esm/components/Timer/TimerContent.js.map +1 -1
- package/dist/esm/components/Token/Token.d.ts +0 -2
- package/dist/esm/components/Token/Token.js +2 -2
- package/dist/esm/components/Token/Token.js.map +1 -1
- package/dist/esm/components/TokenList/TokenListItem.d.ts +1 -4
- package/dist/esm/components/TokenList/TokenListItem.js +3 -3
- package/dist/esm/components/TokenList/TokenListItem.js.map +1 -1
- package/dist/esm/components/TokenList/types.d.ts +2 -1
- package/dist/esm/components/TokenList/useTokenSelect.d.ts +0 -4
- package/dist/esm/components/TokenList/useTokenSelect.js.map +1 -1
- package/dist/esm/components/TokenRate/TokenRate.js +1 -3
- package/dist/esm/components/TokenRate/TokenRate.js.map +1 -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/hooks/timer/time.d.ts +0 -8
- package/dist/esm/hooks/timer/time.js.map +1 -1
- package/dist/esm/hooks/timer/useTimer.d.ts +3 -2
- package/dist/esm/hooks/useAccountsBalancesData.js +1 -1
- package/dist/esm/hooks/useAccountsBalancesData.js.map +1 -1
- package/dist/esm/hooks/useAvailableChains.d.ts +2 -1
- package/dist/esm/hooks/useChain.d.ts +1 -1
- package/dist/esm/hooks/useChains.d.ts +1 -1
- package/dist/esm/hooks/useExplorer.d.ts +2 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.d.ts +2 -1
- package/dist/esm/hooks/useFilteredByTokenBalances.js +12 -3
- package/dist/esm/hooks/useFilteredByTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useListHeight.d.ts +0 -2
- package/dist/esm/hooks/useListHeight.js +2 -2
- package/dist/esm/hooks/useListHeight.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +2 -2
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressAutoPopulate.d.ts +2 -1
- package/dist/esm/hooks/useToken.js +4 -3
- package/dist/esm/hooks/useToken.js.map +1 -1
- package/dist/esm/hooks/useTokenAddressBalance.d.ts +3 -2
- package/dist/esm/hooks/useTokenAddressBalance.js +1 -1
- package/dist/esm/hooks/useTokenAddressBalance.js.map +1 -1
- package/dist/esm/hooks/useTokenBalances.js +1 -1
- package/dist/esm/hooks/useTokenBalances.js.map +1 -1
- package/dist/esm/hooks/useTokenSearch.js +3 -3
- package/dist/esm/hooks/useTokenSearch.js.map +1 -1
- package/dist/esm/hooks/useTokens.d.ts +1 -1
- package/dist/esm/hooks/useTokens.js +27 -6
- package/dist/esm/hooks/useTokens.js.map +1 -1
- package/dist/esm/i18n/pt.json +4 -4
- package/dist/esm/pages/SettingsPage/SettingsCard/SettingCardExpandable.js.map +1 -1
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js +27 -17
- package/dist/esm/pages/SettingsPage/SlippageSettings/SlippageSettings.js.map +1 -1
- package/dist/esm/pages/TransactionPage/RouteTracker.d.ts +2 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.d.ts +0 -5
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js +1 -1
- package/dist/esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/dist/esm/providers/I18nProvider/types.d.ts +4 -3
- package/dist/esm/providers/WalletProvider/EVMProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/EVMProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/EVMProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SVMProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/SuiProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/UTXOProvider.js.map +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.d.ts +0 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js +1 -1
- package/dist/esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.d.ts +1 -2
- package/dist/esm/stores/bookmarks/BookmarkStore.js +1 -1
- package/dist/esm/stores/bookmarks/BookmarkStore.js.map +1 -1
- package/dist/esm/stores/chains/ChainOrderStore.d.ts +0 -5
- package/dist/esm/stores/chains/ChainOrderStore.js +2 -2
- package/dist/esm/stores/chains/ChainOrderStore.js.map +1 -1
- package/dist/esm/stores/chains/types.d.ts +2 -1
- package/dist/esm/stores/header/types.d.ts +2 -1
- package/dist/esm/stores/header/useHeaderStore.d.ts +1 -4
- package/dist/esm/stores/header/useHeaderStore.js +3 -3
- package/dist/esm/stores/header/useHeaderStore.js.map +1 -1
- package/dist/esm/stores/inputMode/useInputModeStore.d.ts +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.d.ts +2 -2
- package/dist/esm/stores/routes/RouteExecutionStore.js +1 -1
- package/dist/esm/stores/routes/RouteExecutionStore.js.map +1 -1
- package/dist/esm/stores/settings/types.d.ts +3 -3
- package/dist/esm/stores/settings/types.js.map +1 -1
- package/dist/esm/stores/settings/useSettingsStore.d.ts +1 -2
- package/dist/esm/stores/settings/useSettingsStore.js +1 -1
- package/dist/esm/stores/settings/useSettingsStore.js.map +1 -1
- package/dist/esm/stores/settings/useSplitSubvariantStore.d.ts +1 -4
- package/dist/esm/stores/settings/useSplitSubvariantStore.js +3 -3
- package/dist/esm/stores/settings/useSplitSubvariantStore.js.map +1 -1
- package/dist/esm/types/events.d.ts +0 -4
- package/dist/esm/types/events.js +0 -4
- package/dist/esm/types/events.js.map +1 -1
- package/dist/esm/utils/fees.d.ts +1 -4
- package/dist/esm/utils/fees.js +3 -3
- package/dist/esm/utils/fees.js.map +1 -1
- package/dist/esm/utils/format.js +1 -1
- package/dist/esm/utils/format.js.map +1 -1
- package/dist/esm/utils/navigationRoutes.d.ts +2 -1
- package/dist/esm/utils/token.js +2 -2
- package/dist/esm/utils/token.js.map +1 -1
- package/dist/esm/utils/tokenList.d.ts +0 -4
- package/dist/esm/utils/tokenList.js +3 -3
- package/dist/esm/utils/tokenList.js.map +1 -1
- package/package.json +7 -7
- package/package.json.tmp +6 -6
- package/src/AppProvider.tsx +1 -1
- package/src/components/AmountInput/AmountInput.tsx +1 -1
- package/src/components/AmountInput/AmountInputAdornment.style.tsx +1 -7
- package/src/components/AmountInput/PriceFormHelperText.tsx +1 -1
- package/src/components/Avatar/Avatar.tsx +1 -1
- package/src/components/Avatar/TokenAvatar.tsx +2 -2
- package/src/components/Card/CardButton.style.tsx +0 -8
- package/src/components/FeeBreakdownTooltip.tsx +2 -5
- package/src/components/Header/Header.tsx +1 -1
- package/src/components/Header/WalletHeader.tsx +1 -1
- package/src/components/SendToWallet/SendToWalletButton.tsx +0 -1
- package/src/components/StepActions/StepActions.tsx +6 -6
- package/src/components/Tabs/Tabs.style.tsx +1 -1
- package/src/components/Timer/TimerContent.tsx +1 -2
- package/src/components/Token/Token.tsx +2 -2
- package/src/components/TokenList/TokenListItem.tsx +17 -19
- package/src/components/TokenList/types.ts +1 -1
- package/src/components/TokenList/useTokenSelect.ts +0 -5
- package/src/components/TokenRate/TokenRate.tsx +0 -1
- package/src/components/TransactionDetails.tsx +0 -1
- package/src/config/version.ts +1 -1
- package/src/hooks/timer/time.ts +0 -10
- package/src/hooks/timer/useTimer.ts +2 -2
- package/src/hooks/useAccountsBalancesData.ts +1 -1
- package/src/hooks/useAvailableChains.ts +1 -1
- package/src/hooks/useExplorer.ts +1 -1
- package/src/hooks/useFilteredByTokenBalances.ts +32 -3
- package/src/hooks/useListHeight.ts +2 -2
- package/src/hooks/useRoutes.ts +4 -2
- package/src/hooks/useToAddressAutoPopulate.ts +1 -1
- package/src/hooks/useToken.ts +10 -4
- package/src/hooks/useTokenAddressBalance.ts +2 -1
- package/src/hooks/useTokenBalances.ts +1 -1
- package/src/hooks/useTokenSearch.ts +4 -7
- package/src/hooks/useTokens.ts +44 -6
- package/src/i18n/pt.json +4 -4
- package/src/pages/SettingsPage/SettingsCard/SettingCardExpandable.tsx +0 -1
- package/src/pages/SettingsPage/SlippageSettings/SlippageSettings.tsx +33 -30
- package/src/pages/TransactionPage/RouteTracker.tsx +1 -1
- package/src/pages/TransactionPage/StatusBottomSheet.tsx +5 -3
- package/src/providers/I18nProvider/types.ts +3 -3
- package/src/providers/WalletProvider/EVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/SVMProvider.tsx +1 -1
- package/src/providers/WalletProvider/SuiProvider.tsx +1 -1
- package/src/providers/WalletProvider/UTXOProvider.tsx +1 -1
- package/src/providers/WalletProvider/WalletProvider.tsx +1 -1
- package/src/stores/bookmarks/BookmarkStore.tsx +1 -1
- package/src/stores/chains/ChainOrderStore.tsx +3 -7
- package/src/stores/chains/types.ts +1 -1
- package/src/stores/header/types.ts +1 -1
- package/src/stores/header/useHeaderStore.tsx +3 -3
- package/src/stores/inputMode/useInputModeStore.ts +1 -1
- package/src/stores/routes/RouteExecutionStore.tsx +4 -3
- package/src/stores/settings/types.ts +2 -6
- package/src/stores/settings/useSettingsStore.ts +1 -1
- package/src/stores/settings/useSplitSubvariantStore.tsx +5 -4
- package/src/types/events.ts +0 -4
- package/src/utils/fees.ts +3 -3
- package/src/utils/format.ts +2 -1
- package/src/utils/navigationRoutes.ts +1 -1
- package/src/utils/token.ts +4 -2
- package/src/utils/tokenList.ts +4 -4
- package/dist/esm/AppDrawer.style.d.ts +0 -1
- package/dist/esm/AppDrawer.style.js +0 -12
- package/dist/esm/AppDrawer.style.js.map +0 -1
- package/dist/esm/components/Select.d.ts +0 -3
- package/dist/esm/components/Select.js +0 -35
- package/dist/esm/components/Select.js.map +0 -1
- package/dist/esm/components/StepActions/StepFees.d.ts +0 -5
- package/dist/esm/components/StepActions/StepFees.js +0 -32
- package/dist/esm/components/StepActions/StepFees.js.map +0 -1
- package/dist/esm/pages/MainPage/MainPage.style.d.ts +0 -1
- package/dist/esm/pages/MainPage/MainPage.style.js +0 -8
- package/dist/esm/pages/MainPage/MainPage.style.js.map +0 -1
- package/dist/esm/pages/SelectNativeTokenPage.d.ts +0 -2
- package/dist/esm/pages/SelectNativeTokenPage.js +0 -23
- package/dist/esm/pages/SelectNativeTokenPage.js.map +0 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.d.ts +0 -1
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js +0 -6
- package/dist/esm/pages/SelectTokenPage/SearchTokenInput.style.js.map +0 -1
- package/dist/esm/pages/SelectTokenPage/types.d.ts +0 -4
- package/dist/esm/pages/SelectTokenPage/types.js +0 -6
- package/dist/esm/pages/SelectTokenPage/types.js.map +0 -1
- package/dist/esm/providers/WidgetProvider/utils.d.ts +0 -5
- package/dist/esm/providers/WidgetProvider/utils.js +0 -17
- package/dist/esm/providers/WidgetProvider/utils.js.map +0 -1
- package/dist/esm/stores/form/useFieldController.d.ts +0 -11
- package/dist/esm/stores/form/useFieldController.js +0 -20
- package/dist/esm/stores/form/useFieldController.js.map +0 -1
- package/dist/esm/stores/form/useValidation.d.ts +0 -2
- package/dist/esm/stores/form/useValidation.js +0 -14
- package/dist/esm/stores/form/useValidation.js.map +0 -1
- package/dist/esm/stores/form/useValidationActions.d.ts +0 -2
- package/dist/esm/stores/form/useValidationActions.js +0 -10
- package/dist/esm/stores/form/useValidationActions.js.map +0 -1
- package/src/AppDrawer.style.tsx +0 -12
- package/src/components/Select.tsx +0 -42
- package/src/components/StepActions/StepFees.tsx +0 -49
- package/src/pages/MainPage/MainPage.style.tsx +0 -8
- package/src/pages/SelectNativeTokenPage.tsx +0 -47
- package/src/pages/SelectTokenPage/SearchTokenInput.style.tsx +0 -6
- package/src/pages/SelectTokenPage/types.ts +0 -4
- package/src/providers/WidgetProvider/utils.ts +0 -26
- package/src/stores/form/useFieldController.ts +0 -31
- package/src/stores/form/useValidation.ts +0 -15
- package/src/stores/form/useValidationActions.ts +0 -12
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Box,
|
|
1
|
+
import { Box, styled } from '@mui/material'
|
|
2
2
|
import { cardClasses } from '@mui/material/Card'
|
|
3
3
|
import { ButtonTertiary } from '../ButtonTertiary.js'
|
|
4
4
|
|
|
@@ -67,9 +67,3 @@ export const MaxButton = styled(ButtonTertiary)(({ theme }) => ({
|
|
|
67
67
|
},
|
|
68
68
|
},
|
|
69
69
|
}))
|
|
70
|
-
|
|
71
|
-
export const MaxButtonSkeleton = styled(Skeleton)(({ theme }) => ({
|
|
72
|
-
width: 46,
|
|
73
|
-
height: 24,
|
|
74
|
-
borderRadius: theme.vars.shape.borderRadiusSecondary,
|
|
75
|
-
}))
|
|
@@ -45,7 +45,7 @@ export const TokenAvatar: React.FC<{
|
|
|
45
45
|
)
|
|
46
46
|
}
|
|
47
47
|
|
|
48
|
-
|
|
48
|
+
const TokenAvatarFallback: React.FC<{
|
|
49
49
|
token?: StaticToken
|
|
50
50
|
isLoading?: boolean
|
|
51
51
|
sx?: SxProps<Theme>
|
|
@@ -69,7 +69,7 @@ export const TokenAvatarFallback: React.FC<{
|
|
|
69
69
|
)
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
const TokenAvatarBase: React.FC<{
|
|
73
73
|
token?: StaticToken
|
|
74
74
|
chain?: Chain
|
|
75
75
|
isLoading?: boolean
|
|
@@ -15,14 +15,6 @@ export const CardRowButton = styled(ButtonBase)(({ theme }) => ({
|
|
|
15
15
|
borderRadius: theme.vars.shape.borderRadius,
|
|
16
16
|
}))
|
|
17
17
|
|
|
18
|
-
export const CardRowContainer = styled(Box)(({ theme }) => ({
|
|
19
|
-
display: 'flex',
|
|
20
|
-
width: '100%',
|
|
21
|
-
justifyContent: 'space-between',
|
|
22
|
-
alignItems: 'center',
|
|
23
|
-
padding: theme.spacing(2),
|
|
24
|
-
}))
|
|
25
|
-
|
|
26
18
|
export const CardValue = styled(Typography)({
|
|
27
19
|
lineHeight: '1.25',
|
|
28
20
|
fontWeight: 500,
|
|
@@ -5,7 +5,7 @@ import { useTranslation } from 'react-i18next'
|
|
|
5
5
|
import type { FeesBreakdown } from '../utils/fees.js'
|
|
6
6
|
import { formatTokenAmount } from '../utils/format.js'
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
interface FeeBreakdownTooltipProps {
|
|
9
9
|
gasCosts?: FeesBreakdown[]
|
|
10
10
|
feeCosts?: FeesBreakdown[]
|
|
11
11
|
relayerSupport?: boolean
|
|
@@ -49,10 +49,7 @@ export const FeeBreakdownTooltip: React.FC<FeeBreakdownTooltipProps> = ({
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
53
|
-
fees: FeesBreakdown[],
|
|
54
|
-
t: TFunction
|
|
55
|
-
) =>
|
|
52
|
+
const getFeeBreakdownTypography = (fees: FeesBreakdown[], t: TFunction) =>
|
|
56
53
|
fees.map((fee, index) => (
|
|
57
54
|
<Typography
|
|
58
55
|
color="inherit"
|
|
@@ -9,7 +9,7 @@ import { Container } from './Header.style.js'
|
|
|
9
9
|
import { NavigationHeader } from './NavigationHeader.js'
|
|
10
10
|
import { WalletHeader } from './WalletHeader.js'
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const HeaderContainer: FC<PropsWithChildren> = ({ children }) => {
|
|
13
13
|
const { pathname } = useLocation()
|
|
14
14
|
const elementId = useDefaultElementId()
|
|
15
15
|
const headerRef = useRef<HTMLDivElement>(null)
|
|
@@ -50,7 +50,7 @@ export const WalletHeader: React.FC = () => {
|
|
|
50
50
|
) : null
|
|
51
51
|
}
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
const WalletMenuButton: React.FC = () => {
|
|
54
54
|
const { variant, hiddenUI } = useWidgetConfig()
|
|
55
55
|
const { account, accounts } = useAccount()
|
|
56
56
|
|
|
@@ -133,7 +133,6 @@ export const SendToWalletButton: React.FC<CardProps> = (props) => {
|
|
|
133
133
|
mountOnEnter
|
|
134
134
|
unmountOnExit
|
|
135
135
|
>
|
|
136
|
-
{/** biome-ignore lint/a11y/useSemanticElements: allowed in react */}
|
|
137
136
|
<Card
|
|
138
137
|
role="button"
|
|
139
138
|
onClick={disabledForChanges ? undefined : handleOnClick}
|
|
@@ -120,7 +120,7 @@ export const StepActions: React.FC<StepActionsProps> = ({
|
|
|
120
120
|
)
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
|
|
123
|
+
const IncludedSteps: React.FC<IncludedStepsProps> = ({ step }) => {
|
|
124
124
|
const { subvariant, subvariantOptions, feeConfig, hiddenUI } =
|
|
125
125
|
useWidgetConfig()
|
|
126
126
|
|
|
@@ -211,7 +211,7 @@ export const IncludedSteps: React.FC<IncludedStepsProps> = ({ step }) => {
|
|
|
211
211
|
)
|
|
212
212
|
}
|
|
213
213
|
|
|
214
|
-
|
|
214
|
+
const StepDetailsContent: React.FC<{
|
|
215
215
|
step: StepExtended
|
|
216
216
|
}> = ({ step }) => {
|
|
217
217
|
const { t } = useTranslation()
|
|
@@ -293,7 +293,7 @@ export const StepDetailsContent: React.FC<{
|
|
|
293
293
|
)
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
-
|
|
296
|
+
const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps> = ({
|
|
297
297
|
step,
|
|
298
298
|
subvariant,
|
|
299
299
|
subvariantOptions,
|
|
@@ -325,7 +325,7 @@ export const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps> = ({
|
|
|
325
325
|
)
|
|
326
326
|
}
|
|
327
327
|
|
|
328
|
-
|
|
328
|
+
const BridgeStepDetailsLabel: React.FC<
|
|
329
329
|
Omit<StepDetailsLabelProps, 'variant'>
|
|
330
330
|
> = ({ step }) => {
|
|
331
331
|
const { t } = useTranslation()
|
|
@@ -341,7 +341,7 @@ export const BridgeStepDetailsLabel: React.FC<
|
|
|
341
341
|
)
|
|
342
342
|
}
|
|
343
343
|
|
|
344
|
-
|
|
344
|
+
const SwapStepDetailsLabel: React.FC<
|
|
345
345
|
Omit<StepDetailsLabelProps, 'variant'>
|
|
346
346
|
> = ({ step }) => {
|
|
347
347
|
const { t } = useTranslation()
|
|
@@ -356,7 +356,7 @@ export const SwapStepDetailsLabel: React.FC<
|
|
|
356
356
|
)
|
|
357
357
|
}
|
|
358
358
|
|
|
359
|
-
|
|
359
|
+
const ProtocolStepDetailsLabel: React.FC<
|
|
360
360
|
Omit<StepDetailsLabelProps, 'variant'>
|
|
361
361
|
> = ({ step, feeConfig, relayerSupport }) => {
|
|
362
362
|
const { t } = useTranslation()
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import AccessTimeFilled from '@mui/icons-material/AccessTimeFilled'
|
|
2
|
-
import { Tooltip } from '@mui/material'
|
|
3
|
-
import { Box } from '@mui/system'
|
|
2
|
+
import { Box, Tooltip } from '@mui/material'
|
|
4
3
|
import type { FC, PropsWithChildren } from 'react'
|
|
5
4
|
import { useTranslation } from 'react-i18next'
|
|
6
5
|
import { IconTypography } from '../IconTypography.js'
|
|
@@ -30,7 +30,7 @@ export const Token: FC<TokenProps & BoxProps> = ({ token, ...other }) => {
|
|
|
30
30
|
return <TokenBase token={token} {...other} />
|
|
31
31
|
}
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
const TokenFallback: FC<TokenProps & BoxProps> = ({
|
|
34
34
|
token,
|
|
35
35
|
isLoading,
|
|
36
36
|
...other
|
|
@@ -49,7 +49,7 @@ export const TokenFallback: FC<TokenProps & BoxProps> = ({
|
|
|
49
49
|
)
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
|
|
52
|
+
const TokenBase: FC<TokenProps & BoxProps> = ({
|
|
53
53
|
token,
|
|
54
54
|
impactToken,
|
|
55
55
|
enableImpactTokenTooltip,
|
|
@@ -62,24 +62,22 @@ export const TokenListItem: React.FC<TokenListItemProps> = memo(
|
|
|
62
62
|
}
|
|
63
63
|
)
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
const [isImageLoading, setIsImageLoading] = useState(true)
|
|
65
|
+
const TokenListItemAvatar = memo(({ token }: TokenListItemAvatarProps) => {
|
|
66
|
+
const [isImageLoading, setIsImageLoading] = useState(true)
|
|
68
67
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
)
|
|
68
|
+
return (
|
|
69
|
+
<Avatar
|
|
70
|
+
src={token.logoURI}
|
|
71
|
+
alt={token.symbol}
|
|
72
|
+
sx={(theme) =>
|
|
73
|
+
isImageLoading ? { bgcolor: theme.vars.palette.grey[300] } : null
|
|
74
|
+
}
|
|
75
|
+
onLoad={() => setIsImageLoading(false)}
|
|
76
|
+
>
|
|
77
|
+
{token.symbol?.[0]}
|
|
78
|
+
</Avatar>
|
|
79
|
+
)
|
|
80
|
+
})
|
|
83
81
|
|
|
84
82
|
interface OpenTokenDetailsButtonProps {
|
|
85
83
|
tokenAddress: string | undefined
|
|
@@ -115,7 +113,7 @@ const OpenTokenDetailsButton = ({
|
|
|
115
113
|
)
|
|
116
114
|
}
|
|
117
115
|
|
|
118
|
-
|
|
116
|
+
const TokenListItemButton: React.FC<TokenListItemButtonProps> = memo(
|
|
119
117
|
({
|
|
120
118
|
onClick,
|
|
121
119
|
token,
|
|
@@ -373,7 +371,7 @@ export const TokenListItemSkeleton = () => {
|
|
|
373
371
|
)
|
|
374
372
|
}
|
|
375
373
|
|
|
376
|
-
|
|
374
|
+
const TokenAmountSkeleton: React.FC = () => {
|
|
377
375
|
return (
|
|
378
376
|
<Box
|
|
379
377
|
sx={{
|
|
@@ -10,11 +10,6 @@ import { useSplitSubvariantStore } from '../../stores/settings/useSplitSubvarian
|
|
|
10
10
|
import { WidgetEvent } from '../../types/events.js'
|
|
11
11
|
import type { DisabledUI } from '../../types/widget.js'
|
|
12
12
|
|
|
13
|
-
export type UseTokenSelectArgs = {
|
|
14
|
-
formType: FormType
|
|
15
|
-
onClick?: () => void
|
|
16
|
-
}
|
|
17
|
-
|
|
18
13
|
export const useTokenSelect = (formType: FormType, onClick?: () => void) => {
|
|
19
14
|
const { subvariant, disabledUI } = useWidgetConfig()
|
|
20
15
|
const splitSubvariant = useSplitSubvariantStore((store) => store.state)
|
|
@@ -56,7 +56,6 @@ export const TokenRate: React.FC<TokenRateProps> = ({ route }) => {
|
|
|
56
56
|
: `1 ${toToken.symbol} ≈ ${t('format.tokenAmount', { value: toFromRate })} ${fromToken.symbol}`
|
|
57
57
|
|
|
58
58
|
return (
|
|
59
|
-
// biome-ignore lint/a11y/useSemanticElements: allowed in react
|
|
60
59
|
<TokenRateTypography onClick={toggleRate} role="button">
|
|
61
60
|
{rateText}
|
|
62
61
|
</TokenRateTypography>
|
|
@@ -102,7 +102,6 @@ export const TransactionDetails: React.FC<TransactionDetailsProps> = ({
|
|
|
102
102
|
feeCosts={feeCosts}
|
|
103
103
|
relayerSupport={hasRelayerSupport}
|
|
104
104
|
>
|
|
105
|
-
{/** biome-ignore lint/a11y/useSemanticElements: allowed in react */}
|
|
106
105
|
<Box
|
|
107
106
|
onClick={toggleCard}
|
|
108
107
|
role="button"
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '3.30.
|
|
2
|
+
export const version = '3.30.1'
|
package/src/hooks/timer/time.ts
CHANGED
|
@@ -8,16 +8,6 @@ export type TimeFromMillisecondsType = {
|
|
|
8
8
|
days: number
|
|
9
9
|
}
|
|
10
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
11
|
export function getTimeFromMilliseconds(
|
|
22
12
|
millisecs: number,
|
|
23
13
|
isCountDown = true
|
|
@@ -9,14 +9,14 @@ import { validateExpiryTimestamp, validateOnExpire } from './validate.js'
|
|
|
9
9
|
|
|
10
10
|
const SECOND_INTERVAL = 1000
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
type useTimerSettingsType = {
|
|
13
13
|
expiryTimestamp: Date
|
|
14
14
|
onExpire?: () => void
|
|
15
15
|
autoStart?: boolean
|
|
16
16
|
interval?: number
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
|
|
19
|
+
type useTimerResultType = TimeFromMillisecondsType & {
|
|
20
20
|
start: () => void
|
|
21
21
|
pause: () => void
|
|
22
22
|
resume: () => void
|
|
@@ -16,7 +16,7 @@ export const useAccountsBalancesData = (
|
|
|
16
16
|
|
|
17
17
|
// Filter out EVM tokens that do not have balances
|
|
18
18
|
const { data: filteredTokens, isLoading: isCachedBalancesLoading } =
|
|
19
|
-
useFilteredTokensByBalance(accountsWithTokens)
|
|
19
|
+
useFilteredTokensByBalance(accountsWithTokens, formType)
|
|
20
20
|
|
|
21
21
|
return {
|
|
22
22
|
data: filteredTokens,
|
|
@@ -6,7 +6,7 @@ import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
|
6
6
|
import { getConfigItemSets, isItemAllowedForSets } from '../utils/item.js'
|
|
7
7
|
import { getQueryKey } from '../utils/queries.js'
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
type GetChainById = (
|
|
10
10
|
chainId?: number,
|
|
11
11
|
chains?: ExtendedChain[]
|
|
12
12
|
) => ExtendedChain | undefined
|
package/src/hooks/useExplorer.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
|
7
7
|
|
|
8
8
|
const sanitiseBaseUrl = (baseUrl: string) => baseUrl.trim().replace(/\/+$/, '')
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type TransactionLinkProps = { chain?: Chain | number } & (
|
|
11
11
|
| {
|
|
12
12
|
txHash: string
|
|
13
13
|
txLink?: never
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import {
|
|
2
|
+
type BaseToken,
|
|
2
3
|
ChainType,
|
|
3
4
|
getWalletBalances,
|
|
4
5
|
type TokenExtended,
|
|
@@ -6,14 +7,20 @@ import {
|
|
|
6
7
|
} from '@lifi/sdk'
|
|
7
8
|
import { useQuery } from '@tanstack/react-query'
|
|
8
9
|
import { useMemo } from 'react'
|
|
10
|
+
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
11
|
+
import type { FormType } from '../stores/form/types.js'
|
|
12
|
+
import { getConfigItemSets, isFormItemAllowed } from '../utils/item.js'
|
|
9
13
|
import { isSupportedToken } from '../utils/tokenList.js'
|
|
10
14
|
|
|
11
15
|
export const useFilteredTokensByBalance = (
|
|
12
16
|
accountsWithTokens?: Record<
|
|
13
17
|
string,
|
|
14
18
|
{ chainType: ChainType; tokens: Record<number, TokenExtended[]> }
|
|
15
|
-
|
|
19
|
+
>,
|
|
20
|
+
formType?: FormType
|
|
16
21
|
) => {
|
|
22
|
+
const { tokens: configTokens } = useWidgetConfig()
|
|
23
|
+
|
|
17
24
|
const evmAddress = useMemo(() => {
|
|
18
25
|
const evmAccount = Object.entries(accountsWithTokens ?? {}).find(
|
|
19
26
|
([_, { chainType }]) => chainType === ChainType.EVM
|
|
@@ -75,10 +82,32 @@ export const useFilteredTokensByBalance = (
|
|
|
75
82
|
const chainTokenSet = new Set(
|
|
76
83
|
chainTokens.map((token) => token.address.toLowerCase())
|
|
77
84
|
)
|
|
85
|
+
|
|
86
|
+
// Get allowed addresses from config tokens
|
|
87
|
+
const allowedAddressesConfig = getConfigItemSets(
|
|
88
|
+
configTokens,
|
|
89
|
+
(tokens: BaseToken[]) =>
|
|
90
|
+
new Set(
|
|
91
|
+
tokens
|
|
92
|
+
.filter((t) => Number(t.chainId) === chainId)
|
|
93
|
+
.map((t) => t.address.toLowerCase())
|
|
94
|
+
),
|
|
95
|
+
formType
|
|
96
|
+
)
|
|
97
|
+
|
|
78
98
|
const additionalTokens = balances.filter(
|
|
79
99
|
(balance: WalletTokenExtended) => {
|
|
80
100
|
const balanceKey = balance.address.toLowerCase()
|
|
81
|
-
return
|
|
101
|
+
return (
|
|
102
|
+
!chainTokenSet.has(balanceKey) &&
|
|
103
|
+
isSupportedToken(balance) &&
|
|
104
|
+
isFormItemAllowed(
|
|
105
|
+
balance,
|
|
106
|
+
allowedAddressesConfig,
|
|
107
|
+
formType,
|
|
108
|
+
(t) => t.address.toLowerCase()
|
|
109
|
+
)
|
|
110
|
+
)
|
|
82
111
|
}
|
|
83
112
|
) as TokenExtended[]
|
|
84
113
|
|
|
@@ -95,7 +124,7 @@ export const useFilteredTokensByBalance = (
|
|
|
95
124
|
}
|
|
96
125
|
|
|
97
126
|
return result
|
|
98
|
-
}, [accountsWithTokens, existingBalances])
|
|
127
|
+
}, [accountsWithTokens, existingBalances, configTokens, formType])
|
|
99
128
|
|
|
100
129
|
return { data: accountsWithFilteredTokens, isLoading }
|
|
101
130
|
}
|
|
@@ -51,8 +51,8 @@ interface UseContentHeightProps {
|
|
|
51
51
|
headerRef?: RefObject<HTMLElement | null>
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
54
|
+
const defaultMinListHeight = 360
|
|
55
|
+
const minMobileListHeight = 160
|
|
56
56
|
|
|
57
57
|
// NOTE: this hook is implicitly tied to the widget height functionality in the
|
|
58
58
|
// AppExpandedContainer, RelativeContainer and CssBaselineContainer components as defined in AppContainer.ts
|
package/src/hooks/useRoutes.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
getContractCallsQuote,
|
|
6
6
|
getRelayerQuote,
|
|
7
7
|
getRoutes,
|
|
8
|
+
isGaslessStep,
|
|
8
9
|
isRelayerStep,
|
|
9
10
|
LiFiErrorCode,
|
|
10
11
|
} from '@lifi/sdk'
|
|
@@ -331,8 +332,9 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
|
|
|
331
332
|
return
|
|
332
333
|
}
|
|
333
334
|
|
|
334
|
-
const isObservableRelayerRoute =
|
|
335
|
-
|
|
335
|
+
const isObservableRelayerRoute = observableRoute?.steps?.some(
|
|
336
|
+
(step) => isRelayerStep(step) && isGaslessStep(step, fromChain)
|
|
337
|
+
)
|
|
336
338
|
|
|
337
339
|
const shouldUseMainRoutes =
|
|
338
340
|
!observableRoute || !isObservableRelayerRoute
|
|
@@ -7,7 +7,7 @@ import { useSendToWalletActions } from '../stores/settings/useSendToWalletStore.
|
|
|
7
7
|
import { getChainTypeFromAddress } from '../utils/chainType.js'
|
|
8
8
|
import { useAvailableChains } from './useAvailableChains.js'
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
type UpdateToAddressArgs = {
|
|
11
11
|
formType: FormType
|
|
12
12
|
selectedToAddress?: string
|
|
13
13
|
selectedChainId?: number
|
package/src/hooks/useToken.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { useMemo } from 'react'
|
|
1
2
|
import { useTokenSearch } from './useTokenSearch.js'
|
|
2
3
|
import { useTokens } from './useTokens.js'
|
|
3
4
|
|
|
@@ -8,10 +9,15 @@ export const useToken = (
|
|
|
8
9
|
) => {
|
|
9
10
|
const { allTokens, isLoading: isTokensLoading } = useTokens()
|
|
10
11
|
|
|
11
|
-
const token =
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
12
|
+
const token = useMemo(
|
|
13
|
+
() =>
|
|
14
|
+
chainId && tokenAddress
|
|
15
|
+
? allTokens?.[chainId]?.find(
|
|
16
|
+
(t) => t.address.toLowerCase() === tokenAddress.toLowerCase()
|
|
17
|
+
)
|
|
18
|
+
: undefined,
|
|
19
|
+
[allTokens, chainId, tokenAddress]
|
|
20
|
+
)
|
|
15
21
|
|
|
16
22
|
const tokenSearchEnabled =
|
|
17
23
|
!!chainId && !!tokenAddress && (latest || (!isTokensLoading && !token))
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { TokenAmount } from '@lifi/sdk'
|
|
1
2
|
import { useAccount } from '@lifi/wallet-management'
|
|
2
3
|
import { useChain } from './useChain.js'
|
|
3
4
|
import { useToken } from './useToken.js'
|
|
@@ -18,7 +19,7 @@ export const useTokenAddressBalance = (
|
|
|
18
19
|
} = useTokenBalance(account?.address, token)
|
|
19
20
|
|
|
20
21
|
return {
|
|
21
|
-
token: tokenBalance,
|
|
22
|
+
token: tokenBalance ?? (token as TokenAmount),
|
|
22
23
|
chain,
|
|
23
24
|
isLoading: isBalanceLoading || isChainLoading || isTokenLoading,
|
|
24
25
|
refetch,
|
|
@@ -16,7 +16,7 @@ export const useTokenBalances = (
|
|
|
16
16
|
allTokens,
|
|
17
17
|
isLoading: isTokensLoading,
|
|
18
18
|
isSearchLoading,
|
|
19
|
-
} = useTokens(formType, search)
|
|
19
|
+
} = useTokens(formType, search, isAllNetworks ? undefined : selectedChainId)
|
|
20
20
|
|
|
21
21
|
const { data: accountsWithAllTokens, isLoading: isAccountsLoading } =
|
|
22
22
|
useAccountsBalancesData(selectedChainId, formType, isAllNetworks, allTokens)
|
|
@@ -35,18 +35,15 @@ export const useTokenSearch = (
|
|
|
35
35
|
new Set(
|
|
36
36
|
tokens
|
|
37
37
|
.filter((t) => t.chainId === token.chainId)
|
|
38
|
-
.map((t) => t.address)
|
|
38
|
+
.map((t) => t.address.toLowerCase())
|
|
39
39
|
),
|
|
40
40
|
formType
|
|
41
41
|
)
|
|
42
42
|
|
|
43
43
|
// Return undefined if the token is denied
|
|
44
44
|
if (
|
|
45
|
-
!isFormItemAllowed(
|
|
46
|
-
|
|
47
|
-
filteredConfigTokens,
|
|
48
|
-
formType,
|
|
49
|
-
(t) => t.address
|
|
45
|
+
!isFormItemAllowed(token, filteredConfigTokens, formType, (t) =>
|
|
46
|
+
t.address.toLowerCase()
|
|
50
47
|
)
|
|
51
48
|
) {
|
|
52
49
|
return undefined
|
|
@@ -58,7 +55,7 @@ export const useTokenSearch = (
|
|
|
58
55
|
if (
|
|
59
56
|
data &&
|
|
60
57
|
!data.tokens[chainId as number]?.some(
|
|
61
|
-
(t) => t.address === token.address
|
|
58
|
+
(t) => t.address.toLowerCase() === token.address.toLowerCase()
|
|
62
59
|
)
|
|
63
60
|
) {
|
|
64
61
|
const clonedData = { ...data, tokens: { ...data.tokens } }
|