@lifi/widget 2.0.0-beta.7 → 2.0.0-beta.8
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/App.d.ts +1 -1
- package/AppDrawer.d.ts +1 -1
- package/cjs/App.d.ts +1 -1
- package/cjs/AppDrawer.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
- package/cjs/components/Header/Header.style.d.ts +10 -3
- package/cjs/components/Header/NavigationHeader.js +1 -1
- package/cjs/components/Header/NavigationTabs.d.ts +1 -1
- package/cjs/components/Header/NavigationTabs.style.d.ts +4 -71
- package/cjs/components/Header/WalletHeader.js +1 -1
- package/cjs/components/SelectChainAndToken.js +8 -7
- package/cjs/components/SendToWallet/SendToWallet.js +2 -2
- package/cjs/components/SmallAvatar.d.ts +1 -1
- package/cjs/components/Step/CircularProgress.d.ts +1 -1
- package/cjs/components/Step/Step.js +1 -1
- package/cjs/components/Step/StepList.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
- package/cjs/components/TokenList/TokenList.js +5 -2
- package/cjs/components/TokenList/TokenList.style.d.ts +5 -2
- package/cjs/components/TokenList/TokenList.style.js +20 -1
- package/cjs/components/TokenList/TokenListItem.d.ts +1 -1
- package/cjs/components/TokenList/TokenListItem.js +27 -4
- package/cjs/components/TokenList/VirtualizedTokenList.js +3 -3
- package/cjs/components/TokenList/types.d.ts +4 -0
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useFundsSufficiency.js +2 -2
- package/cjs/hooks/useGasRefuel.d.ts +1 -1
- package/cjs/hooks/useGasRefuel.js +5 -15
- package/cjs/hooks/useGasSufficiency.js +2 -2
- package/cjs/hooks/useRouteExecution.js +3 -3
- package/cjs/hooks/useSwapRoutes.js +4 -4
- package/cjs/hooks/useTokenBalance.js +2 -2
- package/cjs/i18n/en.json +1 -1
- package/cjs/icons/InsuraceLogo.d.ts +1 -1
- package/cjs/icons/LiFiFullLogo.d.ts +1 -1
- package/cjs/icons/LiFiLogo.d.ts +1 -1
- package/cjs/icons/LiFiToolLogo.d.ts +1 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.js +3 -3
- package/cjs/providers/WalletProvider/WalletProvider.js +73 -47
- package/cjs/providers/WalletProvider/types.d.ts +0 -2
- package/cjs/stores/routes/RouteExecutionStore.d.ts +1 -1
- package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/cjs/types/widget.d.ts +1 -0
- package/cjs/types/widget.js +1 -0
- package/cjs/utils/wallet.d.ts +1 -1
- package/cjs/utils/wallet.js +3 -3
- package/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
- package/components/Header/Header.style.d.ts +10 -3
- package/components/Header/NavigationHeader.js +1 -1
- package/components/Header/NavigationTabs.d.ts +1 -1
- package/components/Header/NavigationTabs.style.d.ts +4 -71
- package/components/Header/WalletHeader.js +2 -2
- package/components/SelectChainAndToken.js +9 -8
- package/components/SendToWallet/SendToWallet.js +2 -2
- package/components/SmallAvatar.d.ts +1 -1
- package/components/Step/CircularProgress.d.ts +1 -1
- package/components/Step/Step.js +2 -2
- package/components/Step/StepList.d.ts +1 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
- package/components/TokenList/TokenList.js +6 -3
- package/components/TokenList/TokenList.style.d.ts +5 -2
- package/components/TokenList/TokenList.style.js +21 -2
- package/components/TokenList/TokenListItem.d.ts +1 -1
- package/components/TokenList/TokenListItem.js +31 -8
- package/components/TokenList/VirtualizedTokenList.js +3 -3
- package/components/TokenList/types.d.ts +4 -0
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useFundsSufficiency.js +2 -2
- package/hooks/useGasRefuel.d.ts +1 -1
- package/hooks/useGasRefuel.js +5 -15
- package/hooks/useGasSufficiency.js +2 -2
- package/hooks/useRouteExecution.js +3 -3
- package/hooks/useSwapRoutes.js +4 -4
- package/hooks/useTokenBalance.js +2 -2
- package/i18n/en.json +1 -1
- package/icons/InsuraceLogo.d.ts +1 -1
- package/icons/LiFiFullLogo.d.ts +1 -1
- package/icons/LiFiLogo.d.ts +1 -1
- package/icons/LiFiToolLogo.d.ts +1 -1
- package/package.json +6 -6
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
- package/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
- package/pages/SettingsPage/SettingsPage.d.ts +1 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
- package/pages/SettingsPage/SlippageInput.d.ts +1 -1
- package/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
- package/pages/SwapPage/StatusBottomSheet.js +4 -4
- package/providers/WalletProvider/WalletProvider.js +74 -48
- package/providers/WalletProvider/types.d.ts +0 -2
- package/stores/routes/RouteExecutionStore.d.ts +1 -1
- package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
- package/types/widget.js +1 -0
- package/utils/wallet.d.ts +1 -1
- package/utils/wallet.js +1 -1
|
@@ -4,10 +4,10 @@ import { useWatch } from 'react-hook-form';
|
|
|
4
4
|
import { ReverseTokensButton } from '../components/ReverseTokensButton';
|
|
5
5
|
import { SelectTokenButton } from '../components/SelectTokenButton';
|
|
6
6
|
import { SwapFormKey, useWidgetConfig } from '../providers';
|
|
7
|
-
import { DisabledUI } from '../types';
|
|
7
|
+
import { DisabledUI, HiddenUI } from '../types';
|
|
8
8
|
export const SelectChainAndToken = (props) => {
|
|
9
9
|
const prefersNarrowView = useMediaQuery((theme) => theme.breakpoints.down('sm'));
|
|
10
|
-
const { disabledUI, variant } = useWidgetConfig();
|
|
10
|
+
const { disabledUI, hiddenUI, variant } = useWidgetConfig();
|
|
11
11
|
const [fromChain, toChain, fromToken, toToken] = useWatch({
|
|
12
12
|
name: [
|
|
13
13
|
SwapFormKey.FromChain,
|
|
@@ -16,19 +16,20 @@ export const SelectChainAndToken = (props) => {
|
|
|
16
16
|
SwapFormKey.ToToken,
|
|
17
17
|
],
|
|
18
18
|
});
|
|
19
|
-
const
|
|
19
|
+
const hiddenReverse = variant === 'refuel' ||
|
|
20
20
|
disabledUI?.includes(DisabledUI.FromToken) ||
|
|
21
|
-
disabledUI?.includes(DisabledUI.ToToken)
|
|
22
|
-
|
|
21
|
+
disabledUI?.includes(DisabledUI.ToToken) ||
|
|
22
|
+
hiddenUI?.includes(HiddenUI.ToToken);
|
|
23
|
+
const hiddenToToken = variant === 'nft' || hiddenUI?.includes(HiddenUI.ToToken);
|
|
23
24
|
const isCompact = fromChain &&
|
|
24
25
|
toChain &&
|
|
25
26
|
fromToken &&
|
|
26
27
|
toToken &&
|
|
27
28
|
!prefersNarrowView &&
|
|
28
|
-
!
|
|
29
|
-
return (_jsxs(Box, { sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' }, ...props, children: [_jsx(SelectTokenButton, { formType: "from", compact: isCompact }), !
|
|
29
|
+
!hiddenToToken;
|
|
30
|
+
return (_jsxs(Box, { sx: { display: 'flex', flexDirection: isCompact ? 'row' : 'column' }, ...props, children: [_jsx(SelectTokenButton, { formType: "from", compact: isCompact }), !hiddenToToken ? (_jsx(Box, { sx: {
|
|
30
31
|
display: 'flex',
|
|
31
32
|
justifyContent: 'center',
|
|
32
33
|
alignItems: 'center',
|
|
33
|
-
}, m: !
|
|
34
|
+
}, m: !hiddenReverse ? -1.125 : 1, children: !hiddenReverse ? (_jsx(ReverseTokensButton, { vertical: !isCompact })) : null })) : null, !hiddenToToken ? (_jsx(SelectTokenButton, { formType: "to", compact: isCompact })) : null] }));
|
|
34
35
|
};
|
|
@@ -12,7 +12,7 @@ import { FormControl, Input } from './SendToWallet.style';
|
|
|
12
12
|
export const SendToWallet = forwardRef((props, ref) => {
|
|
13
13
|
const { t } = useTranslation();
|
|
14
14
|
const { trigger, getValues, clearErrors } = useFormContext();
|
|
15
|
-
const { account
|
|
15
|
+
const { account } = useWallet();
|
|
16
16
|
const { disabledUI, hiddenUI, requiredUI, toAddress } = useWidgetConfig();
|
|
17
17
|
const { showSendToWallet, showSendToWalletDirty, setSendToWallet } = useSendToWalletStore();
|
|
18
18
|
const { showDestinationWallet } = useSettings(['showDestinationWallet']);
|
|
@@ -30,7 +30,7 @@ export const SendToWallet = forwardRef((props, ref) => {
|
|
|
30
30
|
if (!value) {
|
|
31
31
|
return true;
|
|
32
32
|
}
|
|
33
|
-
const address = await provider?.resolveName(value);
|
|
33
|
+
const address = await account.signer?.provider?.resolveName(value);
|
|
34
34
|
return (isAddress(address || value) ||
|
|
35
35
|
t('swap.error.title.walletAddressInvalid'));
|
|
36
36
|
}
|
|
@@ -33,4 +33,4 @@ export declare const SmallAvatarSkeletonContainer: import("@emotion/styled").Sty
|
|
|
33
33
|
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
34
34
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
35
35
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
36
|
-
export declare const SmallAvatarSkeleton: () => JSX.Element;
|
|
36
|
+
export declare const SmallAvatarSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
package/components/Step/Step.js
CHANGED
|
@@ -6,7 +6,7 @@ import { StepActions } from '../../components/StepActions';
|
|
|
6
6
|
import { Token } from '../../components/Token';
|
|
7
7
|
import { useChains } from '../../hooks';
|
|
8
8
|
import { useWidgetConfig } from '../../providers';
|
|
9
|
-
import {
|
|
9
|
+
import { shortenAddress } from '../../utils';
|
|
10
10
|
import { DestinationWalletAddress } from './DestinationWalletAddress';
|
|
11
11
|
import { GasStepProcess } from './GasStepProcess';
|
|
12
12
|
import { StepProcess } from './StepProcess';
|
|
@@ -40,7 +40,7 @@ export const Step = ({ step, fromToken, toToken, toAddress }) => {
|
|
|
40
40
|
: t('swap.stepSwap');
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
|
-
const formattedToAddress =
|
|
43
|
+
const formattedToAddress = shortenAddress(toAddress);
|
|
44
44
|
const toAddressLink = toAddress
|
|
45
45
|
? `${getChainById(step.action.toChainId)?.metamask.blockExplorerUrls[0]}address/${toAddress}`
|
|
46
46
|
: undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Route } from '@lifi/sdk';
|
|
2
|
-
export declare const getStepList: (route?: Route) => JSX.Element[] | undefined;
|
|
2
|
+
export declare const getStepList: (route?: Route) => import("react/jsx-runtime").JSX.Element[] | undefined;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SwapFormTypeProps } from '../../providers';
|
|
2
|
-
export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => JSX.Element;
|
|
2
|
+
export declare const SwapInputEndAdornment: ({ formType }: SwapFormTypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const SwapRoutesExpanded: () => JSX.Element;
|
|
2
|
-
export declare const SwapRoutesExpandedElement: () => JSX.Element;
|
|
1
|
+
export declare const SwapRoutesExpanded: () => import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare const SwapRoutesExpandedElement: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { Box } from '@mui/material';
|
|
3
3
|
import { useRef } from 'react';
|
|
4
4
|
import { useWatch } from 'react-hook-form';
|
|
5
|
-
import { useDebouncedWatch, useTokenBalances, useTokenSearch, } from '../../hooks';
|
|
5
|
+
import { useChain, useDebouncedWatch, useTokenBalances, useTokenSearch, } from '../../hooks';
|
|
6
6
|
import { SwapFormKey, SwapFormKeyHelper, useWallet } from '../../providers';
|
|
7
7
|
import { TokenNotFound } from './TokenNotFound';
|
|
8
8
|
import { VirtualizedTokenList } from './VirtualizedTokenList';
|
|
@@ -14,6 +14,7 @@ export const TokenList = ({ formType, height, onClick, }) => {
|
|
|
14
14
|
name: [SwapFormKeyHelper.getChainKey(formType)],
|
|
15
15
|
});
|
|
16
16
|
const [tokenSearchFilter] = useDebouncedWatch([SwapFormKey.TokenSearchFilter], 320);
|
|
17
|
+
const { chain, isLoading: isChainLoading } = useChain(selectedChainId);
|
|
17
18
|
const { tokens: chainTokens, tokensWithBalance, isLoading: isTokensLoading, isBalanceLoading, featuredTokens, } = useTokenBalances(selectedChainId);
|
|
18
19
|
let filteredTokens = (tokensWithBalance ??
|
|
19
20
|
chainTokens ??
|
|
@@ -29,12 +30,14 @@ export const TokenList = ({ formType, height, onClick, }) => {
|
|
|
29
30
|
!!tokenSearchFilter &&
|
|
30
31
|
!!selectedChainId;
|
|
31
32
|
const { token: searchedToken, isLoading: isSearchedTokenLoading } = useTokenSearch(selectedChainId, tokenSearchFilter, tokenSearchEnabled);
|
|
32
|
-
const isLoading = isTokensLoading ||
|
|
33
|
+
const isLoading = isTokensLoading ||
|
|
34
|
+
isChainLoading ||
|
|
35
|
+
(tokenSearchEnabled && isSearchedTokenLoading);
|
|
33
36
|
const tokens = filteredTokens.length
|
|
34
37
|
? filteredTokens
|
|
35
38
|
: searchedToken
|
|
36
39
|
? [searchedToken]
|
|
37
40
|
: filteredTokens;
|
|
38
41
|
const handleTokenClick = useTokenSelect(formType, onClick);
|
|
39
|
-
return (_jsxs(Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? (_jsx(TokenNotFound, { formType: formType })) : null, _jsx(VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] }));
|
|
42
|
+
return (_jsxs(Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? (_jsx(TokenNotFound, { formType: formType })) : null, _jsx(VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, chain: chain, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] }));
|
|
40
43
|
};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
2
|
+
import type { StyledComponent } from '@emotion/styled';
|
|
3
|
+
import type { ButtonProps, LinkProps } from '@mui/material';
|
|
4
|
+
export declare const ListItemButton: StyledComponent<import("@mui/material").ListItemButtonBaseProps & Omit<{
|
|
3
5
|
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
4
6
|
centerRipple?: boolean | undefined;
|
|
5
7
|
children?: import("react").ReactNode;
|
|
@@ -18,7 +20,7 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
|
|
|
18
20
|
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
21
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
22
|
}, "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
|
-
export declare const ListItem:
|
|
23
|
+
export declare const ListItem: StyledComponent<{
|
|
22
24
|
button?: false | undefined;
|
|
23
25
|
} & import("@mui/material").ListItemBaseProps & {
|
|
24
26
|
components?: {
|
|
@@ -36,3 +38,4 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
|
|
|
36
38
|
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
37
39
|
ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
38
40
|
}, "button" | "className" | "style" | "classes" | "autoFocus" | "children" | "disabled" | "sx" | "alignItems" | "dense" | "divider" | "components" | "slotProps" | "slots" | "componentsProps" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
41
|
+
export declare const LinkButton: StyledComponent<ButtonProps & LinkProps>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ListItem as MuiListItem } from '@mui/material';
|
|
1
|
+
import { Button, ListItem as MuiListItem, buttonClasses } from '@mui/material';
|
|
2
2
|
import { listItemSecondaryActionClasses } from '@mui/material/ListItemSecondaryAction';
|
|
3
3
|
import { listItemTextClasses } from '@mui/material/ListItemText';
|
|
4
|
-
import { styled } from '@mui/material/styles';
|
|
4
|
+
import { alpha, styled } from '@mui/material/styles';
|
|
5
5
|
import { ListItemButton as ListItemButtonBase } from '../ListItemButton';
|
|
6
6
|
export const ListItemButton = styled(ListItemButtonBase)(({ theme }) => ({
|
|
7
7
|
paddingLeft: theme.spacing(1.5),
|
|
@@ -26,3 +26,22 @@ export const ListItem = styled(MuiListItem)(({ theme }) => ({
|
|
|
26
26
|
whiteSpace: 'nowrap',
|
|
27
27
|
},
|
|
28
28
|
}));
|
|
29
|
+
export const LinkButton = styled(Button)(({ theme }) => ({
|
|
30
|
+
lineHeight: 1,
|
|
31
|
+
fontSize: '0.75rem',
|
|
32
|
+
fontWeight: 400,
|
|
33
|
+
padding: theme.spacing(0.375, 0.75),
|
|
34
|
+
color: 'inherit',
|
|
35
|
+
backgroundColor: 'unset',
|
|
36
|
+
'&:hover': {
|
|
37
|
+
backgroundColor: theme.palette.mode === 'light'
|
|
38
|
+
? alpha(theme.palette.common.black, 0.04)
|
|
39
|
+
: alpha(theme.palette.common.white, 0.08),
|
|
40
|
+
},
|
|
41
|
+
[`.${buttonClasses.endIcon}`]: {
|
|
42
|
+
marginLeft: theme.spacing(0.25),
|
|
43
|
+
},
|
|
44
|
+
[`.${buttonClasses.endIcon} > *:nth-of-type(1)`]: {
|
|
45
|
+
fontSize: '0.75rem',
|
|
46
|
+
},
|
|
47
|
+
}));
|
|
@@ -2,5 +2,5 @@
|
|
|
2
2
|
import type { TokenListItemButtonProps, TokenListItemProps } from './types';
|
|
3
3
|
export declare const TokenListItem: React.FC<TokenListItemProps>;
|
|
4
4
|
export declare const TokenListItemButton: React.FC<TokenListItemButtonProps>;
|
|
5
|
-
export declare const TokenListItemSkeleton: () => JSX.Element;
|
|
5
|
+
export declare const TokenListItemSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const TokenAmountSkeleton: React.FC;
|
|
@@ -1,20 +1,43 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import OpenInNewIcon from '@mui/icons-material/OpenInNewRounded';
|
|
3
|
+
import { Avatar, Box, Link, ListItemAvatar, ListItemText, Skeleton, Slide, Typography, } from '@mui/material';
|
|
4
|
+
import { memo, useRef, useState } from 'react';
|
|
4
5
|
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { formatTokenPrice } from '../../utils';
|
|
6
|
-
import { ListItem, ListItemButton } from './TokenList.style';
|
|
7
|
-
export const TokenListItem = memo(({ onClick, size, start, token, showBalance, isBalanceLoading, startAdornment, endAdornment, }) => {
|
|
6
|
+
import { formatTokenPrice, shortenAddress } from '../../utils';
|
|
7
|
+
import { LinkButton, ListItem, ListItemButton } from './TokenList.style';
|
|
8
|
+
export const TokenListItem = memo(({ onClick, size, start, token, chain, showBalance, isBalanceLoading, startAdornment, endAdornment, }) => {
|
|
8
9
|
const handleClick = () => onClick?.(token.address);
|
|
9
10
|
return (_jsxs(ListItem, { disablePadding: true, style: {
|
|
10
11
|
height: `${size}px`,
|
|
11
12
|
transform: `translateY(${start}px)`,
|
|
12
|
-
}, children: [startAdornment, _jsx(TokenListItemButton, { token: token, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] }));
|
|
13
|
+
}, children: [startAdornment, _jsx(TokenListItemButton, { token: token, chain: chain, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] }));
|
|
13
14
|
});
|
|
14
|
-
export const TokenListItemButton = ({ onClick, token, showBalance, isBalanceLoading, }) => {
|
|
15
|
+
export const TokenListItemButton = ({ onClick, token, chain, showBalance, isBalanceLoading, }) => {
|
|
15
16
|
const { t } = useTranslation();
|
|
16
17
|
const tokenPrice = formatTokenPrice(token.amount, token.priceUSD);
|
|
17
|
-
|
|
18
|
+
const container = useRef(null);
|
|
19
|
+
const timeoutId = useRef();
|
|
20
|
+
const [showAddress, setShowAddress] = useState(false);
|
|
21
|
+
const onMouseEnter = () => {
|
|
22
|
+
timeoutId.current = setTimeout(() => setShowAddress(true), 350);
|
|
23
|
+
};
|
|
24
|
+
const onMouseLeave = () => {
|
|
25
|
+
clearTimeout(timeoutId.current);
|
|
26
|
+
if (showAddress) {
|
|
27
|
+
setShowAddress(false);
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
return (_jsxs(ListItemButton, { onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, dense: true, children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), _jsx(ListItemText, { primary: token.symbol, secondaryTypographyProps: {
|
|
31
|
+
component: 'div',
|
|
32
|
+
sx: {
|
|
33
|
+
overflow: 'auto',
|
|
34
|
+
marginLeft: -0.75,
|
|
35
|
+
},
|
|
36
|
+
}, secondary: _jsxs(Box, { position: "relative", height: 18, ref: container, children: [_jsx(Slide, { direction: "down", in: !showAddress, container: container.current, style: {
|
|
37
|
+
position: 'absolute',
|
|
38
|
+
}, appear: false, children: _jsx(Box, { pl: 0.75, children: token.name }) }), _jsx(Slide, { direction: "up", in: showAddress, container: container.current, style: {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
}, appear: false, mountOnEnter: true, children: _jsx(LinkButton, { size: "small", LinkComponent: Link, href: `${chain?.metamask.blockExplorerUrls[0]}address/${token.address}`, target: "_blank", rel: "nofollow noreferrer", onClick: (e) => e.stopPropagation(), endIcon: _jsx(OpenInNewIcon, {}), children: shortenAddress(token.address) }) })] }) }), showBalance ? (isBalanceLoading ? (_jsx(TokenAmountSkeleton, {})) : (_jsxs(Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? (_jsx(Typography, { variant: "body1", noWrap: true, children: t('format.number', {
|
|
18
41
|
value: token.amount,
|
|
19
42
|
}) })) : null, tokenPrice ? (_jsx(Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
|
|
20
43
|
value: tokenPrice,
|
|
@@ -4,7 +4,7 @@ import { useVirtualizer } from '@tanstack/react-virtual';
|
|
|
4
4
|
import { useEffect } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { TokenListItem, TokenListItemSkeleton } from './TokenListItem';
|
|
7
|
-
export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef, chainId, isLoading, isBalanceLoading, showBalance, showFeatured, onClick, }) => {
|
|
7
|
+
export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef, chainId, chain, isLoading, isBalanceLoading, showBalance, showFeatured, onClick, }) => {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
const hasFeaturedTokens = !!featuredTokensLength && showFeatured;
|
|
10
10
|
const featuredTokensLastIndex = (featuredTokensLength ?? 0) - 1;
|
|
@@ -32,7 +32,7 @@ export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollEleme
|
|
|
32
32
|
}
|
|
33
33
|
return size;
|
|
34
34
|
},
|
|
35
|
-
getItemKey: (index) => tokens[index].address
|
|
35
|
+
getItemKey: (index) => `${tokens[index].address}-${index}`,
|
|
36
36
|
});
|
|
37
37
|
useEffect(() => {
|
|
38
38
|
if (getVirtualItems().length) {
|
|
@@ -46,7 +46,7 @@ export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollEleme
|
|
|
46
46
|
}
|
|
47
47
|
return (_jsx(List, { style: { height: getTotalSize() }, disablePadding: true, children: getVirtualItems().map((item) => {
|
|
48
48
|
const token = tokens[item.index];
|
|
49
|
-
return (_jsx(TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? (_jsx(Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('swap.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
|
|
49
|
+
return (_jsx(TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, chain: chain, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? (_jsx(Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('swap.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
|
|
50
50
|
token.featured &&
|
|
51
51
|
item.index === featuredTokensLastIndex &&
|
|
52
52
|
item.index !== tokensLastIndex ? (_jsx(Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('swap.otherTokens') })) : null }, item.key));
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ExtendedChain } from '@lifi/sdk';
|
|
1
2
|
import type { MutableRefObject } from 'react';
|
|
2
3
|
import type { SwapFormType } from '../../providers';
|
|
3
4
|
import type { TokenAmount } from '../../types';
|
|
@@ -13,6 +14,7 @@ export interface VirtualizedTokenListProps {
|
|
|
13
14
|
isLoading: boolean;
|
|
14
15
|
isBalanceLoading: boolean;
|
|
15
16
|
chainId: number;
|
|
17
|
+
chain?: ExtendedChain;
|
|
16
18
|
showBalance?: boolean;
|
|
17
19
|
showFeatured?: boolean;
|
|
18
20
|
onClick(tokenAddress: string): void;
|
|
@@ -25,6 +27,7 @@ export interface TokenListItemBaseProps {
|
|
|
25
27
|
export interface TokenListItemProps extends TokenListItemBaseProps {
|
|
26
28
|
showBalance?: boolean;
|
|
27
29
|
token: TokenAmount;
|
|
30
|
+
chain?: ExtendedChain;
|
|
28
31
|
isBalanceLoading?: boolean;
|
|
29
32
|
startAdornment?: React.ReactNode;
|
|
30
33
|
endAdornment?: React.ReactNode;
|
|
@@ -33,5 +36,6 @@ export interface TokenListItemButtonProps {
|
|
|
33
36
|
onClick?(): void;
|
|
34
37
|
showBalance?: boolean;
|
|
35
38
|
token: TokenAmount;
|
|
39
|
+
chain?: ExtendedChain;
|
|
36
40
|
isBalanceLoading?: boolean;
|
|
37
41
|
}
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "2.0.0-beta.
|
|
2
|
+
export declare const version = "2.0.0-beta.8";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '2.0.0-beta.
|
|
2
|
+
export const version = '2.0.0-beta.8';
|
|
@@ -7,8 +7,8 @@ import { useGetTokenBalancesWithRetry } from './useGetTokenBalancesWithRetry';
|
|
|
7
7
|
import { useTokenAddressBalance } from './useTokenAddressBalance';
|
|
8
8
|
const refetchInterval = 30000;
|
|
9
9
|
export const useFundsSufficiency = (route) => {
|
|
10
|
-
const { account
|
|
11
|
-
const getTokenBalancesWithRetry = useGetTokenBalancesWithRetry(provider);
|
|
10
|
+
const { account } = useWallet();
|
|
11
|
+
const getTokenBalancesWithRetry = useGetTokenBalancesWithRetry(account.signer?.provider);
|
|
12
12
|
const [fromChainId, fromTokenAddress, fromAmount] = useWatch({
|
|
13
13
|
name: [
|
|
14
14
|
SwapFormKey.FromChain,
|
package/hooks/useGasRefuel.d.ts
CHANGED
|
@@ -3,5 +3,5 @@ export declare const useGasRefuel: () => {
|
|
|
3
3
|
availble: boolean | undefined;
|
|
4
4
|
isLoading: boolean;
|
|
5
5
|
chain: import("@lifi/types").ExtendedChain | undefined;
|
|
6
|
-
|
|
6
|
+
fromAmount: string | undefined;
|
|
7
7
|
};
|
package/hooks/useGasRefuel.js
CHANGED
|
@@ -7,12 +7,11 @@ import { useGasRecommendation } from './useGasRecommendation';
|
|
|
7
7
|
import { useTokenBalance } from './useTokenBalance';
|
|
8
8
|
export const useGasRefuel = () => {
|
|
9
9
|
const { getChainById } = useChains();
|
|
10
|
-
const [fromChainId, fromTokenAddress, toChainId,
|
|
10
|
+
const [fromChainId, fromTokenAddress, toChainId, toAddress] = useWatch({
|
|
11
11
|
name: [
|
|
12
12
|
SwapFormKey.FromChain,
|
|
13
13
|
SwapFormKey.FromToken,
|
|
14
14
|
SwapFormKey.ToChain,
|
|
15
|
-
SwapFormKey.ToToken,
|
|
16
15
|
SwapFormKey.ToAddress,
|
|
17
16
|
],
|
|
18
17
|
});
|
|
@@ -24,10 +23,7 @@ export const useGasRefuel = () => {
|
|
|
24
23
|
// We don't allow same chain refuel.
|
|
25
24
|
// If a user runs out of gas, he can't send a source chain transaction.
|
|
26
25
|
fromChainId === toChainId ||
|
|
27
|
-
// We don't want to apply auto refuel when swapping to native tokens
|
|
28
|
-
toChain?.nativeToken.address === toTokenAddress ||
|
|
29
26
|
!gasRecommendation?.available ||
|
|
30
|
-
!gasRecommendation.recommended ||
|
|
31
27
|
!nativeToken) {
|
|
32
28
|
return false;
|
|
33
29
|
}
|
|
@@ -38,20 +34,14 @@ export const useGasRefuel = () => {
|
|
|
38
34
|
.div(2);
|
|
39
35
|
const insufficientGas = tokenBalance.lt(recommendedAmount);
|
|
40
36
|
return insufficientGas;
|
|
41
|
-
}, [
|
|
42
|
-
fromChainId,
|
|
43
|
-
gasRecommendation?.available,
|
|
44
|
-
gasRecommendation?.recommended,
|
|
45
|
-
nativeToken,
|
|
46
|
-
toChain?.nativeToken.address,
|
|
47
|
-
toChainId,
|
|
48
|
-
toTokenAddress,
|
|
49
|
-
]);
|
|
37
|
+
}, [fromChainId, gasRecommendation, nativeToken, toChainId]);
|
|
50
38
|
return {
|
|
51
39
|
enabled: enabled,
|
|
52
40
|
availble: gasRecommendation?.available,
|
|
53
41
|
isLoading: isLoading,
|
|
54
42
|
chain: toChain,
|
|
55
|
-
gasRecommendation
|
|
43
|
+
fromAmount: gasRecommendation?.available
|
|
44
|
+
? gasRecommendation.fromAmount
|
|
45
|
+
: undefined,
|
|
56
46
|
};
|
|
57
47
|
};
|
|
@@ -4,9 +4,9 @@ import { useChains, useGetTokenBalancesWithRetry } from '.';
|
|
|
4
4
|
import { useWallet } from '../providers';
|
|
5
5
|
const refetchInterval = 30000;
|
|
6
6
|
export const useGasSufficiency = (route) => {
|
|
7
|
-
const { account
|
|
7
|
+
const { account } = useWallet();
|
|
8
8
|
const { getChainById } = useChains();
|
|
9
|
-
const getTokenBalancesWithRetry = useGetTokenBalancesWithRetry(provider);
|
|
9
|
+
const getTokenBalancesWithRetry = useGetTokenBalancesWithRetry(account.signer?.provider);
|
|
10
10
|
const { data: insufficientGas, isInitialLoading } = useQuery(['gas-sufficiency-check', account.address, route?.id], async () => {
|
|
11
11
|
if (!account.address || !route) {
|
|
12
12
|
return;
|
|
@@ -14,7 +14,7 @@ export const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchan
|
|
|
14
14
|
const routeExecutionStoreContext = useRouteExecutionStoreContext();
|
|
15
15
|
const routeExecution = useRouteExecutionStore((state) => state.routes[routeId]);
|
|
16
16
|
const [updateRoute, restartRoute, deleteRoute] = useRouteExecutionStore((state) => [state.updateRoute, state.restartRoute, state.deleteRoute], shallow);
|
|
17
|
-
const
|
|
17
|
+
const updateRouteHook = (updatedRoute) => {
|
|
18
18
|
const routeExecution = routeExecutionStoreContext.getState().routes[updatedRoute.id];
|
|
19
19
|
if (!routeExecution) {
|
|
20
20
|
return;
|
|
@@ -68,7 +68,7 @@ export const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchan
|
|
|
68
68
|
}
|
|
69
69
|
queryClient.removeQueries(['routes'], { exact: false });
|
|
70
70
|
return lifi.executeRoute(account.signer, routeExecution.route, {
|
|
71
|
-
|
|
71
|
+
updateRouteHook,
|
|
72
72
|
switchChainHook,
|
|
73
73
|
acceptExchangeRateUpdateHook,
|
|
74
74
|
infiniteApproval: false,
|
|
@@ -90,7 +90,7 @@ export const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchan
|
|
|
90
90
|
throw Error('Execution route not found.');
|
|
91
91
|
}
|
|
92
92
|
return lifi.resumeRoute(account.signer, resumedRoute ?? routeExecution.route, {
|
|
93
|
-
|
|
93
|
+
updateRouteHook,
|
|
94
94
|
switchChainHook,
|
|
95
95
|
acceptExchangeRateUpdateHook,
|
|
96
96
|
infiniteApproval: false,
|
package/hooks/useSwapRoutes.js
CHANGED
|
@@ -12,7 +12,7 @@ const refetchTime = 60000;
|
|
|
12
12
|
export const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
13
13
|
const lifi = useLiFi();
|
|
14
14
|
const { variant, sdkConfig, insurance, contractTool } = useWidgetConfig();
|
|
15
|
-
const { account
|
|
15
|
+
const { account } = useWallet();
|
|
16
16
|
const queryClient = useQueryClient();
|
|
17
17
|
const swapOnly = useSwapOnly();
|
|
18
18
|
const { slippage, enabledBridges, enabledAutoRefuel, enabledExchanges, routePriority, } = useSettings([
|
|
@@ -38,7 +38,7 @@ export const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
38
38
|
});
|
|
39
39
|
const { token: fromToken } = useToken(fromChainId, fromTokenAddress);
|
|
40
40
|
const { token: toToken } = useToken(toChainId, toTokenAddress);
|
|
41
|
-
const { enabled: enabledRefuel,
|
|
41
|
+
const { enabled: enabledRefuel, fromAmount: gasRecommendationFromAmount } = useGasRefuel();
|
|
42
42
|
const hasAmount = (!isNaN(fromTokenAmount) && Number(fromTokenAmount) > 0) ||
|
|
43
43
|
(!isNaN(toTokenAmount) && Number(toTokenAmount) > 0);
|
|
44
44
|
const contractCallQuoteEnabled = variant === 'nft'
|
|
@@ -71,7 +71,7 @@ export const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
71
71
|
variant,
|
|
72
72
|
sdkConfig?.defaultRouteOptions?.allowSwitchChain,
|
|
73
73
|
enabledRefuel && enabledAutoRefuel,
|
|
74
|
-
|
|
74
|
+
gasRecommendationFromAmount,
|
|
75
75
|
insurance,
|
|
76
76
|
insurableRoute?.id,
|
|
77
77
|
];
|
|
@@ -79,7 +79,7 @@ export const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
79
79
|
let toWalletAddress;
|
|
80
80
|
try {
|
|
81
81
|
toWalletAddress =
|
|
82
|
-
(await provider?.resolveName(toAddress)) ??
|
|
82
|
+
(await account.signer?.provider?.resolveName(toAddress)) ??
|
|
83
83
|
(isAddress(toAddress) ? toAddress : fromAddress);
|
|
84
84
|
}
|
|
85
85
|
catch {
|
package/hooks/useTokenBalance.js
CHANGED
|
@@ -5,10 +5,10 @@ import { formatTokenAmount } from '../utils';
|
|
|
5
5
|
import { useGetTokenBalancesWithRetry } from './useGetTokenBalancesWithRetry';
|
|
6
6
|
const defaultRefetchInterval = 30000;
|
|
7
7
|
export const useTokenBalance = (token, accountAddress) => {
|
|
8
|
-
const { account
|
|
8
|
+
const { account } = useWallet();
|
|
9
9
|
const queryClient = useQueryClient();
|
|
10
10
|
const walletAddress = accountAddress || account.address;
|
|
11
|
-
const getTokenBalancesWithRetry = useGetTokenBalancesWithRetry(provider);
|
|
11
|
+
const getTokenBalancesWithRetry = useGetTokenBalancesWithRetry(account.signer?.provider);
|
|
12
12
|
const tokenBalanceQueryKey = useMemo(() => ['token-balance', walletAddress, token?.chainId, token?.address], [token?.address, token?.chainId, walletAddress]);
|
|
13
13
|
const { data, isLoading, refetch } = useQuery(tokenBalanceQueryKey, async ({ queryKey: [, accountAddress] }) => {
|
|
14
14
|
const cachedToken = queryClient
|
package/i18n/en.json
CHANGED
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
"to": "To",
|
|
218
218
|
"tokenOnChain": "{{tokenSymbol}} on {{chainName}}",
|
|
219
219
|
"tokenOnChainAmount": "{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}}",
|
|
220
|
-
"tokenSearch": "Search
|
|
220
|
+
"tokenSearch": "Search by token name or address",
|
|
221
221
|
"valueLoss": "Value loss",
|
|
222
222
|
"walletAddressOrEns": "Wallet address or ENS name",
|
|
223
223
|
"warning": {
|
package/icons/InsuraceLogo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const InsuraceLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const InsuraceLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/icons/LiFiFullLogo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const LiFiFullLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const LiFiFullLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/icons/LiFiLogo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const LiFiLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const LiFiLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/icons/LiFiToolLogo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const LiFiToolLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const LiFiToolLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.8",
|
|
4
4
|
"description": "LI.FI Widget for cross-chain bridging and swapping. It will drive your multi-chain strategy and attract new users from everywhere.",
|
|
5
5
|
"main": "./cjs/index.js",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -37,17 +37,17 @@
|
|
|
37
37
|
"lifi"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@emotion/react": "^11.
|
|
41
|
-
"@emotion/styled": "^11.
|
|
40
|
+
"@emotion/react": "^11.11.0",
|
|
41
|
+
"@emotion/styled": "^11.11.0",
|
|
42
42
|
"@ethersproject/abstract-signer": "^5.7.0",
|
|
43
43
|
"@ethersproject/address": "^5.7.0",
|
|
44
44
|
"@ethersproject/experimental": "^5.7.0",
|
|
45
45
|
"@ethersproject/providers": "^5.7.2",
|
|
46
|
-
"@lifi/sdk": "^2.0.0-beta.
|
|
47
|
-
"@lifi/wallet-management": "^2.0.0-beta.
|
|
46
|
+
"@lifi/sdk": "^2.0.0-beta.12",
|
|
47
|
+
"@lifi/wallet-management": "^2.0.0-beta.6",
|
|
48
48
|
"@mui/icons-material": "^5.11.16",
|
|
49
49
|
"@mui/lab": "^5.0.0-alpha.129",
|
|
50
|
-
"@mui/material": "^5.
|
|
50
|
+
"@mui/material": "^5.13.0",
|
|
51
51
|
"@tanstack/react-query": "^4.29.5",
|
|
52
52
|
"@tanstack/react-virtual": "^3.0.0-beta.54",
|
|
53
53
|
"big.js": "^6.2.1",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ActiveSwapsPage: () => JSX.Element;
|
|
1
|
+
export declare const ActiveSwapsPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SearchTokenInput: () => JSX.Element;
|
|
1
|
+
export declare const SearchTokenInput: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SelectWalletPage: () => JSX.Element;
|
|
1
|
+
export declare const SelectWalletPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GasPriceSelect: () => JSX.Element;
|
|
1
|
+
export declare const GasPriceSelect: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SettingsPage: () => JSX.Element;
|
|
1
|
+
export declare const SettingsPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ShowDestinationWallet: () => JSX.Element | null;
|
|
1
|
+
export declare const ShowDestinationWallet: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SlippageInput: () => JSX.Element;
|
|
1
|
+
export declare const SlippageInput: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -56,5 +56,5 @@ export const SwapDetailsPage = () => {
|
|
|
56
56
|
}).format(startedAt) })] }), getStepList(routeExecution?.route), variant === 'nft' ? _jsx(ContractComponent, { mt: 2 }) : null, routeExecution?.route?.insurance?.state === 'INSURED' ? (_jsx(Insurance, { mt: 2, status: routeExecution.status, feeAmountUsd: routeExecution.route.insurance.feeAmountUsd, insurableRouteId: routeExecution.route.id, insuranceCoverageId: insuranceCoverageId })) : null, _jsxs(Card, { mt: 2, children: [_jsxs(Box, { sx: {
|
|
57
57
|
display: 'flex',
|
|
58
58
|
flex: 1,
|
|
59
|
-
}, children: [_jsx(CardTitle, { flex: 1, children: t('swap.supportId') }), _jsx(Box, { mr: 1, mt: 1, children: _jsx(IconButton, { size: "medium", onClick: copySupportId, children: _jsx(ContentCopyIcon, { fontSize: "small" }) }) })] }), _jsx(Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), _jsx(Box, { mt: 2, children: _jsx(Button, { href: "https://discord.
|
|
59
|
+
}, children: [_jsx(CardTitle, { flex: 1, children: t('swap.supportId') }), _jsx(Box, { mr: 1, mt: 1, children: _jsx(IconButton, { size: "medium", onClick: copySupportId, children: _jsx(ContentCopyIcon, { fontSize: "small" }) }) })] }), _jsx(Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), _jsx(Box, { mt: 2, children: _jsx(Button, { href: "https://discord.gg/lifi", target: "_blank", rel: "nofollow noreferrer", fullWidth: true, children: t('button.contactSupport') }) }), _jsxs(Dialog, { open: open, onClose: toggleDialog, children: [_jsx(DialogTitle, { children: t('swap.warning.title.deleteSwap') }), _jsx(DialogContent, { children: _jsx(DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), _jsxs(DialogActions, { children: [_jsx(Button, { onClick: toggleDialog, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: handleDeleteRoute, autoFocus: true, children: t('button.delete') })] })] })] }));
|
|
60
60
|
};
|