@lifi/widget 3.7.0-beta.6 → 3.7.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/AppProvider.tsx +6 -4
- package/AppRoutes.tsx +14 -2
- package/CHANGELOG.md +22 -0
- package/_esm/AppProvider.js +3 -2
- package/_esm/AppProvider.js.map +1 -1
- package/_esm/AppRoutes.js +9 -2
- package/_esm/AppRoutes.js.map +1 -1
- package/_esm/components/ActiveTransactions/ActiveTransactions.style.js +1 -1
- package/_esm/components/ActiveTransactions/ActiveTransactions.style.js.map +1 -1
- package/_esm/components/AmountInput/AmountInputEndAdornment.js +3 -1
- package/_esm/components/AmountInput/AmountInputEndAdornment.js.map +1 -1
- package/_esm/components/AppContainer.js +10 -5
- package/_esm/components/AppContainer.js.map +1 -1
- package/_esm/components/Avatar/AccountAvatar.d.ts +1 -1
- package/_esm/components/Avatar/AccountAvatar.js +1 -1
- package/_esm/components/Avatar/AccountAvatar.js.map +1 -1
- package/_esm/components/Avatar/Avatar.d.ts +0 -1
- package/_esm/components/Avatar/Avatar.js +4 -7
- package/_esm/components/Avatar/Avatar.js.map +1 -1
- package/_esm/components/Avatar/Avatar.style.d.ts +3 -6
- package/_esm/components/Avatar/Avatar.style.js +6 -19
- package/_esm/components/Avatar/Avatar.style.js.map +1 -1
- package/_esm/components/Avatar/TokenAvatar.js +1 -1
- package/_esm/components/Avatar/TokenAvatar.js.map +1 -1
- package/_esm/components/BaseTransactionButton/BaseTransactionButton.js +5 -3
- package/_esm/components/BaseTransactionButton/BaseTransactionButton.js.map +1 -1
- package/_esm/components/Card/InputCard.d.ts +1 -1
- package/_esm/components/ChainSelect/useChainSelect.js +1 -5
- package/_esm/components/ChainSelect/useChainSelect.js.map +1 -1
- package/_esm/components/FeeBreakdownTooltip.js +1 -4
- package/_esm/components/FeeBreakdownTooltip.js.map +1 -1
- package/_esm/components/FullPageContainer.d.ts +2 -0
- package/_esm/components/FullPageContainer.js +9 -0
- package/_esm/components/FullPageContainer.js.map +1 -0
- package/_esm/components/Header/EVMDisconnectIconButton.d.ts +4 -0
- package/_esm/components/Header/EVMDisconnectIconButton.js +12 -0
- package/_esm/components/Header/EVMDisconnectIconButton.js.map +1 -0
- package/_esm/components/Header/Header.js +23 -3
- package/_esm/components/Header/Header.js.map +1 -1
- package/_esm/components/Header/NavigationHeader.js +1 -1
- package/_esm/components/Header/NavigationHeader.js.map +1 -1
- package/_esm/components/Header/SVMDisconnectIconButton.d.ts +1 -0
- package/_esm/components/Header/SVMDisconnectIconButton.js +12 -0
- package/_esm/components/Header/SVMDisconnectIconButton.js.map +1 -0
- package/_esm/components/Header/WalletHeader.js +9 -5
- package/_esm/components/Header/WalletHeader.js.map +1 -1
- package/_esm/components/Header/WalletMenu.js +18 -10
- package/_esm/components/Header/WalletMenu.js.map +1 -1
- package/_esm/components/Header/WalletMenu.style.js +1 -5
- package/_esm/components/Header/WalletMenu.style.js.map +1 -1
- package/_esm/components/PageContainer.d.ts +2 -1
- package/_esm/components/PageContainer.js.map +1 -1
- package/_esm/components/PageEntered.d.ts +1 -0
- package/_esm/components/PageEntered.js +13 -0
- package/_esm/components/PageEntered.js.map +1 -0
- package/_esm/components/Routes/RoutesExpanded.js +1 -1
- package/_esm/components/Routes/RoutesExpanded.js.map +1 -1
- package/_esm/components/Search/SearchInput.d.ts +11 -0
- package/_esm/components/Search/SearchInput.js +21 -0
- package/_esm/components/Search/SearchInput.js.map +1 -0
- package/_esm/components/Search/SearchInput.style.d.ts +12 -0
- package/_esm/components/Search/SearchInput.style.js +38 -0
- package/_esm/components/Search/SearchInput.style.js.map +1 -0
- package/_esm/components/Search/SearchNotFound.d.ts +6 -0
- package/_esm/components/Search/SearchNotFound.js +5 -0
- package/_esm/components/Search/SearchNotFound.js.map +1 -0
- package/_esm/components/Search/SearchNotFound.style.d.ts +14 -0
- package/_esm/components/Search/SearchNotFound.style.js +29 -0
- package/_esm/components/Search/SearchNotFound.style.js.map +1 -0
- package/_esm/components/SendToWallet/SendToWalletButton.js +1 -1
- package/_esm/components/SendToWallet/SendToWalletButton.js.map +1 -1
- package/_esm/components/Skeleton/WidgetSkeleton.js +3 -4
- package/_esm/components/Skeleton/WidgetSkeleton.js.map +1 -1
- package/_esm/components/Skeleton/WidgetSkeleton.style.d.ts +4 -1
- package/_esm/components/Skeleton/WidgetSkeleton.style.js +20 -1
- package/_esm/components/Skeleton/WidgetSkeleton.style.js.map +1 -1
- package/_esm/components/SmallAvatar.d.ts +10 -0
- package/_esm/components/SmallAvatar.js +19 -0
- package/_esm/components/SmallAvatar.js.map +1 -0
- package/_esm/components/StepActions/StepActions.js +1 -1
- package/_esm/components/StepActions/StepActions.js.map +1 -1
- package/_esm/components/Tabs/Tabs.style.d.ts +1 -1
- package/_esm/components/Token/Token.js +1 -1
- package/_esm/components/Token/Token.js.map +1 -1
- package/_esm/components/TokenList/TokenList.js +2 -5
- package/_esm/components/TokenList/TokenList.js.map +1 -1
- package/_esm/components/TokenList/TokenListItem.js +5 -11
- package/_esm/components/TokenList/TokenListItem.js.map +1 -1
- package/_esm/components/TokenList/TokenNotFound.js +5 -13
- package/_esm/components/TokenList/TokenNotFound.js.map +1 -1
- package/_esm/components/TokenList/VirtualizedTokenList.js +1 -1
- package/_esm/components/TokenList/VirtualizedTokenList.js.map +1 -1
- package/_esm/components/TokenList/types.d.ts +3 -3
- package/_esm/components/TokenRate/TokenRate.js +2 -2
- package/_esm/components/TokenRate/TokenRate.js.map +1 -1
- package/_esm/config/version.d.ts +1 -1
- package/_esm/config/version.js +1 -1
- package/_esm/config/version.js.map +1 -1
- package/_esm/hooks/useAccount.d.ts +45 -0
- package/_esm/hooks/useAccount.js +56 -0
- package/_esm/hooks/useAccount.js.map +1 -0
- package/_esm/hooks/useAvailableChains.d.ts +1 -2
- package/_esm/hooks/useAvailableChains.js +8 -9
- package/_esm/hooks/useAvailableChains.js.map +1 -1
- package/_esm/hooks/useChains.d.ts +3 -4
- package/_esm/hooks/useChains.js +3 -5
- package/_esm/hooks/useChains.js.map +1 -1
- package/_esm/hooks/useFromTokenSufficiency.js +1 -1
- package/_esm/hooks/useFromTokenSufficiency.js.map +1 -1
- package/_esm/hooks/useGasSufficiency.js +3 -3
- package/_esm/hooks/useGasSufficiency.js.map +1 -1
- package/_esm/hooks/useProcessMessage.js +0 -4
- package/_esm/hooks/useProcessMessage.js.map +1 -1
- package/_esm/hooks/useRouteExecution.js +1 -1
- package/_esm/hooks/useRouteExecution.js.map +1 -1
- package/_esm/hooks/useRoutes.js +1 -1
- package/_esm/hooks/useRoutes.js.map +1 -1
- package/_esm/hooks/useScrollableContainer.d.ts +0 -1
- package/_esm/hooks/useScrollableContainer.js +1 -2
- package/_esm/hooks/useScrollableContainer.js.map +1 -1
- package/_esm/hooks/useSetContentHeight.js +9 -6
- package/_esm/hooks/useSetContentHeight.js.map +1 -1
- package/_esm/hooks/useTokenBalance.js +1 -1
- package/_esm/hooks/useTokenBalance.js.map +1 -1
- package/_esm/hooks/useTokenBalances.js +1 -1
- package/_esm/hooks/useTokenBalances.js.map +1 -1
- package/_esm/hooks/useTokens.js +1 -1
- package/_esm/hooks/useTokens.js.map +1 -1
- package/_esm/hooks/useTransactionDetails.js +1 -1
- package/_esm/hooks/useTransactionDetails.js.map +1 -1
- package/_esm/hooks/useTransactionHistory.js +1 -1
- package/_esm/hooks/useTransactionHistory.js.map +1 -1
- package/_esm/hooks/useWallets.d.ts +6 -0
- package/_esm/hooks/useWallets.js +80 -0
- package/_esm/hooks/useWallets.js.map +1 -0
- package/_esm/i18n/en.json +11 -4
- package/_esm/index.d.ts +2 -0
- package/_esm/index.js +2 -0
- package/_esm/index.js.map +1 -1
- package/_esm/pages/RoutesPage/RoutesPage.js +1 -1
- package/_esm/pages/RoutesPage/RoutesPage.js.map +1 -1
- package/_esm/pages/SelectChainPage/SelectChainPage.js +27 -8
- package/_esm/pages/SelectChainPage/SelectChainPage.js.map +1 -1
- package/_esm/pages/SelectEnabledToolsPage.js +38 -16
- package/_esm/pages/SelectEnabledToolsPage.js.map +1 -1
- package/_esm/pages/SelectTokenPage/SearchTokenInput.js +2 -12
- package/_esm/pages/SelectTokenPage/SearchTokenInput.js.map +1 -1
- package/_esm/pages/SelectTokenPage/SelectTokenPage.js +2 -2
- package/_esm/pages/SelectTokenPage/SelectTokenPage.js.map +1 -1
- package/_esm/pages/SelectTokenPage/useTokenListHeight.js +8 -14
- package/_esm/pages/SelectTokenPage/useTokenListHeight.js.map +1 -1
- package/_esm/pages/SelectWalletPage/EVMListItemButton.d.ts +9 -0
- package/_esm/pages/SelectWalletPage/EVMListItemButton.js +39 -0
- package/_esm/pages/SelectWalletPage/EVMListItemButton.js.map +1 -0
- package/_esm/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
- package/_esm/pages/SelectWalletPage/SVMListItemButton.js +32 -0
- package/_esm/pages/SelectWalletPage/SVMListItemButton.js.map +1 -0
- package/_esm/pages/SelectWalletPage/SelectWalletPage.d.ts +1 -0
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js +41 -0
- package/_esm/pages/SelectWalletPage/SelectWalletPage.js.map +1 -0
- package/_esm/pages/SendToWallet/ConnectedWalletsPage.js +1 -1
- package/_esm/pages/SendToWallet/ConnectedWalletsPage.js.map +1 -1
- package/_esm/pages/SendToWallet/SendToWalletPage.js +1 -1
- package/_esm/pages/SendToWallet/SendToWalletPage.js.map +1 -1
- package/_esm/pages/SendToWallet/SendToWalletPage.style.d.ts +1 -1
- package/_esm/pages/TransactionPage/StatusBottomSheet.js +5 -5
- package/_esm/pages/TransactionPage/StatusBottomSheet.js.map +1 -1
- package/_esm/providers/I18nProvider/types.d.ts +2 -2
- package/_esm/providers/WalletProvider/SDKProviders.js +7 -15
- package/_esm/providers/WalletProvider/SDKProviders.js.map +1 -1
- package/_esm/providers/WalletProvider/WalletProvider.d.ts +0 -1
- package/_esm/providers/WalletProvider/WalletProvider.js +1 -14
- package/_esm/providers/WalletProvider/WalletProvider.js.map +1 -1
- package/_esm/providers/WalletProvider/useHasExternalWalletProvider.d.ts +1 -1
- package/_esm/providers/WalletProvider/useHasExternalWalletProvider.js +3 -8
- package/_esm/providers/WalletProvider/useHasExternalWalletProvider.js.map +1 -1
- package/_esm/providers/WidgetProvider/WidgetProvider.js +1 -2
- package/_esm/providers/WidgetProvider/WidgetProvider.js.map +1 -1
- package/_esm/providers/WidgetProvider/types.d.ts +2 -0
- package/_esm/stores/form/FormUpdater.js +1 -1
- package/_esm/stores/form/FormUpdater.js.map +1 -1
- package/_esm/stores/form/types.d.ts +4 -4
- package/_esm/stores/header/types.d.ts +2 -0
- package/_esm/stores/header/useHeaderStore.d.ts +7 -1
- package/_esm/stores/header/useHeaderStore.js +26 -2
- package/_esm/stores/header/useHeaderStore.js.map +1 -1
- package/_esm/stores/routes/useExecutingRoutesIds.js +1 -1
- package/_esm/stores/routes/useExecutingRoutesIds.js.map +1 -1
- package/_esm/stores/settings/types.d.ts +1 -1
- package/_esm/stores/settings/useSettingsStore.js +22 -9
- package/_esm/stores/settings/useSettingsStore.js.map +1 -1
- package/_esm/themes/createTheme.js +1 -2
- package/_esm/themes/createTheme.js.map +1 -1
- package/_esm/types/events.d.ts +6 -6
- package/_esm/types/events.js +3 -2
- package/_esm/types/events.js.map +1 -1
- package/_esm/utils/chainType.js +3 -2
- package/_esm/utils/chainType.js.map +1 -1
- package/_esm/utils/elements.d.ts +5 -2
- package/_esm/utils/elements.js +6 -1
- package/_esm/utils/elements.js.map +1 -1
- package/_esm/utils/fees.js +5 -9
- package/_esm/utils/fees.js.map +1 -1
- package/_esm/utils/format.js +1 -1
- package/_esm/utils/format.js.map +1 -1
- package/_esm/utils/navigationRoutes.d.ts +3 -1
- package/_esm/utils/navigationRoutes.js +3 -0
- package/_esm/utils/navigationRoutes.js.map +1 -1
- package/_esm/utils/svm.d.ts +1 -0
- package/_esm/utils/svm.js +11 -0
- package/_esm/utils/svm.js.map +1 -0
- package/_esm/utils/wallet.js +1 -1
- package/components/ActiveTransactions/ActiveTransactions.style.ts +1 -1
- package/components/AmountInput/AmountInputEndAdornment.tsx +5 -1
- package/components/AppContainer.tsx +15 -10
- package/components/Avatar/AccountAvatar.tsx +2 -2
- package/components/Avatar/Avatar.style.tsx +7 -20
- package/components/Avatar/Avatar.tsx +4 -12
- package/components/Avatar/TokenAvatar.tsx +1 -1
- package/components/BaseTransactionButton/BaseTransactionButton.tsx +5 -3
- package/components/ChainSelect/useChainSelect.ts +1 -10
- package/components/FeeBreakdownTooltip.tsx +1 -4
- package/components/FullPageContainer.tsx +14 -0
- package/components/Header/EVMDisconnectIconButton.tsx +24 -0
- package/components/Header/Header.tsx +28 -3
- package/components/Header/NavigationHeader.tsx +1 -1
- package/components/Header/SVMDisconnectIconButton.tsx +19 -0
- package/components/Header/WalletHeader.tsx +12 -11
- package/components/Header/WalletMenu.style.tsx +1 -5
- package/components/Header/WalletMenu.tsx +32 -22
- package/components/PageContainer.ts +2 -1
- package/components/PageEntered.ts +14 -0
- package/components/Routes/RoutesExpanded.tsx +2 -1
- package/components/Search/SearchInput.style.tsx +46 -0
- package/components/Search/SearchInput.tsx +57 -0
- package/components/Search/SearchNotFound.style.tsx +36 -0
- package/components/Search/SearchNotFound.tsx +23 -0
- package/components/SendToWallet/SendToWalletButton.tsx +1 -1
- package/components/Skeleton/WidgetSkeleton.style.tsx +21 -1
- package/components/Skeleton/WidgetSkeleton.tsx +10 -9
- package/components/SmallAvatar.tsx +25 -0
- package/components/StepActions/StepActions.tsx +1 -1
- package/components/Token/Token.tsx +1 -1
- package/components/TokenList/TokenList.tsx +2 -9
- package/components/TokenList/TokenListItem.tsx +7 -15
- package/components/TokenList/TokenNotFound.tsx +7 -27
- package/components/TokenList/VirtualizedTokenList.tsx +1 -1
- package/components/TokenList/types.ts +3 -3
- package/components/TokenRate/TokenRate.tsx +2 -2
- package/config/version.ts +1 -1
- package/hooks/useAccount.ts +109 -0
- package/hooks/useAvailableChains.ts +10 -9
- package/hooks/useChains.ts +3 -6
- package/hooks/useFromTokenSufficiency.ts +1 -1
- package/hooks/useGasSufficiency.ts +3 -5
- package/hooks/useProcessMessage.ts +0 -4
- package/hooks/useRouteExecution.ts +1 -1
- package/hooks/useRoutes.ts +1 -1
- package/hooks/useScrollableContainer.ts +1 -6
- package/hooks/useSetContentHeight.ts +10 -6
- package/hooks/useTokenBalance.ts +1 -1
- package/hooks/useTokenBalances.ts +1 -1
- package/hooks/useTokens.ts +1 -2
- package/hooks/useTransactionDetails.ts +1 -1
- package/hooks/useTransactionHistory.ts +1 -1
- package/hooks/useWallets.ts +147 -0
- package/i18n/en.json +11 -4
- package/index.ts +2 -0
- package/package.json +6 -6
- package/pages/RoutesPage/RoutesPage.tsx +1 -1
- package/pages/SelectChainPage/SelectChainPage.tsx +62 -23
- package/pages/SelectEnabledToolsPage.tsx +94 -37
- package/pages/SelectTokenPage/SearchTokenInput.tsx +8 -26
- package/pages/SelectTokenPage/SelectTokenPage.tsx +3 -3
- package/pages/SelectTokenPage/useTokenListHeight.ts +14 -21
- package/pages/SelectWalletPage/EVMListItemButton.tsx +74 -0
- package/pages/SelectWalletPage/SVMListItemButton.tsx +47 -0
- package/pages/SelectWalletPage/SelectWalletPage.tsx +90 -0
- package/pages/SendToWallet/ConnectedWalletsPage.tsx +2 -2
- package/pages/SendToWallet/SendToWalletPage.tsx +1 -1
- package/pages/TransactionPage/StatusBottomSheet.tsx +6 -8
- package/providers/I18nProvider/types.ts +2 -2
- package/providers/WalletProvider/SDKProviders.tsx +7 -25
- package/providers/WalletProvider/WalletProvider.tsx +3 -24
- package/providers/WalletProvider/useHasExternalWalletProvider.ts +5 -11
- package/providers/WidgetProvider/WidgetProvider.tsx +1 -2
- package/providers/WidgetProvider/types.ts +2 -0
- package/stores/form/FormUpdater.tsx +1 -1
- package/stores/form/types.ts +4 -4
- package/stores/header/types.ts +2 -0
- package/stores/header/useHeaderStore.tsx +40 -2
- package/stores/routes/useExecutingRoutesIds.ts +1 -1
- package/stores/settings/types.ts +1 -1
- package/stores/settings/useSettingsStore.ts +30 -9
- package/themes/createTheme.ts +1 -3
- package/types/events.ts +5 -5
- package/utils/chainType.ts +3 -2
- package/utils/elements.ts +21 -1
- package/utils/fees.ts +13 -15
- package/utils/format.ts +1 -1
- package/utils/navigationRoutes.ts +7 -1
- package/utils/svm.ts +10 -0
- package/utils/wallet.ts +1 -1
- package/_esm/components/Avatar/SmallAvatar.d.ts +0 -4
- package/_esm/components/Avatar/SmallAvatar.js +0 -12
- package/_esm/components/Avatar/SmallAvatar.js.map +0 -1
- package/_esm/components/Header/DisconnectIconButton.d.ts +0 -4
- package/_esm/components/Header/DisconnectIconButton.js +0 -12
- package/_esm/components/Header/DisconnectIconButton.js.map +0 -1
- package/_esm/hooks/useHeaderHeight.d.ts +0 -6
- package/_esm/hooks/useHeaderHeight.js +0 -23
- package/_esm/hooks/useHeaderHeight.js.map +0 -1
- package/_esm/providers/WalletProvider/UTXOBaseProvider.d.ts +0 -2
- package/_esm/providers/WalletProvider/UTXOBaseProvider.js +0 -17
- package/_esm/providers/WalletProvider/UTXOBaseProvider.js.map +0 -1
- package/_esm/providers/WalletProvider/UTXOExternalContext.d.ts +0 -1
- package/_esm/providers/WalletProvider/UTXOExternalContext.js +0 -3
- package/_esm/providers/WalletProvider/UTXOExternalContext.js.map +0 -1
- package/_esm/providers/WalletProvider/UTXOProvider.d.ts +0 -3
- package/_esm/providers/WalletProvider/UTXOProvider.js +0 -18
- package/_esm/providers/WalletProvider/UTXOProvider.js.map +0 -1
- package/components/Avatar/SmallAvatar.tsx +0 -16
- package/components/Header/DisconnectIconButton.tsx +0 -18
- package/hooks/useHeaderHeight.ts +0 -27
- package/providers/WalletProvider/UTXOBaseProvider.tsx +0 -28
- package/providers/WalletProvider/UTXOExternalContext.ts +0 -3
- package/providers/WalletProvider/UTXOProvider.tsx +0 -26
|
@@ -1,24 +1,16 @@
|
|
|
1
1
|
import type { SDKProvider } from '@lifi/sdk';
|
|
2
|
-
import { ChainType, EVM, Solana,
|
|
3
|
-
import {
|
|
4
|
-
getConnectorClient as getBigmiConnectorClient,
|
|
5
|
-
useConfig as useBigmiConfig,
|
|
6
|
-
} from '@lifi/wallet-management';
|
|
2
|
+
import { ChainType, EVM, Solana, config } from '@lifi/sdk';
|
|
7
3
|
import type { SignerWalletAdapter } from '@solana/wallet-adapter-base';
|
|
8
4
|
import { useWallet } from '@solana/wallet-adapter-react';
|
|
9
|
-
import {
|
|
10
|
-
getConnectorClient as getWagmiConnectorClient,
|
|
11
|
-
switchChain,
|
|
12
|
-
} from '@wagmi/core';
|
|
5
|
+
import { getWalletClient, switchChain } from '@wagmi/core';
|
|
13
6
|
import { useEffect } from 'react';
|
|
14
|
-
import { useConfig
|
|
7
|
+
import { useConfig } from 'wagmi';
|
|
15
8
|
import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js';
|
|
16
9
|
|
|
17
10
|
export const SDKProviders = () => {
|
|
18
11
|
const { sdkConfig } = useWidgetConfig();
|
|
19
12
|
const { wallet } = useWallet();
|
|
20
|
-
const wagmiConfig =
|
|
21
|
-
const bigmiConfig = useBigmiConfig();
|
|
13
|
+
const wagmiConfig = useConfig();
|
|
22
14
|
|
|
23
15
|
useEffect(() => {
|
|
24
16
|
// Configure SDK Providers
|
|
@@ -29,16 +21,13 @@ export const SDKProviders = () => {
|
|
|
29
21
|
const hasConfiguredSVMProvider = sdkConfig?.providers?.some(
|
|
30
22
|
(provider) => provider.type === ChainType.SVM,
|
|
31
23
|
);
|
|
32
|
-
const hasConfiguredUTXOProvider = sdkConfig?.providers?.some(
|
|
33
|
-
(provider) => provider.type === ChainType.UTXO,
|
|
34
|
-
);
|
|
35
24
|
if (!hasConfiguredEVMProvider) {
|
|
36
25
|
providers.push(
|
|
37
26
|
EVM({
|
|
38
|
-
getWalletClient: () =>
|
|
27
|
+
getWalletClient: () => getWalletClient(wagmiConfig),
|
|
39
28
|
switchChain: async (chainId: number) => {
|
|
40
29
|
const chain = await switchChain(wagmiConfig, { chainId });
|
|
41
|
-
return
|
|
30
|
+
return getWalletClient(wagmiConfig, { chainId: chain.id });
|
|
42
31
|
},
|
|
43
32
|
}),
|
|
44
33
|
);
|
|
@@ -52,18 +41,11 @@ export const SDKProviders = () => {
|
|
|
52
41
|
}),
|
|
53
42
|
);
|
|
54
43
|
}
|
|
55
|
-
if (!hasConfiguredUTXOProvider) {
|
|
56
|
-
providers.push(
|
|
57
|
-
UTXO({
|
|
58
|
-
getWalletClient: () => getBigmiConnectorClient(bigmiConfig),
|
|
59
|
-
}),
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
44
|
if (sdkConfig?.providers?.length) {
|
|
63
45
|
providers.push(...sdkConfig?.providers);
|
|
64
46
|
}
|
|
65
47
|
config.setProviders(providers);
|
|
66
|
-
}, [
|
|
48
|
+
}, [sdkConfig?.providers, wagmiConfig, wallet?.adapter]);
|
|
67
49
|
|
|
68
50
|
return null;
|
|
69
51
|
};
|
|
@@ -1,36 +1,15 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import { WalletManagementProvider } from '@lifi/wallet-management';
|
|
3
|
-
import { useMemo, type FC, type PropsWithChildren } from 'react';
|
|
4
|
-
import { useTranslation } from 'react-i18next';
|
|
5
|
-
import { useWidgetConfig } from '../WidgetProvider/WidgetProvider.js';
|
|
1
|
+
import { type FC, type PropsWithChildren } from 'react';
|
|
6
2
|
import { EVMProvider } from './EVMProvider.js';
|
|
7
3
|
import { SDKProviders } from './SDKProviders.js';
|
|
8
4
|
import { SVMProvider } from './SVMProvider.js';
|
|
9
|
-
import { UTXOProvider } from './UTXOProvider.js';
|
|
10
5
|
|
|
11
6
|
export const WalletProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
12
7
|
return (
|
|
13
8
|
<EVMProvider>
|
|
14
9
|
<SVMProvider>
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
<WalletMenuProvider>{children}</WalletMenuProvider>
|
|
18
|
-
</UTXOProvider>
|
|
10
|
+
<SDKProviders />
|
|
11
|
+
{children}
|
|
19
12
|
</SVMProvider>
|
|
20
13
|
</EVMProvider>
|
|
21
14
|
);
|
|
22
15
|
};
|
|
23
|
-
|
|
24
|
-
export const WalletMenuProvider: FC<PropsWithChildren> = ({ children }) => {
|
|
25
|
-
const { walletConfig } = useWidgetConfig();
|
|
26
|
-
const { i18n } = useTranslation();
|
|
27
|
-
|
|
28
|
-
const config: WalletManagementConfig = useMemo(() => {
|
|
29
|
-
return { locale: i18n.resolvedLanguage as never, ...walletConfig };
|
|
30
|
-
}, [i18n.resolvedLanguage, walletConfig]);
|
|
31
|
-
return (
|
|
32
|
-
<WalletManagementProvider config={config}>
|
|
33
|
-
{children}
|
|
34
|
-
</WalletManagementProvider>
|
|
35
|
-
);
|
|
36
|
-
};
|
|
@@ -2,35 +2,29 @@ import { ChainType } from '@lifi/sdk';
|
|
|
2
2
|
import { useContext, useMemo } from 'react';
|
|
3
3
|
import { EVMExternalContext } from './EVMExternalContext.js';
|
|
4
4
|
import { SVMExternalContext } from './SVMExternalContext.js';
|
|
5
|
-
import { UTXOExternalContext } from './UTXOExternalContext.js';
|
|
6
5
|
|
|
7
6
|
interface ExternalWalletProvider {
|
|
8
7
|
hasExternalProvider: boolean;
|
|
9
|
-
|
|
8
|
+
providers: ChainType[];
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
export function useHasExternalWalletProvider(): ExternalWalletProvider {
|
|
13
12
|
const hasExternalEVMContext = useContext(EVMExternalContext);
|
|
14
13
|
const hasExternalSVMContext = useContext(SVMExternalContext);
|
|
15
|
-
const hasExternalUTXOContext = useContext(UTXOExternalContext);
|
|
16
14
|
|
|
17
15
|
const providers = useMemo(() => {
|
|
18
|
-
const providers
|
|
16
|
+
const providers = [];
|
|
19
17
|
if (hasExternalEVMContext) {
|
|
20
18
|
providers.push(ChainType.EVM);
|
|
21
19
|
}
|
|
22
20
|
if (hasExternalSVMContext) {
|
|
23
21
|
providers.push(ChainType.SVM);
|
|
24
22
|
}
|
|
25
|
-
if (hasExternalUTXOContext) {
|
|
26
|
-
providers.push(ChainType.UTXO);
|
|
27
|
-
}
|
|
28
23
|
return providers;
|
|
29
|
-
}, [hasExternalEVMContext, hasExternalSVMContext
|
|
24
|
+
}, [hasExternalEVMContext, hasExternalSVMContext]);
|
|
30
25
|
|
|
31
26
|
return {
|
|
32
|
-
hasExternalProvider:
|
|
33
|
-
|
|
34
|
-
availableChainTypes: providers,
|
|
27
|
+
hasExternalProvider: hasExternalEVMContext || hasExternalSVMContext,
|
|
28
|
+
providers,
|
|
35
29
|
};
|
|
36
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
import { useAccount } from '@lifi/wallet-management';
|
|
3
2
|
import { useEffect } from 'react';
|
|
3
|
+
import { useAccount } from '../../hooks/useAccount.js';
|
|
4
4
|
import { useChains } from '../../hooks/useChains.js';
|
|
5
5
|
import { useWidgetConfig } from '../../providers/WidgetProvider/WidgetProvider.js';
|
|
6
6
|
import { useBookmarkActions } from '../../stores/bookmarks/useBookmarkActions.js';
|
package/stores/form/types.ts
CHANGED
|
@@ -35,17 +35,17 @@ export type FormFieldArray<T extends FormFieldNames[]> = {
|
|
|
35
35
|
[K in keyof T]: ExtractValueType<FormValues[T[K]]>;
|
|
36
36
|
};
|
|
37
37
|
|
|
38
|
-
export type TouchedFields = { [
|
|
38
|
+
export type TouchedFields = { [key in FormFieldNames]?: boolean };
|
|
39
39
|
|
|
40
40
|
type ValidationFn = (value: any) => Promise<boolean | string>;
|
|
41
41
|
export interface ValidationProps {
|
|
42
42
|
isValid: boolean;
|
|
43
43
|
isValidating: boolean;
|
|
44
44
|
errors: {
|
|
45
|
-
[
|
|
45
|
+
[key in FormFieldNames]?: string;
|
|
46
46
|
};
|
|
47
47
|
validation: {
|
|
48
|
-
[
|
|
48
|
+
[key in FormFieldNames]?: ValidationFn;
|
|
49
49
|
};
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -61,7 +61,7 @@ export interface ValidationActions {
|
|
|
61
61
|
export interface FormProps {
|
|
62
62
|
defaultValues: FormValues;
|
|
63
63
|
userValues: FormValues;
|
|
64
|
-
touchedFields: { [
|
|
64
|
+
touchedFields: { [key in FormFieldNames]?: boolean };
|
|
65
65
|
}
|
|
66
66
|
|
|
67
67
|
interface ResetOptions {
|
package/stores/header/types.ts
CHANGED
|
@@ -6,6 +6,7 @@ export type HeaderStore = UseBoundStoreWithEqualityFn<StoreApi<HeaderState>>;
|
|
|
6
6
|
export interface HeaderStateBase {
|
|
7
7
|
element?: React.ReactNode | null;
|
|
8
8
|
title?: string;
|
|
9
|
+
headerHeight: number;
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export interface HeaderState extends HeaderStateBase {
|
|
@@ -13,4 +14,5 @@ export interface HeaderState extends HeaderStateBase {
|
|
|
13
14
|
setTitle(title?: string): () => void;
|
|
14
15
|
removeAction(): void;
|
|
15
16
|
removeTitle(): void;
|
|
17
|
+
setHeaderHeight(headerHeight: number): void;
|
|
16
18
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { createContext, useContext, useRef } from 'react';
|
|
2
|
+
import { shallow } from 'zustand/shallow';
|
|
2
3
|
import { createWithEqualityFn } from 'zustand/traditional';
|
|
3
4
|
import type { PersistStoreProps, PersistStoreProviderProps } from '../types.js';
|
|
4
5
|
import type { HeaderState, HeaderStore } from './types.js';
|
|
@@ -30,13 +31,45 @@ export function useHeaderStoreContext() {
|
|
|
30
31
|
return useStore;
|
|
31
32
|
}
|
|
32
33
|
|
|
33
|
-
export function useHeaderStore<T>(
|
|
34
|
+
export function useHeaderStore<T>(
|
|
35
|
+
selector: (state: HeaderState) => T,
|
|
36
|
+
equalityCheck?: (objA: T, objB: T) => boolean,
|
|
37
|
+
): T {
|
|
34
38
|
const useStore = useHeaderStoreContext();
|
|
35
|
-
return useStore(selector);
|
|
39
|
+
return useStore(selector, equalityCheck);
|
|
36
40
|
}
|
|
41
|
+
|
|
42
|
+
// We use fixed position on the header when Widget is in Full Height layout.
|
|
43
|
+
// We do this to get it to work like the sticky header does in the other layout modes.
|
|
44
|
+
// As the header is position fixed its not in the document flow anymore.
|
|
45
|
+
// To prevent the remaining page content from appearing behind the header we need to
|
|
46
|
+
// pass the headers height so that the position of the page content can be adjusted
|
|
47
|
+
export function useHeaderHeight() {
|
|
48
|
+
const [headerHeight] = useHeaderStore(
|
|
49
|
+
(state) => [state.headerHeight],
|
|
50
|
+
shallow,
|
|
51
|
+
);
|
|
52
|
+
|
|
53
|
+
return {
|
|
54
|
+
headerHeight,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
export function useSetHeaderHeight() {
|
|
59
|
+
const [setHeaderHeight] = useHeaderStore(
|
|
60
|
+
(state) => [state.setHeaderHeight],
|
|
61
|
+
shallow,
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
return {
|
|
65
|
+
setHeaderHeight,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
|
|
37
69
|
export const createHeaderStore = ({ namePrefix }: PersistStoreProps) =>
|
|
38
70
|
createWithEqualityFn<HeaderState>(
|
|
39
71
|
(set, get) => ({
|
|
72
|
+
headerHeight: 108, // a basic default height
|
|
40
73
|
setAction: (element) => {
|
|
41
74
|
set(() => ({
|
|
42
75
|
element,
|
|
@@ -59,6 +92,11 @@ export const createHeaderStore = ({ namePrefix }: PersistStoreProps) =>
|
|
|
59
92
|
title: undefined,
|
|
60
93
|
}));
|
|
61
94
|
},
|
|
95
|
+
setHeaderHeight: (headerHeight) => {
|
|
96
|
+
set(() => ({
|
|
97
|
+
headerHeight,
|
|
98
|
+
}));
|
|
99
|
+
},
|
|
62
100
|
}),
|
|
63
101
|
Object.is,
|
|
64
102
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { useAccount } from '@lifi/wallet-management';
|
|
2
1
|
import { shallow } from 'zustand/shallow';
|
|
2
|
+
import { useAccount } from '../../hooks/useAccount.js';
|
|
3
3
|
import { useRouteExecutionStore } from './RouteExecutionStore.js';
|
|
4
4
|
import type { RouteExecution } from './types.js';
|
|
5
5
|
import { RouteExecutionStatus } from './types.js';
|
package/stores/settings/types.ts
CHANGED
|
@@ -40,7 +40,7 @@ export interface SettingsState extends SettingsProps {
|
|
|
40
40
|
reset?: boolean,
|
|
41
41
|
): void;
|
|
42
42
|
setToolValue(toolType: SettingsToolType, tool: string, value: boolean): void;
|
|
43
|
-
|
|
43
|
+
toggleToolKeys(toolType: SettingsToolType, toolKeys: string[]): void;
|
|
44
44
|
reset(bridges: string[], exchanges: string[]): void;
|
|
45
45
|
}
|
|
46
46
|
|
|
@@ -99,17 +99,38 @@ export const useSettingsStore = createWithEqualityFn<SettingsState>(
|
|
|
99
99
|
),
|
|
100
100
|
};
|
|
101
101
|
}),
|
|
102
|
-
|
|
102
|
+
toggleToolKeys: (toolType, toolKeys) =>
|
|
103
103
|
set((state) => {
|
|
104
|
-
const
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
104
|
+
const allKeysInCollectionEnabled = toolKeys.every(
|
|
105
|
+
(toolKey) => state[`_enabled${toolType}`][toolKey],
|
|
106
|
+
);
|
|
107
|
+
|
|
108
|
+
// then toggle those keys to false
|
|
109
|
+
const updatedTools = toolKeys.reduce(
|
|
110
|
+
(accum, toolKey) => {
|
|
111
|
+
accum[toolKey] = !allKeysInCollectionEnabled;
|
|
112
|
+
return accum;
|
|
113
|
+
},
|
|
114
|
+
{
|
|
115
|
+
...state[`_enabled${toolType}`],
|
|
116
|
+
},
|
|
117
|
+
);
|
|
118
|
+
|
|
119
|
+
const enableKeys: string[] = [];
|
|
120
|
+
const disabledKeys: string[] = [];
|
|
121
|
+
|
|
122
|
+
Object.entries(updatedTools).forEach(([key, value]) => {
|
|
123
|
+
if (value) {
|
|
124
|
+
enableKeys.push(key);
|
|
125
|
+
} else {
|
|
126
|
+
disabledKeys.push(key);
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
|
|
109
130
|
return {
|
|
110
|
-
[`_enabled${toolType}`]:
|
|
111
|
-
[`enabled${toolType}`]:
|
|
112
|
-
[`disabled${toolType}`]:
|
|
131
|
+
[`_enabled${toolType}`]: updatedTools,
|
|
132
|
+
[`enabled${toolType}`]: enableKeys,
|
|
133
|
+
[`disabled${toolType}`]: disabledKeys,
|
|
113
134
|
};
|
|
114
135
|
}),
|
|
115
136
|
reset: (bridges, exchanges) => {
|
package/themes/createTheme.ts
CHANGED
|
@@ -63,7 +63,7 @@ export const createTheme = (
|
|
|
63
63
|
const borderRadiusSecondary =
|
|
64
64
|
widgetTheme.shape?.borderRadiusSecondary ?? shape.borderRadiusSecondary;
|
|
65
65
|
|
|
66
|
-
|
|
66
|
+
return createMuiTheme({
|
|
67
67
|
container: widgetTheme.container,
|
|
68
68
|
header: widgetTheme.header,
|
|
69
69
|
navigation: {
|
|
@@ -409,6 +409,4 @@ export const createTheme = (
|
|
|
409
409
|
},
|
|
410
410
|
},
|
|
411
411
|
});
|
|
412
|
-
|
|
413
|
-
return theme;
|
|
414
412
|
};
|
package/types/events.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ChainId, ChainType, Process, Route } from '@lifi/sdk';
|
|
2
|
+
import type { NavigationRouteType } from '../utils/navigationRoutes.js';
|
|
2
3
|
|
|
3
4
|
export enum WidgetEvent {
|
|
4
5
|
RouteExecutionStarted = 'routeExecutionStarted',
|
|
@@ -11,12 +12,13 @@ export enum WidgetEvent {
|
|
|
11
12
|
SourceChainTokenSelected = 'sourceChainTokenSelected',
|
|
12
13
|
DestinationChainTokenSelected = 'destinationChainTokenSelected',
|
|
13
14
|
SendToWalletToggled = 'sendToWalletToggled',
|
|
14
|
-
ReviewTransactionPageEntered = 'reviewTransactionPageEntered',
|
|
15
15
|
/**
|
|
16
|
-
* @deprecated
|
|
16
|
+
* @deprecated Use `PageEntered` event instead.
|
|
17
17
|
*/
|
|
18
|
+
ReviewTransactionPageEntered = 'reviewTransactionPageEntered',
|
|
18
19
|
WalletConnected = 'walletConnected',
|
|
19
20
|
WidgetExpanded = 'widgetExpanded',
|
|
21
|
+
PageEntered = 'pageEntered',
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
export type WidgetEvents = {
|
|
@@ -31,11 +33,9 @@ export type WidgetEvents = {
|
|
|
31
33
|
destinationChainTokenSelected: ChainTokenSelected;
|
|
32
34
|
sendToWalletToggled: boolean;
|
|
33
35
|
reviewTransactionPageEntered?: Route;
|
|
34
|
-
/**
|
|
35
|
-
* @deprecated use useWalletManagementEvents hook.
|
|
36
|
-
*/
|
|
37
36
|
walletConnected: WalletConnected;
|
|
38
37
|
widgetExpanded: boolean;
|
|
38
|
+
pageEntered: NavigationRouteType;
|
|
39
39
|
};
|
|
40
40
|
|
|
41
41
|
export interface ContactSupport {
|
package/utils/chainType.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ChainId, ChainType
|
|
1
|
+
import { ChainId, ChainType } from '@lifi/sdk';
|
|
2
2
|
import { isAddress as isEVMAddress } from 'viem';
|
|
3
|
+
import { isSVMAddress } from './svm.js';
|
|
3
4
|
|
|
4
5
|
const chainTypeAddressValidation = {
|
|
5
6
|
[ChainType.EVM]: isEVMAddress,
|
|
6
7
|
[ChainType.SVM]: isSVMAddress,
|
|
7
|
-
[ChainType.UTXO]:
|
|
8
|
+
[ChainType.UTXO]: () => false,
|
|
8
9
|
};
|
|
9
10
|
|
|
10
11
|
export const getChainTypeFromAddress = (
|
package/utils/elements.ts
CHANGED
|
@@ -3,8 +3,28 @@ export enum ElementId {
|
|
|
3
3
|
Header = 'widget-header',
|
|
4
4
|
RelativeContainer = 'widget-relative-container',
|
|
5
5
|
ScrollableContainer = 'widget-scrollable-container',
|
|
6
|
-
TokenList = 'token-list',
|
|
7
6
|
}
|
|
8
7
|
|
|
9
8
|
export const createElementId = (ElementId: ElementId, elementId: string) =>
|
|
10
9
|
elementId ? `${ElementId}-${elementId}` : ElementId;
|
|
10
|
+
|
|
11
|
+
// NOTE: The getter functions here are often used with code that can be effected by css changes in the
|
|
12
|
+
// AppExpandedContainer, RelativeContainer and CssBaselineContainer components as defined in AppContainer.ts
|
|
13
|
+
|
|
14
|
+
export const getAppContainer = (elementId: string) =>
|
|
15
|
+
document.getElementById(
|
|
16
|
+
createElementId(ElementId.AppExpandedContainer, elementId),
|
|
17
|
+
);
|
|
18
|
+
|
|
19
|
+
export const getRelativeContainer = (elementId: string) =>
|
|
20
|
+
document.getElementById(
|
|
21
|
+
createElementId(ElementId.RelativeContainer, elementId),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export const getScrollableContainer = (elementId: string) =>
|
|
25
|
+
document.getElementById(
|
|
26
|
+
createElementId(ElementId.ScrollableContainer, elementId),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
export const getHeaderElement = (elementId: string) =>
|
|
30
|
+
document.getElementById(createElementId(ElementId.Header, elementId));
|
package/utils/fees.ts
CHANGED
|
@@ -104,22 +104,20 @@ export const getFeeCostsBreakdown = (
|
|
|
104
104
|
export const getStepFeeCostsBreakdown = (
|
|
105
105
|
feeCosts: FeeCost[] | GasCost[],
|
|
106
106
|
): FeesBreakdown => {
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
{ amount: 0n, amountUSD: 0 },
|
|
107
|
+
const token = feeCosts[0].token;
|
|
108
|
+
const amount = feeCosts.reduce(
|
|
109
|
+
(amount, feeCost) => amount + BigInt(feeCost.amount || 0),
|
|
110
|
+
0n,
|
|
111
|
+
);
|
|
112
|
+
const amountUSD = feeCosts.reduce(
|
|
113
|
+
(amount, feeCost) =>
|
|
114
|
+
amount +
|
|
115
|
+
parseFloat(feeCost.token.priceUSD || '0') *
|
|
116
|
+
parseFloat(
|
|
117
|
+
formatUnits(BigInt(feeCost.amount || 0), feeCost.token.decimals),
|
|
118
|
+
),
|
|
119
|
+
0,
|
|
121
120
|
);
|
|
122
|
-
|
|
123
121
|
return {
|
|
124
122
|
amount,
|
|
125
123
|
amountUSD,
|
package/utils/format.ts
CHANGED
|
@@ -60,7 +60,7 @@ export function formatInputAmount(
|
|
|
60
60
|
if (!amount) {
|
|
61
61
|
return amount;
|
|
62
62
|
}
|
|
63
|
-
let formattedAmount = amount.replaceAll(',', '.');
|
|
63
|
+
let formattedAmount = amount.trim().replaceAll(',', '.');
|
|
64
64
|
if (formattedAmount.startsWith('.')) {
|
|
65
65
|
formattedAmount = '0' + formattedAmount;
|
|
66
66
|
}
|
|
@@ -7,6 +7,7 @@ export const navigationRoutes = {
|
|
|
7
7
|
fromToken: 'from-token',
|
|
8
8
|
languages: 'languages',
|
|
9
9
|
routes: 'routes',
|
|
10
|
+
selectWallet: 'select-wallet',
|
|
10
11
|
settings: 'settings',
|
|
11
12
|
toChain: 'to-chain',
|
|
12
13
|
toToken: 'to-token',
|
|
@@ -30,6 +31,7 @@ export const stickyHeaderRoutes = [
|
|
|
30
31
|
navigationRoutes.fromChain,
|
|
31
32
|
navigationRoutes.home,
|
|
32
33
|
navigationRoutes.routes,
|
|
34
|
+
navigationRoutes.selectWallet,
|
|
33
35
|
navigationRoutes.settings,
|
|
34
36
|
navigationRoutes.toChain,
|
|
35
37
|
navigationRoutes.toTokenNative,
|
|
@@ -51,6 +53,7 @@ export const backButtonRoutes = [
|
|
|
51
53
|
navigationRoutes.fromChain,
|
|
52
54
|
navigationRoutes.fromToken,
|
|
53
55
|
navigationRoutes.routes,
|
|
56
|
+
navigationRoutes.selectWallet,
|
|
54
57
|
navigationRoutes.settings,
|
|
55
58
|
navigationRoutes.toChain,
|
|
56
59
|
navigationRoutes.toToken,
|
|
@@ -65,4 +68,7 @@ export const backButtonRoutes = [
|
|
|
65
68
|
navigationRoutes.configuredWallets,
|
|
66
69
|
];
|
|
67
70
|
|
|
68
|
-
export type
|
|
71
|
+
export type NavigationRouteTypeKeys = keyof typeof navigationRoutes;
|
|
72
|
+
|
|
73
|
+
export type NavigationRouteType =
|
|
74
|
+
(typeof navigationRoutes)[NavigationRouteTypeKeys];
|
package/utils/svm.ts
ADDED
package/utils/wallet.ts
CHANGED
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
export declare const SmallAvatar: import("@emotion/styled").StyledComponent<import("@mui/material").AvatarOwnProps & import("@mui/material").AvatarSlotsAndSlotProps & import("@mui/material/OverridableComponent.js").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
2
|
-
ref?: ((instance: HTMLDivElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLDivElement> | null | undefined;
|
|
3
|
-
}, "children" | "sx" | "style" | "className" | "sizes" | "alt" | "src" | "srcSet" | "classes" | "variant" | "imgProps" | "slots" | "slotProps"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
4
|
-
export declare const SmallAvatarSkeleton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { Avatar, Skeleton, styled } from '@mui/material';
|
|
3
|
-
import { AvatarSkeletonContainer } from './Avatar.style.js';
|
|
4
|
-
export const SmallAvatar = styled(Avatar)(({ theme }) => ({
|
|
5
|
-
background: theme.palette.background.paper,
|
|
6
|
-
width: 16,
|
|
7
|
-
height: 16,
|
|
8
|
-
}));
|
|
9
|
-
export const SmallAvatarSkeleton = () => {
|
|
10
|
-
return (_jsx(AvatarSkeletonContainer, { children: _jsx(Skeleton, { width: 16, height: 16, variant: "circular" }) }));
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=SmallAvatar.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SmallAvatar.js","sourceRoot":"","sources":["../../../components/Avatar/SmallAvatar.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AACzD,OAAO,EAAE,uBAAuB,EAAE,MAAM,mBAAmB,CAAC;AAE5D,MAAM,CAAC,MAAM,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC,CAAC;IACxD,UAAU,EAAE,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,KAAK;IAC1C,KAAK,EAAE,EAAE;IACT,MAAM,EAAE,EAAE;CACX,CAAC,CAAC,CAAC;AAEJ,MAAM,CAAC,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,OAAO,CACL,KAAC,uBAAuB,cACtB,KAAC,QAAQ,IAAC,KAAK,EAAE,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,OAAO,EAAC,UAAU,GAAG,GAC9B,CAC3B,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useAccountDisconnect } from '@lifi/wallet-management';
|
|
3
|
-
import { PowerSettingsNewRounded } from '@mui/icons-material';
|
|
4
|
-
import { IconButton } from '@mui/material';
|
|
5
|
-
export const DisconnectIconButton = ({ account }) => {
|
|
6
|
-
const disconnect = useAccountDisconnect();
|
|
7
|
-
return (_jsx(IconButton, { size: "medium", onClick: async (e) => {
|
|
8
|
-
e.stopPropagation();
|
|
9
|
-
await disconnect(account);
|
|
10
|
-
}, children: _jsx(PowerSettingsNewRounded, {}) }));
|
|
11
|
-
};
|
|
12
|
-
//# sourceMappingURL=DisconnectIconButton.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"DisconnectIconButton.js","sourceRoot":"","sources":["../../../components/Header/DisconnectIconButton.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAgB,MAAM,yBAAyB,CAAC;AAC7E,OAAO,EAAE,uBAAuB,EAAE,MAAM,qBAAqB,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAE3C,MAAM,CAAC,MAAM,oBAAoB,GAAG,CAAC,EAAE,OAAO,EAAwB,EAAE,EAAE;IACxE,MAAM,UAAU,GAAG,oBAAoB,EAAE,CAAC;IAC1C,OAAO,CACL,KAAC,UAAU,IACT,IAAI,EAAC,QAAQ,EACb,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE;YACnB,CAAC,CAAC,eAAe,EAAE,CAAC;YACpB,MAAM,UAAU,CAAC,OAAO,CAAC,CAAC;QAC5B,CAAC,YAED,KAAC,uBAAuB,KAAG,GAChB,CACd,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { useHasExternalWalletProvider } from '../providers/WalletProvider/useHasExternalWalletProvider.js';
|
|
2
|
-
import { useWidgetConfig } from '../providers/WidgetProvider/WidgetProvider.js';
|
|
3
|
-
export const minHeaderHeight = 64;
|
|
4
|
-
export const maxHeaderHeight = 108;
|
|
5
|
-
export const maxHeaderHeightSubvariantSplit = 136;
|
|
6
|
-
// We use fixed position on the header when Widget is in Full Height layout.
|
|
7
|
-
// We do this to get it to work like the sticky header does in the other layout modes.
|
|
8
|
-
// As the header is position fixed its not in the document flow anymore.
|
|
9
|
-
// To prevent the remaining page content from appearing behind the header we need to
|
|
10
|
-
// pass the headers height so that the position of the page content can be adjusted
|
|
11
|
-
export const useHeaderHeight = () => {
|
|
12
|
-
const { hiddenUI, subvariant } = useWidgetConfig();
|
|
13
|
-
const { hasExternalProvider } = useHasExternalWalletProvider();
|
|
14
|
-
const headerHeight = subvariant === 'split'
|
|
15
|
-
? maxHeaderHeightSubvariantSplit
|
|
16
|
-
: hiddenUI?.includes('walletMenu') || hasExternalProvider
|
|
17
|
-
? minHeaderHeight
|
|
18
|
-
: maxHeaderHeight;
|
|
19
|
-
return {
|
|
20
|
-
headerHeight,
|
|
21
|
-
};
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=useHeaderHeight.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useHeaderHeight.js","sourceRoot":"","sources":["../../hooks/useHeaderHeight.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,6DAA6D,CAAC;AAC3G,OAAO,EAAE,eAAe,EAAE,MAAM,+CAA+C,CAAC;AAEhF,MAAM,CAAC,MAAM,eAAe,GAAG,EAAE,CAAC;AAClC,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,CAAC;AACnC,MAAM,CAAC,MAAM,8BAA8B,GAAG,GAAG,CAAC;AAElD,4EAA4E;AAC5E,sFAAsF;AACtF,wEAAwE;AACxE,oFAAoF;AACpF,mFAAmF;AACnF,MAAM,CAAC,MAAM,eAAe,GAAG,GAAG,EAAE;IAClC,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,GAAG,eAAe,EAAE,CAAC;IACnD,MAAM,EAAE,mBAAmB,EAAE,GAAG,4BAA4B,EAAE,CAAC;IAE/D,MAAM,YAAY,GAChB,UAAU,KAAK,OAAO;QACpB,CAAC,CAAC,8BAA8B;QAChC,CAAC,CAAC,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,IAAI,mBAAmB;YACvD,CAAC,CAAC,eAAe;YACjB,CAAC,CAAC,eAAe,CAAC;IAExB,OAAO;QACL,YAAY;KACb,CAAC;AACJ,CAAC,CAAC"}
|