@lifi/widget 1.18.8 → 1.19.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/App.js +3 -3
- package/cjs/App.js +3 -3
- package/cjs/components/ActiveSwaps/ActiveSwaps.js +1 -1
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +0 -14
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.js +1 -9
- package/cjs/components/AppContainer.d.ts +11 -1
- package/cjs/components/AppContainer.js +3 -6
- package/cjs/components/BottomSheet/BottomSheet.js +9 -32
- package/cjs/components/BottomSheet/types.d.ts +2 -2
- package/cjs/components/Card/Card.js +1 -1
- package/cjs/components/Card/CardHeader.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.js +1 -1
- package/cjs/components/ChainSelect/useChainSelect.js +2 -4
- package/cjs/components/Dialog.d.ts +22 -1
- package/cjs/components/Dialog.js +23 -20
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +19 -22
- package/cjs/components/Header/NavigationHeader.js +1 -1
- package/cjs/components/Header/WalletHeader.js +2 -2
- package/cjs/components/PoweredBy/PoweredBy.js +1 -1
- package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +1 -1
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +6 -6
- package/cjs/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWallet.d.ts +1 -0
- package/cjs/components/SendToWallet/SendToWallet.js +10 -5
- package/cjs/components/SendToWallet/SendToWalletButton.js +2 -2
- package/cjs/components/Step/StepProcess.js +1 -1
- package/cjs/components/SwapButton/SwapButton.js +4 -4
- package/cjs/components/SwapButton/types.d.ts +2 -0
- package/cjs/components/SwapInput/SwapInput.js +6 -2
- package/cjs/components/SwapInput/SwapInputAdornment.js +4 -2
- package/cjs/components/SwapInput/SwapInputAdornment.style.js +1 -13
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +8 -4
- package/cjs/components/SwapRoutes/SwapRoutes.js +4 -4
- package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +14 -14
- package/cjs/components/SwapRoutes/SwapRoutes.style.js +13 -13
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +17 -12
- package/cjs/components/SwapRoutes/useSetRecommendedRoute.d.ts +2 -0
- package/cjs/components/SwapRoutes/useSetRecommendedRoute.js +13 -0
- package/cjs/components/Token/Token.js +5 -5
- package/cjs/components/Token/Token.style.d.ts +10 -0
- package/cjs/components/Token/Token.style.js +13 -7
- package/cjs/components/TokenList/TokenList.js +10 -7
- package/cjs/config/theme.js +22 -8
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +1 -0
- package/cjs/hooks/index.js +1 -0
- package/cjs/hooks/useExpandableVariant.d.ts +1 -0
- package/cjs/hooks/useExpandableVariant.js +14 -0
- package/cjs/hooks/useGasSufficiency.d.ts +3 -2
- package/cjs/hooks/useGasSufficiency.js +50 -26
- package/cjs/hooks/useSwapRoutes.js +4 -2
- package/cjs/hooks/useToken.js +5 -2
- package/cjs/hooks/useTokenBalance.js +15 -10
- package/cjs/hooks/useTokenSearch.d.ts +1 -3
- package/cjs/hooks/useTokenSearch.js +3 -5
- package/cjs/i18n/en/translation.json +9 -8
- package/cjs/i18n/index.d.ts +6 -5
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +21 -4
- package/cjs/pages/MainPage/MainPage.js +3 -3
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +1 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +2 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/cjs/pages/SwapPage/StatusBottomSheet.js +4 -4
- package/cjs/pages/SwapPage/SwapPage.js +4 -4
- package/cjs/providers/SwapFormProvider/SwapFormProvider.js +3 -2
- package/cjs/providers/SwapFormProvider/URLSearchParamsBuilder.d.ts +1 -0
- package/cjs/providers/SwapFormProvider/URLSearchParamsBuilder.js +46 -0
- package/cjs/providers/SwapFormProvider/types.d.ts +4 -4
- package/cjs/providers/SwapFormProvider/types.js +2 -2
- package/cjs/providers/WalletProvider/WalletFormUpdate.d.ts +5 -0
- package/cjs/providers/WalletProvider/WalletFormUpdate.js +64 -0
- package/cjs/providers/WalletProvider/WalletProvider.js +3 -58
- package/cjs/providers/WidgetProvider/WidgetProvider.js +12 -5
- package/cjs/stores/routes/index.d.ts +1 -1
- package/cjs/stores/routes/index.js +1 -1
- package/cjs/stores/routes/types.d.ts +4 -4
- package/cjs/stores/routes/useRecommendedRouteStore.d.ts +4 -0
- package/cjs/stores/routes/{useSelectedRouteStore.js → useRecommendedRouteStore.js} +4 -4
- package/cjs/stores/routes/useRouteExecutionStore.js +10 -2
- package/cjs/stores/settings/useSettingsStore.js +5 -2
- package/cjs/types/widget.d.ts +1 -0
- package/components/ActiveSwaps/ActiveSwaps.js +3 -3
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +0 -14
- package/components/ActiveSwaps/ActiveSwaps.style.js +1 -9
- package/components/AppContainer.d.ts +11 -1
- package/components/AppContainer.js +2 -4
- package/components/BottomSheet/BottomSheet.js +9 -32
- package/components/BottomSheet/types.d.ts +2 -2
- package/components/Card/Card.js +1 -1
- package/components/Card/CardHeader.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.js +1 -1
- package/components/ChainSelect/useChainSelect.js +2 -4
- package/components/Dialog.d.ts +22 -1
- package/components/Dialog.js +22 -19
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +21 -24
- package/components/Header/NavigationHeader.js +2 -2
- package/components/Header/WalletHeader.js +2 -2
- package/components/PoweredBy/PoweredBy.js +1 -1
- package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +1 -1
- package/components/ReverseTokensButton/ReverseTokensButton.js +6 -6
- package/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
- package/components/SendToWallet/SendToWallet.d.ts +1 -0
- package/components/SendToWallet/SendToWallet.js +9 -5
- package/components/SendToWallet/SendToWalletButton.js +2 -2
- package/components/Step/StepProcess.js +1 -1
- package/components/SwapButton/SwapButton.js +4 -4
- package/components/SwapButton/types.d.ts +2 -0
- package/components/SwapInput/SwapInput.js +6 -2
- package/components/SwapInput/SwapInputAdornment.js +4 -2
- package/components/SwapInput/SwapInputAdornment.style.js +2 -14
- package/components/SwapRouteCard/SwapRouteCard.js +9 -5
- package/components/SwapRoutes/SwapRoutes.js +4 -4
- package/components/SwapRoutes/SwapRoutes.style.d.ts +14 -14
- package/components/SwapRoutes/SwapRoutes.style.js +13 -13
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +1 -0
- package/components/SwapRoutes/SwapRoutesExpanded.js +16 -12
- package/components/SwapRoutes/useSetRecommendedRoute.d.ts +2 -0
- package/components/SwapRoutes/useSetRecommendedRoute.js +9 -0
- package/components/Token/Token.js +7 -7
- package/components/Token/Token.style.d.ts +10 -0
- package/components/Token/Token.style.js +12 -6
- package/components/TokenList/TokenList.js +10 -7
- package/config/theme.js +22 -8
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +1 -0
- package/hooks/index.js +1 -0
- package/hooks/useExpandableVariant.d.ts +1 -0
- package/hooks/useExpandableVariant.js +10 -0
- package/hooks/useGasSufficiency.d.ts +3 -2
- package/hooks/useGasSufficiency.js +50 -26
- package/hooks/useSwapRoutes.js +4 -2
- package/hooks/useToken.js +5 -2
- package/hooks/useTokenBalance.js +15 -10
- package/hooks/useTokenSearch.d.ts +1 -3
- package/hooks/useTokenSearch.js +3 -5
- package/i18n/en/translation.json +9 -8
- package/i18n/index.d.ts +6 -5
- package/package.json +11 -11
- package/pages/ActiveSwapsPage/ActiveSwapsPage.js +24 -7
- package/pages/MainPage/MainPage.js +3 -3
- package/pages/SelectWalletPage/SelectWalletPage.js +1 -1
- package/pages/SwapDetailsPage/SwapDetailsPage.js +2 -2
- package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/pages/SwapPage/StatusBottomSheet.js +4 -4
- package/pages/SwapPage/SwapPage.js +5 -5
- package/providers/SwapFormProvider/SwapFormProvider.js +4 -3
- package/providers/SwapFormProvider/URLSearchParamsBuilder.d.ts +1 -0
- package/providers/SwapFormProvider/URLSearchParamsBuilder.js +42 -0
- package/providers/SwapFormProvider/types.d.ts +4 -4
- package/providers/SwapFormProvider/types.js +2 -2
- package/providers/WalletProvider/WalletFormUpdate.d.ts +5 -0
- package/providers/WalletProvider/WalletFormUpdate.js +60 -0
- package/providers/WalletProvider/WalletProvider.js +5 -60
- package/providers/WidgetProvider/WidgetProvider.js +12 -5
- package/stores/routes/index.d.ts +1 -1
- package/stores/routes/index.js +1 -1
- package/stores/routes/types.d.ts +4 -4
- package/stores/routes/useRecommendedRouteStore.d.ts +4 -0
- package/stores/routes/useRecommendedRouteStore.js +9 -0
- package/stores/routes/useRouteExecutionStore.js +10 -2
- package/stores/settings/useSettingsStore.js +5 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
- package/cjs/components/SwapRoutes/useSetSelectedRoute.d.ts +0 -2
- package/cjs/components/SwapRoutes/useSetSelectedRoute.js +0 -13
- package/cjs/stores/routes/useSelectedRouteStore.d.ts +0 -4
- package/components/SwapRoutes/useSetSelectedRoute.d.ts +0 -2
- package/components/SwapRoutes/useSetSelectedRoute.js +0 -9
- package/stores/routes/useSelectedRouteStore.d.ts +0 -4
- package/stores/routes/useSelectedRouteStore.js +0 -9
|
@@ -9,7 +9,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
9
9
|
}
|
|
10
10
|
return t;
|
|
11
11
|
};
|
|
12
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
12
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
13
13
|
import { Box, Typography } from '@mui/material';
|
|
14
14
|
import { useTranslation } from 'react-i18next';
|
|
15
15
|
import { useChains } from '../../hooks';
|
|
@@ -17,7 +17,7 @@ import { formatTokenAmount } from '../../utils';
|
|
|
17
17
|
import { SmallAvatar } from '../SmallAvatar';
|
|
18
18
|
import { TextFitter } from '../TextFitter';
|
|
19
19
|
import { TokenAvatar } from '../TokenAvatar';
|
|
20
|
-
import { TextSecondary } from './Token.style';
|
|
20
|
+
import { TextSecondary, TextSecondaryContainer } from './Token.style';
|
|
21
21
|
export const Token = (_a) => {
|
|
22
22
|
var _b;
|
|
23
23
|
var { token, connected, step } = _a, other = __rest(_a, ["token", "connected", "step"]);
|
|
@@ -25,11 +25,11 @@ export const Token = (_a) => {
|
|
|
25
25
|
const { getChainById } = useChains();
|
|
26
26
|
return (_jsxs(Box, Object.assign({ flex: 1 }, other, { children: [_jsxs(Box, Object.assign({ display: "flex", flex: 1, alignItems: "center" }, { children: [_jsx(TokenAvatar, { token: token, sx: { marginRight: 2 } }), _jsx(TextFitter, Object.assign({ height: 30, textStyle: {
|
|
27
27
|
fontWeight: 700,
|
|
28
|
-
} }, { children: formatTokenAmount(token.amount, token.decimals) }))] })), _jsxs(
|
|
28
|
+
} }, { children: formatTokenAmount(token.amount, token.decimals) }))] })), _jsxs(TextSecondaryContainer, Object.assign({ connected: connected, component: "span" }, { children: [_jsx(TextSecondary, Object.assign({ connected: connected }, { children: t(`swap.tokenOnChain`, {
|
|
29
29
|
tokenSymbol: token.symbol,
|
|
30
30
|
chainName: (_b = getChainById(token.chainId)) === null || _b === void 0 ? void 0 : _b.name,
|
|
31
|
-
}) })), step ? (_jsxs(
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
}) })), step ? (_jsxs(_Fragment, { children: [_jsx(Typography, Object.assign({ fontSize: 12, lineHeight: 1, fontWeight: 500, color: "text.secondary", px: 1, mt: 0.5 }, { children: "\u2022" })), _jsxs(Box, Object.assign({ display: "flex", alignItems: "flex-end", height: 12, mt: 0.5 }, { children: [_jsx(Box, Object.assign({ pr: 0.75 }, { children: _jsx(SmallAvatar, Object.assign({ src: step.toolDetails.logoURI, alt: step.toolDetails.name, sx: {
|
|
32
|
+
border: 0,
|
|
33
|
+
marginBottom: -0.25,
|
|
34
|
+
} }, { children: step.toolDetails.name[0] })) })), _jsx(Typography, Object.assign({ fontSize: 12, lineHeight: 1, fontWeight: 500, color: "text.secondary" }, { children: step.toolDetails.name }))] }))] })) : null] }))] })));
|
|
35
35
|
};
|
|
@@ -1,4 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
+
export declare const TextSecondaryContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
+
children?: import("react").ReactNode;
|
|
4
|
+
component?: import("react").ElementType<any> | undefined;
|
|
5
|
+
ref?: import("react").Ref<unknown> | undefined;
|
|
6
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Pick<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof import("react").HTMLAttributes<HTMLDivElement>> & {
|
|
8
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "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> & {
|
|
10
|
+
connected?: boolean | undefined;
|
|
11
|
+
}, {}, {}>;
|
|
2
12
|
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
13
|
align?: "inherit" | "left" | "right" | "center" | "justify" | undefined;
|
|
4
14
|
children?: import("react").ReactNode;
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
import { Box, Typography } from '@mui/material';
|
|
2
2
|
import { styled } from '@mui/material/styles';
|
|
3
|
-
export const
|
|
3
|
+
export const TextSecondaryContainer = styled(Box, {
|
|
4
4
|
shouldForwardProp: (prop) => prop !== 'connected',
|
|
5
5
|
})(({ theme, connected }) => ({
|
|
6
|
-
fontSize: 12,
|
|
7
|
-
lineHeight: 1,
|
|
8
|
-
fontWeight: 500,
|
|
9
|
-
color: theme.palette.text.secondary,
|
|
10
6
|
borderLeftWidth: connected ? 2 : 0,
|
|
11
7
|
borderLeftStyle: 'solid',
|
|
12
8
|
borderColor: theme.palette.mode === 'light'
|
|
@@ -14,12 +10,22 @@ export const TextSecondary = styled(Typography, {
|
|
|
14
10
|
: theme.palette.grey[800],
|
|
15
11
|
margin: connected
|
|
16
12
|
? theme.spacing(0.5, 0, 0, 1.875)
|
|
17
|
-
: theme.spacing(0
|
|
13
|
+
: theme.spacing(0, 0, 0, 6),
|
|
18
14
|
padding: connected
|
|
19
15
|
? theme.spacing(0, 0, 0, 3.875)
|
|
20
16
|
: theme.spacing(0, 0, 0, 0),
|
|
21
17
|
display: 'flex',
|
|
22
18
|
alignItems: 'flex-start',
|
|
19
|
+
flexWrap: 'wrap',
|
|
20
|
+
}));
|
|
21
|
+
export const TextSecondary = styled(Typography, {
|
|
22
|
+
shouldForwardProp: (prop) => prop !== 'connected',
|
|
23
|
+
})(({ theme, connected }) => ({
|
|
24
|
+
fontSize: 12,
|
|
25
|
+
lineHeight: 1,
|
|
26
|
+
fontWeight: 500,
|
|
27
|
+
color: theme.palette.text.secondary,
|
|
28
|
+
marginTop: connected ? 0 : theme.spacing(0.5),
|
|
23
29
|
}));
|
|
24
30
|
export const TokenDivider = styled(Box)(({ theme }) => ({
|
|
25
31
|
height: 12,
|
|
@@ -27,7 +27,7 @@ export const TokenList = ({ formType, height, onClick, }) => {
|
|
|
27
27
|
!filteredTokens.length &&
|
|
28
28
|
!!tokenSearchFilter &&
|
|
29
29
|
!!selectedChainId;
|
|
30
|
-
const { token: searchedToken, isLoading: isSearchedTokenLoading } = useTokenSearch(
|
|
30
|
+
const { token: searchedToken, isLoading: isSearchedTokenLoading } = useTokenSearch(selectedChainId, tokenSearchFilter, tokenSearchEnabled);
|
|
31
31
|
const isLoading = isTokensLoading || (tokenSearchEnabled && isSearchedTokenLoading);
|
|
32
32
|
const tokens = filteredTokens.length
|
|
33
33
|
? filteredTokens
|
|
@@ -36,22 +36,25 @@ export const TokenList = ({ formType, height, onClick, }) => {
|
|
|
36
36
|
: filteredTokens;
|
|
37
37
|
const handleTokenClick = useCallback((tokenAddress) => {
|
|
38
38
|
setValue(SwapFormKeyHelper.getTokenKey(formType), tokenAddress, {
|
|
39
|
-
|
|
39
|
+
shouldTouch: true,
|
|
40
|
+
});
|
|
41
|
+
// Set chain again to trigger URL builder update
|
|
42
|
+
setValue(SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
43
|
+
shouldTouch: true,
|
|
40
44
|
});
|
|
41
45
|
setValue(SwapFormKeyHelper.getAmountKey(formType), '');
|
|
42
46
|
const oppositeFormType = formType === 'from' ? 'to' : 'from';
|
|
43
|
-
const [selectedOppositeToken,
|
|
47
|
+
const [selectedOppositeToken, selectedOppositeChainId] = getValues([
|
|
44
48
|
SwapFormKeyHelper.getTokenKey(oppositeFormType),
|
|
45
49
|
SwapFormKeyHelper.getChainKey(oppositeFormType),
|
|
46
|
-
SwapFormKeyHelper.getChainKey(formType),
|
|
47
50
|
]);
|
|
48
51
|
if (selectedOppositeToken === tokenAddress &&
|
|
49
|
-
|
|
52
|
+
selectedOppositeChainId === selectedChainId) {
|
|
50
53
|
setValue(SwapFormKeyHelper.getTokenKey(oppositeFormType), '', {
|
|
51
|
-
|
|
54
|
+
shouldTouch: true,
|
|
52
55
|
});
|
|
53
56
|
}
|
|
54
57
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
55
|
-
}, [formType, getValues, onClick, setValue]);
|
|
58
|
+
}, [formType, getValues, onClick, selectedChainId, setValue]);
|
|
56
59
|
return (_jsxs(Box, Object.assign({ ref: parentRef, style: { height, overflow: 'auto' } }, { children: [!tokens.length && !isLoading ? (_jsx(TokenNotFound, { formType: formType })) : null, _jsx(VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens === null || featuredTokens === void 0 ? void 0 : featuredTokens.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] })));
|
|
57
60
|
};
|
package/config/theme.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { loadingButtonClasses } from '@mui/lab/LoadingButton';
|
|
1
2
|
import { common } from '@mui/material/colors';
|
|
2
3
|
import { dialogActionsClasses } from '@mui/material/DialogActions';
|
|
3
4
|
import { alpha, createTheme as createMuiTheme, darken, getContrastRatio, lighten, } from '@mui/material/styles';
|
|
@@ -45,6 +46,9 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
45
46
|
const primaryMainColor = (_c = (_b = (_a = theme.palette) === null || _a === void 0 ? void 0 : _a.primary) === null || _b === void 0 ? void 0 : _b.main) !== null && _c !== void 0 ? _c : palette.primary.main;
|
|
46
47
|
const primaryLightColor = lighten((_f = (_e = (_d = theme.palette) === null || _d === void 0 ? void 0 : _d.primary) === null || _e === void 0 ? void 0 : _e.main) !== null && _f !== void 0 ? _f : palette.primary.main, 0.5);
|
|
47
48
|
const primaryDarkColor = darken((_j = (_h = (_g = theme.palette) === null || _g === void 0 ? void 0 : _g.primary) === null || _h === void 0 ? void 0 : _h.main) !== null && _j !== void 0 ? _j : palette.primary.main, 0.2);
|
|
49
|
+
const contrastButtonColor = getContrastRatio(common.white, primaryMainColor) >= 3
|
|
50
|
+
? common.white
|
|
51
|
+
: common.black;
|
|
48
52
|
return createMuiTheme({
|
|
49
53
|
typography: Object.assign({ fontFamily: 'Inter var, Inter, sans-serif' }, theme.typography),
|
|
50
54
|
palette: Object.assign(Object.assign(Object.assign({ mode }, palette), { primary: {
|
|
@@ -80,13 +84,25 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
80
84
|
borderRadius: (_v = (_u = theme.shape) === null || _u === void 0 ? void 0 : _u.borderRadiusSecondary) !== null && _v !== void 0 ? _v : shape.borderRadiusSecondary,
|
|
81
85
|
textTransform: 'none',
|
|
82
86
|
fontSize: '1rem',
|
|
83
|
-
|
|
87
|
+
[`&.Mui-disabled, &.Mui-disabled:hover`]: {
|
|
84
88
|
color: mode === 'light'
|
|
85
|
-
? 'rgb(0 0 0 /
|
|
86
|
-
: 'rgb(255 255 255 /
|
|
89
|
+
? 'rgb(0 0 0 / 56%)'
|
|
90
|
+
: 'rgb(255 255 255 / 56%)',
|
|
87
91
|
cursor: 'not-allowed',
|
|
88
92
|
pointerEvents: 'auto',
|
|
89
93
|
},
|
|
94
|
+
[`&.${loadingButtonClasses.loading}.Mui-disabled`]: {
|
|
95
|
+
backgroundColor: primaryMainColor,
|
|
96
|
+
color: contrastButtonColor,
|
|
97
|
+
cursor: 'auto',
|
|
98
|
+
pointerEvents: 'auto',
|
|
99
|
+
},
|
|
100
|
+
[`.${loadingButtonClasses.loadingIndicator}`]: {
|
|
101
|
+
color: contrastButtonColor,
|
|
102
|
+
},
|
|
103
|
+
[`&.${loadingButtonClasses.root}.${loadingButtonClasses.loading}`]: {
|
|
104
|
+
color: 'transparent',
|
|
105
|
+
},
|
|
90
106
|
}, text: {
|
|
91
107
|
backgroundColor: alpha(primaryMainColor, 0.08),
|
|
92
108
|
'&:hover': {
|
|
@@ -94,9 +110,7 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
94
110
|
},
|
|
95
111
|
}, contained: {
|
|
96
112
|
'&:hover': {
|
|
97
|
-
color:
|
|
98
|
-
? common.white
|
|
99
|
-
: common.black,
|
|
113
|
+
color: contrastButtonColor,
|
|
100
114
|
},
|
|
101
115
|
}, sizeMedium: {
|
|
102
116
|
padding: '10px 16px',
|
|
@@ -114,10 +128,10 @@ export const createTheme = (mode, theme = {}) => {
|
|
|
114
128
|
},
|
|
115
129
|
},
|
|
116
130
|
text: {
|
|
117
|
-
backgroundColor: paletteDark.background.paper,
|
|
131
|
+
backgroundColor: lighten(paletteDark.background.paper, 0.08),
|
|
118
132
|
color: common.white,
|
|
119
133
|
'&:hover': {
|
|
120
|
-
backgroundColor: lighten(paletteDark.background.paper, 0.
|
|
134
|
+
backgroundColor: lighten(paletteDark.background.paper, 0.12),
|
|
121
135
|
},
|
|
122
136
|
},
|
|
123
137
|
}
|
package/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "1.
|
|
2
|
+
export declare const version = "1.19.0";
|
package/config/version.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget';
|
|
2
|
-
export const version = '1.
|
|
2
|
+
export const version = '1.19.0';
|
package/hooks/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ export * from './useChain';
|
|
|
2
2
|
export * from './useChains';
|
|
3
3
|
export * from './useContentHeight';
|
|
4
4
|
export * from './useDebouncedWatch';
|
|
5
|
+
export * from './useExpandableVariant';
|
|
5
6
|
export * from './useFeaturedTokens';
|
|
6
7
|
export * from './useGasSufficiency';
|
|
7
8
|
export * from './useInitializer';
|
package/hooks/index.js
CHANGED
|
@@ -2,6 +2,7 @@ export * from './useChain';
|
|
|
2
2
|
export * from './useChains';
|
|
3
3
|
export * from './useContentHeight';
|
|
4
4
|
export * from './useDebouncedWatch';
|
|
5
|
+
export * from './useExpandableVariant';
|
|
5
6
|
export * from './useFeaturedTokens';
|
|
6
7
|
export * from './useGasSufficiency';
|
|
7
8
|
export * from './useInitializer';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useExpandableVariant: () => boolean;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { useMediaQuery } from '@mui/material';
|
|
2
|
+
import { useWidgetConfig } from '../providers';
|
|
3
|
+
const defaultExpandableWidth = 852;
|
|
4
|
+
export const useExpandableVariant = () => {
|
|
5
|
+
const { variant } = useWidgetConfig();
|
|
6
|
+
const expandableAllowed = useMediaQuery((theme) => {
|
|
7
|
+
return theme.breakpoints.up(defaultExpandableWidth);
|
|
8
|
+
});
|
|
9
|
+
return variant === 'expandable' && expandableAllowed;
|
|
10
|
+
};
|
|
@@ -9,7 +9,8 @@ interface GasSufficiency {
|
|
|
9
9
|
chain?: EVMChain;
|
|
10
10
|
}
|
|
11
11
|
export declare const useGasSufficiency: (route?: Route) => {
|
|
12
|
-
insufficientGas: GasSufficiency[] | undefined;
|
|
13
|
-
insufficientFunds: boolean;
|
|
12
|
+
insufficientGas: GasSufficiency[] | null | undefined;
|
|
13
|
+
insufficientFunds: boolean | null | undefined;
|
|
14
|
+
isLoading: boolean;
|
|
14
15
|
};
|
|
15
16
|
export {};
|
|
@@ -7,23 +7,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
7
7
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
8
|
});
|
|
9
9
|
};
|
|
10
|
+
import { useQuery } from '@tanstack/react-query';
|
|
10
11
|
import Big from 'big.js';
|
|
11
|
-
import { useCallback, useEffect, useMemo, useState } from 'react';
|
|
12
12
|
import { useChains } from '.';
|
|
13
13
|
import { useWallet } from '../providers';
|
|
14
|
+
import { isRouteCompleted } from '../stores';
|
|
14
15
|
import { useTokenBalance } from './useTokenBalance';
|
|
16
|
+
const refetchInterval = 30000;
|
|
15
17
|
export const useGasSufficiency = (route) => {
|
|
16
18
|
const { account } = useWallet();
|
|
17
19
|
const { getChainById } = useChains();
|
|
18
20
|
const { token: fromToken, getTokenBalancesWithRetry } = useTokenBalance(route === null || route === void 0 ? void 0 : route.fromToken);
|
|
19
|
-
const
|
|
20
|
-
const checkInsufficientGas = useCallback(() => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
+
const { data: insufficientGas, isInitialLoading: insufficientGasLoading } = useQuery(['gas-sufficiency-check', account.address, route === null || route === void 0 ? void 0 : route.id], () => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
22
|
var _a, _b;
|
|
22
23
|
if (!account.address || !route) {
|
|
23
|
-
|
|
24
|
-
return;
|
|
24
|
+
return null;
|
|
25
25
|
}
|
|
26
|
-
const gasCosts = route.steps
|
|
26
|
+
const gasCosts = route.steps
|
|
27
|
+
.filter((step) => !step.execution || step.execution.status !== 'DONE')
|
|
28
|
+
.reduce((groupedGasCosts, step) => {
|
|
27
29
|
if (step.estimate.gasCosts) {
|
|
28
30
|
const { token } = step.estimate.gasCosts[0];
|
|
29
31
|
const gasCostAmount = step.estimate.gasCosts
|
|
@@ -37,7 +39,6 @@ export const useGasSufficiency = (route) => {
|
|
|
37
39
|
gasAmount,
|
|
38
40
|
tokenAmount: gasAmount,
|
|
39
41
|
token,
|
|
40
|
-
chain: getChainById(token.chainId),
|
|
41
42
|
};
|
|
42
43
|
return groupedGasCosts;
|
|
43
44
|
}
|
|
@@ -48,41 +49,64 @@ export const useGasSufficiency = (route) => {
|
|
|
48
49
|
}
|
|
49
50
|
const tokenBalances = yield getTokenBalancesWithRetry(account.address, Object.values(gasCosts).map((item) => item.token));
|
|
50
51
|
if (!(tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.length)) {
|
|
51
|
-
|
|
52
|
-
return;
|
|
52
|
+
return null;
|
|
53
53
|
}
|
|
54
54
|
[route.fromChainId, route.toChainId].forEach((chainId) => {
|
|
55
55
|
var _a, _b, _c, _d, _e, _f;
|
|
56
56
|
if (gasCosts[chainId]) {
|
|
57
57
|
const gasTokenBalance = Big((_b = (_a = tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances.find((t) => t.chainId === gasCosts[chainId].token.chainId &&
|
|
58
58
|
t.address === gasCosts[chainId].token.address)) === null || _a === void 0 ? void 0 : _a.amount) !== null && _b !== void 0 ? _b : 0);
|
|
59
|
-
const
|
|
59
|
+
const insufficient = gasTokenBalance.lte(0) ||
|
|
60
60
|
gasTokenBalance.lt((_c = gasCosts[chainId].gasAmount) !== null && _c !== void 0 ? _c : Big(0)) ||
|
|
61
61
|
gasTokenBalance.lt((_d = gasCosts[chainId].tokenAmount) !== null && _d !== void 0 ? _d : Big(0));
|
|
62
|
-
const
|
|
62
|
+
const insufficientAmount = insufficient
|
|
63
63
|
? (_f = (_e = gasCosts[chainId].tokenAmount) === null || _e === void 0 ? void 0 : _e.minus(gasTokenBalance)) !== null && _f !== void 0 ? _f : gasCosts[chainId].gasAmount.minus(gasTokenBalance)
|
|
64
64
|
: undefined;
|
|
65
|
-
gasCosts[chainId] = Object.assign(Object.assign({}, gasCosts[chainId]), { insufficient
|
|
65
|
+
gasCosts[chainId] = Object.assign(Object.assign({}, gasCosts[chainId]), { insufficient, insufficientAmount: insufficientAmount === null || insufficientAmount === void 0 ? void 0 : insufficientAmount.round(5, Big.roundUp), chain: insufficient ? getChainById(chainId) : undefined });
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
68
|
const gasCostResult = Object.values(gasCosts).filter((gasCost) => gasCost.insufficient);
|
|
69
|
-
|
|
70
|
-
}),
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
return gasCostResult;
|
|
70
|
+
}), {
|
|
71
|
+
enabled: Boolean(account.address && route),
|
|
72
|
+
refetchIntervalInBackground: true,
|
|
73
|
+
refetchInterval,
|
|
74
|
+
staleTime: refetchInterval,
|
|
75
|
+
cacheTime: refetchInterval,
|
|
76
|
+
});
|
|
77
|
+
const { data: insufficientFunds, isInitialLoading: insufficientFundsLoading, } = useQuery(['funds-sufficiency-check', account.address, route === null || route === void 0 ? void 0 : route.id], () => __awaiter(void 0, void 0, void 0, function* () {
|
|
78
|
+
var _c, _d, _e, _f;
|
|
79
|
+
if (!account.address || !fromToken || !route || isRouteCompleted(route)) {
|
|
80
|
+
return null;
|
|
81
|
+
}
|
|
82
|
+
let currentTokenBalance = Big((_c = fromToken === null || fromToken === void 0 ? void 0 : fromToken.amount) !== null && _c !== void 0 ? _c : 0);
|
|
83
|
+
const currentAction = (_d = route.steps.filter((step) => !step.execution || step.execution.status !== 'DONE')[0]) === null || _d === void 0 ? void 0 : _d.action;
|
|
84
|
+
if (fromToken.chainId === currentAction.fromToken.chainId &&
|
|
85
|
+
fromToken.address === currentAction.fromToken.address &&
|
|
86
|
+
currentTokenBalance.gt(0)) {
|
|
87
|
+
const insufficientFunds = Big(route.fromAmount)
|
|
88
|
+
.div(Math.pow(10, route.fromToken.decimals))
|
|
89
|
+
.gt(currentTokenBalance);
|
|
90
|
+
return insufficientFunds;
|
|
75
91
|
}
|
|
76
|
-
const
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
92
|
+
const tokenBalances = yield getTokenBalancesWithRetry(account.address, [
|
|
93
|
+
currentAction.fromToken,
|
|
94
|
+
]);
|
|
95
|
+
currentTokenBalance = Big((_f = (_e = tokenBalances === null || tokenBalances === void 0 ? void 0 : tokenBalances[0]) === null || _e === void 0 ? void 0 : _e.amount) !== null && _f !== void 0 ? _f : 0);
|
|
96
|
+
const insufficientFunds = Big(currentAction.fromAmount)
|
|
97
|
+
.div(Math.pow(10, currentAction.fromToken.decimals))
|
|
98
|
+
.gt(currentTokenBalance);
|
|
99
|
+
return insufficientFunds;
|
|
100
|
+
}), {
|
|
101
|
+
enabled: Boolean(account.address && route && fromToken),
|
|
102
|
+
refetchIntervalInBackground: true,
|
|
103
|
+
refetchInterval,
|
|
104
|
+
staleTime: refetchInterval,
|
|
105
|
+
cacheTime: refetchInterval,
|
|
106
|
+
});
|
|
84
107
|
return {
|
|
85
108
|
insufficientGas,
|
|
86
109
|
insufficientFunds,
|
|
110
|
+
isLoading: insufficientGasLoading || insufficientFundsLoading,
|
|
87
111
|
};
|
|
88
112
|
};
|
package/hooks/useSwapRoutes.js
CHANGED
|
@@ -74,16 +74,18 @@ export const useSwapRoutes = () => {
|
|
|
74
74
|
catch (_d) {
|
|
75
75
|
toWalletAddress = isAddress(toAddress) ? toAddress : fromAddress;
|
|
76
76
|
}
|
|
77
|
+
const fromAmount = Big(Number(fromTokenAmount) * Math.pow(10, ((_c = token === null || token === void 0 ? void 0 : token.decimals) !== null && _c !== void 0 ? _c : 0))).toString();
|
|
78
|
+
const formattedSlippage = parseFloat(slippage) / 100;
|
|
77
79
|
return lifi.getRoutes({
|
|
78
80
|
fromChainId,
|
|
79
|
-
fromAmount
|
|
81
|
+
fromAmount,
|
|
80
82
|
fromTokenAddress,
|
|
81
83
|
toChainId,
|
|
82
84
|
toTokenAddress,
|
|
83
85
|
fromAddress,
|
|
84
86
|
toAddress: toWalletAddress,
|
|
85
87
|
options: {
|
|
86
|
-
slippage:
|
|
88
|
+
slippage: formattedSlippage,
|
|
87
89
|
bridges: {
|
|
88
90
|
allow: enabledBridges,
|
|
89
91
|
},
|
package/hooks/useToken.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { useMemo } from 'react';
|
|
2
2
|
import { useTokens } from './useTokens';
|
|
3
|
+
import { useTokenSearch } from './useTokenSearch';
|
|
3
4
|
export const useToken = (chainId, tokenAddress) => {
|
|
4
5
|
const { tokens, isLoading } = useTokens(chainId);
|
|
5
6
|
const token = useMemo(() => {
|
|
6
7
|
const token = tokens === null || tokens === void 0 ? void 0 : tokens.find((token) => token.address === tokenAddress && token.chainId === chainId);
|
|
7
8
|
return token;
|
|
8
9
|
}, [chainId, tokenAddress, tokens]);
|
|
10
|
+
const tokenSearchEnabled = !isLoading && !token;
|
|
11
|
+
const { token: searchedToken, isLoading: isSearchedTokenLoading } = useTokenSearch(chainId, tokenAddress, tokenSearchEnabled);
|
|
9
12
|
return {
|
|
10
|
-
token,
|
|
11
|
-
isLoading,
|
|
13
|
+
token: token !== null && token !== void 0 ? token : searchedToken,
|
|
14
|
+
isLoading: isLoading || (tokenSearchEnabled && isSearchedTokenLoading),
|
|
12
15
|
};
|
|
13
16
|
};
|
package/hooks/useTokenBalance.js
CHANGED
|
@@ -18,18 +18,23 @@ export const useTokenBalance = (token, accountAddress) => {
|
|
|
18
18
|
const queryClient = useQueryClient();
|
|
19
19
|
const walletAddress = accountAddress !== null && accountAddress !== void 0 ? accountAddress : account.address;
|
|
20
20
|
const getTokenBalancesWithRetry = useCallback((accountAddress, tokens, depth = 0) => __awaiter(void 0, void 0, void 0, function* () {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
if (
|
|
24
|
-
|
|
25
|
-
|
|
21
|
+
try {
|
|
22
|
+
const tokenBalances = yield lifi.getTokenBalances(accountAddress, tokens);
|
|
23
|
+
if (!tokenBalances.every((token) => token.blockNumber)) {
|
|
24
|
+
if (depth > 10) {
|
|
25
|
+
console.warn('Token balance backoff depth exceeded.');
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
yield new Promise((resolve) => {
|
|
29
|
+
setTimeout(resolve, Math.pow(1.5, depth) * 100);
|
|
30
|
+
});
|
|
31
|
+
return getTokenBalancesWithRetry(accountAddress, tokens, depth + 1);
|
|
26
32
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
return tokenBalances;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
//
|
|
31
37
|
}
|
|
32
|
-
return tokenBalances;
|
|
33
38
|
}), [lifi]);
|
|
34
39
|
const tokenBalanceQueryKey = useMemo(() => ['token-balance', walletAddress, token === null || token === void 0 ? void 0 : token.chainId, token === null || token === void 0 ? void 0 : token.address], [token === null || token === void 0 ? void 0 : token.address, token === null || token === void 0 ? void 0 : token.chainId, walletAddress]);
|
|
35
40
|
const { data, isLoading, refetch } = useQuery(tokenBalanceQueryKey, ({ queryKey: [, accountAddress] }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
import type { Token } from '../types';
|
|
2
|
-
export declare const useTokenSearch: (
|
|
2
|
+
export declare const useTokenSearch: (chainId: number, token: string, enabled?: boolean) => {
|
|
3
3
|
token: Token | undefined;
|
|
4
4
|
isLoading: boolean;
|
|
5
|
-
isFetching: boolean;
|
|
6
|
-
isFetched: boolean;
|
|
7
5
|
};
|
package/hooks/useTokenSearch.js
CHANGED
|
@@ -9,10 +9,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
9
9
|
};
|
|
10
10
|
import { useQuery, useQueryClient } from '@tanstack/react-query';
|
|
11
11
|
import { useLiFi } from '../providers';
|
|
12
|
-
export const useTokenSearch = (
|
|
12
|
+
export const useTokenSearch = (chainId, token, enabled) => {
|
|
13
13
|
const lifi = useLiFi();
|
|
14
14
|
const queryClient = useQueryClient();
|
|
15
|
-
const { data, isLoading
|
|
15
|
+
const { data, isLoading } = useQuery(['token-search', chainId, token], ({ queryKey: [, chainId, token], signal }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
16
|
const data = yield lifi.getToken(chainId, token, {
|
|
17
17
|
signal,
|
|
18
18
|
});
|
|
@@ -26,13 +26,11 @@ export const useTokenSearch = (token, chainId, enabled) => {
|
|
|
26
26
|
}
|
|
27
27
|
return data;
|
|
28
28
|
}), {
|
|
29
|
-
enabled,
|
|
29
|
+
enabled: Boolean(chainId && token && enabled),
|
|
30
30
|
retry: false,
|
|
31
31
|
});
|
|
32
32
|
return {
|
|
33
33
|
token: data,
|
|
34
34
|
isLoading,
|
|
35
|
-
isFetching,
|
|
36
|
-
isFetched,
|
|
37
35
|
};
|
|
38
36
|
};
|
package/i18n/en/translation.json
CHANGED
|
@@ -44,10 +44,6 @@
|
|
|
44
44
|
"routes": "You get",
|
|
45
45
|
"approximateCurrency": "\u2248 {{value, currency(currency: USD)}}",
|
|
46
46
|
"currency": "{{value, currency(currency: USD)}}",
|
|
47
|
-
"sendToRecipient": "Send to recipient",
|
|
48
|
-
"addressConfirmation": "I confirm that the address above is correct",
|
|
49
|
-
"gas": "gas fee",
|
|
50
|
-
"minutes": "minutes",
|
|
51
47
|
"tokenSearch": "Search your token",
|
|
52
48
|
"selectChain": "Chain",
|
|
53
49
|
"selectToken": "Token",
|
|
@@ -58,7 +54,7 @@
|
|
|
58
54
|
"stepSwap": "Swap",
|
|
59
55
|
"stepBridge": "Bridge",
|
|
60
56
|
"stepSwapAndBridge": "Swap and bridge",
|
|
61
|
-
"estimatedTime": "
|
|
57
|
+
"estimatedTime": "{{value}}m",
|
|
62
58
|
"crossStepDetails": "Bridge from {{from}} to {{to}} via {{tool}}",
|
|
63
59
|
"swapStepDetails": "Swap on {{chain}} via {{tool}}",
|
|
64
60
|
"tokenOnChain": "{{tokenSymbol}} on {{chainName}}",
|
|
@@ -98,12 +94,14 @@
|
|
|
98
94
|
"title": {
|
|
99
95
|
"insufficientGas": "Insufficient gas",
|
|
100
96
|
"deleteSwap": "Delete this swap?",
|
|
101
|
-
"deleteSwapHistory": "Delete swap history?"
|
|
97
|
+
"deleteSwapHistory": "Delete swap history?",
|
|
98
|
+
"deleteActiveSwaps": "Delete all active swaps?"
|
|
102
99
|
},
|
|
103
100
|
"message": {
|
|
104
101
|
"insufficientFunds": "You don't have enough funds to execute the swap.",
|
|
105
102
|
"insufficientGas": "You need to add at least:",
|
|
106
|
-
"
|
|
103
|
+
"deleteSwapHistory": "Swap history is only stored locally and can't be recovered if you delete it.",
|
|
104
|
+
"deleteActiveSwaps": "Active swaps are only stored locally and can't be recovered if you delete them."
|
|
107
105
|
}
|
|
108
106
|
},
|
|
109
107
|
"error": {
|
|
@@ -179,6 +177,9 @@
|
|
|
179
177
|
"title": "404",
|
|
180
178
|
"text": "We couldn't find this page."
|
|
181
179
|
},
|
|
182
|
-
"progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click
|
|
180
|
+
"progressToNextUpdate": "Displayed data will auto-refresh after {{value}} seconds. Click here to update manually.",
|
|
181
|
+
"numberOfSteps": "A number of swap steps. Each step can contain 1-3 transactions that require a signature.",
|
|
182
|
+
"estimatedTime": "Estimated time in minutes.",
|
|
183
|
+
"estimatedNetworkFee": "Estimated network fee."
|
|
183
184
|
}
|
|
184
185
|
}
|
package/i18n/index.d.ts
CHANGED
|
@@ -47,10 +47,6 @@ export declare const resources: {
|
|
|
47
47
|
routes: string;
|
|
48
48
|
approximateCurrency: string;
|
|
49
49
|
currency: string;
|
|
50
|
-
sendToRecipient: string;
|
|
51
|
-
addressConfirmation: string;
|
|
52
|
-
gas: string;
|
|
53
|
-
minutes: string;
|
|
54
50
|
tokenSearch: string;
|
|
55
51
|
selectChain: string;
|
|
56
52
|
selectToken: string;
|
|
@@ -102,11 +98,13 @@ export declare const resources: {
|
|
|
102
98
|
insufficientGas: string;
|
|
103
99
|
deleteSwap: string;
|
|
104
100
|
deleteSwapHistory: string;
|
|
101
|
+
deleteActiveSwaps: string;
|
|
105
102
|
};
|
|
106
103
|
message: {
|
|
107
104
|
insufficientFunds: string;
|
|
108
105
|
insufficientGas: string;
|
|
109
|
-
|
|
106
|
+
deleteSwapHistory: string;
|
|
107
|
+
deleteActiveSwaps: string;
|
|
110
108
|
};
|
|
111
109
|
};
|
|
112
110
|
error: {
|
|
@@ -183,6 +181,9 @@ export declare const resources: {
|
|
|
183
181
|
text: string;
|
|
184
182
|
};
|
|
185
183
|
progressToNextUpdate: string;
|
|
184
|
+
numberOfSteps: string;
|
|
185
|
+
estimatedTime: string;
|
|
186
|
+
estimatedNetworkFee: string;
|
|
186
187
|
};
|
|
187
188
|
};
|
|
188
189
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.0",
|
|
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",
|
|
@@ -45,25 +45,25 @@
|
|
|
45
45
|
"@lifi/sdk": "^1.6.0",
|
|
46
46
|
"@lifi/wallet-management": "^1.1.10",
|
|
47
47
|
"@mui/icons-material": "^5.10.6",
|
|
48
|
-
"@mui/lab": "^5.0.0-alpha.
|
|
49
|
-
"@mui/material": "^5.10.
|
|
50
|
-
"@sentry/integrations": "^7.
|
|
51
|
-
"@sentry/react": "^7.
|
|
52
|
-
"@sentry/tracing": "^7.
|
|
53
|
-
"@tanstack/react-query": "^4.
|
|
48
|
+
"@mui/lab": "^5.0.0-alpha.102",
|
|
49
|
+
"@mui/material": "^5.10.8",
|
|
50
|
+
"@sentry/integrations": "^7.14.2",
|
|
51
|
+
"@sentry/react": "^7.14.2",
|
|
52
|
+
"@sentry/tracing": "^7.14.2",
|
|
53
|
+
"@tanstack/react-query": "^4.10.3",
|
|
54
54
|
"@tanstack/react-virtual": "^3.0.0-beta.18",
|
|
55
55
|
"big.js": "^6.2.1",
|
|
56
|
-
"i18next": "^21.
|
|
56
|
+
"i18next": "^21.10.0",
|
|
57
57
|
"immer": "^9.0.15",
|
|
58
58
|
"microdiff": "^1.3.1",
|
|
59
59
|
"mitt": "^3.0.0",
|
|
60
60
|
"react": "^18.2.0",
|
|
61
61
|
"react-dom": "^18.2.0",
|
|
62
|
-
"react-hook-form": "^7.
|
|
62
|
+
"react-hook-form": "^7.37.0",
|
|
63
63
|
"react-i18next": "^11.18.6",
|
|
64
|
-
"react-router-dom": "^6.4.
|
|
64
|
+
"react-router-dom": "^6.4.2",
|
|
65
65
|
"react-timer-hook": "^3.0.5",
|
|
66
|
-
"zustand": "^4.1.
|
|
66
|
+
"zustand": "^4.1.2"
|
|
67
67
|
},
|
|
68
68
|
"peerDependencies": {
|
|
69
69
|
"@types/react": "^18.0.0",
|