@lifi/widget 1.24.0 → 1.25.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/AppDrawer.style.d.ts +1 -1
- package/AppProvider.js +1 -1
- package/cjs/AppDrawer.style.d.ts +1 -1
- package/cjs/AppProvider.js +1 -1
- package/cjs/components/ActiveSwaps/ActiveSwapItem.js +2 -1
- package/cjs/components/BottomSheet/types.d.ts +1 -1
- package/cjs/components/Card/Card.d.ts +2 -2
- package/cjs/components/Card/CardTitle.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.js +6 -1
- package/cjs/components/ChainSelect/useChainSelect.d.ts +3 -1
- package/cjs/components/ChainSelect/useChainSelect.js +12 -3
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SwapInput/FitInputText.d.ts +3 -0
- package/cjs/components/SwapInput/FitInputText.js +19 -0
- package/cjs/components/SwapInput/FormPriceHelperText.d.ts +1 -3
- package/cjs/components/SwapInput/FormPriceHelperText.js +1 -1
- package/cjs/components/SwapInput/SwapInput.js +12 -24
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +3 -0
- package/cjs/components/SwapInput/{SwapInputAdornment.js → SwapInputEndAdornment.js} +3 -3
- package/cjs/components/SwapInput/SwapInputStartAdornment.d.ts +3 -0
- package/cjs/components/SwapInput/SwapInputStartAdornment.js +21 -0
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +1 -1
- package/cjs/components/Token/Token.style.d.ts +1 -1
- package/cjs/components/TokenList/useTokenSelect.js +7 -4
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useGasSufficiency.js +1 -1
- package/cjs/hooks/useRouteExecution.js +1 -1
- package/cjs/hooks/useSwapRoutes.js +12 -9
- package/cjs/hooks/useTools.d.ts +1 -1
- package/cjs/i18n/en.json +3 -1
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +2 -1
- package/cjs/pages/SettingsPage/SlippageInput.js +2 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.js +61 -14
- package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -2
- package/cjs/pages/SwapPage/StatusBottomSheet.style.js +5 -2
- package/cjs/pages/SwapPage/SwapPage.js +8 -6
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
- package/cjs/providers/I18nProvider/types.d.ts +5 -5
- package/cjs/providers/SDKProvider/SDKProvider.js +4 -3
- package/cjs/providers/SwapFormProvider/FormUpdater.d.ts +5 -0
- package/cjs/providers/{WalletProvider/WalletFormUpdate.js → SwapFormProvider/FormUpdater.js} +24 -21
- package/cjs/providers/SwapFormProvider/SwapFormProvider.js +12 -7
- package/cjs/providers/SwapFormProvider/types.d.ts +2 -2
- package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -1
- package/cjs/providers/WalletProvider/WalletProvider.js +1 -2
- package/cjs/providers/WalletProvider/types.d.ts +3 -3
- package/cjs/providers/WidgetProvider/WidgetProvider.js +4 -0
- package/cjs/providers/WidgetProvider/types.d.ts +1 -1
- package/cjs/stores/routes/types.d.ts +8 -1
- package/cjs/stores/routes/types.js +10 -0
- package/cjs/stores/routes/useExecutingRoutesIds.js +3 -1
- package/cjs/stores/routes/useRouteExecutionStore.js +53 -18
- package/cjs/stores/routes/useSwapHistory.js +4 -1
- package/cjs/stores/routes/utils.d.ts +3 -1
- package/cjs/stores/routes/utils.js +12 -4
- package/cjs/stores/settings/types.d.ts +6 -6
- package/cjs/stores/settings/useSettingsStore.d.ts +12 -9
- package/cjs/stores/settings/useSettingsStore.js +22 -5
- package/cjs/types/events.d.ts +1 -1
- package/cjs/types/widget.d.ts +14 -8
- package/cjs/utils/enum.d.ts +1 -0
- package/cjs/utils/enum.js +5 -0
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +1 -0
- package/cjs/utils/navigationRoutes.d.ts +1 -1
- package/components/ActiveSwaps/ActiveSwapItem.js +2 -1
- package/components/BottomSheet/types.d.ts +1 -1
- package/components/Card/Card.d.ts +2 -2
- package/components/Card/CardTitle.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.js +6 -1
- package/components/ChainSelect/useChainSelect.d.ts +3 -1
- package/components/ChainSelect/useChainSelect.js +13 -4
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SwapInput/FitInputText.d.ts +3 -0
- package/components/SwapInput/FitInputText.js +16 -0
- package/components/SwapInput/FormPriceHelperText.d.ts +1 -3
- package/components/SwapInput/FormPriceHelperText.js +1 -1
- package/components/SwapInput/SwapInput.js +16 -28
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +3 -0
- package/components/SwapInput/{SwapInputAdornment.js → SwapInputEndAdornment.js} +1 -1
- package/components/SwapInput/SwapInputStartAdornment.d.ts +3 -0
- package/components/SwapInput/SwapInputStartAdornment.js +17 -0
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +1 -1
- package/components/SwapRoutes/SwapRoutes.style.d.ts +1 -1
- package/components/Token/Token.style.d.ts +1 -1
- package/components/TokenList/useTokenSelect.js +8 -5
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useGasSufficiency.js +2 -2
- package/hooks/useRouteExecution.js +2 -2
- package/hooks/useSwapRoutes.js +12 -9
- package/hooks/useTools.d.ts +1 -1
- package/i18n/en.json +3 -1
- package/package.json +13 -13
- package/pages/SettingsPage/RoutePrioritySelect.js +2 -1
- package/pages/SettingsPage/SlippageInput.js +2 -1
- package/pages/SwapPage/StatusBottomSheet.js +62 -15
- package/pages/SwapPage/StatusBottomSheet.style.d.ts +4 -2
- package/pages/SwapPage/StatusBottomSheet.style.js +5 -2
- package/pages/SwapPage/SwapPage.js +8 -6
- package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
- package/providers/I18nProvider/types.d.ts +5 -5
- package/providers/SDKProvider/SDKProvider.js +4 -3
- package/providers/SwapFormProvider/FormUpdater.d.ts +5 -0
- package/providers/{WalletProvider/WalletFormUpdate.js → SwapFormProvider/FormUpdater.js} +23 -20
- package/providers/SwapFormProvider/SwapFormProvider.js +12 -7
- package/providers/SwapFormProvider/types.d.ts +2 -2
- package/providers/WalletProvider/WalletProvider.d.ts +1 -1
- package/providers/WalletProvider/WalletProvider.js +2 -3
- package/providers/WalletProvider/types.d.ts +3 -3
- package/providers/WidgetProvider/WidgetProvider.js +5 -1
- package/providers/WidgetProvider/types.d.ts +1 -1
- package/stores/routes/types.d.ts +8 -1
- package/stores/routes/types.js +9 -1
- package/stores/routes/useExecutingRoutesIds.js +3 -1
- package/stores/routes/useRouteExecutionStore.js +51 -16
- package/stores/routes/useSwapHistory.js +4 -1
- package/stores/routes/utils.d.ts +3 -1
- package/stores/routes/utils.js +8 -2
- package/stores/settings/types.d.ts +6 -6
- package/stores/settings/useSettingsStore.d.ts +12 -9
- package/stores/settings/useSettingsStore.js +20 -4
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +1 -1
- package/types/widget.d.ts +14 -8
- package/utils/enum.d.ts +1 -0
- package/utils/enum.js +1 -0
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/navigationRoutes.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.d.ts +0 -3
- package/cjs/providers/WalletProvider/WalletFormUpdate.d.ts +0 -5
- package/components/SwapInput/SwapInputAdornment.d.ts +0 -3
- package/providers/WalletProvider/WalletFormUpdate.d.ts +0 -5
package/AppDrawer.style.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
|
39
39
|
} | undefined;
|
|
40
40
|
}, {}, {}>;
|
|
41
41
|
export declare const DrawerButtonTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
42
|
-
align?: "
|
|
42
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
43
43
|
children?: import("react").ReactNode;
|
|
44
44
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
45
45
|
gutterBottom?: boolean | undefined;
|
package/AppProvider.js
CHANGED
|
@@ -6,7 +6,7 @@ import { queryClient } from './config/queryClient';
|
|
|
6
6
|
import { I18nProvider, SDKProvider, SwapFormProvider, TelemetryProvider, ThemeProvider, WalletProvider, WidgetProvider, } from './providers';
|
|
7
7
|
const QueryProvider = QueryClientProvider;
|
|
8
8
|
export const AppProvider = ({ children, config, }) => {
|
|
9
|
-
return (_jsx(QueryProvider, Object.assign({ client: queryClient }, { children: _jsx(WidgetProvider, Object.assign({ config: config }, { children: _jsx(SDKProvider, { children: _jsx(TelemetryProvider, { children: _jsx(
|
|
9
|
+
return (_jsx(QueryProvider, Object.assign({ client: queryClient }, { children: _jsx(WidgetProvider, Object.assign({ config: config }, { children: _jsx(SDKProvider, { children: _jsx(TelemetryProvider, { children: _jsx(ThemeProvider, { children: _jsx(I18nProvider, { children: _jsx(WalletProvider, { children: _jsx(SwapFormProvider, { children: _jsx(AppRouter, { children: children }) }) }) }) }) }) }) })) })));
|
|
10
10
|
};
|
|
11
11
|
export const AppRouter = ({ children }) => {
|
|
12
12
|
const inRouterContext = useInRouterContext();
|
package/cjs/AppDrawer.style.d.ts
CHANGED
|
@@ -39,7 +39,7 @@ export declare const DrawerButton: import("@emotion/styled").StyledComponent<{
|
|
|
39
39
|
} | undefined;
|
|
40
40
|
}, {}, {}>;
|
|
41
41
|
export declare const DrawerButtonTypography: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
42
|
-
align?: "
|
|
42
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
43
43
|
children?: import("react").ReactNode;
|
|
44
44
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
45
45
|
gutterBottom?: boolean | undefined;
|
package/cjs/AppProvider.js
CHANGED
|
@@ -9,7 +9,7 @@ const queryClient_1 = require("./config/queryClient");
|
|
|
9
9
|
const providers_1 = require("./providers");
|
|
10
10
|
const QueryProvider = react_query_1.QueryClientProvider;
|
|
11
11
|
const AppProvider = ({ children, config, }) => {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(QueryProvider, Object.assign({ client: queryClient_1.queryClient }, { children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(providers_1.SDKProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.TelemetryProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(QueryProvider, Object.assign({ client: queryClient_1.queryClient }, { children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, Object.assign({ config: config }, { children: (0, jsx_runtime_1.jsx)(providers_1.SDKProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.TelemetryProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.I18nProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.WalletProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.SwapFormProvider, { children: (0, jsx_runtime_1.jsx)(exports.AppRouter, { children: children }) }) }) }) }) }) }) })) })));
|
|
13
13
|
};
|
|
14
14
|
exports.AppProvider = AppProvider;
|
|
15
15
|
const AppRouter = ({ children }) => {
|
|
@@ -6,6 +6,7 @@ const icons_material_1 = require("@mui/icons-material");
|
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_router_dom_1 = require("react-router-dom");
|
|
8
8
|
const hooks_1 = require("../../hooks");
|
|
9
|
+
const stores_1 = require("../../stores");
|
|
9
10
|
const utils_1 = require("../../utils");
|
|
10
11
|
const StepTimer_1 = require("../Step/StepTimer");
|
|
11
12
|
const TokenAvatar_1 = require("../TokenAvatar");
|
|
@@ -40,6 +41,6 @@ const ActiveSwapItem = ({ routeId, dense }) => {
|
|
|
40
41
|
alignItems: 'center',
|
|
41
42
|
marginLeft: 2,
|
|
42
43
|
height: 16,
|
|
43
|
-
} }, { children: [route.fromToken.symbol, (0, jsx_runtime_1.jsx)(icons_material_1.ArrowForward, { sx: { paddingX: 0.5 } }), route.toToken.symbol] })), secondary: status !==
|
|
44
|
+
} }, { children: [route.fromToken.symbol, (0, jsx_runtime_1.jsx)(icons_material_1.ArrowForward, { sx: { paddingX: 0.5 } }), route.toToken.symbol] })), secondary: status !== stores_1.RouteExecutionStatus.Done ? ((0, jsx_runtime_1.jsx)(material_1.Typography, Object.assign({ fontWeight: 400, fontSize: 12, color: "text.secondary", lineHeight: 1, mt: 0.75, ml: 2 }, { children: title }))) : null }), getStatusComponent()] })));
|
|
44
45
|
};
|
|
45
46
|
exports.ActiveSwapItem = ActiveSwapItem;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { DrawerProps } from '@mui/material';
|
|
2
2
|
import type { RefObject } from 'react';
|
|
3
|
-
export
|
|
3
|
+
export type BottomSheetProps = DrawerProps & {
|
|
4
4
|
elementRef?: RefObject<HTMLDivElement>;
|
|
5
5
|
};
|
|
6
6
|
export interface BottomSheetBase {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { BoxProps, Theme } from '@mui/material';
|
|
2
2
|
import type { MouseEventHandler } from 'react';
|
|
3
|
-
|
|
4
|
-
export
|
|
3
|
+
type CardVariant = 'default' | 'selected' | 'error';
|
|
4
|
+
export type CardProps = {
|
|
5
5
|
variant?: CardVariant;
|
|
6
6
|
selectionColor?: 'primary' | 'secondary';
|
|
7
7
|
dense?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const CardTitle: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
-
align?: "
|
|
3
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
6
|
gutterBottom?: boolean | undefined;
|
|
@@ -13,10 +13,15 @@ const useChainSelect_1 = require("./useChainSelect");
|
|
|
13
13
|
const ChainSelect = ({ formType }) => {
|
|
14
14
|
var _a;
|
|
15
15
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
16
|
-
const { chains, getChains, setCurrentChain,
|
|
16
|
+
const { chainOrder, chains, getChains, isLoading, setChainOrder, setCurrentChain, } = (0, useChainSelect_1.useChainSelect)(formType);
|
|
17
17
|
const [chainId] = (0, react_hook_form_1.useWatch)({
|
|
18
18
|
name: [providers_1.SwapFormKeyHelper.getChainKey(formType)],
|
|
19
19
|
});
|
|
20
|
+
const hasChainInOrderedList = chainOrder.includes(chainId);
|
|
21
|
+
// If we don't have a chain in the ordered chain list we should add it.
|
|
22
|
+
if (!hasChainInOrderedList) {
|
|
23
|
+
setChainOrder(chainId);
|
|
24
|
+
}
|
|
20
25
|
const showAllChains = () => {
|
|
21
26
|
navigate(utils_1.navigationRoutes[`${formType}Chain`]);
|
|
22
27
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import type { EVMChain } from '@lifi/sdk';
|
|
2
2
|
import type { SwapFormType } from '../../providers';
|
|
3
3
|
export declare const useChainSelect: (formType: SwapFormType) => {
|
|
4
|
+
chainOrder: number[];
|
|
4
5
|
chains: import("@lifi/sdk").ExtendedChain[] | undefined;
|
|
5
6
|
getChains: () => EVMChain[];
|
|
6
|
-
setCurrentChain: (chainId: number) => void;
|
|
7
7
|
isLoading: boolean;
|
|
8
|
+
setChainOrder: (chainId: number) => void;
|
|
9
|
+
setCurrentChain: (chainId: number) => void;
|
|
8
10
|
};
|
|
@@ -6,10 +6,11 @@ const hooks_1 = require("../../hooks");
|
|
|
6
6
|
const providers_1 = require("../../providers");
|
|
7
7
|
const stores_1 = require("../../stores");
|
|
8
8
|
const useChainSelect = (formType) => {
|
|
9
|
+
const chainKey = providers_1.SwapFormKeyHelper.getChainKey(formType);
|
|
10
|
+
const { field: { onChange, onBlur }, } = (0, react_hook_form_1.useController)({ name: chainKey });
|
|
9
11
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
10
12
|
const { chains, isLoading } = (0, hooks_1.useChains)();
|
|
11
13
|
const [chainOrder, setChainOrder] = (0, stores_1.useChainOrder)();
|
|
12
|
-
const chainKey = providers_1.SwapFormKeyHelper.getChainKey(formType);
|
|
13
14
|
const getChains = () => {
|
|
14
15
|
if (!chains) {
|
|
15
16
|
return [];
|
|
@@ -20,12 +21,20 @@ const useChainSelect = (formType) => {
|
|
|
20
21
|
return selectedChains;
|
|
21
22
|
};
|
|
22
23
|
const setCurrentChain = (chainId) => {
|
|
23
|
-
|
|
24
|
+
onChange(chainId);
|
|
25
|
+
onBlur();
|
|
24
26
|
setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), '');
|
|
25
27
|
setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
|
|
26
28
|
setValue(providers_1.SwapFormKey.TokenSearchFilter, '');
|
|
27
29
|
setChainOrder(chainId);
|
|
28
30
|
};
|
|
29
|
-
return {
|
|
31
|
+
return {
|
|
32
|
+
chainOrder,
|
|
33
|
+
chains,
|
|
34
|
+
getChains,
|
|
35
|
+
isLoading,
|
|
36
|
+
setChainOrder,
|
|
37
|
+
setCurrentChain,
|
|
38
|
+
};
|
|
30
39
|
};
|
|
31
40
|
exports.useChainSelect = useChainSelect;
|
|
@@ -8,7 +8,7 @@ export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
|
8
8
|
fullWidth?: boolean | undefined;
|
|
9
9
|
focused?: boolean | undefined;
|
|
10
10
|
hiddenLabel?: boolean | undefined;
|
|
11
|
-
margin?: "
|
|
11
|
+
margin?: "normal" | "none" | "dense" | undefined;
|
|
12
12
|
required?: boolean | undefined;
|
|
13
13
|
size?: "small" | "medium" | undefined;
|
|
14
14
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.FitInputText = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
6
|
+
const providers_1 = require("../../providers");
|
|
7
|
+
const utils_1 = require("../../utils");
|
|
8
|
+
const SwapInput_style_1 = require("./SwapInput.style");
|
|
9
|
+
exports.FitInputText = (0, react_1.forwardRef)(({ formType }, ref) => {
|
|
10
|
+
const amountKey = providers_1.SwapFormKeyHelper.getAmountKey(formType);
|
|
11
|
+
const [amount] = (0, react_hook_form_1.useWatch)({
|
|
12
|
+
name: [amountKey],
|
|
13
|
+
});
|
|
14
|
+
(0, react_1.useLayoutEffect)(() => {
|
|
15
|
+
(0, utils_1.fitInputText)(SwapInput_style_1.maxInputFontSize, SwapInput_style_1.minInputFontSize, ref
|
|
16
|
+
.current);
|
|
17
|
+
}, [amount, ref]);
|
|
18
|
+
return null;
|
|
19
|
+
});
|
|
@@ -8,7 +8,7 @@ const react_i18next_1 = require("react-i18next");
|
|
|
8
8
|
const hooks_1 = require("../../hooks");
|
|
9
9
|
const providers_1 = require("../../providers");
|
|
10
10
|
const utils_1 = require("../../utils");
|
|
11
|
-
const FormPriceHelperText = ({ formType,
|
|
11
|
+
const FormPriceHelperText = ({ formType, }) => {
|
|
12
12
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
13
|
const [amount, chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
|
|
14
14
|
name: [
|
|
@@ -5,49 +5,37 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_1 = require("react");
|
|
6
6
|
const react_hook_form_1 = require("react-hook-form");
|
|
7
7
|
const react_i18next_1 = require("react-i18next");
|
|
8
|
-
const hooks_1 = require("../../hooks");
|
|
9
8
|
const providers_1 = require("../../providers");
|
|
10
9
|
const types_1 = require("../../types");
|
|
11
10
|
const utils_1 = require("../../utils");
|
|
12
11
|
const Card_1 = require("../Card");
|
|
13
|
-
const
|
|
12
|
+
const FitInputText_1 = require("./FitInputText");
|
|
14
13
|
const FormPriceHelperText_1 = require("./FormPriceHelperText");
|
|
15
14
|
const SwapInput_style_1 = require("./SwapInput.style");
|
|
16
|
-
const
|
|
15
|
+
const SwapInputEndAdornment_1 = require("./SwapInputEndAdornment");
|
|
16
|
+
const SwapInputStartAdornment_1 = require("./SwapInputStartAdornment");
|
|
17
17
|
const SwapInput = ({ formType }) => {
|
|
18
18
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
19
|
-
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
20
|
-
const { disabledUI } = (0, providers_1.useWidgetConfig)();
|
|
21
|
-
const ref = (0, react_1.useRef)(null);
|
|
22
19
|
const amountKey = providers_1.SwapFormKeyHelper.getAmountKey(formType);
|
|
23
|
-
const
|
|
24
|
-
name:
|
|
25
|
-
amountKey,
|
|
26
|
-
providers_1.SwapFormKeyHelper.getChainKey(formType),
|
|
27
|
-
providers_1.SwapFormKeyHelper.getTokenKey(formType),
|
|
28
|
-
],
|
|
20
|
+
const { field: { onChange, onBlur, value }, } = (0, react_hook_form_1.useController)({
|
|
21
|
+
name: amountKey,
|
|
29
22
|
});
|
|
30
|
-
const {
|
|
31
|
-
const
|
|
32
|
-
const isSelected = !!(chain && token);
|
|
23
|
+
const { disabledUI } = (0, providers_1.useWidgetConfig)();
|
|
24
|
+
const ref = (0, react_1.useRef)(null);
|
|
33
25
|
const handleChange = (event) => {
|
|
34
26
|
const { value } = event.target;
|
|
35
27
|
const formattedAmount = (0, utils_1.formatAmount)(value, true);
|
|
36
|
-
|
|
37
|
-
shouldTouch: true,
|
|
38
|
-
});
|
|
28
|
+
onChange(formattedAmount);
|
|
39
29
|
};
|
|
40
30
|
const handleBlur = (event) => {
|
|
41
31
|
const { value } = event.target;
|
|
42
32
|
const formattedAmount = (0, utils_1.formatAmount)(value);
|
|
43
|
-
|
|
33
|
+
onChange(formattedAmount);
|
|
34
|
+
onBlur();
|
|
44
35
|
};
|
|
45
|
-
(0, react_1.useLayoutEffect)(() => {
|
|
46
|
-
(0, utils_1.fitInputText)(SwapInput_style_1.maxInputFontSize, SwapInput_style_1.minInputFontSize, ref.current);
|
|
47
|
-
}, [amount]);
|
|
48
36
|
const disabled = disabledUI === null || disabledUI === void 0 ? void 0 : disabledUI.includes(types_1.DisabledUI.FromAmount);
|
|
49
|
-
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.fromAmount') }), (0, jsx_runtime_1.jsxs)(SwapInput_style_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(SwapInput_style_1.Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment:
|
|
37
|
+
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t('swap.fromAmount') }), (0, jsx_runtime_1.jsxs)(SwapInput_style_1.FormControl, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(SwapInput_style_1.Input, { inputRef: ref, size: "small", autoComplete: "off", placeholder: "0", startAdornment: (0, jsx_runtime_1.jsx)(SwapInputStartAdornment_1.SwapInputStartAdornment, { formType: formType }), endAdornment: !disabled ? ((0, jsx_runtime_1.jsx)(SwapInputEndAdornment_1.SwapInputEndAdornment, { formType: formType })) : undefined, inputProps: {
|
|
50
38
|
inputMode: 'decimal',
|
|
51
|
-
}, onChange: handleChange, onBlur: handleBlur, value:
|
|
39
|
+
}, onChange: handleChange, onBlur: handleBlur, value: value, name: amountKey, disabled: disabled, required: true }), (0, jsx_runtime_1.jsx)(FormPriceHelperText_1.FormPriceHelperText, { formType: formType })] })), (0, jsx_runtime_1.jsx)(FitInputText_1.FitInputText, { ref: ref, formType: formType })] }));
|
|
52
40
|
};
|
|
53
41
|
exports.SwapInput = SwapInput;
|
|
@@ -10,7 +10,7 @@ export declare const FormControl: import("@emotion/styled").StyledComponent<{
|
|
|
10
10
|
fullWidth?: boolean | undefined;
|
|
11
11
|
focused?: boolean | undefined;
|
|
12
12
|
hiddenLabel?: boolean | undefined;
|
|
13
|
-
margin?: "
|
|
13
|
+
margin?: "normal" | "none" | "dense" | undefined;
|
|
14
14
|
required?: boolean | undefined;
|
|
15
15
|
size?: "small" | "medium" | undefined;
|
|
16
16
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SwapInputEndAdornment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const react_hook_form_1 = require("react-hook-form");
|
|
@@ -8,7 +8,7 @@ const react_i18next_1 = require("react-i18next");
|
|
|
8
8
|
const hooks_1 = require("../../hooks");
|
|
9
9
|
const providers_1 = require("../../providers");
|
|
10
10
|
const SwapInputAdornment_style_1 = require("./SwapInputAdornment.style");
|
|
11
|
-
const
|
|
11
|
+
const SwapInputEndAdornment = ({ formType }) => {
|
|
12
12
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
13
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
14
14
|
const [chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
|
|
@@ -26,4 +26,4 @@ const SwapInputAdornment = ({ formType }) => {
|
|
|
26
26
|
};
|
|
27
27
|
return ((0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "rectangular", width: 46, height: 24, sx: { borderRadius: 0.5 } })) : formType === 'from' && (token === null || token === void 0 ? void 0 : token.amount) ? ((0, jsx_runtime_1.jsx)(SwapInputAdornment_style_1.Button, Object.assign({ onClick: handleMax }, { children: t('button.max') }))) : null })));
|
|
28
28
|
};
|
|
29
|
-
exports.
|
|
29
|
+
exports.SwapInputEndAdornment = SwapInputEndAdornment;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SwapInputStartAdornment = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_hook_form_1 = require("react-hook-form");
|
|
6
|
+
const hooks_1 = require("../../hooks");
|
|
7
|
+
const providers_1 = require("../../providers");
|
|
8
|
+
const TokenAvatar_1 = require("../TokenAvatar");
|
|
9
|
+
const SwapInputStartAdornment = ({ formType, }) => {
|
|
10
|
+
const [chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
|
|
11
|
+
name: [
|
|
12
|
+
providers_1.SwapFormKeyHelper.getChainKey(formType),
|
|
13
|
+
providers_1.SwapFormKeyHelper.getTokenKey(formType),
|
|
14
|
+
],
|
|
15
|
+
});
|
|
16
|
+
const { chain } = (0, hooks_1.useChain)(chainId);
|
|
17
|
+
const { token } = (0, hooks_1.useToken)(chainId, tokenAddress);
|
|
18
|
+
const isSelected = !!(chain && token);
|
|
19
|
+
return isSelected ? ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain, sx: { marginLeft: 2 } })) : ((0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatarSkeleton, { sx: { marginLeft: 2 } }));
|
|
20
|
+
};
|
|
21
|
+
exports.SwapInputStartAdornment = SwapInputStartAdornment;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
export declare const Label: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
3
|
-
align?: "
|
|
3
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
4
4
|
children?: import("react").ReactNode;
|
|
5
5
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
6
6
|
gutterBottom?: boolean | undefined;
|
|
@@ -34,7 +34,7 @@ export declare const Header: import("@emotion/styled").StyledComponent<import("@
|
|
|
34
34
|
export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
35
35
|
ref?: import("react").Ref<unknown> | undefined;
|
|
36
36
|
children?: import("react").ReactNode;
|
|
37
|
-
direction?: import("@mui/system").ResponsiveStyleValue<"
|
|
37
|
+
direction?: import("@mui/system").ResponsiveStyleValue<"column" | "column-reverse" | "row" | "row-reverse"> | undefined;
|
|
38
38
|
spacing?: import("@mui/system").ResponsiveStyleValue<string | number> | undefined;
|
|
39
39
|
divider?: import("react").ReactNode;
|
|
40
40
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
@@ -10,7 +10,7 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
|
|
|
10
10
|
connected?: boolean | undefined;
|
|
11
11
|
}, {}, {}>;
|
|
12
12
|
export declare const TextSecondary: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
13
|
-
align?: "
|
|
13
|
+
align?: "left" | "right" | "inherit" | "center" | "justify" | undefined;
|
|
14
14
|
children?: import("react").ReactNode;
|
|
15
15
|
classes?: Partial<import("@mui/material").TypographyClasses> | undefined;
|
|
16
16
|
gutterBottom?: boolean | undefined;
|
|
@@ -5,14 +5,16 @@ const react_1 = require("react");
|
|
|
5
5
|
const react_hook_form_1 = require("react-hook-form");
|
|
6
6
|
const providers_1 = require("../../providers");
|
|
7
7
|
const useTokenSelect = (formType, onClick) => {
|
|
8
|
+
const tokenKey = providers_1.SwapFormKeyHelper.getTokenKey(formType);
|
|
9
|
+
const { field: { onChange, onBlur }, } = (0, react_hook_form_1.useController)({ name: tokenKey });
|
|
8
10
|
const { setValue, getValues } = (0, react_hook_form_1.useFormContext)();
|
|
9
11
|
return (0, react_1.useCallback)((tokenAddress, chainId) => {
|
|
12
|
+
onChange(tokenAddress);
|
|
13
|
+
onBlur();
|
|
10
14
|
const selectedChainId = chainId !== null && chainId !== void 0 ? chainId : getValues(providers_1.SwapFormKeyHelper.getChainKey(formType));
|
|
11
|
-
setValue(providers_1.SwapFormKeyHelper.getTokenKey(formType), tokenAddress, {
|
|
12
|
-
shouldTouch: true,
|
|
13
|
-
});
|
|
14
15
|
// Set chain again to trigger URL builder update
|
|
15
16
|
setValue(providers_1.SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
17
|
+
shouldDirty: true,
|
|
16
18
|
shouldTouch: true,
|
|
17
19
|
});
|
|
18
20
|
setValue(providers_1.SwapFormKeyHelper.getAmountKey(formType), '');
|
|
@@ -24,10 +26,11 @@ const useTokenSelect = (formType, onClick) => {
|
|
|
24
26
|
if (selectedOppositeToken === tokenAddress &&
|
|
25
27
|
selectedOppositeChainId === selectedChainId) {
|
|
26
28
|
setValue(providers_1.SwapFormKeyHelper.getTokenKey(oppositeFormType), '', {
|
|
29
|
+
shouldDirty: true,
|
|
27
30
|
shouldTouch: true,
|
|
28
31
|
});
|
|
29
32
|
}
|
|
30
33
|
onClick === null || onClick === void 0 ? void 0 : onClick();
|
|
31
|
-
}, [formType, getValues, onClick, setValue]);
|
|
34
|
+
}, [formType, getValues, onBlur, onChange, onClick, setValue]);
|
|
32
35
|
};
|
|
33
36
|
exports.useTokenSelect = useTokenSelect;
|
package/cjs/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.25.1";
|
package/cjs/config/version.js
CHANGED
|
@@ -78,7 +78,7 @@ const useGasSufficiency = (route) => {
|
|
|
78
78
|
});
|
|
79
79
|
const { data: insufficientFunds, isInitialLoading: insufficientFundsLoading, } = (0, react_query_1.useQuery)(['funds-sufficiency-check', account.address, route === null || route === void 0 ? void 0 : route.id], () => __awaiter(void 0, void 0, void 0, function* () {
|
|
80
80
|
var _c, _d, _e, _f;
|
|
81
|
-
if (!account.address || !fromToken || !route || (0, stores_1.
|
|
81
|
+
if (!account.address || !fromToken || !route || (0, stores_1.isRouteDone)(route)) {
|
|
82
82
|
return null;
|
|
83
83
|
}
|
|
84
84
|
let currentTokenBalance = (0, big_js_1.default)((_c = fromToken === null || fromToken === void 0 ? void 0 : fromToken.amount) !== null && _c !== void 0 ? _c : 0);
|
|
@@ -39,7 +39,7 @@ const useRouteExecution = (routeId, executeInBackground) => {
|
|
|
39
39
|
process,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
|
-
if ((0, stores_1.
|
|
42
|
+
if ((0, stores_1.isRouteDone)(clonedUpdatedRoute)) {
|
|
43
43
|
emitter.emit(events_1.WidgetEvent.RouteExecutionCompleted, clonedUpdatedRoute);
|
|
44
44
|
}
|
|
45
45
|
if ((0, stores_1.isRouteFailed)(clonedUpdatedRoute) && process) {
|
|
@@ -19,9 +19,9 @@ const providers_1 = require("../providers");
|
|
|
19
19
|
const stores_1 = require("../stores");
|
|
20
20
|
const refetchTime = 60000;
|
|
21
21
|
const useSwapRoutes = () => {
|
|
22
|
-
var _a;
|
|
22
|
+
var _a, _b;
|
|
23
23
|
const lifi = (0, providers_1.useLiFi)();
|
|
24
|
-
const { variant } = (0, providers_1.useWidgetConfig)();
|
|
24
|
+
const { variant, sdkConfig } = (0, providers_1.useWidgetConfig)();
|
|
25
25
|
const { account, provider } = (0, providers_1.useWallet)();
|
|
26
26
|
const queryClient = (0, react_query_1.useQueryClient)();
|
|
27
27
|
const { slippage, enabledBridges, enabledExchanges, routePriority } = (0, stores_1.useSettings)([
|
|
@@ -65,22 +65,25 @@ const useSwapRoutes = () => {
|
|
|
65
65
|
enabledExchanges,
|
|
66
66
|
routePriority,
|
|
67
67
|
variant,
|
|
68
|
+
(_a = sdkConfig === null || sdkConfig === void 0 ? void 0 : sdkConfig.defaultRouteOptions) === null || _a === void 0 ? void 0 : _a.allowSwitchChain,
|
|
68
69
|
];
|
|
69
|
-
const previousDataUpdatedAt = (
|
|
70
|
+
const previousDataUpdatedAt = (_b = queryClient.getQueryState(queryKey)) === null || _b === void 0 ? void 0 : _b.dataUpdatedAt;
|
|
70
71
|
const refetchInterval = previousDataUpdatedAt
|
|
71
72
|
? Math.min(Math.abs(refetchTime - (Date.now() - previousDataUpdatedAt)), refetchTime)
|
|
72
73
|
: refetchTime;
|
|
73
|
-
const { data, isLoading, isFetching, isFetched, dataUpdatedAt, refetch } = (0, react_query_1.useQuery)(queryKey, ({ queryKey: [_, fromAddress, fromChainId, fromTokenAddress, fromTokenAmount, toChainId, toTokenAddress, toAddress, slippage, enabledBridges, enabledExchanges, routePriority, variant,], signal, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
74
|
-
var
|
|
74
|
+
const { data, isLoading, isFetching, isFetched, dataUpdatedAt, refetch } = (0, react_query_1.useQuery)(queryKey, ({ queryKey: [_, fromAddress, fromChainId, fromTokenAddress, fromTokenAmount, toChainId, toTokenAddress, toAddress, slippage, enabledBridges, enabledExchanges, routePriority, variant, allowSwitchChain,], signal, }) => __awaiter(void 0, void 0, void 0, function* () {
|
|
75
|
+
var _c, _d;
|
|
75
76
|
let toWalletAddress;
|
|
76
77
|
try {
|
|
77
78
|
toWalletAddress =
|
|
78
|
-
(
|
|
79
|
+
(_c = (yield (provider === null || provider === void 0 ? void 0 : provider.resolveName(toAddress)))) !== null && _c !== void 0 ? _c : ((0, address_1.isAddress)(toAddress) ? toAddress : fromAddress);
|
|
79
80
|
}
|
|
80
|
-
catch (
|
|
81
|
+
catch (_e) {
|
|
81
82
|
toWalletAddress = (0, address_1.isAddress)(toAddress) ? toAddress : fromAddress;
|
|
82
83
|
}
|
|
83
|
-
const fromAmount = (0, big_js_1.default)(
|
|
84
|
+
const fromAmount = (0, big_js_1.default)(fromTokenAmount)
|
|
85
|
+
.mul(Math.pow(10, ((_d = fromToken === null || fromToken === void 0 ? void 0 : fromToken.decimals) !== null && _d !== void 0 ? _d : 0)))
|
|
86
|
+
.toString();
|
|
84
87
|
const formattedSlippage = parseFloat(slippage) / 100;
|
|
85
88
|
return lifi.getRoutes({
|
|
86
89
|
fromChainId,
|
|
@@ -99,7 +102,7 @@ const useSwapRoutes = () => {
|
|
|
99
102
|
allow: enabledExchanges,
|
|
100
103
|
},
|
|
101
104
|
order: routePriority,
|
|
102
|
-
allowSwitchChain: variant
|
|
105
|
+
allowSwitchChain: variant === 'refuel' ? false : allowSwitchChain,
|
|
103
106
|
},
|
|
104
107
|
}, { signal });
|
|
105
108
|
}), {
|
package/cjs/hooks/useTools.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import type { Bridge, Exchange } from '@lifi/sdk';
|
|
|
2
2
|
interface WidgetBridge extends Omit<Bridge, 'key'> {
|
|
3
3
|
key: string;
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
type FormattedTool<T, K extends keyof T> = Record<string, Pick<T, K>>;
|
|
6
6
|
export declare const useTools: () => {
|
|
7
7
|
tools: import("@lifi/sdk").ToolsResponse | undefined;
|
|
8
8
|
formattedTools: {
|
package/cjs/i18n/en.json
CHANGED
|
@@ -148,10 +148,12 @@
|
|
|
148
148
|
"stepSwapAndBridge": "Swap and bridge",
|
|
149
149
|
"success": {
|
|
150
150
|
"message": {
|
|
151
|
-
"
|
|
151
|
+
"swapPartiallySuccessful": "We've tried to complete the swap, but {{tool}} ran out of liquidity for {{tokenSymbol}} token.",
|
|
152
|
+
"swapSuccessful": "There are now {{amount, number(maximumFractionDigits: 4)}} {{tokenSymbol}} in {{walletAddress}} wallet on {{chainName}} chain."
|
|
152
153
|
},
|
|
153
154
|
"title": {
|
|
154
155
|
"gasSwapSuccessful": "Gas swap successful",
|
|
156
|
+
"swapPartiallySuccessful": "Swap partially successful",
|
|
155
157
|
"swapSuccessful": "Swap successful"
|
|
156
158
|
}
|
|
157
159
|
},
|
|
@@ -13,7 +13,8 @@ const RoutePrioritySelect = () => {
|
|
|
13
13
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
14
14
|
const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
|
|
15
15
|
const { routePriority } = (0, stores_1.useSettings)(['routePriority']);
|
|
16
|
-
|
|
16
|
+
const value = routePriority !== null && routePriority !== void 0 ? routePriority : '';
|
|
17
|
+
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.routePriority`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(Select_1.Select, Object.assign({ MenuProps: { elevation: 2 }, value: value, onChange: (event) => setValue('routePriority', event.target.value), IconComponent: icons_material_1.KeyboardArrowDown, dense: true }, { children: sdk_1.Orders.map((order) => {
|
|
17
18
|
const tag = t(`swap.tags.${order.toUpperCase()}`);
|
|
18
19
|
const tagName = `${tag[0]}${tag.slice(1).toLowerCase()}`;
|
|
19
20
|
return ((0, jsx_runtime_1.jsx)(material_1.MenuItem, Object.assign({ value: order }, { children: tagName }), order));
|
|
@@ -22,8 +22,9 @@ const SlippageInput = () => {
|
|
|
22
22
|
const { value } = event.target;
|
|
23
23
|
setValue('slippage', (0, utils_1.formatSlippage)(value, defaultValue.current));
|
|
24
24
|
};
|
|
25
|
+
const value = slippage !== null && slippage !== void 0 ? slippage : '';
|
|
25
26
|
return ((0, jsx_runtime_1.jsxs)(Card_1.Card, { children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { children: t(`settings.slippage`) }), (0, jsx_runtime_1.jsx)(material_1.FormControl, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(Input_1.Input, { size: "small", placeholder: t(`settings.slippage`), endAdornment: (0, jsx_runtime_1.jsx)(material_1.InputAdornment, Object.assign({ position: "end" }, { children: "%" })), autoComplete: "off", inputProps: {
|
|
26
27
|
inputMode: 'decimal',
|
|
27
|
-
}, onChange: handleChange, onBlur: handleBlur, value:
|
|
28
|
+
}, onChange: handleChange, onBlur: handleBlur, value: value }) }))] }));
|
|
28
29
|
};
|
|
29
30
|
exports.SlippageInput = SlippageInput;
|