@lifi/widget 2.0.0-beta.6 → 2.0.0-beta.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/App.d.ts +4 -3
- package/AppDrawer.d.ts +1 -1
- package/cjs/App.d.ts +4 -3
- package/cjs/AppDrawer.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/cjs/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
- package/cjs/components/Header/Header.style.d.ts +10 -3
- package/cjs/components/Header/NavigationHeader.js +1 -1
- package/cjs/components/Header/NavigationTabs.d.ts +1 -1
- package/cjs/components/Header/NavigationTabs.style.d.ts +4 -71
- package/cjs/components/Header/WalletHeader.js +1 -1
- package/cjs/components/SelectChainAndToken.js +8 -7
- package/cjs/components/SendToWallet/SendToWallet.js +2 -2
- package/cjs/components/SmallAvatar.d.ts +1 -1
- package/cjs/components/Step/CircularProgress.d.ts +1 -1
- package/cjs/components/Step/Step.js +1 -1
- package/cjs/components/Step/StepList.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
- package/cjs/components/TokenList/TokenList.js +5 -2
- package/cjs/components/TokenList/TokenList.style.d.ts +5 -2
- package/cjs/components/TokenList/TokenList.style.js +20 -1
- package/cjs/components/TokenList/TokenListItem.d.ts +1 -1
- package/cjs/components/TokenList/TokenListItem.js +27 -4
- package/cjs/components/TokenList/VirtualizedTokenList.js +3 -3
- package/cjs/components/TokenList/types.d.ts +4 -0
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useFundsSufficiency.js +2 -2
- package/cjs/hooks/useGasRefuel.d.ts +1 -1
- package/cjs/hooks/useGasRefuel.js +5 -15
- package/cjs/hooks/useGasSufficiency.js +2 -2
- package/cjs/hooks/useRouteExecution.js +3 -3
- package/cjs/hooks/useSwapRoutes.js +4 -4
- package/cjs/hooks/useTokenBalance.js +2 -2
- package/cjs/i18n/en.json +1 -1
- package/cjs/icons/InsuraceLogo.d.ts +1 -1
- package/cjs/icons/LiFiFullLogo.d.ts +1 -1
- package/cjs/icons/LiFiLogo.d.ts +1 -1
- package/cjs/icons/LiFiToolLogo.d.ts +1 -1
- package/cjs/index.d.ts +1 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +1 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +1 -1
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.js +3 -3
- package/cjs/providers/WalletProvider/WalletProvider.js +73 -47
- package/cjs/providers/WalletProvider/types.d.ts +0 -2
- package/cjs/stores/routes/RouteExecutionStore.d.ts +1 -1
- package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/cjs/types/widget.d.ts +1 -0
- package/cjs/types/widget.js +1 -0
- package/cjs/utils/wallet.d.ts +1 -1
- package/cjs/utils/wallet.js +3 -3
- package/components/ChainSelect/ChainSelect.d.ts +1 -1
- package/components/GasMessage/FundsSufficiencyMessage.d.ts +1 -1
- package/components/Header/Header.style.d.ts +10 -3
- package/components/Header/NavigationHeader.js +1 -1
- package/components/Header/NavigationTabs.d.ts +1 -1
- package/components/Header/NavigationTabs.style.d.ts +4 -71
- package/components/Header/WalletHeader.js +2 -2
- package/components/SelectChainAndToken.js +9 -8
- package/components/SendToWallet/SendToWallet.js +2 -2
- package/components/SmallAvatar.d.ts +1 -1
- package/components/Step/CircularProgress.d.ts +1 -1
- package/components/Step/Step.js +2 -2
- package/components/Step/StepList.d.ts +1 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +1 -1
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +2 -2
- package/components/TokenList/TokenList.js +6 -3
- package/components/TokenList/TokenList.style.d.ts +5 -2
- package/components/TokenList/TokenList.style.js +21 -2
- package/components/TokenList/TokenListItem.d.ts +1 -1
- package/components/TokenList/TokenListItem.js +31 -8
- package/components/TokenList/VirtualizedTokenList.js +3 -3
- package/components/TokenList/types.d.ts +4 -0
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useFundsSufficiency.js +2 -2
- package/hooks/useGasRefuel.d.ts +1 -1
- package/hooks/useGasRefuel.js +5 -15
- package/hooks/useGasSufficiency.js +2 -2
- package/hooks/useRouteExecution.js +3 -3
- package/hooks/useSwapRoutes.js +4 -4
- package/hooks/useTokenBalance.js +2 -2
- package/i18n/en.json +1 -1
- package/icons/InsuraceLogo.d.ts +1 -1
- package/icons/LiFiFullLogo.d.ts +1 -1
- package/icons/LiFiLogo.d.ts +1 -1
- package/icons/LiFiToolLogo.d.ts +1 -1
- package/index.d.ts +1 -1
- package/package.json +6 -6
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +1 -1
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +1 -1
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -1
- package/pages/SettingsPage/GasPriceSelect.d.ts +1 -1
- package/pages/SettingsPage/SettingsPage.d.ts +1 -1
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +1 -1
- package/pages/SettingsPage/SlippageInput.d.ts +1 -1
- package/pages/SwapDetailsPage/SwapDetailsPage.js +1 -1
- package/pages/SwapPage/StatusBottomSheet.js +4 -4
- package/providers/WalletProvider/WalletProvider.js +74 -48
- package/providers/WalletProvider/types.d.ts +0 -2
- package/stores/routes/RouteExecutionStore.d.ts +1 -1
- package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/widget.d.ts +1 -0
- package/types/widget.js +1 -0
- package/utils/wallet.d.ts +1 -1
- package/utils/wallet.js +1 -1
|
@@ -17,7 +17,7 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
17
17
|
const routeExecutionStoreContext = (0, stores_1.useRouteExecutionStoreContext)();
|
|
18
18
|
const routeExecution = (0, stores_1.useRouteExecutionStore)((state) => state.routes[routeId]);
|
|
19
19
|
const [updateRoute, restartRoute, deleteRoute] = (0, stores_1.useRouteExecutionStore)((state) => [state.updateRoute, state.restartRoute, state.deleteRoute], shallow_1.shallow);
|
|
20
|
-
const
|
|
20
|
+
const updateRouteHook = (updatedRoute) => {
|
|
21
21
|
const routeExecution = routeExecutionStoreContext.getState().routes[updatedRoute.id];
|
|
22
22
|
if (!routeExecution) {
|
|
23
23
|
return;
|
|
@@ -71,7 +71,7 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
71
71
|
}
|
|
72
72
|
queryClient.removeQueries(['routes'], { exact: false });
|
|
73
73
|
return lifi.executeRoute(account.signer, routeExecution.route, {
|
|
74
|
-
|
|
74
|
+
updateRouteHook,
|
|
75
75
|
switchChainHook,
|
|
76
76
|
acceptExchangeRateUpdateHook,
|
|
77
77
|
infiniteApproval: false,
|
|
@@ -93,7 +93,7 @@ const useRouteExecution = ({ routeId, executeInBackground, onAcceptExchangeRateU
|
|
|
93
93
|
throw Error('Execution route not found.');
|
|
94
94
|
}
|
|
95
95
|
return lifi.resumeRoute(account.signer, resumedRoute ?? routeExecution.route, {
|
|
96
|
-
|
|
96
|
+
updateRouteHook,
|
|
97
97
|
switchChainHook,
|
|
98
98
|
acceptExchangeRateUpdateHook,
|
|
99
99
|
infiniteApproval: false,
|
|
@@ -15,7 +15,7 @@ const refetchTime = 60000;
|
|
|
15
15
|
const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
16
16
|
const lifi = (0, providers_1.useLiFi)();
|
|
17
17
|
const { variant, sdkConfig, insurance, contractTool } = (0, providers_1.useWidgetConfig)();
|
|
18
|
-
const { account
|
|
18
|
+
const { account } = (0, providers_1.useWallet)();
|
|
19
19
|
const queryClient = (0, react_query_1.useQueryClient)();
|
|
20
20
|
const swapOnly = (0, useSwapOnly_1.useSwapOnly)();
|
|
21
21
|
const { slippage, enabledBridges, enabledAutoRefuel, enabledExchanges, routePriority, } = (0, stores_1.useSettings)([
|
|
@@ -41,7 +41,7 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
41
41
|
});
|
|
42
42
|
const { token: fromToken } = (0, _1.useToken)(fromChainId, fromTokenAddress);
|
|
43
43
|
const { token: toToken } = (0, _1.useToken)(toChainId, toTokenAddress);
|
|
44
|
-
const { enabled: enabledRefuel,
|
|
44
|
+
const { enabled: enabledRefuel, fromAmount: gasRecommendationFromAmount } = (0, _1.useGasRefuel)();
|
|
45
45
|
const hasAmount = (!isNaN(fromTokenAmount) && Number(fromTokenAmount) > 0) ||
|
|
46
46
|
(!isNaN(toTokenAmount) && Number(toTokenAmount) > 0);
|
|
47
47
|
const contractCallQuoteEnabled = variant === 'nft'
|
|
@@ -74,7 +74,7 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
74
74
|
variant,
|
|
75
75
|
sdkConfig?.defaultRouteOptions?.allowSwitchChain,
|
|
76
76
|
enabledRefuel && enabledAutoRefuel,
|
|
77
|
-
|
|
77
|
+
gasRecommendationFromAmount,
|
|
78
78
|
insurance,
|
|
79
79
|
insurableRoute?.id,
|
|
80
80
|
];
|
|
@@ -82,7 +82,7 @@ const useSwapRoutes = ({ onSettled, insurableRoute, } = {}) => {
|
|
|
82
82
|
let toWalletAddress;
|
|
83
83
|
try {
|
|
84
84
|
toWalletAddress =
|
|
85
|
-
(await provider?.resolveName(toAddress)) ??
|
|
85
|
+
(await account.signer?.provider?.resolveName(toAddress)) ??
|
|
86
86
|
((0, address_1.isAddress)(toAddress) ? toAddress : fromAddress);
|
|
87
87
|
}
|
|
88
88
|
catch {
|
|
@@ -8,10 +8,10 @@ const utils_1 = require("../utils");
|
|
|
8
8
|
const useGetTokenBalancesWithRetry_1 = require("./useGetTokenBalancesWithRetry");
|
|
9
9
|
const defaultRefetchInterval = 30000;
|
|
10
10
|
const useTokenBalance = (token, accountAddress) => {
|
|
11
|
-
const { account
|
|
11
|
+
const { account } = (0, providers_1.useWallet)();
|
|
12
12
|
const queryClient = (0, react_query_1.useQueryClient)();
|
|
13
13
|
const walletAddress = accountAddress || account.address;
|
|
14
|
-
const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(provider);
|
|
14
|
+
const getTokenBalancesWithRetry = (0, useGetTokenBalancesWithRetry_1.useGetTokenBalancesWithRetry)(account.signer?.provider);
|
|
15
15
|
const tokenBalanceQueryKey = (0, react_1.useMemo)(() => ['token-balance', walletAddress, token?.chainId, token?.address], [token?.address, token?.chainId, walletAddress]);
|
|
16
16
|
const { data, isLoading, refetch } = (0, react_query_1.useQuery)(tokenBalanceQueryKey, async ({ queryKey: [, accountAddress] }) => {
|
|
17
17
|
const cachedToken = queryClient
|
package/cjs/i18n/en.json
CHANGED
|
@@ -217,7 +217,7 @@
|
|
|
217
217
|
"to": "To",
|
|
218
218
|
"tokenOnChain": "{{tokenSymbol}} on {{chainName}}",
|
|
219
219
|
"tokenOnChainAmount": "{{amount, number(maximumFractionDigits: 9)}} {{tokenSymbol}} on {{chainName}}",
|
|
220
|
-
"tokenSearch": "Search
|
|
220
|
+
"tokenSearch": "Search by token name or address",
|
|
221
221
|
"valueLoss": "Value loss",
|
|
222
222
|
"walletAddressOrEns": "Wallet address or ENS name",
|
|
223
223
|
"warning": {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const InsuraceLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const InsuraceLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const LiFiFullLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const LiFiFullLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/cjs/icons/LiFiLogo.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const LiFiLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const LiFiLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SVGProps } from 'react';
|
|
2
|
-
export declare const LiFiToolLogo: (props: SVGProps<SVGSVGElement>) => JSX.Element;
|
|
2
|
+
export declare const LiFiToolLogo: (props: SVGProps<SVGSVGElement>) => import("react/jsx-runtime").JSX.Element;
|
package/cjs/index.d.ts
CHANGED
|
@@ -6,4 +6,4 @@ export * from './config/version';
|
|
|
6
6
|
export { useWidgetEvents, widgetEvents } from './hooks';
|
|
7
7
|
export { useWallet } from './providers/WalletProvider';
|
|
8
8
|
export * from './types';
|
|
9
|
-
export declare const LiFiWidget: import("react").
|
|
9
|
+
export declare const LiFiWidget: import("react").ForwardRefExoticComponent<import("./types").WidgetDrawerProps & import("./types").WidgetConfig & import("./types").WidgetConfigPartialProps & import("react").RefAttributes<import("./AppDrawer").WidgetDrawer>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ActiveSwapsPage: () => JSX.Element;
|
|
1
|
+
export declare const ActiveSwapsPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SearchTokenInput: () => JSX.Element;
|
|
1
|
+
export declare const SearchTokenInput: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SelectWalletPage: () => JSX.Element;
|
|
1
|
+
export declare const SelectWalletPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const GasPriceSelect: () => JSX.Element;
|
|
1
|
+
export declare const GasPriceSelect: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SettingsPage: () => JSX.Element;
|
|
1
|
+
export declare const SettingsPage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const ShowDestinationWallet: () => JSX.Element | null;
|
|
1
|
+
export declare const ShowDestinationWallet: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SlippageInput: () => JSX.Element;
|
|
1
|
+
export declare const SlippageInput: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -59,6 +59,6 @@ const SwapDetailsPage = () => {
|
|
|
59
59
|
}).format(startedAt) })] }), (0, Step_1.getStepList)(routeExecution?.route), variant === 'nft' ? (0, jsx_runtime_1.jsx)(ContractComponent_1.ContractComponent, { mt: 2 }) : null, routeExecution?.route?.insurance?.state === 'INSURED' ? ((0, jsx_runtime_1.jsx)(Insurance_1.Insurance, { mt: 2, status: routeExecution.status, feeAmountUsd: routeExecution.route.insurance.feeAmountUsd, insurableRouteId: routeExecution.route.id, insuranceCoverageId: insuranceCoverageId })) : null, (0, jsx_runtime_1.jsxs)(Card_1.Card, { mt: 2, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
60
60
|
display: 'flex',
|
|
61
61
|
flex: 1,
|
|
62
|
-
}, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { flex: 1, children: t('swap.supportId') }), (0, jsx_runtime_1.jsx)(material_1.Box, { mr: 1, mt: 1, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: copySupportId, children: (0, jsx_runtime_1.jsx)(ContentCopyRounded_1.default, { fontSize: "small" }) }) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { href: "https://discord.
|
|
62
|
+
}, children: [(0, jsx_runtime_1.jsx)(Card_1.CardTitle, { flex: 1, children: t('swap.supportId') }), (0, jsx_runtime_1.jsx)(material_1.Box, { mr: 1, mt: 1, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", onClick: copySupportId, children: (0, jsx_runtime_1.jsx)(ContentCopyRounded_1.default, { fontSize: "small" }) }) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", pt: 1, pb: 2, px: 2, sx: { wordBreak: 'break-all' }, children: supportId })] }), (0, jsx_runtime_1.jsx)(material_1.Box, { mt: 2, children: (0, jsx_runtime_1.jsx)(material_1.Button, { href: "https://discord.gg/lifi", target: "_blank", rel: "nofollow noreferrer", fullWidth: true, children: t('button.contactSupport') }) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('swap.warning.title.deleteSwap') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('swap.warning.message.deleteSwapHistory') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleDeleteRoute, autoFocus: true, children: t('button.delete') })] })] })] }));
|
|
63
63
|
};
|
|
64
64
|
exports.SwapDetailsPage = SwapDetailsPage;
|
|
@@ -82,7 +82,7 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
82
82
|
amount: token.amount,
|
|
83
83
|
tokenSymbol: token.symbol,
|
|
84
84
|
chainName: getChainById(token.chainId)?.name,
|
|
85
|
-
walletAddress: (0, utils_1.
|
|
85
|
+
walletAddress: (0, utils_1.shortenAddress)(route.toAddress),
|
|
86
86
|
});
|
|
87
87
|
}
|
|
88
88
|
handlePrimaryButton = handleDone;
|
|
@@ -99,7 +99,7 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
99
99
|
amount: token.amount,
|
|
100
100
|
tokenSymbol: token.symbol,
|
|
101
101
|
chainName: getChainById(token.chainId)?.name,
|
|
102
|
-
walletAddress: (0, utils_1.
|
|
102
|
+
walletAddress: (0, utils_1.shortenAddress)(route.toAddress),
|
|
103
103
|
});
|
|
104
104
|
}
|
|
105
105
|
handlePrimaryButton = handlePartialDone;
|
|
@@ -116,7 +116,7 @@ const StatusBottomSheet = ({ status, route, }) => {
|
|
|
116
116
|
amount: token.amount,
|
|
117
117
|
tokenSymbol: token.symbol,
|
|
118
118
|
chainName: getChainById(token.chainId)?.name,
|
|
119
|
-
walletAddress: (0, utils_1.
|
|
119
|
+
walletAddress: (0, utils_1.shortenAddress)(route.toAddress),
|
|
120
120
|
});
|
|
121
121
|
}
|
|
122
122
|
break;
|
|
@@ -24,19 +24,6 @@ const WalletProvider = ({ children }) => {
|
|
|
24
24
|
const { walletManagement } = (0, WidgetProvider_1.useWidgetConfig)();
|
|
25
25
|
const [account, setAccount] = (0, react_1.useState)({});
|
|
26
26
|
const [currentWallet, setCurrentWallet] = (0, react_1.useState)();
|
|
27
|
-
(0, react_1.useEffect)(() => {
|
|
28
|
-
const autoConnect = async () => {
|
|
29
|
-
const persistedActiveWallets = (0, wallet_management_1.readActiveWallets)();
|
|
30
|
-
const activeWallets = wallet_management_1.supportedWallets.filter((wallet) => persistedActiveWallets.some((perstistedWallet) => perstistedWallet.name === wallet.name));
|
|
31
|
-
if (!activeWallets.length) {
|
|
32
|
-
return;
|
|
33
|
-
}
|
|
34
|
-
await liFiWalletManagement.autoConnect(activeWallets);
|
|
35
|
-
activeWallets[0].on('walletAccountChanged', handleWalletUpdate);
|
|
36
|
-
handleWalletUpdate(activeWallets[0]);
|
|
37
|
-
};
|
|
38
|
-
autoConnect();
|
|
39
|
-
}, []);
|
|
40
27
|
const handleWalletUpdate = async (wallet) => {
|
|
41
28
|
setCurrentWallet(wallet);
|
|
42
29
|
const account = await (0, exports.extractAccountFromSigner)(wallet?.account?.signer);
|
|
@@ -64,54 +51,102 @@ const WalletProvider = ({ children }) => {
|
|
|
64
51
|
currentWallet.removeAllListeners();
|
|
65
52
|
handleWalletUpdate(undefined);
|
|
66
53
|
}
|
|
67
|
-
}, [
|
|
54
|
+
}, [currentWallet, walletManagement]);
|
|
68
55
|
const switchChain = (0, react_1.useCallback)(async (chainId) => {
|
|
69
|
-
if (walletManagement?.switchChain) {
|
|
70
|
-
const signer = await walletManagement.switchChain(chainId);
|
|
71
|
-
const account = await (0, exports.extractAccountFromSigner)(signer);
|
|
72
|
-
setAccount(account);
|
|
73
|
-
return true;
|
|
74
|
-
}
|
|
75
56
|
try {
|
|
76
|
-
|
|
77
|
-
|
|
57
|
+
if (walletManagement?.switchChain) {
|
|
58
|
+
const signer = await walletManagement.switchChain(chainId);
|
|
59
|
+
const account = await (0, exports.extractAccountFromSigner)(signer);
|
|
60
|
+
setAccount(account);
|
|
61
|
+
}
|
|
62
|
+
else if (!currentWallet) {
|
|
63
|
+
const provider = account.signer?.provider;
|
|
64
|
+
if (!provider) {
|
|
65
|
+
throw new Error(`Switch chain: No provider available`);
|
|
66
|
+
}
|
|
67
|
+
await (0, wallet_management_1.switchChain)(provider, chainId);
|
|
68
|
+
}
|
|
69
|
+
else {
|
|
70
|
+
await currentWallet?.switchChain(chainId);
|
|
71
|
+
handleWalletUpdate(currentWallet);
|
|
72
|
+
}
|
|
78
73
|
return true;
|
|
79
74
|
}
|
|
80
75
|
catch {
|
|
81
76
|
return false;
|
|
82
77
|
}
|
|
83
|
-
}, [
|
|
78
|
+
}, [account.signer?.provider, currentWallet, walletManagement]);
|
|
84
79
|
const addChain = (0, react_1.useCallback)(async (chainId) => {
|
|
85
|
-
if (walletManagement?.addChain) {
|
|
86
|
-
return walletManagement.addChain(chainId);
|
|
87
|
-
}
|
|
88
80
|
try {
|
|
89
|
-
|
|
90
|
-
|
|
81
|
+
if (walletManagement?.addChain) {
|
|
82
|
+
return walletManagement.addChain(chainId);
|
|
83
|
+
}
|
|
84
|
+
else if (!currentWallet) {
|
|
85
|
+
const provider = account.signer?.provider;
|
|
86
|
+
if (!provider) {
|
|
87
|
+
throw new Error(`Add chain: No provider available`);
|
|
88
|
+
}
|
|
89
|
+
await (0, wallet_management_1.addChain)(provider, chainId);
|
|
90
|
+
}
|
|
91
|
+
else {
|
|
92
|
+
await currentWallet?.addChain(chainId);
|
|
93
|
+
handleWalletUpdate(currentWallet);
|
|
94
|
+
}
|
|
91
95
|
return true;
|
|
92
96
|
}
|
|
93
97
|
catch {
|
|
94
98
|
return false;
|
|
95
99
|
}
|
|
96
|
-
}, [
|
|
100
|
+
}, [account.signer?.provider, currentWallet, walletManagement]);
|
|
97
101
|
const addToken = (0, react_1.useCallback)(async (chainId, token) => {
|
|
98
|
-
|
|
99
|
-
|
|
102
|
+
try {
|
|
103
|
+
if (walletManagement?.addToken) {
|
|
104
|
+
return walletManagement.addToken(token, chainId);
|
|
105
|
+
}
|
|
106
|
+
else if (!currentWallet) {
|
|
107
|
+
const provider = account.signer?.provider;
|
|
108
|
+
if (!provider) {
|
|
109
|
+
throw new Error(`Add token: No provider available`);
|
|
110
|
+
}
|
|
111
|
+
await (0, wallet_management_1.switchChainAndAddToken)(provider, chainId, token);
|
|
112
|
+
}
|
|
113
|
+
else {
|
|
114
|
+
await currentWallet?.addToken(chainId, token);
|
|
115
|
+
handleWalletUpdate(currentWallet);
|
|
116
|
+
}
|
|
100
117
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
118
|
+
catch { }
|
|
119
|
+
}, [account.signer?.provider, currentWallet, walletManagement]);
|
|
120
|
+
(0, react_1.useEffect)(() => {
|
|
121
|
+
const autoConnect = async () => {
|
|
122
|
+
const persistedActiveWallets = (0, wallet_management_1.readActiveWallets)();
|
|
123
|
+
const activeWallets = wallet_management_1.supportedWallets.filter((wallet) => persistedActiveWallets.some((perstistedWallet) => perstistedWallet.name === wallet.name));
|
|
124
|
+
if (!activeWallets.length) {
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
await liFiWalletManagement.autoConnect(activeWallets);
|
|
128
|
+
activeWallets[0].on('walletAccountChanged', handleWalletUpdate);
|
|
129
|
+
handleWalletUpdate(activeWallets[0]);
|
|
130
|
+
};
|
|
131
|
+
autoConnect();
|
|
132
|
+
}, []);
|
|
105
133
|
// keep widget in sync with changing external signer object
|
|
106
134
|
(0, react_1.useEffect)(() => {
|
|
107
135
|
if (walletManagement) {
|
|
136
|
+
let ignore = false;
|
|
108
137
|
const updateAccount = async () => {
|
|
109
138
|
const account = await (0, exports.extractAccountFromSigner)(walletManagement?.signer);
|
|
110
|
-
|
|
139
|
+
// we should ignore the update if there is a newer one
|
|
140
|
+
if (!ignore) {
|
|
141
|
+
setAccount(account);
|
|
142
|
+
}
|
|
111
143
|
};
|
|
112
144
|
updateAccount();
|
|
145
|
+
return () => {
|
|
146
|
+
ignore = true;
|
|
147
|
+
};
|
|
113
148
|
}
|
|
114
|
-
}, [walletManagement
|
|
149
|
+
}, [walletManagement]);
|
|
115
150
|
const value = (0, react_1.useMemo)(() => ({
|
|
116
151
|
connect,
|
|
117
152
|
disconnect,
|
|
@@ -119,16 +154,7 @@ const WalletProvider = ({ children }) => {
|
|
|
119
154
|
addChain,
|
|
120
155
|
addToken,
|
|
121
156
|
account,
|
|
122
|
-
|
|
123
|
-
}), [
|
|
124
|
-
account,
|
|
125
|
-
addChain,
|
|
126
|
-
addToken,
|
|
127
|
-
connect,
|
|
128
|
-
disconnect,
|
|
129
|
-
currentWallet,
|
|
130
|
-
switchChain,
|
|
131
|
-
]);
|
|
157
|
+
}), [account, addChain, addToken, connect, disconnect, switchChain]);
|
|
132
158
|
return ((0, jsx_runtime_1.jsx)(WalletContext.Provider, { value: value, children: children }));
|
|
133
159
|
};
|
|
134
160
|
exports.WalletProvider = WalletProvider;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import type { Signer } from '@ethersproject/abstract-signer';
|
|
2
|
-
import type { Provider } from '@ethersproject/providers';
|
|
3
2
|
import type { StaticToken } from '@lifi/sdk';
|
|
4
3
|
import type { Wallet } from '@lifi/wallet-management';
|
|
5
4
|
export interface WalletContextProps {
|
|
6
5
|
account: WalletAccount;
|
|
7
|
-
provider?: Provider;
|
|
8
6
|
addChain(chainId: number): Promise<boolean>;
|
|
9
7
|
addToken(chainId: number, token: StaticToken): Promise<void>;
|
|
10
8
|
disconnect(wallet?: Wallet): void;
|
|
@@ -4,6 +4,6 @@ import type { PersistStoreProviderProps } from '../types';
|
|
|
4
4
|
import type { RouteExecutionState } from './types';
|
|
5
5
|
export type RouteExecutionStore = UseBoundStore<StoreApi<RouteExecutionState>>;
|
|
6
6
|
export declare const RouteExecutionStoreContext: import("react").Context<RouteExecutionStore | null>;
|
|
7
|
-
export declare function RouteExecutionStoreProvider({ children, ...props }: PersistStoreProviderProps): JSX.Element;
|
|
7
|
+
export declare function RouteExecutionStoreProvider({ children, ...props }: PersistStoreProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export declare function useRouteExecutionStore<T>(selector: (state: RouteExecutionState) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
9
9
|
export declare function useRouteExecutionStoreContext(): RouteExecutionStore;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { SplitSubvariantProps, SplitSubvariantProviderProps, SplitSubvariantState, SplitSubvariantStore } from './types';
|
|
3
3
|
export declare const SplitSubvariantStoreContext: import("react").Context<SplitSubvariantStore | null>;
|
|
4
|
-
export declare function SplitSubvariantStoreProvider({ children, ...props }: SplitSubvariantProviderProps): JSX.Element;
|
|
4
|
+
export declare function SplitSubvariantStoreProvider({ children, ...props }: SplitSubvariantProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
5
5
|
export declare function useSplitSubvariantStore<T>(selector: (state: SplitSubvariantState) => T, equalityFn?: (left: T, right: T) => boolean): T;
|
|
6
6
|
export declare function useSplitSubvariantStoreContext(): SplitSubvariantStore;
|
|
7
7
|
export declare const createSplitSubvariantStore: ({ state }: SplitSubvariantProps) => import("zustand").UseBoundStore<import("zustand").StoreApi<SplitSubvariantState>>;
|
package/cjs/types/widget.d.ts
CHANGED
package/cjs/types/widget.js
CHANGED
|
@@ -16,6 +16,7 @@ var HiddenUI;
|
|
|
16
16
|
HiddenUI["Language"] = "language";
|
|
17
17
|
HiddenUI["PoweredBy"] = "poweredBy";
|
|
18
18
|
HiddenUI["ToAddress"] = "toAddress";
|
|
19
|
+
HiddenUI["ToToken"] = "toToken";
|
|
19
20
|
HiddenUI["WalletMenu"] = "walletMenu";
|
|
20
21
|
})(HiddenUI = exports.HiddenUI || (exports.HiddenUI = {}));
|
|
21
22
|
var RequiredUI;
|
package/cjs/utils/wallet.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const
|
|
1
|
+
export declare const shortenAddress: (address?: string) => string | null;
|
package/cjs/utils/wallet.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
4
|
-
const
|
|
3
|
+
exports.shortenAddress = void 0;
|
|
4
|
+
const shortenAddress = (address) => address
|
|
5
5
|
? `${address.substring(0, 5)}...${address.substring(address.length - 4)}`
|
|
6
6
|
: null;
|
|
7
|
-
exports.
|
|
7
|
+
exports.shortenAddress = shortenAddress;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { SwapFormTypeProps } from '../../providers';
|
|
2
|
-
export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => JSX.Element;
|
|
2
|
+
export declare const ChainSelect: ({ formType }: SwapFormTypeProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const FundsSufficiencyMessage: () => JSX.Element;
|
|
1
|
+
export declare const FundsSufficiencyMessage: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<
|
|
2
|
+
export declare const HeaderAppBar: import("@emotion/styled").StyledComponent<{
|
|
3
3
|
classes?: Partial<import("@mui/material").AppBarClasses> | undefined;
|
|
4
4
|
color?: import("@mui/types").OverridableStringUnion<"transparent" | import("@mui/material").PropTypes.Color, import("@mui/material").AppBarPropsColorOverrides> | undefined;
|
|
5
5
|
enableColorOnDark?: boolean | undefined;
|
|
6
6
|
position?: "fixed" | "absolute" | "relative" | "static" | "sticky" | undefined;
|
|
7
7
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
8
|
-
} &
|
|
8
|
+
} & Omit<{
|
|
9
|
+
children?: import("react").ReactNode;
|
|
10
|
+
classes?: Partial<import("@mui/material").PaperClasses> | undefined;
|
|
11
|
+
elevation?: number | undefined;
|
|
12
|
+
square?: boolean | undefined;
|
|
13
|
+
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
14
|
+
variant?: import("@mui/types").OverridableStringUnion<"outlined" | "elevation", import("@mui/material").PaperPropsVariantOverrides> | undefined;
|
|
15
|
+
}, "classes" | "color" | "position"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLElement>, HTMLElement>, "ref"> & {
|
|
9
16
|
ref?: ((instance: HTMLElement | null) => void) | import("react").RefObject<HTMLElement> | null | undefined;
|
|
10
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "
|
|
17
|
+
}, keyof import("@mui/material/OverridableComponent").CommonProps | "color" | "children" | "sx" | "position" | "variant" | "square" | "elevation" | "enableColorOnDark"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
18
|
export declare const Container: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
12
19
|
children?: import("react").ReactNode;
|
|
13
20
|
component?: import("react").ElementType<any> | undefined;
|
|
@@ -15,7 +15,7 @@ import { WalletMenuButton } from './WalletHeader';
|
|
|
15
15
|
import { useHeaderActionStore } from './useHeaderActionStore';
|
|
16
16
|
export const NavigationHeader = () => {
|
|
17
17
|
const { t } = useTranslation();
|
|
18
|
-
const { variant, subvariant, hiddenUI
|
|
18
|
+
const { variant, subvariant, hiddenUI } = useWidgetConfig();
|
|
19
19
|
const { navigate, navigateBack } = useNavigateBack();
|
|
20
20
|
const { account } = useWallet();
|
|
21
21
|
const { element } = useHeaderActionStore();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const NavigationTabs: () => JSX.Element;
|
|
1
|
+
export declare const NavigationTabs: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,75 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
'aria-labelledby'?: string | undefined;
|
|
7
|
-
centered?: boolean | undefined;
|
|
8
|
-
children?: import("react").ReactNode;
|
|
9
|
-
classes?: Partial<import("@mui/material").TabsClasses> | undefined;
|
|
10
|
-
slots?: {
|
|
11
|
-
StartScrollButtonIcon?: import("react").ElementType<any> | undefined;
|
|
12
|
-
EndScrollButtonIcon?: import("react").ElementType<any> | undefined;
|
|
13
|
-
} | undefined;
|
|
14
|
-
slotProps?: {
|
|
15
|
-
startScrollButtonIcon?: import("@mui/base").SlotComponentProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
16
|
-
muiName: string;
|
|
17
|
-
}, import("@mui/material").TabsStartScrollButtonIconSlotPropsOverrides, import("@mui/material").TabsOwnerState> | undefined;
|
|
18
|
-
endScrollButtonIcon?: import("@mui/base").SlotComponentProps<import("@mui/material/OverridableComponent").OverridableComponent<import("@mui/material").SvgIconTypeMap<{}, "svg">> & {
|
|
19
|
-
muiName: string;
|
|
20
|
-
}, import("@mui/material").TabsEndScrollButtonIconSlotPropsOverrides, import("@mui/material").TabsOwnerState> | undefined;
|
|
21
|
-
} | undefined;
|
|
22
|
-
indicatorColor?: import("@mui/types").OverridableStringUnion<"primary" | "secondary", import("@mui/material").TabsPropsIndicatorColorOverrides> | undefined;
|
|
23
|
-
onChange?: ((event: import("react").SyntheticEvent<Element, Event>, value: any) => void) | undefined;
|
|
24
|
-
orientation?: "horizontal" | "vertical" | undefined;
|
|
25
|
-
ScrollButtonComponent?: import("react").ElementType<any> | undefined;
|
|
26
|
-
scrollButtons?: boolean | "auto" | undefined;
|
|
27
|
-
selectionFollowsFocus?: boolean | undefined;
|
|
28
|
-
TabIndicatorProps?: (import("react").HTMLAttributes<HTMLDivElement> & {
|
|
29
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
30
|
-
}) | undefined;
|
|
31
|
-
TabScrollButtonProps?: Partial<import("@mui/material").TabScrollButtonProps> | undefined;
|
|
32
|
-
textColor?: "inherit" | "primary" | "secondary" | undefined;
|
|
33
|
-
value?: any;
|
|
34
|
-
variant?: "fullWidth" | "standard" | "scrollable" | undefined;
|
|
35
|
-
visibleScrollbar?: boolean | undefined;
|
|
36
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
37
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<{
|
|
38
|
-
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
39
|
-
centerRipple?: boolean | undefined;
|
|
40
|
-
children?: import("react").ReactNode;
|
|
41
|
-
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
42
|
-
disabled?: boolean | undefined;
|
|
43
|
-
disableRipple?: boolean | undefined;
|
|
44
|
-
disableTouchRipple?: boolean | undefined;
|
|
45
|
-
focusRipple?: boolean | undefined;
|
|
46
|
-
focusVisibleClassName?: string | undefined;
|
|
47
|
-
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
48
|
-
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
49
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
50
|
-
tabIndex?: number | undefined;
|
|
51
|
-
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
52
|
-
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
53
|
-
} & Omit<{
|
|
54
|
-
action?: import("react").Ref<import("@mui/material").ButtonBaseActions> | undefined;
|
|
55
|
-
centerRipple?: boolean | undefined;
|
|
56
|
-
children?: import("react").ReactNode;
|
|
57
|
-
classes?: Partial<import("@mui/material").ButtonBaseClasses> | undefined;
|
|
58
|
-
disabled?: boolean | undefined;
|
|
59
|
-
disableRipple?: boolean | undefined;
|
|
60
|
-
disableTouchRipple?: boolean | undefined;
|
|
61
|
-
focusRipple?: boolean | undefined;
|
|
62
|
-
focusVisibleClassName?: string | undefined;
|
|
63
|
-
LinkComponent?: import("react").ElementType<any> | undefined;
|
|
64
|
-
onFocusVisible?: import("react").FocusEventHandler<any> | undefined;
|
|
65
|
-
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
66
|
-
tabIndex?: number | undefined;
|
|
67
|
-
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
68
|
-
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
69
|
-
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
70
|
-
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
71
|
-
}, keyof import("@mui/material/OverridableComponent").CommonProps | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef">, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "aria-label" | "aria-labelledby" | "onChange" | "action" | "sx" | "variant" | "value" | "slotProps" | "slots" | "orientation" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
72
|
-
export declare const NavbarTab: import("@emotion/styled").StyledComponent<{
|
|
2
|
+
import type { StyledComponent } from '@emotion/styled';
|
|
3
|
+
import type { TabsProps } from '@mui/material';
|
|
4
|
+
export declare const NavbarTabs: StyledComponent<TabsProps>;
|
|
5
|
+
export declare const NavbarTab: StyledComponent<{
|
|
73
6
|
children?: null | undefined;
|
|
74
7
|
classes?: Partial<import("@mui/material").TabClasses> | undefined;
|
|
75
8
|
disabled?: boolean | undefined;
|
|
@@ -10,7 +10,7 @@ import { useTranslation } from 'react-i18next';
|
|
|
10
10
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
11
11
|
import { useChain } from '../../hooks';
|
|
12
12
|
import { useWallet, useWidgetConfig } from '../../providers';
|
|
13
|
-
import { navigationRoutes,
|
|
13
|
+
import { navigationRoutes, shortenAddress } from '../../utils';
|
|
14
14
|
import { HeaderAppBar, WalletButton } from './Header.style';
|
|
15
15
|
import { WalletMenu } from './WalletMenu';
|
|
16
16
|
export const WalletHeader = () => {
|
|
@@ -42,7 +42,7 @@ const ConnectedButton = () => {
|
|
|
42
42
|
const { t } = useTranslation();
|
|
43
43
|
const { subvariant } = useWidgetConfig();
|
|
44
44
|
const { account, disconnect } = useWallet();
|
|
45
|
-
const walletAddress =
|
|
45
|
+
const walletAddress = shortenAddress(account.address);
|
|
46
46
|
const { chain } = useChain(account.chainId);
|
|
47
47
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
48
48
|
const handleClick = (event) => {
|