@lifi/widget 3.16.0 → 3.16.1-beta.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/dist/esm/components/Messages/WarningMessages.d.ts +7 -0
- package/dist/esm/components/Messages/{MainMessages.js → WarningMessages.js} +3 -6
- package/dist/esm/components/Messages/WarningMessages.js.map +1 -0
- package/dist/esm/components/Messages/useMessageQueue.d.ts +1 -0
- package/dist/esm/components/Messages/useMessageQueue.js +10 -5
- package/dist/esm/components/Messages/useMessageQueue.js.map +1 -1
- package/dist/esm/components/Routes/RoutesExpanded.js +4 -1
- package/dist/esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/dist/esm/components/StepActions/StepActions.js +1 -1
- package/dist/esm/components/StepActions/StepActions.js.map +1 -1
- package/dist/esm/config/version.d.ts +1 -1
- package/dist/esm/config/version.js +1 -1
- package/dist/esm/config/version.js.map +1 -1
- package/dist/esm/hooks/useGasSufficiency.js +1 -1
- package/dist/esm/hooks/useGasSufficiency.js.map +1 -1
- package/dist/esm/hooks/useIsCompatibleDestinationAccount.d.ts +8 -0
- package/dist/esm/hooks/useIsCompatibleDestinationAccount.js +37 -0
- package/dist/esm/hooks/useIsCompatibleDestinationAccount.js.map +1 -0
- package/dist/esm/hooks/useIsContractAddress.d.ts +2 -0
- package/dist/esm/hooks/useIsContractAddress.js +7 -2
- package/dist/esm/hooks/useIsContractAddress.js.map +1 -1
- package/dist/esm/hooks/useRoutes.js +6 -1
- package/dist/esm/hooks/useRoutes.js.map +1 -1
- package/dist/esm/hooks/useToAddressRequirements.d.ts +2 -2
- package/dist/esm/hooks/useToAddressRequirements.js +10 -12
- package/dist/esm/hooks/useToAddressRequirements.js.map +1 -1
- package/dist/esm/i18n/en.json +1 -1
- package/dist/esm/pages/MainPage/MainPage.js +2 -2
- package/dist/esm/pages/MainPage/MainPage.js.map +1 -1
- package/dist/esm/pages/MainPage/MainWarningMessages.d.ts +7 -0
- package/dist/esm/pages/MainPage/MainWarningMessages.js +9 -0
- package/dist/esm/pages/MainPage/MainWarningMessages.js.map +1 -0
- package/dist/esm/pages/MainPage/ReviewButton.js +4 -2
- package/dist/esm/pages/MainPage/ReviewButton.js.map +1 -1
- package/dist/esm/pages/RoutesPage/RoutesPage.js +5 -2
- package/dist/esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js +5 -2
- package/dist/esm/pages/TransactionPage/ConfirmToAddressSheet.js.map +1 -1
- package/dist/esm/pages/TransactionPage/StartTransactionButton.js +3 -6
- package/dist/esm/pages/TransactionPage/StartTransactionButton.js.map +1 -1
- package/dist/esm/pages/TransactionPage/TransactionPage.js +2 -2
- package/dist/esm/pages/TransactionPage/TransactionPage.js.map +1 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js +4 -1
- package/dist/esm/stores/form/URLSearchParamsBuilder.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Messages/{MainMessages.tsx → WarningMessages.tsx} +10 -5
- package/src/components/Messages/useMessageQueue.ts +16 -6
- package/src/components/Routes/RoutesExpanded.tsx +5 -1
- package/src/components/StepActions/StepActions.tsx +1 -1
- package/src/config/version.ts +1 -1
- package/src/hooks/useGasSufficiency.ts +1 -1
- package/src/hooks/useIsCompatibleDestinationAccount.ts +58 -0
- package/src/hooks/useIsContractAddress.ts +11 -2
- package/src/hooks/useRoutes.ts +7 -1
- package/src/hooks/useToAddressRequirements.ts +16 -20
- package/src/i18n/en.json +1 -1
- package/src/pages/MainPage/MainPage.tsx +2 -2
- package/src/pages/MainPage/MainWarningMessages.tsx +17 -0
- package/src/pages/MainPage/ReviewButton.tsx +4 -3
- package/src/pages/RoutesPage/RoutesPage.tsx +6 -3
- package/src/pages/TransactionPage/ConfirmToAddressSheet.tsx +5 -2
- package/src/pages/TransactionPage/StartTransactionButton.tsx +4 -12
- package/src/pages/TransactionPage/TransactionPage.tsx +2 -2
- package/src/stores/form/URLSearchParamsBuilder.tsx +4 -1
- package/dist/esm/components/Messages/MainMessages.d.ts +0 -2
- package/dist/esm/components/Messages/MainMessages.js.map +0 -1
|
@@ -2,6 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTranslation } from 'react-i18next';
|
|
3
3
|
import { useNavigate } from 'react-router-dom';
|
|
4
4
|
import { BaseTransactionButton } from '../../components/BaseTransactionButton/BaseTransactionButton.js';
|
|
5
|
+
import { useIsCompatibleDestinationAccount } from '../../hooks/useIsCompatibleDestinationAccount.js';
|
|
5
6
|
import { useRoutes } from '../../hooks/useRoutes.js';
|
|
6
7
|
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js';
|
|
7
8
|
import { useWidgetEvents } from '../../hooks/useWidgetEvents.js';
|
|
@@ -15,7 +16,8 @@ export const ReviewButton = () => {
|
|
|
15
16
|
const emitter = useWidgetEvents();
|
|
16
17
|
const { subvariant, subvariantOptions } = useWidgetConfig();
|
|
17
18
|
const splitState = useSplitSubvariantStore((state) => state.state);
|
|
18
|
-
const { toAddress, requiredToAddress
|
|
19
|
+
const { toAddress, requiredToAddress } = useToAddressRequirements();
|
|
20
|
+
const { isCompatibleDestinationAccount } = useIsCompatibleDestinationAccount();
|
|
19
21
|
const { routes, setReviewableRoute } = useRoutes();
|
|
20
22
|
const currentRoute = routes?.[0];
|
|
21
23
|
const handleClick = async () => {
|
|
@@ -63,6 +65,6 @@ export const ReviewButton = () => {
|
|
|
63
65
|
}
|
|
64
66
|
};
|
|
65
67
|
return (_jsx(BaseTransactionButton, { text: getButtonText(), onClick: handleClick, disabled: (currentRoute && requiredToAddress && !toAddress) ||
|
|
66
|
-
|
|
68
|
+
!isCompatibleDestinationAccount }));
|
|
67
69
|
};
|
|
68
70
|
//# sourceMappingURL=ReviewButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReviewButton.js","sourceRoot":"","sources":["../../../../src/pages/MainPage/ReviewButton.tsx"],"names":[],"mappings":";AAA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QAAQ,EACN,CAAC,YAAY,IAAI,iBAAiB,IAAI,CAAC,SAAS,CAAC;YACjD,CAAC,8BAA8B,GAEjC,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -7,6 +7,7 @@ import { RouteCard } from '../../components/RouteCard/RouteCard.js';
|
|
|
7
7
|
import { RouteCardSkeleton } from '../../components/RouteCard/RouteCardSkeleton.js';
|
|
8
8
|
import { RouteNotFoundCard } from '../../components/RouteCard/RouteNotFoundCard.js';
|
|
9
9
|
import { useHeader } from '../../hooks/useHeader.js';
|
|
10
|
+
import { useIsCompatibleDestinationAccount } from '../../hooks/useIsCompatibleDestinationAccount.js';
|
|
10
11
|
import { useNavigateBack } from '../../hooks/useNavigateBack.js';
|
|
11
12
|
import { useRoutes } from '../../hooks/useRoutes.js';
|
|
12
13
|
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js';
|
|
@@ -16,13 +17,14 @@ import { WidgetEvent } from '../../types/events.js';
|
|
|
16
17
|
import { navigationRoutes } from '../../utils/navigationRoutes.js';
|
|
17
18
|
import { Stack } from './RoutesPage.style.js';
|
|
18
19
|
export const RoutesPage = () => {
|
|
20
|
+
const { t } = useTranslation();
|
|
19
21
|
const { navigate } = useNavigateBack();
|
|
20
22
|
const emitter = useWidgetEvents();
|
|
21
23
|
const { routes, isLoading, isFetching, dataUpdatedAt, refetchTime, fromChain, refetch, setReviewableRoute, } = useRoutes();
|
|
22
24
|
const { account } = useAccount({ chainType: fromChain?.chainType });
|
|
23
25
|
const [toAddress] = useFieldValues('toAddress');
|
|
24
26
|
const { requiredToAddress } = useToAddressRequirements();
|
|
25
|
-
const {
|
|
27
|
+
const { isCompatibleDestinationAccount } = useIsCompatibleDestinationAccount();
|
|
26
28
|
const headerAction = useMemo(() => (_jsx(ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: { marginRight: -1 }, size: "medium" })), [dataUpdatedAt, isFetching, refetch, refetchTime]);
|
|
27
29
|
useHeader(t('header.receive'), headerAction);
|
|
28
30
|
const handleRouteClick = (route) => {
|
|
@@ -36,7 +38,8 @@ export const RoutesPage = () => {
|
|
|
36
38
|
});
|
|
37
39
|
};
|
|
38
40
|
const routeNotFound = !routes?.length && !isLoading && !isFetching;
|
|
39
|
-
const toAddressUnsatisfied = routes?.[0] && requiredToAddress && !toAddress
|
|
41
|
+
const toAddressUnsatisfied = (routes?.[0] && requiredToAddress && !toAddress) ||
|
|
42
|
+
!isCompatibleDestinationAccount;
|
|
40
43
|
const allowInteraction = account.isConnected && !toAddressUnsatisfied;
|
|
41
44
|
return (_jsx(Stack, { direction: "column", spacing: 2, flex: 1, children: routeNotFound ? (_jsx(RouteNotFoundCard, {})) : isLoading ? (Array.from({ length: 3 }).map((_, index) => (_jsx(RouteCardSkeleton, {}, index)))) : (routes?.map((route, index) => (_jsx(RouteCard, { route: route, onClick: allowInteraction ? () => handleRouteClick(route) : undefined, active: index === 0, expanded: routes?.length === 1 }, index)))) }));
|
|
42
45
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RoutesPage.js","sourceRoot":"","sources":["../../../../src/pages/RoutesPage/RoutesPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAA;AAEpD,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAA;AAC/B,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,oBAAoB,EAAE,MAAM,0CAA0C,CAAA;AAC/E,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAA;AACnE,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AACnF,OAAO,EAAE,iBAAiB,EAAE,MAAM,iDAAiD,CAAA;AACnF,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,C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ACf,KAAC,iBAAiB,KAAG,CACtB,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,CACd,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,CAAC,CAC1C,KAAC,iBAAiB,MAAM,KAAK,CAAI,CAClC,CAAC,CACH,CAAC,CAAC,CAAC,CACF,MAAM,EAAE,GAAG,CAAC,CAAC,KAAY,EAAE,KAAa,EAAE,EAAE,CAAC,CAC3C,KAAC,SAAS,IAER,KAAK,EAAE,KAAK,EACZ,OAAO,EACL,gBAAgB,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,gBAAgB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,EAE9D,MAAM,EAAE,KAAK,KAAK,CAAC,EACnB,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,CAAC,IANzB,KAAK,CAOV,CACH,CAAC,CACH,GACK,CACT,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { Wallet, WarningRounded } from '@mui/icons-material';
|
|
3
3
|
import { Button, Typography } from '@mui/material';
|
|
4
|
-
import { forwardRef } from 'react';
|
|
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
8
|
import { useChain } from '../../hooks/useChain.js';
|
|
9
|
+
import { useSetContentHeight } from '../../hooks/useSetContentHeight.js';
|
|
9
10
|
import { useWidgetEvents } from '../../hooks/useWidgetEvents.js';
|
|
10
11
|
import { WidgetEvent } from '../../types/events.js';
|
|
11
12
|
import { IconContainer, SendToWalletButtonRow, SendToWalletSheetContainer, SheetAddressContainer, } from '../SendToWallet/SendToWalletPage.style.js';
|
|
@@ -20,6 +21,8 @@ const ConfirmToAddressSheetContent = ({ onContinue, onClose, toAddress, toChainI
|
|
|
20
21
|
const { t } = useTranslation();
|
|
21
22
|
const { chain } = useChain(toChainId);
|
|
22
23
|
const emitter = useWidgetEvents();
|
|
24
|
+
const ref = useRef(null);
|
|
25
|
+
useSetContentHeight(ref);
|
|
23
26
|
const handleContinue = () => {
|
|
24
27
|
emitter.emit(WidgetEvent.LowAddressActivityConfirmed, {
|
|
25
28
|
address: toAddress,
|
|
@@ -28,7 +31,7 @@ const ConfirmToAddressSheetContent = ({ onContinue, onClose, toAddress, toChainI
|
|
|
28
31
|
onClose();
|
|
29
32
|
onContinue();
|
|
30
33
|
};
|
|
31
|
-
return (_jsxs(SendToWalletSheetContainer, { children: [_jsx(IconContainer, { children: _jsx(Wallet, { sx: { fontSize: 40 } }) }), _jsx(Typography, { variant: "h6", sx: { textAlign: 'center', mb: 2 }, children: t('warning.title.lowAddressActivity') }), _jsx(SheetAddressContainer, { children: _jsx(Typography, { children: toAddress }) }), _jsx(AlertMessage, { severity: "warning", title: _jsx(Typography, { variant: "body2", sx: { color: 'text.primary' }, children: t('warning.message.lowAddressActivity', {
|
|
34
|
+
return (_jsxs(SendToWalletSheetContainer, { ref: ref, children: [_jsx(IconContainer, { children: _jsx(Wallet, { sx: { fontSize: 40 } }) }), _jsx(Typography, { variant: "h6", sx: { textAlign: 'center', mb: 2 }, children: t('warning.title.lowAddressActivity') }), _jsx(SheetAddressContainer, { children: _jsx(Typography, { children: toAddress }) }), _jsx(AlertMessage, { severity: "warning", title: _jsx(Typography, { variant: "body2", sx: { color: 'text.primary' }, children: t('warning.message.lowAddressActivity', {
|
|
32
35
|
chainName: chain?.name,
|
|
33
36
|
}) }), 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: handleContinue, fullWidth: true, children: t('button.continue') })] })] }));
|
|
34
37
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ConfirmToAddressSheet.js","sourceRoot":"","sources":["../../../../src/pages/TransactionPage/ConfirmToAddressSheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,OAAO,CAAA;
|
|
1
|
+
{"version":3,"file":"ConfirmToAddressSheet.js","sourceRoot":"","sources":["../../../../src/pages/TransactionPage/ConfirmToAddressSheet.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AAC5D,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,eAAe,CAAA;AAElD,OAAO,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,OAAO,CAAA;AAC1C,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,6CAA6C,CAAA;AAEzE,OAAO,EAAE,YAAY,EAAE,MAAM,2CAA2C,CAAA;AACxE,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAA;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,gCAAgC,CAAA;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAA;AACnD,OAAO,EACL,aAAa,EACb,qBAAqB,EACrB,0BAA0B,EAC1B,qBAAqB,GACtB,MAAM,2CAA2C,CAAA;AAYlD,MAAM,CAAC,MAAM,qBAAqB,GAAG,UAAU,CAG7C,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;IACf,MAAM,WAAW,GAAG,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AS,EAClB,KAAK,EACH,KAAC,UAAU,IAAC,OAAO,EAAC,OAAO,EAAC,EAAE,EAAE,EAAE,KAAK,EAAE,cAAc,EAAE,YACtD,CAAC,CAAC,oCAAoC,EAAE;wBACvC,SAAS,EAAE,KAAK,EAAE,IAAI;qBACvB,CAAC,GACS,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,cAAc,EAAE,SAAS,kBAC3D,CAAC,CAAC,iBAAiB,CAAC,GACd,IACa,IACG,CAC9B,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { BaseTransactionButton } from '../../components/BaseTransactionButton/BaseTransactionButton.js';
|
|
3
|
-
import {
|
|
4
|
-
import { useGasSufficiency } from '../../hooks/useGasSufficiency.js';
|
|
3
|
+
import { useMessageQueue } from '../../components/Messages/useMessageQueue.js';
|
|
5
4
|
export const StartTransactionButton = ({ onClick, route, text, loading, }) => {
|
|
6
|
-
const {
|
|
7
|
-
|
|
8
|
-
const shouldDisableButton = insufficientFromToken || !!insufficientGas?.length;
|
|
9
|
-
return (_jsx(BaseTransactionButton, { onClick: onClick, text: text, disabled: shouldDisableButton, loading: isFromTokenSufficiencyLoading || isGasSufficiencyLoading || loading }));
|
|
5
|
+
const { hasMessages, isLoading } = useMessageQueue(route);
|
|
6
|
+
return (_jsx(BaseTransactionButton, { onClick: onClick, text: text, disabled: hasMessages, loading: isLoading || loading }));
|
|
10
7
|
};
|
|
11
8
|
//# sourceMappingURL=StartTransactionButton.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"StartTransactionButton.js","sourceRoot":"","sources":["../../../../src/pages/TransactionPage/StartTransactionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iEAAiE,CAAA;AACvG,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"StartTransactionButton.js","sourceRoot":"","sources":["../../../../src/pages/TransactionPage/StartTransactionButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,iEAAiE,CAAA;AACvG,OAAO,EAAE,eAAe,EAAE,MAAM,8CAA8C,CAAA;AAG9E,MAAM,CAAC,MAAM,sBAAsB,GAA0C,CAAC,EAC5E,OAAO,EACP,KAAK,EACL,IAAI,EACJ,OAAO,GACR,EAAE,EAAE;IACH,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,GAAG,eAAe,CAAC,KAAK,CAAC,CAAA;IAEzD,OAAO,CACL,KAAC,qBAAqB,IACpB,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,IAAI,EACV,QAAQ,EAAE,WAAW,EACrB,OAAO,EAAE,SAAS,IAAI,OAAO,GAC7B,CACH,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -5,7 +5,7 @@ import { useEffect, useMemo, useRef, useState } from 'react';
|
|
|
5
5
|
import { useTranslation } from 'react-i18next';
|
|
6
6
|
import { useLocation } from 'react-router-dom';
|
|
7
7
|
import { ContractComponent } from '../../components/ContractComponent/ContractComponent.js';
|
|
8
|
-
import {
|
|
8
|
+
import { WarningMessages } from '../../components/Messages/WarningMessages.js';
|
|
9
9
|
import { PageContainer } from '../../components/PageContainer.js';
|
|
10
10
|
import { getStepList } from '../../components/Step/StepList.js';
|
|
11
11
|
import { TransactionDetails } from '../../components/TransactionDetails.js';
|
|
@@ -141,7 +141,7 @@ export const TransactionPage = () => {
|
|
|
141
141
|
}
|
|
142
142
|
};
|
|
143
143
|
return (_jsxs(PageContainer, { bottomGutters: true, children: [getStepList(route, subvariant), subvariant === 'custom' && contractSecondaryComponent ? (_jsx(ContractComponent, { sx: { marginTop: 2 }, children: contractSecondaryComponent })) : null, _jsx(TransactionDetails, { route: route, sx: { marginTop: 2 } }), status === RouteExecutionStatus.Idle ||
|
|
144
|
-
status === RouteExecutionStatus.Failed ? (_jsxs(_Fragment, { children: [_jsx(
|
|
144
|
+
status === RouteExecutionStatus.Failed ? (_jsxs(_Fragment, { children: [_jsx(WarningMessages, { mt: 2, route: route }), _jsxs(Box, { sx: {
|
|
145
145
|
mt: 2,
|
|
146
146
|
display: 'flex',
|
|
147
147
|
}, children: [_jsx(StartTransactionButton, { text: getButtonText(), onClick: handleStartClick, route: route, loading: routeRefreshing || isLoadingAddressActivity }), status === RouteExecutionStatus.Failed ? (_jsx(Tooltip, { title: t('button.removeTransaction'), placement: "bottom-end", children: _jsx(Button, { onClick: handleRemoveRoute, sx: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TransactionPage.js","sourceRoot":"","sources":["../../../../src/pages/TransactionPage/TransactionPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,eAAe,CAAA;AACpD,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC5D,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAA;AAC9C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAE9C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yDAAyD,CAAA;AAC3F,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"TransactionPage.js","sourceRoot":"","sources":["../../../../src/pages/TransactionPage/TransactionPage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,MAAM,EAAE,MAAM,qBAAqB,CAAA;AAC5C,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,OAAO,EA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,YAED,KAAC,MAAM,KAAG,GACH,GACD,CACX,CAAC,CAAC,CAAC,IAAI,IACJ,IACL,CACJ,CAAC,CAAC,CAAC,IAAI,EACP,MAAM,CAAC,CAAC,CAAC,KAAC,iBAAiB,IAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,GAAI,CAAC,CAAC,CAAC,IAAI,EACnE,UAAU,KAAK,QAAQ,CAAC,CAAC,CAAC,CACzB,KAAC,qBAAqB,IACpB,KAAK,EAAE,KAAK,EACZ,GAAG,EAAE,wBAAwB,EAC7B,UAAU,EAAE,kBAAkB,GAC9B,CACH,CAAC,CAAC,CAAC,IAAI,EACR,KAAC,uBAAuB,IAAC,GAAG,EAAE,0BAA0B,GAAI,EAC5D,KAAC,qBAAqB,IACpB,GAAG,EAAE,wBAAwB,EAC7B,UAAU,EAAE,kBAAkB,EAC9B,SAAS,EAAE,SAAU,EACrB,SAAS,EAAE,KAAK,CAAC,SAAU,GAC3B,IACY,CACjB,CAAA;AACH,CAAC,CAAA"}
|
|
@@ -63,7 +63,10 @@ export const URLSearchParamsBuilder = () => {
|
|
|
63
63
|
const validationResult = await validateAddress({
|
|
64
64
|
value: formValues.toAddress,
|
|
65
65
|
});
|
|
66
|
-
if
|
|
66
|
+
// Check if the toAddress is still in the query string
|
|
67
|
+
// Could be modified by the user before the validation is done
|
|
68
|
+
const { toAddress } = getDefaultValuesFromQueryString();
|
|
69
|
+
if (validationResult.isValid && toAddress) {
|
|
67
70
|
const bookmark = {
|
|
68
71
|
address: validationResult.address,
|
|
69
72
|
chainType: validationResult.chainType,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"URLSearchParamsBuilder.js","sourceRoot":"","sources":["../../../../src/stores/form/URLSearchParamsBuilder.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AACjC,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAA;AAC9C,OAAO,EAAE,oBAAo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IAC5D,CAAC,EAAE,CAAC,QAAQ,EAAE,aAAa,EAAE,MAAM,EAAE,SAAS,EAAE,cAAc,CAAC,CAAC,CAAA;IAEhE,OAAO,IAAI,CAAA;AACb,CAAC,CAAA"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@lifi/widget",
|
|
3
|
-
"version": "3.16.0",
|
|
3
|
+
"version": "3.16.1-beta.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
|
"type": "module",
|
|
6
6
|
"main": "./dist/esm/index.js",
|
|
@@ -1,16 +1,21 @@
|
|
|
1
|
+
import type { Route } from '@lifi/sdk'
|
|
1
2
|
import type { BoxProps } from '@mui/material'
|
|
2
3
|
import { Collapse } from '@mui/material'
|
|
3
|
-
import { useRoutes } from '../../hooks/useRoutes.js'
|
|
4
4
|
import { AccountNotDeployedMessage } from './AccountNotDeployedMessage.js'
|
|
5
5
|
import { FundsSufficiencyMessage } from './FundsSufficiencyMessage.js'
|
|
6
6
|
import { GasSufficiencyMessage } from './GasSufficiencyMessage.js'
|
|
7
7
|
import { ToAddressRequiredMessage } from './ToAddressRequiredMessage.js'
|
|
8
8
|
import { useMessageQueue } from './useMessageQueue.js'
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
type WarningMessagesProps = BoxProps & {
|
|
11
|
+
route?: Route
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const WarningMessages: React.FC<WarningMessagesProps> = ({
|
|
15
|
+
route,
|
|
16
|
+
...props
|
|
17
|
+
}) => {
|
|
18
|
+
const { currentMessage, hasMessages } = useMessageQueue(route)
|
|
14
19
|
|
|
15
20
|
const getMessage = () => {
|
|
16
21
|
switch (currentMessage?.id) {
|
|
@@ -2,6 +2,7 @@ import type { Route } from '@lifi/sdk'
|
|
|
2
2
|
import { useMemo } from 'react'
|
|
3
3
|
import { useFromTokenSufficiency } from '../../hooks/useFromTokenSufficiency.js'
|
|
4
4
|
import { useGasSufficiency } from '../../hooks/useGasSufficiency.js'
|
|
5
|
+
import { useIsCompatibleDestinationAccount } from '../../hooks/useIsCompatibleDestinationAccount.js'
|
|
5
6
|
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js'
|
|
6
7
|
|
|
7
8
|
interface QueuedMessage {
|
|
@@ -11,10 +12,15 @@ interface QueuedMessage {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
export const useMessageQueue = (route?: Route) => {
|
|
14
|
-
const { requiredToAddress,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
15
|
+
const { requiredToAddress, toAddress } = useToAddressRequirements(route)
|
|
16
|
+
const {
|
|
17
|
+
isCompatibleDestinationAccount,
|
|
18
|
+
isLoading: isCompatibleDestinationAccountLoading,
|
|
19
|
+
} = useIsCompatibleDestinationAccount(route)
|
|
20
|
+
const { insufficientFromToken, isLoading: isFromTokenSufficiencyLoading } =
|
|
21
|
+
useFromTokenSufficiency(route)
|
|
22
|
+
const { insufficientGas, isLoading: isGasSufficiencyLoading } =
|
|
23
|
+
useGasSufficiency(route)
|
|
18
24
|
|
|
19
25
|
const messageQueue = useMemo(() => {
|
|
20
26
|
const queue: QueuedMessage[] = []
|
|
@@ -34,7 +40,7 @@ export const useMessageQueue = (route?: Route) => {
|
|
|
34
40
|
})
|
|
35
41
|
}
|
|
36
42
|
|
|
37
|
-
if (
|
|
43
|
+
if (!isCompatibleDestinationAccount) {
|
|
38
44
|
queue.push({
|
|
39
45
|
id: 'ACCOUNT_NOT_DEPLOYED',
|
|
40
46
|
priority: 3,
|
|
@@ -50,7 +56,7 @@ export const useMessageQueue = (route?: Route) => {
|
|
|
50
56
|
|
|
51
57
|
return queue.sort((a, b) => a.priority - b.priority)
|
|
52
58
|
}, [
|
|
53
|
-
|
|
59
|
+
isCompatibleDestinationAccount,
|
|
54
60
|
insufficientFromToken,
|
|
55
61
|
insufficientGas,
|
|
56
62
|
requiredToAddress,
|
|
@@ -60,5 +66,9 @@ export const useMessageQueue = (route?: Route) => {
|
|
|
60
66
|
return {
|
|
61
67
|
currentMessage: messageQueue[0],
|
|
62
68
|
hasMessages: messageQueue.length > 0,
|
|
69
|
+
isLoading:
|
|
70
|
+
isGasSufficiencyLoading ||
|
|
71
|
+
isFromTokenSufficiencyLoading ||
|
|
72
|
+
isCompatibleDestinationAccountLoading,
|
|
63
73
|
}
|
|
64
74
|
}
|
|
@@ -5,6 +5,7 @@ import { type PropsWithChildren, useEffect, useRef } from 'react'
|
|
|
5
5
|
import { useTranslation } from 'react-i18next'
|
|
6
6
|
import type { RouteObject } from 'react-router-dom'
|
|
7
7
|
import { useRoutes as useDOMRoutes, useNavigate } from 'react-router-dom'
|
|
8
|
+
import { useIsCompatibleDestinationAccount } from '../../hooks/useIsCompatibleDestinationAccount.js'
|
|
8
9
|
import { useRoutes } from '../../hooks/useRoutes.js'
|
|
9
10
|
import { useToAddressRequirements } from '../../hooks/useToAddressRequirements.js'
|
|
10
11
|
import { useWidgetEvents } from '../../hooks/useWidgetEvents.js'
|
|
@@ -82,6 +83,7 @@ export const RoutesExpandedElement = () => {
|
|
|
82
83
|
const { account } = useAccount({ chainType: fromChain?.chainType })
|
|
83
84
|
const [toAddress] = useFieldValues('toAddress')
|
|
84
85
|
const { requiredToAddress } = useToAddressRequirements()
|
|
86
|
+
const { isCompatibleDestinationAccount } = useIsCompatibleDestinationAccount()
|
|
85
87
|
|
|
86
88
|
const handleRouteClick = (route: Route) => {
|
|
87
89
|
setReviewableRoute(route)
|
|
@@ -111,7 +113,9 @@ export const RoutesExpandedElement = () => {
|
|
|
111
113
|
)
|
|
112
114
|
|
|
113
115
|
const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded
|
|
114
|
-
const toAddressUnsatisfied =
|
|
116
|
+
const toAddressUnsatisfied =
|
|
117
|
+
(currentRoute && requiredToAddress && !toAddress) ||
|
|
118
|
+
!isCompatibleDestinationAccount
|
|
115
119
|
const allowInteraction = account.isConnected && !toAddressUnsatisfied
|
|
116
120
|
|
|
117
121
|
useEffect(() => {
|
|
@@ -353,7 +353,7 @@ export const ProtocolStepDetailsLabel: React.FC<
|
|
|
353
353
|
? feeConfig?.name
|
|
354
354
|
? t('main.fees.integrator', { tool: feeConfig.name })
|
|
355
355
|
: t('main.fees.defaultIntegrator')
|
|
356
|
-
: step.toolDetails.key === '
|
|
356
|
+
: step.toolDetails.key === 'gasZip'
|
|
357
357
|
? t('main.refuelStepDetails', {
|
|
358
358
|
tool: step.toolDetails.name,
|
|
359
359
|
})
|
package/src/config/version.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export const name = '@lifi/widget'
|
|
2
|
-
export const version = '3.16.0'
|
|
2
|
+
export const version = '3.16.1-beta.0'
|
|
@@ -38,7 +38,7 @@ export const useGasSufficiency = (route?: RouteExtended) => {
|
|
|
38
38
|
// We assume that LI.Fuel protocol always refuels the destination chain
|
|
39
39
|
const hasRefuelStep = route.steps
|
|
40
40
|
.flatMap((step) => step.includedSteps)
|
|
41
|
-
.some((includedStep) => includedStep.tool === '
|
|
41
|
+
.some((includedStep) => includedStep.tool === 'gasZip')
|
|
42
42
|
|
|
43
43
|
const gasCosts = route.steps
|
|
44
44
|
.filter((step) => !step.execution || step.execution.status !== 'DONE')
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import type { RouteExtended } from '@lifi/sdk'
|
|
2
|
+
import { useAccount } from '@lifi/wallet-management'
|
|
3
|
+
import { useFieldValues } from '../stores/form/useFieldValues.js'
|
|
4
|
+
import { isDelegationDesignatorCode } from '../utils/eip7702.js'
|
|
5
|
+
import { useChain } from './useChain.js'
|
|
6
|
+
import { useIsContractAddress } from './useIsContractAddress.js'
|
|
7
|
+
|
|
8
|
+
export const useIsCompatibleDestinationAccount = (route?: RouteExtended) => {
|
|
9
|
+
const [formFromChainId, formToChainId, formToAddress] = useFieldValues(
|
|
10
|
+
'fromChain',
|
|
11
|
+
'toChain',
|
|
12
|
+
'toAddress'
|
|
13
|
+
)
|
|
14
|
+
|
|
15
|
+
const fromChainId = route?.fromChainId ?? formFromChainId
|
|
16
|
+
const toChainId = route?.toChainId ?? formToChainId
|
|
17
|
+
|
|
18
|
+
const { chain: fromChain } = useChain(fromChainId)
|
|
19
|
+
const { chain: toChain } = useChain(toChainId)
|
|
20
|
+
const { account } = useAccount({
|
|
21
|
+
chainType: fromChain?.chainType,
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
const fromAddress = route?.fromAddress ?? account.address
|
|
25
|
+
const toAddress = route
|
|
26
|
+
? route.fromAddress !== route.toAddress
|
|
27
|
+
? route.toAddress
|
|
28
|
+
: formToAddress
|
|
29
|
+
: formToAddress
|
|
30
|
+
|
|
31
|
+
const {
|
|
32
|
+
isContractAddress: isFromContractAddress,
|
|
33
|
+
contractCode: fromContractCode,
|
|
34
|
+
isLoading: isFromContractLoading,
|
|
35
|
+
isFetched: isFromContractFetched,
|
|
36
|
+
} = useIsContractAddress(fromAddress, fromChainId, fromChain?.chainType)
|
|
37
|
+
const {
|
|
38
|
+
isContractAddress: isToContractAddress,
|
|
39
|
+
isLoading: isToContractLoading,
|
|
40
|
+
isFetched: isToContractFetched,
|
|
41
|
+
} = useIsContractAddress(toAddress, toChainId, toChain?.chainType)
|
|
42
|
+
|
|
43
|
+
const accountNotDeployedAtDestination =
|
|
44
|
+
isFromContractAddress &&
|
|
45
|
+
// We don't want to block transfers for EIP-7702 accounts since they are designed
|
|
46
|
+
// to maintain EOA-like properties while delegating execution.
|
|
47
|
+
!isDelegationDesignatorCode(fromContractCode) &&
|
|
48
|
+
!isToContractAddress &&
|
|
49
|
+
fromAddress?.toLowerCase() === toAddress?.toLowerCase()
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
isCompatibleDestinationAccount: !accountNotDeployedAtDestination,
|
|
53
|
+
isFromContractAddress,
|
|
54
|
+
isToContractAddress,
|
|
55
|
+
isLoading: isFromContractLoading || isToContractLoading,
|
|
56
|
+
isFetched: isFromContractFetched && isToContractFetched,
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -7,7 +7,11 @@ export const useIsContractAddress = (
|
|
|
7
7
|
chainId?: number,
|
|
8
8
|
chainType?: ChainType
|
|
9
9
|
) => {
|
|
10
|
-
const {
|
|
10
|
+
const {
|
|
11
|
+
data: contractCode,
|
|
12
|
+
isLoading,
|
|
13
|
+
isFetched,
|
|
14
|
+
} = useBytecode({
|
|
11
15
|
address: address as Address,
|
|
12
16
|
chainId: chainId,
|
|
13
17
|
query: {
|
|
@@ -17,5 +21,10 @@ export const useIsContractAddress = (
|
|
|
17
21
|
},
|
|
18
22
|
})
|
|
19
23
|
|
|
20
|
-
return {
|
|
24
|
+
return {
|
|
25
|
+
isContractAddress: !!contractCode,
|
|
26
|
+
contractCode,
|
|
27
|
+
isLoading,
|
|
28
|
+
isFetched,
|
|
29
|
+
}
|
|
21
30
|
}
|
package/src/hooks/useRoutes.ts
CHANGED
|
@@ -13,6 +13,7 @@ import { getChainTypeFromAddress } from '../utils/chainType.js'
|
|
|
13
13
|
import { useChain } from './useChain.js'
|
|
14
14
|
import { useDebouncedWatch } from './useDebouncedWatch.js'
|
|
15
15
|
import { useGasRefuel } from './useGasRefuel.js'
|
|
16
|
+
import { useIsCompatibleDestinationAccount } from './useIsCompatibleDestinationAccount.js'
|
|
16
17
|
import { useSwapOnly } from './useSwapOnly.js'
|
|
17
18
|
import { useToken } from './useToken.js'
|
|
18
19
|
import { useWidgetEvents } from './useWidgetEvents.js'
|
|
@@ -76,6 +77,8 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
|
|
|
76
77
|
const { token: toToken } = useToken(toChainId, toTokenAddress)
|
|
77
78
|
const { chain: fromChain } = useChain(fromChainId)
|
|
78
79
|
const { chain: toChain } = useChain(toChainId)
|
|
80
|
+
const { isCompatibleDestinationAccount } =
|
|
81
|
+
useIsCompatibleDestinationAccount(observableRoute)
|
|
79
82
|
const { enabled: enabledRefuel, fromAmount: gasRecommendationFromAmount } =
|
|
80
83
|
useGasRefuel()
|
|
81
84
|
|
|
@@ -107,6 +110,9 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
|
|
|
107
110
|
exchanges?.allow?.length || exchanges?.deny?.length
|
|
108
111
|
? enabledExchanges
|
|
109
112
|
: undefined
|
|
113
|
+
const allowSwitchChain = isCompatibleDestinationAccount
|
|
114
|
+
? sdkConfig?.routeOptions?.allowSwitchChain
|
|
115
|
+
: false
|
|
110
116
|
|
|
111
117
|
const isEnabled =
|
|
112
118
|
Boolean(Number(fromChainId)) &&
|
|
@@ -138,7 +144,7 @@ export const useRoutes = ({ observableRoute }: RoutesProps = {}) => {
|
|
|
138
144
|
allowedExchanges,
|
|
139
145
|
routePriority,
|
|
140
146
|
subvariant,
|
|
141
|
-
|
|
147
|
+
allowSwitchChain,
|
|
142
148
|
enabledRefuel && enabledAutoRefuel,
|
|
143
149
|
gasRecommendationFromAmount,
|
|
144
150
|
feeConfig?.fee || fee,
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
+
import type { RouteExtended } from '@lifi/sdk'
|
|
1
2
|
import { useAccount } from '@lifi/wallet-management'
|
|
2
3
|
import { useChain } from '../hooks/useChain.js'
|
|
3
4
|
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js'
|
|
4
5
|
import { useFieldValues } from '../stores/form/useFieldValues.js'
|
|
5
6
|
import { RequiredUI } from '../types/widget.js'
|
|
6
|
-
import { isDelegationDesignatorCode } from '../utils/eip7702.js'
|
|
7
7
|
import { useIsContractAddress } from './useIsContractAddress.js'
|
|
8
8
|
|
|
9
|
-
export const useToAddressRequirements = () => {
|
|
9
|
+
export const useToAddressRequirements = (route?: RouteExtended) => {
|
|
10
10
|
const { requiredUI } = useWidgetConfig()
|
|
11
|
-
const [
|
|
11
|
+
const [formFromChainId, formToChainId, formToAddress] = useFieldValues(
|
|
12
12
|
'fromChain',
|
|
13
13
|
'toChain',
|
|
14
14
|
'toAddress'
|
|
15
15
|
)
|
|
16
|
+
|
|
17
|
+
const fromChainId = route?.fromChainId ?? formFromChainId
|
|
18
|
+
const toChainId = route?.toChainId ?? formToChainId
|
|
19
|
+
const toAddress = route
|
|
20
|
+
? route.fromAddress !== route.toAddress
|
|
21
|
+
? route.toAddress
|
|
22
|
+
: formToAddress
|
|
23
|
+
: formToAddress
|
|
24
|
+
|
|
16
25
|
const { chain: fromChain } = useChain(fromChainId)
|
|
17
26
|
const { chain: toChain } = useChain(toChainId)
|
|
18
27
|
const { account } = useAccount({
|
|
19
28
|
chainType: fromChain?.chainType,
|
|
20
29
|
})
|
|
21
|
-
const {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
const { isContractAddress: isToContractAddress } = useIsContractAddress(
|
|
26
|
-
toAddress,
|
|
27
|
-
toChainId,
|
|
28
|
-
toChain?.chainType
|
|
30
|
+
const { isContractAddress: isFromContractAddress } = useIsContractAddress(
|
|
31
|
+
account.address,
|
|
32
|
+
fromChainId,
|
|
33
|
+
account.chainType
|
|
29
34
|
)
|
|
30
35
|
|
|
31
36
|
const isDifferentChainType =
|
|
@@ -34,14 +39,6 @@ export const useToAddressRequirements = () => {
|
|
|
34
39
|
const isCrossChainContractAddress =
|
|
35
40
|
isFromContractAddress && fromChainId !== toChainId
|
|
36
41
|
|
|
37
|
-
const accountNotDeployedAtDestination =
|
|
38
|
-
isFromContractAddress &&
|
|
39
|
-
// We don't want to block transfers for EIP-7702 accounts since they are designed
|
|
40
|
-
// to maintain EOA-like properties while delegating execution.
|
|
41
|
-
!isDelegationDesignatorCode(fromContractCode) &&
|
|
42
|
-
!isToContractAddress &&
|
|
43
|
-
account.address?.toLowerCase() === toAddress?.toLowerCase()
|
|
44
|
-
|
|
45
42
|
const requiredToAddress =
|
|
46
43
|
requiredUI?.includes(RequiredUI.ToAddress) ||
|
|
47
44
|
isDifferentChainType ||
|
|
@@ -50,7 +47,6 @@ export const useToAddressRequirements = () => {
|
|
|
50
47
|
return {
|
|
51
48
|
requiredToAddress,
|
|
52
49
|
requiredToChainType: toChain?.chainType,
|
|
53
|
-
accountNotDeployedAtDestination,
|
|
54
50
|
toAddress,
|
|
55
51
|
}
|
|
56
52
|
}
|
package/src/i18n/en.json
CHANGED
|
@@ -90,7 +90,7 @@
|
|
|
90
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
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": "
|
|
93
|
+
"toAddressIsRequired": "The destination wallet address is required to proceed with the transfer."
|
|
94
94
|
},
|
|
95
95
|
"title": {
|
|
96
96
|
"autoRefuel": "Get {{chainName}} gas",
|