diff --git a/packages/widget/src/components/AlertMessage/AlertMessage.tsx b/packages/widget/src/components/AlertMessage/AlertMessage.tsx index 396afac7a..2e4f33ed3 100644 --- a/packages/widget/src/components/AlertMessage/AlertMessage.tsx +++ b/packages/widget/src/components/AlertMessage/AlertMessage.tsx @@ -9,7 +9,7 @@ import type { Severity } from './types.js' interface AlertMessageProps extends PropsWithChildren> { icon: ReactNode title: ReactNode - multilineTitle?: boolean + multiline?: boolean severity?: Severity } @@ -17,14 +17,14 @@ export const AlertMessage = ({ title, icon, children, - multilineTitle, + multiline, severity = 'info', ...rest }: AlertMessageProps) => ( {icon} {title} diff --git a/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx b/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx index a6f3a69b9..b1cf42b98 100644 --- a/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx +++ b/packages/widget/src/components/GasMessage/FundsSufficiencyMessage.tsx @@ -20,7 +20,7 @@ export const FundsSufficiencyMessage = () => { {t('warning.message.insufficientFunds')} } - multilineTitle + multiline /> ) } diff --git a/packages/widget/src/components/ToAddressRequiredMessage.tsx b/packages/widget/src/components/ToAddressRequiredMessage.tsx index 6b30ced8b..5c9d6424a 100644 --- a/packages/widget/src/components/ToAddressRequiredMessage.tsx +++ b/packages/widget/src/components/ToAddressRequiredMessage.tsx @@ -36,7 +36,7 @@ export const ToAddressRequiredMessage: React.FC< } icon={} - multilineTitle + multiline /> diff --git a/packages/widget/src/i18n/en.json b/packages/widget/src/i18n/en.json index 51a57ea24..f6b899b7b 100644 --- a/packages/widget/src/i18n/en.json +++ b/packages/widget/src/i18n/en.json @@ -88,7 +88,8 @@ "emptyBridgesList": "We couldn't find any bridges that match your search", "emptyExchangesList": "We couldn't find any exchanges that match your search", "emptyTransactionHistory": "Transaction history is only stored locally and will be deleted if you clear your browser data.", - "fundsToExchange": "Funds sent to an exchange may be lost", + "smartContractAccount": "Always ensure your smart contract account is set up on the destination chain to avoid potential fund loss.", + "fundsToExchange": "Funds sent directly to exchanges might not be recoverable.", "toAddressIsRequired": "Please provide the destination wallet address to which the funds will be transferred.", "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." }, diff --git a/packages/widget/src/pages/SendToWallet/ConfirmAddressSheet.tsx b/packages/widget/src/pages/SendToWallet/ConfirmAddressSheet.tsx index f1417c7f3..e57966684 100644 --- a/packages/widget/src/pages/SendToWallet/ConfirmAddressSheet.tsx +++ b/packages/widget/src/pages/SendToWallet/ConfirmAddressSheet.tsx @@ -1,11 +1,12 @@ -import { Info, Wallet } from '@mui/icons-material' -import { Button, Typography } from '@mui/material' +import { Info, Wallet, Warning } from '@mui/icons-material' +import { Box, Button, Typography } from '@mui/material' import type { MutableRefObject } from 'react' import { forwardRef } from 'react' import { useTranslation } from 'react-i18next' import { AlertMessage } from '../../components/AlertMessage/AlertMessage.js' import { BottomSheet } from '../../components/BottomSheet/BottomSheet.js' import type { BottomSheetBase } from '../../components/BottomSheet/types.js' +import { useIsContractAddress } from '../../hooks/useIsContractAddress.js' import { useNavigateBack } from '../../hooks/useNavigateBack.js' import type { Bookmark } from '../../stores/bookmarks/types.js' import { useFieldActions } from '../../stores/form/useFieldActions.js' @@ -21,16 +22,22 @@ import { interface ConfirmAddressSheetProps { onConfirm: (wallet: Bookmark) => void validatedBookmark?: Bookmark + chainId?: number } export const ConfirmAddressSheet = forwardRef< BottomSheetBase, ConfirmAddressSheetProps ->(({ validatedBookmark, onConfirm }, ref) => { +>(({ validatedBookmark, onConfirm, chainId }, ref) => { const { t } = useTranslation() const { navigateBack } = useNavigateBack() const { setFieldValue } = useFieldActions() const { setSendToWallet } = useSendToWalletActions() + const isContractAddress = useIsContractAddress( + validatedBookmark?.address, + chainId, + validatedBookmark?.chainType + ) const handleClose = () => { ;(ref as MutableRefObject).current?.close() @@ -71,12 +78,27 @@ export const ConfirmAddressSheet = forwardRef< - {t('info.message.fundsToExchange')} - + + + {t('info.message.fundsToExchange')} + + } icon={} + multiline /> + {isContractAddress ? ( + + {t('info.message.smartContractAccount')} + + } + icon={} + severity="warning" + multiline + /> + ) : null}