@lifi/widget 3.15.0 → 3.15.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/esm/components/Messages/GasSufficiencyMessage.d.ts +2 -1
- package/dist/esm/components/Messages/GasSufficiencyMessage.js +2 -2
- package/dist/esm/components/Messages/GasSufficiencyMessage.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/i18n/en.json +7 -8
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js +2 -2
- package/dist/esm/pages/SendToWallet/BookmarkAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.d.ts +0 -1
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js +5 -7
- package/dist/esm/pages/SendToWallet/ConfirmAddressSheet.js.map +1 -1
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js +1 -3
- package/dist/esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Messages/GasSufficiencyMessage.tsx +4 -2
- package/src/config/version.ts +1 -1
- package/src/i18n/en.json +7 -8
- package/src/pages/SendToWallet/BookmarkAddressSheet.tsx +8 -4
- package/src/pages/SendToWallet/ConfirmAddressSheet.tsx +8 -29
- package/src/pages/SendToWallet/SendToWalletPage.tsx +0 -5
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [3.15.1](https://github.com/lifinance/widget/compare/v3.15.0...v3.15.1) (2025-01-31)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
* improve funds loss warning message ([317f8b1](https://github.com/lifinance/widget/commit/317f8b131cfc0c685ebb5e4f4fe1a9828afa4a51))
|
|
11
|
+
* include gas sufficiency message props ([2b29bd8](https://github.com/lifinance/widget/commit/2b29bd857a81733dfe61894fc446814be3b6c7b0))
|
|
12
|
+
|
|
5
13
|
## [3.15.0](https://github.com/lifinance/widget/compare/v3.14.2...v3.15.0) (2025-01-30)
|
|
6
14
|
|
|
7
15
|
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { type BoxProps } from '@mui/material';
|
|
1
2
|
import type { GasSufficiency } from '../../hooks/useGasSufficiency.js';
|
|
2
|
-
interface GasSufficiencyMessageProps {
|
|
3
|
+
interface GasSufficiencyMessageProps extends BoxProps {
|
|
3
4
|
insufficientGas?: GasSufficiency[];
|
|
4
5
|
}
|
|
5
6
|
export declare const GasSufficiencyMessage: React.FC<GasSufficiencyMessageProps>;
|
|
@@ -4,11 +4,11 @@ import { Typography } from '@mui/material';
|
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
5
|
import { formatUnits } from 'viem';
|
|
6
6
|
import { AlertMessage } from './AlertMessage.js';
|
|
7
|
-
export const GasSufficiencyMessage = ({ insufficientGas, }) => {
|
|
7
|
+
export const GasSufficiencyMessage = ({ insufficientGas, ...props }) => {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
return (_jsxs(AlertMessage, { severity: "warning", icon: _jsx(EvStation, {}), title: _jsx(Typography, { variant: "body2", sx: {
|
|
10
10
|
fontWeight: 700,
|
|
11
|
-
}, children: t('warning.title.insufficientGas') }), children: [_jsx(Typography, { variant: "body2", sx: {
|
|
11
|
+
}, children: t('warning.title.insufficientGas') }), ...props, children: [_jsx(Typography, { variant: "body2", sx: {
|
|
12
12
|
px: 2,
|
|
13
13
|
pt: 1,
|
|
14
14
|
}, children: t('warning.message.insufficientGas') }), insufficientGas?.map((item, index) => (_jsx(Typography, { variant: "body2", sx: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GasSufficiencyMessage.js","sourceRoot":"","sources":["../../../../src/components/Messages/GasSufficiencyMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,
|
|
1
|
+
{"version":3,"file":"GasSufficiencyMessage.js","sourceRoot":"","sources":["../../../../src/components/Messages/GasSufficiencyMessage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,qBAAqB,CAAA;AAC/C,OAAO,EAAiB,UAAU,EAAE,MAAM,eAAe,CAAA;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,MAAM,CAAA;AAElC,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAMhD,MAAM,CAAC,MAAM,qBAAqB,GAAyC,CAAC,EAC1E,eAAe,EACf,GAAG,KAAK,EACT,EAAE,EAAE;IACH,MAAM,EAAE,CAAC,EAAE,GAAG,cAAc,EAAE,CAAA;IAC9B,OAAO,CACL,MAAC,YAAY,IACX,QAAQ,EAAC,SAAS,EAClB,IAAI,EAAE,KAAC,SAAS,KAAG,EACnB,KAAK,EACH,KAAC,UAAU,IACT,OAAO,EAAC,OAAO,EACf,EAAE,EAAE;gBACF,UAAU,EAAE,GAAG;aAChB,YAEA,CAAC,CAAC,+BAA+B,CAAC,GACxB,KAEX,KAAK,aAET,KAAC,UAAU,IACT,OAAO,EAAC,OAAO,EACf,EAAE,EAAE;oBACF,EAAE,EAAE,CAAC;oBACL,EAAE,EAAE,CAAC;iBACN,YAEA,CAAC,CAAC,iCAAiC,CAAC,GAC1B,EACZ,eAAe,EAAE,GAAG,CAAC,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CACrC,KAAC,UAAU,IAET,OAAO,EAAC,OAAO,EACf,EAAE,EAAE;oBACF,EAAE,EAAE,CAAC;oBACL,EAAE,EAAE,GAAG;iBACR,YAEA,CAAC,CAAC,yBAAyB,EAAE;oBAC5B,MAAM,EAAE,WAAW,CACjB,IAAI,CAAC,kBAAkB,IAAI,EAAE,EAC7B,IAAI,CAAC,KAAK,CAAC,QAAQ,CACpB;oBACD,WAAW,EAAE,IAAI,CAAC,KAAK,CAAC,MAAM;oBAC9B,SAAS,EAAE,IAAI,CAAC,KAAK,EAAE,IAAI;iBAC5B,CAAC,IAdG,KAAK,CAeC,CACd,CAAC,IACW,CAChB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "3.15.
|
|
2
|
+
export declare const version = "3.15.1";
|
package/dist/esm/i18n/en.json
CHANGED
|
@@ -84,15 +84,13 @@
|
|
|
84
84
|
"message": {
|
|
85
85
|
"autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the transaction.",
|
|
86
86
|
"emptyActiveTransactions": "Transactions in progress will appear here. Once completed, find them in transaction history.",
|
|
87
|
-
"emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please search by contract address if your token doesn't appear or choose another chain.",
|
|
88
|
-
"emptyChainList": "We couldn't find any chains that match your search",
|
|
89
87
|
"emptyBridgesList": "We couldn't find any bridges that match your search",
|
|
88
|
+
"emptyChainList": "We couldn't find any chains that match your search",
|
|
90
89
|
"emptyExchangesList": "We couldn't find any exchanges that match your search",
|
|
90
|
+
"emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please search by contract address if your token doesn't appear or choose another chain.",
|
|
91
91
|
"emptyTransactionHistory": "Transaction history is only stored locally and will be deleted if you clear your browser data.",
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"toAddressIsRequired": "Please provide the destination wallet address to which the funds will be transferred.",
|
|
95
|
-
"routeNotFound": "Reasons for that could be: low liquidity, amount selected is too low, gas costs are too high or there are no routes for the selected combination."
|
|
92
|
+
"routeNotFound": "Reasons for that could be: low liquidity, amount selected is too low, gas costs are too high or there are no routes for the selected combination.",
|
|
93
|
+
"toAddressIsRequired": "Please provide the destination wallet address to which the funds will be transferred."
|
|
96
94
|
},
|
|
97
95
|
"title": {
|
|
98
96
|
"autoRefuel": "Get {{chainName}} gas",
|
|
@@ -119,15 +117,16 @@
|
|
|
119
117
|
},
|
|
120
118
|
"warning": {
|
|
121
119
|
"message": {
|
|
120
|
+
"accountNotDeployedMessage": "Smart contract account is not deployed on the destination chain. Sending funds to a non-existent contract would result in permanent loss.",
|
|
122
121
|
"deleteActiveTransactions": "Active transactions are only stored locally and can't be recovered if you delete them.",
|
|
123
122
|
"deleteTransactionHistory": "Transaction history is only stored locally and can't be recovered if you delete it.",
|
|
123
|
+
"fundsLossPrevention": "Always ensure smart contract accounts are properly set up on the destination chain and avoid direct transfers to exchanges to prevent fund loss.",
|
|
124
124
|
"highValueLoss": "The value of the received tokens is significantly lower than the exchanged tokens and transaction cost.",
|
|
125
125
|
"insufficientFunds": "You don't have enough funds to complete the transaction.",
|
|
126
126
|
"insufficientGas": "You don't have enough gas to complete the transaction. You need to add at least:",
|
|
127
127
|
"rateChanged": "The exchange rate has changed. By continuing the transaction, you'll accept the new rate.",
|
|
128
128
|
"resetSettings": "This will reset your route priority, slippage, gas price, enabled bridges and exchanges.",
|
|
129
|
-
"slippageOutsideRecommendedLimits": "High slippage tolerance may result in unfavorable trade caused by front-running."
|
|
130
|
-
"accountNotDeployedMessage": "Smart contract account is not deployed on the destination chain. Sending funds to a non-existent contract would result in permanent loss."
|
|
129
|
+
"slippageOutsideRecommendedLimits": "High slippage tolerance may result in unfavorable trade caused by front-running."
|
|
131
130
|
},
|
|
132
131
|
"title": {
|
|
133
132
|
"deleteActiveTransactions": "Delete all active transactions?",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { Error as ErrorIcon,
|
|
2
|
+
import { Error as ErrorIcon, TurnedIn, WarningRounded, } from '@mui/icons-material';
|
|
3
3
|
import { Button, Typography } from '@mui/material';
|
|
4
4
|
import { forwardRef, useState } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
@@ -110,6 +110,6 @@ export const BookmarkAddressSheet = forwardRef(({ validatedWallet, onAddBookmark
|
|
|
110
110
|
context: 'long',
|
|
111
111
|
}), "aria-label": t('sendToWallet.enterAddress', {
|
|
112
112
|
context: 'long',
|
|
113
|
-
}), maxRows: 2, inputProps: { maxLength: 128 }, multiline: true }) })), error ? (_jsx(ValidationAlert, { icon: _jsx(ErrorIcon, {}), children: error.message })) : null] }), _jsx(AlertMessage, { title: _jsx(Typography, { variant: "body2", children: t('
|
|
113
|
+
}), maxRows: 2, inputProps: { maxLength: 128 }, multiline: true }) })), error ? (_jsx(ValidationAlert, { icon: _jsx(ErrorIcon, {}), children: error.message })) : null] }), _jsx(AlertMessage, { title: _jsx(Typography, { variant: "body2", sx: { color: 'text.primary' }, children: t('warning.message.fundsLossPrevention') }), icon: _jsx(WarningRounded, {}) }), _jsxs(SendToWalletButtonRow, { children: [_jsx(Button, { variant: "text", onClick: handleCancel, fullWidth: true, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: handleBookmark, loading: isValidating, loadingPosition: "center", fullWidth: true, focusRipple: true, children: t('button.bookmark') })] })] }) }));
|
|
114
114
|
});
|
|
115
115
|
//# sourceMappingURL=BookmarkAddressSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BookmarkAddressSheet.js","sourceRoot":"","sources":["../../../../src/pages/SendToWallet/BookmarkAddressSheet.tsx"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"BookmarkAddressSheet.js","sourceRoot":"","sources":["../../../../src/pages/SendToWallet/BookmarkAddressSheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EACL,KAAK,IAAI,SAAS,EAClB,QAAQ,EACR,cAAc,GACf,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;A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@@ import type { Bookmark } from '../../stores/bookmarks/types.js';
|
|
|
3
3
|
interface ConfirmAddressSheetProps {
|
|
4
4
|
onConfirm: (wallet: Bookmark) => void;
|
|
5
5
|
validatedBookmark?: Bookmark;
|
|
6
|
-
chainId?: number;
|
|
7
6
|
}
|
|
8
7
|
export declare const ConfirmAddressSheet: import("react").ForwardRefExoticComponent<ConfirmAddressSheetProps & import("react").RefAttributes<BottomSheetBase>>;
|
|
9
8
|
export {};
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { Wallet, WarningRounded } from '@mui/icons-material';
|
|
3
|
+
import { Button, Typography } from '@mui/material';
|
|
4
4
|
import { forwardRef, useRef } from 'react';
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { BottomSheet } from '../../components/BottomSheet/BottomSheet.js';
|
|
7
7
|
import { AlertMessage } from '../../components/Messages/AlertMessage.js';
|
|
8
|
-
import { useIsContractAddress } from '../../hooks/useIsContractAddress.js';
|
|
9
8
|
import { useNavigateBack } from '../../hooks/useNavigateBack.js';
|
|
10
9
|
import { useSetContentHeight } from '../../hooks/useSetContentHeight.js';
|
|
11
10
|
import { useFieldActions } from '../../stores/form/useFieldActions.js';
|
|
@@ -18,14 +17,13 @@ export const ConfirmAddressSheet = forwardRef((props, ref) => {
|
|
|
18
17
|
};
|
|
19
18
|
return (_jsx(BottomSheet, { ref: ref, children: _jsx(ConfirmAddressSheetContent, { ...props, onClose: handleClose }) }));
|
|
20
19
|
});
|
|
21
|
-
const ConfirmAddressSheetContent = ({ validatedBookmark, onConfirm,
|
|
20
|
+
const ConfirmAddressSheetContent = ({ validatedBookmark, onConfirm, onClose, }) => {
|
|
22
21
|
const { t } = useTranslation();
|
|
23
22
|
const { navigateBack } = useNavigateBack();
|
|
24
23
|
const { setFieldValue } = useFieldActions();
|
|
25
24
|
const { setSendToWallet } = useSendToWalletActions();
|
|
26
|
-
const { isContractAddress } = useIsContractAddress(validatedBookmark?.address, chainId, validatedBookmark?.chainType);
|
|
27
25
|
const containerRef = useRef(null);
|
|
28
|
-
useSetContentHeight(containerRef
|
|
26
|
+
useSetContentHeight(containerRef);
|
|
29
27
|
const handleConfirm = () => {
|
|
30
28
|
if (validatedBookmark) {
|
|
31
29
|
setFieldValue('toAddress', validatedBookmark.address, {
|
|
@@ -41,6 +39,6 @@ const ConfirmAddressSheetContent = ({ validatedBookmark, onConfirm, chainId, onC
|
|
|
41
39
|
return (_jsxs(SendToWalletSheetContainer, { ref: containerRef, children: [_jsx(IconContainer, { children: _jsx(Wallet, { sx: { fontSize: 40 } }) }), _jsx(SheetTitle, { children: t('sendToWallet.confirmWalletAddress') }), _jsxs(SheetAddressContainer, { children: [validatedBookmark?.name ? (_jsx(Typography, { sx: {
|
|
42
40
|
fontWeight: 600,
|
|
43
41
|
mb: 0.5,
|
|
44
|
-
}, children: validatedBookmark?.name })) : null, _jsx(Typography, { children: validatedBookmark?.address })] }), _jsx(AlertMessage, {
|
|
42
|
+
}, children: validatedBookmark?.name })) : null, _jsx(Typography, { children: validatedBookmark?.address })] }), _jsx(AlertMessage, { severity: "warning", title: _jsx(Typography, { variant: "body2", sx: { color: 'text.primary' }, children: t('warning.message.fundsLossPrevention') }), icon: _jsx(WarningRounded, {}), multiline: true }), _jsxs(SendToWalletButtonRow, { children: [_jsx(Button, { variant: "text", onClick: onClose, fullWidth: true, children: t('button.cancel') }), _jsx(Button, { variant: "contained", onClick: handleConfirm, fullWidth: true, children: t('button.confirm') })] })] }));
|
|
45
43
|
};
|
|
46
44
|
//# sourceMappingURL=ConfirmAddressSheet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmAddressSheet.js","sourceRoot":"","sources":["../../../../src/pages/SendToWallet/ConfirmAddressSheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3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AAc,EAAE,YACtD,CAAC,CAAC,qCAAqC,CAAC,GAC9B,EAEf,IAAI,EAAE,KAAC,cAAc,KAAG,EACxB,SAAS,SACT,EACF,MAAC,qBAAqB,eACpB,KAAC,MAAM,IAAC,OAAO,EAAC,MAAM,EAAC,OAAO,EAAE,OAAO,EAAE,SAAS,kBAC/C,CAAC,CAAC,eAAe,CAAC,GACZ,EACT,KAAC,MAAM,IAAC,OAAO,EAAC,WAAW,EAAC,OAAO,EAAE,aAAa,EAAE,SAAS,kBAC1D,CAAC,CAAC,gBAAgB,CAAC,GACb,IACa,IACG,CAC9B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { ChainType } from '@lifi/sdk';
|
|
3
2
|
import { useAccount } from '@lifi/wallet-management';
|
|
4
3
|
import { Error as ErrorIcon, History, TurnedIn, Wallet, } from '@mui/icons-material';
|
|
5
4
|
import { Box, Tooltip, Typography } from '@mui/material';
|
|
@@ -41,7 +40,6 @@ export const SendToWalletPage = () => {
|
|
|
41
40
|
const { variant } = useWidgetConfig();
|
|
42
41
|
const { accounts } = useAccount();
|
|
43
42
|
const connectedWallets = accounts.filter((account) => account.isConnected);
|
|
44
|
-
const connectedEVMChainId = connectedWallets.find((account) => account.chainType === ChainType.EVM)?.chainId;
|
|
45
43
|
useHeader(t('header.sendToWallet'));
|
|
46
44
|
const handleInputChange = (e) => {
|
|
47
45
|
if (errorMessage) {
|
|
@@ -144,7 +142,7 @@ export const SendToWalletPage = () => {
|
|
|
144
142
|
});
|
|
145
143
|
return (_jsxs(FullHeightAdjustablePageContainer, { bottomGutters: true, enableFullHeight: variant !== 'drawer', children: [_jsxs(SendToWalletCard, { type: errorMessage ? 'error' : 'default', sx: {
|
|
146
144
|
marginBottom: 6,
|
|
147
|
-
}, children: [_jsx(AddressInput, { size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: handleInputChange, value: inputAddressValue, placeholder: placeholder, "aria-label": placeholder, maxRows: 2, inputProps: { maxLength: 128 }, multiline: true }), errorMessage ? (_jsx(ValidationAlert, { icon: _jsx(ErrorIcon, {}), sx: { pb: 2, paddingX: 2 }, children: errorMessage })) : null, _jsxs(SendToWalletButtonRow, { sx: { paddingX: 2, paddingBottom: 2 }, children: [_jsx(ButtonTertiary, { variant: "text", onClick: handleDone, loading: isDoneButtonLoading, loadingPosition: "center", sx: { flexGrow: 1 }, children: t('button.done') }), _jsx(Tooltip, { title: t('button.bookmark'), children: _jsx(SendToWalletIconButton, { onClick: handleBookmarkAddress, loading: isBookmarkButtonLoading, loadingPosition: "center", children: _jsx(TurnedIn, { fontSize: "small" }) }) })] }), _jsx(ConfirmAddressSheet, { ref: confirmAddressSheetRef, validatedBookmark: validatedWallet, onConfirm: handleOnConfirm
|
|
145
|
+
}, children: [_jsx(AddressInput, { size: "small", autoComplete: "off", autoCorrect: "off", autoCapitalize: "off", spellCheck: "false", onChange: handleInputChange, value: inputAddressValue, placeholder: placeholder, "aria-label": placeholder, maxRows: 2, inputProps: { maxLength: 128 }, multiline: true }), errorMessage ? (_jsx(ValidationAlert, { icon: _jsx(ErrorIcon, {}), sx: { pb: 2, paddingX: 2 }, children: errorMessage })) : null, _jsxs(SendToWalletButtonRow, { sx: { paddingX: 2, paddingBottom: 2 }, children: [_jsx(ButtonTertiary, { variant: "text", onClick: handleDone, loading: isDoneButtonLoading, loadingPosition: "center", sx: { flexGrow: 1 }, children: t('button.done') }), _jsx(Tooltip, { title: t('button.bookmark'), children: _jsx(SendToWalletIconButton, { onClick: handleBookmarkAddress, loading: isBookmarkButtonLoading, loadingPosition: "center", children: _jsx(TurnedIn, { fontSize: "small" }) }) })] }), _jsx(ConfirmAddressSheet, { ref: confirmAddressSheetRef, validatedBookmark: validatedWallet, onConfirm: handleOnConfirm }), _jsx(BookmarkAddressSheet, { ref: bookmarkAddressSheetRef, validatedWallet: validatedWallet, onAddBookmark: handleAddBookmark })] }), _jsxs(Box, { sx: { display: 'flex', flexDirection: 'column', gap: 1 }, children: [_jsx(CardButton, { title: t('header.recentWallets'), icon: _jsx(History, {}), onClick: handleRecentWalletsClick, children: !!recentWallets.length && (_jsx(Typography, { sx: {
|
|
148
146
|
color: 'text.secondary',
|
|
149
147
|
}, children: recentWallets.length })) }), _jsx(CardButton, { title: t('sendToWallet.connectedWallets'), icon: _jsx(Wallet, {}), onClick: handleConnectedWalletsClick, children: !!connectedWallets.length && (_jsx(Typography, { sx: {
|
|
150
148
|
color: 'text.secondary',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SendToWalletPage.js","sourceRoot":"","sources":["../../../../src/pages/SendToWallet/SendToWalletPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"SendToWalletPage.js","sourceRoot":"","sources":["../../../../src/pages/SendToWallet/SendToWalletPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AACpD,OAAO,EACL,KAAK,IAAI,SAAS,EAClB,OAAO,EACP,QAAQ,EACR,MAAM,GACP,MAAM,qBAAqB,CAAA;AAC5B,OAAO,EAAE,GAAG,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAExD,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AACxC,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AACnE,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAA;AAChE,OAAO,EACL,WAAW,EACX,oBAAoB,GACrB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,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KAAK,EAAE,gBAAgB;6BACxB,YAEA,gBAAgB,CAAC,MAAM,GACb,CACd,GACU,EACb,KAAC,UAAU,IACT,KAAK,EAAE,CAAC,CAAC,0BAA0B,CAAC,EACpC,IAAI,EAAE,KAAC,QAAQ,KAAG,EAClB,OAAO,EAAE,4BAA4B,YAEpC,CAAC,CAAC,SAAS,CAAC,MAAM,IAAI,CACrB,KAAC,UAAU,IACT,EAAE,EAAE;gCACF,KAAK,EAAE,gBAAgB;6BACxB,YAEA,SAAS,CAAC,MAAM,GACN,CACd,GACU,IACT,IAC4B,CACrC,CAAA;AACH,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.1",
|
|
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
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { EvStation } from '@mui/icons-material'
|
|
2
|
-
import { Typography } from '@mui/material'
|
|
2
|
+
import { type BoxProps, Typography } from '@mui/material'
|
|
3
3
|
import { useTranslation } from 'react-i18next'
|
|
4
4
|
import { formatUnits } from 'viem'
|
|
5
5
|
import type { GasSufficiency } from '../../hooks/useGasSufficiency.js'
|
|
6
6
|
import { AlertMessage } from './AlertMessage.js'
|
|
7
7
|
|
|
8
|
-
interface GasSufficiencyMessageProps {
|
|
8
|
+
interface GasSufficiencyMessageProps extends BoxProps {
|
|
9
9
|
insufficientGas?: GasSufficiency[]
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export const GasSufficiencyMessage: React.FC<GasSufficiencyMessageProps> = ({
|
|
13
13
|
insufficientGas,
|
|
14
|
+
...props
|
|
14
15
|
}) => {
|
|
15
16
|
const { t } = useTranslation()
|
|
16
17
|
return (
|
|
@@ -27,6 +28,7 @@ export const GasSufficiencyMessage: React.FC<GasSufficiencyMessageProps> = ({
|
|
|
27
28
|
{t('warning.title.insufficientGas')}
|
|
28
29
|
</Typography>
|
|
29
30
|
}
|
|
31
|
+
{...props}
|
|
30
32
|
>
|
|
31
33
|
<Typography
|
|
32
34
|
variant="body2"
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '3.15.
|
|
2
|
+
export const version = '3.15.1'
|
package/src/i18n/en.json
CHANGED
|
@@ -84,15 +84,13 @@
|
|
|
84
84
|
"message": {
|
|
85
85
|
"autoRefuel": "You're low on {{chainName}} gas. By continuing, you'll get enough gas to complete the transaction.",
|
|
86
86
|
"emptyActiveTransactions": "Transactions in progress will appear here. Once completed, find them in transaction history.",
|
|
87
|
-
"emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please search by contract address if your token doesn't appear or choose another chain.",
|
|
88
|
-
"emptyChainList": "We couldn't find any chains that match your search",
|
|
89
87
|
"emptyBridgesList": "We couldn't find any bridges that match your search",
|
|
88
|
+
"emptyChainList": "We couldn't find any chains that match your search",
|
|
90
89
|
"emptyExchangesList": "We couldn't find any exchanges that match your search",
|
|
90
|
+
"emptyTokenList": "We couldn't find tokens on {{chainName}} chain or you don't have any. Please search by contract address if your token doesn't appear or choose another chain.",
|
|
91
91
|
"emptyTransactionHistory": "Transaction history is only stored locally and will be deleted if you clear your browser data.",
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"toAddressIsRequired": "Please provide the destination wallet address to which the funds will be transferred.",
|
|
95
|
-
"routeNotFound": "Reasons for that could be: low liquidity, amount selected is too low, gas costs are too high or there are no routes for the selected combination."
|
|
92
|
+
"routeNotFound": "Reasons for that could be: low liquidity, amount selected is too low, gas costs are too high or there are no routes for the selected combination.",
|
|
93
|
+
"toAddressIsRequired": "Please provide the destination wallet address to which the funds will be transferred."
|
|
96
94
|
},
|
|
97
95
|
"title": {
|
|
98
96
|
"autoRefuel": "Get {{chainName}} gas",
|
|
@@ -119,15 +117,16 @@
|
|
|
119
117
|
},
|
|
120
118
|
"warning": {
|
|
121
119
|
"message": {
|
|
120
|
+
"accountNotDeployedMessage": "Smart contract account is not deployed on the destination chain. Sending funds to a non-existent contract would result in permanent loss.",
|
|
122
121
|
"deleteActiveTransactions": "Active transactions are only stored locally and can't be recovered if you delete them.",
|
|
123
122
|
"deleteTransactionHistory": "Transaction history is only stored locally and can't be recovered if you delete it.",
|
|
123
|
+
"fundsLossPrevention": "Always ensure smart contract accounts are properly set up on the destination chain and avoid direct transfers to exchanges to prevent fund loss.",
|
|
124
124
|
"highValueLoss": "The value of the received tokens is significantly lower than the exchanged tokens and transaction cost.",
|
|
125
125
|
"insufficientFunds": "You don't have enough funds to complete the transaction.",
|
|
126
126
|
"insufficientGas": "You don't have enough gas to complete the transaction. You need to add at least:",
|
|
127
127
|
"rateChanged": "The exchange rate has changed. By continuing the transaction, you'll accept the new rate.",
|
|
128
128
|
"resetSettings": "This will reset your route priority, slippage, gas price, enabled bridges and exchanges.",
|
|
129
|
-
"slippageOutsideRecommendedLimits": "High slippage tolerance may result in unfavorable trade caused by front-running."
|
|
130
|
-
"accountNotDeployedMessage": "Smart contract account is not deployed on the destination chain. Sending funds to a non-existent contract would result in permanent loss."
|
|
129
|
+
"slippageOutsideRecommendedLimits": "High slippage tolerance may result in unfavorable trade caused by front-running."
|
|
131
130
|
},
|
|
132
131
|
"title": {
|
|
133
132
|
"deleteActiveTransactions": "Delete all active transactions?",
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Error as ErrorIcon,
|
|
3
|
+
TurnedIn,
|
|
4
|
+
WarningRounded,
|
|
5
|
+
} from '@mui/icons-material'
|
|
2
6
|
import { Button, Typography } from '@mui/material'
|
|
3
7
|
import type { ChangeEvent, MutableRefObject } from 'react'
|
|
4
8
|
import { forwardRef, useState } from 'react'
|
|
@@ -206,11 +210,11 @@ export const BookmarkAddressSheet = forwardRef<
|
|
|
206
210
|
</BookmarkInputFields>
|
|
207
211
|
<AlertMessage
|
|
208
212
|
title={
|
|
209
|
-
<Typography variant="body2">
|
|
210
|
-
{t('
|
|
213
|
+
<Typography variant="body2" sx={{ color: 'text.primary' }}>
|
|
214
|
+
{t('warning.message.fundsLossPrevention')}
|
|
211
215
|
</Typography>
|
|
212
216
|
}
|
|
213
|
-
icon={<
|
|
217
|
+
icon={<WarningRounded />}
|
|
214
218
|
/>
|
|
215
219
|
<SendToWalletButtonRow>
|
|
216
220
|
<Button variant="text" onClick={handleCancel} fullWidth>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { Wallet, WarningRounded } from '@mui/icons-material'
|
|
2
|
+
import { Button, Typography } from '@mui/material'
|
|
3
3
|
import type { MutableRefObject } from 'react'
|
|
4
4
|
import { forwardRef, useRef } from 'react'
|
|
5
5
|
import { useTranslation } from 'react-i18next'
|
|
6
6
|
import { BottomSheet } from '../../components/BottomSheet/BottomSheet.js'
|
|
7
7
|
import type { BottomSheetBase } from '../../components/BottomSheet/types.js'
|
|
8
8
|
import { AlertMessage } from '../../components/Messages/AlertMessage.js'
|
|
9
|
-
import { useIsContractAddress } from '../../hooks/useIsContractAddress.js'
|
|
10
9
|
import { useNavigateBack } from '../../hooks/useNavigateBack.js'
|
|
11
10
|
import { useSetContentHeight } from '../../hooks/useSetContentHeight.js'
|
|
12
11
|
import type { Bookmark } from '../../stores/bookmarks/types.js'
|
|
@@ -23,7 +22,6 @@ import {
|
|
|
23
22
|
interface ConfirmAddressSheetProps {
|
|
24
23
|
onConfirm: (wallet: Bookmark) => void
|
|
25
24
|
validatedBookmark?: Bookmark
|
|
26
|
-
chainId?: number
|
|
27
25
|
}
|
|
28
26
|
|
|
29
27
|
interface ConfirmAddressSheetContentProps extends ConfirmAddressSheetProps {
|
|
@@ -48,21 +46,15 @@ export const ConfirmAddressSheet = forwardRef<
|
|
|
48
46
|
const ConfirmAddressSheetContent: React.FC<ConfirmAddressSheetContentProps> = ({
|
|
49
47
|
validatedBookmark,
|
|
50
48
|
onConfirm,
|
|
51
|
-
chainId,
|
|
52
49
|
onClose,
|
|
53
50
|
}) => {
|
|
54
51
|
const { t } = useTranslation()
|
|
55
52
|
const { navigateBack } = useNavigateBack()
|
|
56
53
|
const { setFieldValue } = useFieldActions()
|
|
57
54
|
const { setSendToWallet } = useSendToWalletActions()
|
|
58
|
-
const { isContractAddress } = useIsContractAddress(
|
|
59
|
-
validatedBookmark?.address,
|
|
60
|
-
chainId,
|
|
61
|
-
validatedBookmark?.chainType
|
|
62
|
-
)
|
|
63
55
|
|
|
64
56
|
const containerRef = useRef<HTMLElement>(null)
|
|
65
|
-
useSetContentHeight(containerRef
|
|
57
|
+
useSetContentHeight(containerRef)
|
|
66
58
|
|
|
67
59
|
const handleConfirm = () => {
|
|
68
60
|
if (validatedBookmark) {
|
|
@@ -97,28 +89,15 @@ const ConfirmAddressSheetContent: React.FC<ConfirmAddressSheetContentProps> = ({
|
|
|
97
89
|
<Typography>{validatedBookmark?.address}</Typography>
|
|
98
90
|
</SheetAddressContainer>
|
|
99
91
|
<AlertMessage
|
|
92
|
+
severity="warning"
|
|
100
93
|
title={
|
|
101
|
-
<
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
</Typography>
|
|
105
|
-
</Box>
|
|
94
|
+
<Typography variant="body2" sx={{ color: 'text.primary' }}>
|
|
95
|
+
{t('warning.message.fundsLossPrevention')}
|
|
96
|
+
</Typography>
|
|
106
97
|
}
|
|
107
|
-
icon={<
|
|
98
|
+
icon={<WarningRounded />}
|
|
108
99
|
multiline
|
|
109
100
|
/>
|
|
110
|
-
{isContractAddress ? (
|
|
111
|
-
<AlertMessage
|
|
112
|
-
title={
|
|
113
|
-
<Typography variant="body2" fontWeight={500}>
|
|
114
|
-
{t('info.message.smartContractAccount')}
|
|
115
|
-
</Typography>
|
|
116
|
-
}
|
|
117
|
-
icon={<Warning />}
|
|
118
|
-
severity="warning"
|
|
119
|
-
multiline
|
|
120
|
-
/>
|
|
121
|
-
) : null}
|
|
122
101
|
<SendToWalletButtonRow>
|
|
123
102
|
<Button variant="text" onClick={onClose} fullWidth>
|
|
124
103
|
{t('button.cancel')}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { ChainType } from '@lifi/sdk'
|
|
2
1
|
import { useAccount } from '@lifi/wallet-management'
|
|
3
2
|
import {
|
|
4
3
|
Error as ErrorIcon,
|
|
@@ -68,9 +67,6 @@ export const SendToWalletPage = () => {
|
|
|
68
67
|
|
|
69
68
|
const { accounts } = useAccount()
|
|
70
69
|
const connectedWallets = accounts.filter((account) => account.isConnected)
|
|
71
|
-
const connectedEVMChainId = connectedWallets.find(
|
|
72
|
-
(account) => account.chainType === ChainType.EVM
|
|
73
|
-
)?.chainId
|
|
74
70
|
|
|
75
71
|
useHeader(t('header.sendToWallet'))
|
|
76
72
|
|
|
@@ -246,7 +242,6 @@ export const SendToWalletPage = () => {
|
|
|
246
242
|
ref={confirmAddressSheetRef}
|
|
247
243
|
validatedBookmark={validatedWallet}
|
|
248
244
|
onConfirm={handleOnConfirm}
|
|
249
|
-
chainId={connectedEVMChainId || toChainId}
|
|
250
245
|
/>
|
|
251
246
|
<BookmarkAddressSheet
|
|
252
247
|
ref={bookmarkAddressSheetRef}
|