@lifi/widget 2.9.3 → 3.0.0-alpha.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.js +2 -2
- package/AppRoutes.js +75 -67
- package/cjs/AppProvider.js +1 -1
- package/cjs/AppRoutes.js +74 -66
- package/cjs/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
- package/cjs/components/ActiveTransactions/ActiveTransactions.js +2 -2
- package/cjs/components/AmountInput/AmountInputEndAdornment.js +9 -10
- package/cjs/components/AmountInput/FormPriceHelperText.js +1 -1
- package/cjs/components/BaseTransactionButton/BaseTransactionButton.js +5 -4
- package/cjs/components/Card/CardLabel.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.js +8 -5
- package/cjs/components/ChainSelect/useChainSelect.js +21 -2
- package/cjs/components/GasMessage/GasMessage.style.js +3 -6
- package/cjs/components/GasMessage/GasSufficiencyMessage.js +2 -1
- package/cjs/components/Header/Header.style.d.ts +8 -0
- package/cjs/components/Header/Header.style.js +16 -1
- package/cjs/components/Header/NavigationHeader.d.ts +1 -0
- package/cjs/components/Header/NavigationHeader.js +15 -8
- package/cjs/components/Header/NavigationTabs.js +2 -2
- package/cjs/components/Header/SettingsButton.d.ts +1 -0
- package/cjs/components/Header/SettingsButton.js +25 -0
- package/cjs/components/Header/SettingsButton.style.d.ts +11 -0
- package/cjs/components/Header/SettingsButton.style.js +43 -0
- package/cjs/components/Header/WalletHeader.js +11 -24
- package/cjs/components/Header/WalletMenu.d.ts +3 -1
- package/cjs/components/Header/WalletMenu.js +58 -24
- package/cjs/components/Header/WalletMenu.style.d.ts +1 -0
- package/cjs/components/Header/WalletMenu.style.js +27 -0
- package/cjs/components/Insurance/InsuranceCollapsed.js +1 -1
- package/cjs/components/NFT/NFT.js +3 -1
- package/cjs/components/NFT/types.d.ts +1 -1
- package/cjs/components/PoweredBy/PoweredBy.js +2 -1
- package/cjs/components/RouteCard/RouteCard.js +3 -3
- package/cjs/components/RouteCard/RouteCardEssentials.js +2 -1
- package/cjs/components/RouteCard/utils.d.ts +2 -3
- package/cjs/components/RouteCard/utils.js +4 -9
- package/cjs/components/SendToWallet/SendToWallet.js +24 -21
- package/cjs/components/SendToWallet/SendToWalletButton.js +3 -2
- package/{pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → cjs/components/SettingsListItemButton.d.ts} +1 -1
- package/cjs/components/SettingsListItemButton.js +8 -0
- package/cjs/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/cjs/components/Step/GasStepProcess.d.ts +2 -2
- package/cjs/components/Step/Step.d.ts +2 -2
- package/cjs/components/Step/Step.js +1 -1
- package/cjs/components/Step/StepList.d.ts +2 -2
- package/cjs/components/Step/StepList.js +4 -4
- package/cjs/components/Step/StepProcess.d.ts +2 -2
- package/cjs/components/Step/StepTimer.d.ts +2 -2
- package/cjs/components/StepActions/StepActions.d.ts +3 -3
- package/cjs/components/StepActions/StepActions.js +11 -14
- package/cjs/components/StepActions/types.d.ts +2 -2
- package/cjs/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
- package/cjs/components/{Header/NavigationTabs.style.js → Tabs/Tabs.style.js} +9 -31
- package/cjs/components/Tabs/index.d.ts +1 -0
- package/cjs/{providers/SDKProvider → components/Tabs}/index.js +1 -1
- package/cjs/components/Token/Token.d.ts +3 -3
- package/cjs/components/Token/Token.js +5 -5
- package/cjs/components/TokenList/TokenList.js +2 -2
- package/cjs/components/TokenList/TokenListItem.js +9 -5
- package/cjs/components/TokenList/TokenNotFound.js +1 -1
- package/cjs/components/TokenList/VirtualizedTokenList.js +2 -1
- package/cjs/config/queryClient.js +0 -4
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/index.d.ts +7 -1
- package/cjs/hooks/index.js +7 -1
- package/cjs/hooks/useAccount.d.ts +31 -0
- package/cjs/hooks/useAccount.js +53 -0
- package/cjs/hooks/useAvailableChains.d.ts +6 -0
- package/cjs/hooks/useAvailableChains.js +36 -0
- package/cjs/hooks/useChain.js +3 -6
- package/cjs/hooks/useChains.d.ts +1 -1
- package/cjs/hooks/useChains.js +7 -38
- package/cjs/hooks/useFromTokenSufficiency.d.ts +3 -3
- package/cjs/hooks/useFromTokenSufficiency.js +39 -41
- package/cjs/hooks/useGasRecommendation.d.ts +2 -2
- package/cjs/hooks/useGasRecommendation.js +23 -18
- package/cjs/hooks/useGasRefuel.js +18 -11
- package/cjs/hooks/useGasSufficiency.d.ts +6 -7
- package/cjs/hooks/useGasSufficiency.js +68 -71
- package/cjs/hooks/useLanguages.d.ts +6 -0
- package/cjs/hooks/useLanguages.js +28 -0
- package/cjs/hooks/useProcessMessage.d.ts +3 -3
- package/cjs/hooks/useProcessMessage.js +32 -28
- package/cjs/hooks/useRequiredToAddress.d.ts +1 -0
- package/cjs/hooks/useRequiredToAddress.js +19 -0
- package/cjs/hooks/useRouteExecution.d.ts +2 -2
- package/cjs/hooks/useRouteExecution.js +44 -58
- package/cjs/hooks/useRoutes.d.ts +1 -1
- package/cjs/hooks/useRoutes.js +128 -113
- package/cjs/hooks/useSettingMonitor.d.ts +11 -0
- package/cjs/hooks/useSettingMonitor.js +57 -0
- package/cjs/hooks/useTokenAddressBalance.d.ts +1 -1
- package/cjs/hooks/useTokenBalance.d.ts +5 -3
- package/cjs/hooks/useTokenBalance.js +77 -47
- package/cjs/hooks/useTokenBalances.d.ts +3 -3
- package/cjs/hooks/useTokenBalances.js +34 -24
- package/cjs/hooks/useTokenSearch.js +18 -17
- package/cjs/hooks/useTokens.d.ts +2 -1
- package/cjs/hooks/useTokens.js +18 -15
- package/cjs/hooks/useTools.d.ts +1 -1
- package/cjs/hooks/useTools.js +12 -11
- package/cjs/hooks/useTransactionDetails.d.ts +4 -0
- package/cjs/hooks/useTransactionDetails.js +56 -0
- package/cjs/hooks/useTransactionHistory.d.ts +5 -0
- package/cjs/hooks/useTransactionHistory.js +39 -0
- package/cjs/i18n/en.json +18 -9
- package/cjs/i18n/fr.json +7 -4
- package/cjs/i18n/pt.json +7 -4
- package/cjs/i18n/tr.json +7 -4
- package/cjs/i18n/uk.json +7 -4
- package/cjs/i18n/zh.json +7 -4
- package/cjs/icons/index.d.ts +1 -3
- package/cjs/icons/index.js +1 -3
- package/cjs/icons/lifi.d.ts +1 -0
- package/cjs/icons/lifi.js +4 -0
- package/cjs/index.d.ts +2 -3
- package/cjs/index.js +4 -4
- package/cjs/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
- package/cjs/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
- package/cjs/pages/LanguagesPage/LanguagesPage.js +22 -0
- package/cjs/pages/LanguagesPage/index.d.ts +1 -0
- package/cjs/pages/LanguagesPage/index.js +17 -0
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +15 -5
- package/cjs/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
- package/cjs/pages/SelectWalletPage/EVMListItemButton.js +40 -0
- package/cjs/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
- package/cjs/pages/SelectWalletPage/SVMListItemButton.js +34 -0
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +31 -32
- package/cjs/pages/SelectWalletPage/utils.d.ts +3 -0
- package/cjs/pages/SelectWalletPage/utils.js +21 -0
- package/{pages/SettingsPage/EnabledToolsButton.d.ts → cjs/pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
- package/cjs/pages/SettingsPage/BridgeAndExchangeSettings.js +36 -0
- package/cjs/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/GasPriceSettings.js +21 -0
- package/cjs/pages/SettingsPage/LanguageSetting.d.ts +2 -0
- package/cjs/pages/SettingsPage/LanguageSetting.js +26 -0
- package/cjs/pages/SettingsPage/ResetSettingsButton.js +3 -30
- package/cjs/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/RoutePrioritySettings.js +25 -0
- package/cjs/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
- package/cjs/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +6 -9
- package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
- package/cjs/pages/SettingsPage/SettingsCard/BadgedValue.js +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.js +11 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCard.style.js +53 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardButton.js +8 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +16 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
- package/cjs/pages/SettingsPage/SettingsCard/SettingsAccordian.js +36 -0
- package/cjs/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
- package/cjs/pages/SettingsPage/SettingsCard/index.js +22 -0
- package/cjs/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
- package/cjs/pages/SettingsPage/SettingsPage.js +9 -8
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.js +51 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
- package/cjs/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +74 -0
- package/cjs/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
- package/cjs/pages/SettingsPage/SlippageSettings/index.js +17 -0
- package/cjs/pages/SettingsPage/ThemeSettings.d.ts +2 -0
- package/cjs/pages/SettingsPage/ThemeSettings.js +39 -0
- package/cjs/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsPage.js +33 -28
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
- package/cjs/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +31 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
- package/cjs/pages/TransactionHistoryPage/TransactionHistoryPage.js +21 -22
- package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +26 -0
- package/cjs/pages/TransactionHistoryPage/constants.d.ts +1 -0
- package/cjs/pages/TransactionHistoryPage/constants.js +4 -0
- package/cjs/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
- package/cjs/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/cjs/pages/TransactionPage/StatusBottomSheet.js +12 -8
- package/cjs/pages/TransactionPage/TransactionPage.js +1 -1
- package/cjs/providers/FormProvider/FormUpdater.js +4 -4
- package/cjs/providers/I18nProvider/I18nProvider.js +3 -7
- package/cjs/providers/I18nProvider/types.d.ts +4 -3
- package/cjs/providers/WalletProvider/EVMProvider.d.ts +3 -0
- package/cjs/providers/WalletProvider/EVMProvider.js +79 -0
- package/cjs/providers/WalletProvider/SDKProviders.d.ts +1 -0
- package/cjs/providers/WalletProvider/SDKProviders.js +31 -0
- package/cjs/providers/WalletProvider/SolanaProvider.d.ts +3 -0
- package/cjs/providers/WalletProvider/SolanaProvider.js +35 -0
- package/cjs/providers/WalletProvider/WalletProvider.d.ts +1 -15
- package/cjs/providers/WalletProvider/WalletProvider.js +5 -183
- package/cjs/providers/WalletProvider/index.d.ts +1 -1
- package/cjs/providers/WalletProvider/index.js +1 -1
- package/cjs/providers/WalletProvider/utils.d.ts +3 -0
- package/cjs/providers/WalletProvider/utils.js +25 -0
- package/cjs/providers/WidgetProvider/WidgetProvider.js +51 -35
- package/cjs/providers/index.d.ts +0 -1
- package/cjs/providers/index.js +0 -1
- package/cjs/stores/chains/ChainOrderStore.js +24 -0
- package/cjs/stores/header/useHeaderStore.d.ts +1 -1
- package/cjs/stores/header/useHeaderStore.js +2 -2
- package/cjs/stores/routes/createRouteExecutionStore.js +6 -60
- package/cjs/stores/routes/index.d.ts +0 -1
- package/cjs/stores/routes/index.js +0 -1
- package/cjs/stores/routes/types.d.ts +2 -2
- package/cjs/stores/routes/utils.d.ts +8 -8
- package/cjs/stores/routes/utils.js +7 -5
- package/cjs/stores/settings/useSettingsStore.js +2 -4
- package/cjs/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/cjs/stores/settings/useSplitSubvariantStore.js +2 -2
- package/cjs/types/events.d.ts +6 -5
- package/cjs/types/events.js +1 -1
- package/cjs/types/widget.d.ts +7 -14
- package/cjs/utils/colors.d.ts +3 -0
- package/cjs/utils/colors.js +13 -1
- package/cjs/utils/converters.d.ts +3 -0
- package/cjs/utils/converters.js +172 -0
- package/cjs/utils/format.d.ts +1 -1
- package/cjs/utils/format.js +5 -12
- package/cjs/utils/index.d.ts +1 -0
- package/cjs/utils/index.js +1 -0
- package/cjs/utils/navigationRoutes.d.ts +1 -0
- package/cjs/utils/navigationRoutes.js +3 -1
- package/cjs/utils/svm.d.ts +1 -0
- package/cjs/utils/svm.js +14 -0
- package/components/ActiveTransactions/ActiveTransactionItem.js +1 -5
- package/components/ActiveTransactions/ActiveTransactions.js +2 -2
- package/components/AmountInput/AmountInputEndAdornment.js +10 -11
- package/components/AmountInput/FormPriceHelperText.js +1 -1
- package/components/BaseTransactionButton/BaseTransactionButton.js +6 -5
- package/components/Card/CardLabel.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.js +8 -5
- package/components/ChainSelect/useChainSelect.js +22 -3
- package/components/GasMessage/GasMessage.style.js +3 -6
- package/components/GasMessage/GasSufficiencyMessage.js +2 -1
- package/components/Header/Header.style.d.ts +8 -0
- package/components/Header/Header.style.js +16 -1
- package/components/Header/NavigationHeader.d.ts +1 -0
- package/components/Header/NavigationHeader.js +16 -10
- package/components/Header/NavigationTabs.js +3 -3
- package/components/Header/SettingsButton.d.ts +1 -0
- package/components/Header/SettingsButton.js +21 -0
- package/components/Header/SettingsButton.style.d.ts +11 -0
- package/components/Header/SettingsButton.style.js +40 -0
- package/components/Header/WalletHeader.js +15 -28
- package/components/Header/WalletMenu.d.ts +3 -1
- package/components/Header/WalletMenu.js +58 -25
- package/components/Header/WalletMenu.style.d.ts +1 -0
- package/components/Header/WalletMenu.style.js +24 -0
- package/components/Insurance/InsuranceCollapsed.js +1 -1
- package/components/NFT/NFT.js +3 -1
- package/components/NFT/types.d.ts +1 -1
- package/components/PoweredBy/PoweredBy.js +2 -1
- package/components/RouteCard/RouteCard.js +3 -3
- package/components/RouteCard/RouteCardEssentials.js +2 -1
- package/components/RouteCard/utils.d.ts +2 -3
- package/components/RouteCard/utils.js +4 -9
- package/components/SendToWallet/SendToWallet.js +26 -23
- package/components/SendToWallet/SendToWalletButton.js +5 -4
- package/{cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts → components/SettingsListItemButton.d.ts} +1 -1
- package/components/SettingsListItemButton.js +5 -0
- package/components/Step/DestinationWalletAddress.d.ts +2 -2
- package/components/Step/GasStepProcess.d.ts +2 -2
- package/components/Step/Step.d.ts +2 -2
- package/components/Step/Step.js +2 -2
- package/components/Step/StepList.d.ts +2 -2
- package/components/Step/StepList.js +4 -4
- package/components/Step/StepProcess.d.ts +2 -2
- package/components/Step/StepTimer.d.ts +2 -2
- package/components/StepActions/StepActions.d.ts +3 -3
- package/components/StepActions/StepActions.js +12 -15
- package/components/StepActions/types.d.ts +2 -2
- package/components/{Header/NavigationTabs.style.d.ts → Tabs/Tabs.style.d.ts} +2 -2
- package/components/Tabs/Tabs.style.js +36 -0
- package/components/Tabs/index.d.ts +1 -0
- package/components/Tabs/index.js +1 -0
- package/components/Token/Token.d.ts +3 -3
- package/components/Token/Token.js +5 -5
- package/components/TokenList/TokenList.js +4 -4
- package/components/TokenList/TokenListItem.js +9 -6
- package/components/TokenList/TokenNotFound.js +2 -2
- package/components/TokenList/VirtualizedTokenList.js +2 -1
- package/config/queryClient.js +0 -4
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/index.d.ts +7 -1
- package/hooks/index.js +7 -1
- package/hooks/useAccount.d.ts +31 -0
- package/hooks/useAccount.js +48 -0
- package/hooks/useAvailableChains.d.ts +6 -0
- package/hooks/useAvailableChains.js +32 -0
- package/hooks/useChain.js +3 -6
- package/hooks/useChains.d.ts +1 -1
- package/hooks/useChains.js +9 -40
- package/hooks/useFromTokenSufficiency.d.ts +3 -3
- package/hooks/useFromTokenSufficiency.js +41 -43
- package/hooks/useGasRecommendation.d.ts +2 -2
- package/hooks/useGasRecommendation.js +23 -18
- package/hooks/useGasRefuel.js +19 -12
- package/hooks/useGasSufficiency.d.ts +6 -7
- package/hooks/useGasSufficiency.js +69 -72
- package/hooks/useLanguages.d.ts +6 -0
- package/hooks/useLanguages.js +24 -0
- package/hooks/useProcessMessage.d.ts +3 -3
- package/hooks/useProcessMessage.js +33 -29
- package/hooks/useRequiredToAddress.d.ts +1 -0
- package/hooks/useRequiredToAddress.js +15 -0
- package/hooks/useRouteExecution.d.ts +2 -2
- package/hooks/useRouteExecution.js +44 -58
- package/hooks/useRoutes.d.ts +1 -1
- package/hooks/useRoutes.js +131 -116
- package/hooks/useSettingMonitor.d.ts +11 -0
- package/hooks/useSettingMonitor.js +53 -0
- package/hooks/useTokenAddressBalance.d.ts +1 -1
- package/hooks/useTokenBalance.d.ts +5 -3
- package/hooks/useTokenBalance.js +74 -45
- package/hooks/useTokenBalances.d.ts +3 -3
- package/hooks/useTokenBalances.js +34 -24
- package/hooks/useTokenSearch.js +18 -17
- package/hooks/useTokens.d.ts +2 -1
- package/hooks/useTokens.js +19 -16
- package/hooks/useTools.d.ts +1 -1
- package/hooks/useTools.js +13 -12
- package/hooks/useTransactionDetails.d.ts +4 -0
- package/hooks/useTransactionDetails.js +52 -0
- package/hooks/useTransactionHistory.d.ts +5 -0
- package/hooks/useTransactionHistory.js +35 -0
- package/i18n/en.json +18 -9
- package/i18n/fr.json +7 -4
- package/i18n/pt.json +7 -4
- package/i18n/tr.json +7 -4
- package/i18n/uk.json +7 -4
- package/i18n/zh.json +7 -4
- package/icons/index.d.ts +1 -3
- package/icons/index.js +1 -3
- package/icons/lifi.d.ts +1 -0
- package/icons/lifi.js +1 -0
- package/index.d.ts +2 -3
- package/index.js +2 -4
- package/package.json +19 -19
- package/pages/ActiveTransactionsPage/ActiveTransactionsPage.js +2 -2
- package/pages/LanguagesPage/LanguagesPage.d.ts +2 -0
- package/pages/LanguagesPage/LanguagesPage.js +18 -0
- package/pages/LanguagesPage/index.d.ts +1 -0
- package/pages/LanguagesPage/index.js +1 -0
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +16 -6
- package/pages/SelectWalletPage/EVMListItemButton.d.ts +8 -0
- package/pages/SelectWalletPage/EVMListItemButton.js +36 -0
- package/pages/SelectWalletPage/SVMListItemButton.d.ts +6 -0
- package/pages/SelectWalletPage/SVMListItemButton.js +30 -0
- package/pages/SelectWalletPage/SelectWalletPage.js +34 -35
- package/pages/SelectWalletPage/utils.d.ts +3 -0
- package/pages/SelectWalletPage/utils.js +17 -0
- package/{cjs/pages/SettingsPage/EnabledToolsButton.d.ts → pages/SettingsPage/BridgeAndExchangeSettings.d.ts} +1 -1
- package/pages/SettingsPage/BridgeAndExchangeSettings.js +32 -0
- package/pages/SettingsPage/GasPriceSettings.d.ts +2 -0
- package/pages/SettingsPage/GasPriceSettings.js +17 -0
- package/pages/SettingsPage/LanguageSetting.d.ts +2 -0
- package/pages/SettingsPage/LanguageSetting.js +22 -0
- package/pages/SettingsPage/ResetSettingsButton.js +4 -31
- package/pages/SettingsPage/RoutePrioritySettings.d.ts +2 -0
- package/pages/SettingsPage/RoutePrioritySettings.js +21 -0
- package/pages/SettingsPage/SendToWalletOptionSetting.d.ts +1 -0
- package/pages/SettingsPage/{ShowDestinationWallet.js → SendToWalletOptionSetting.js} +4 -7
- package/pages/SettingsPage/SettingsCard/BadgedValue.d.ts +8 -0
- package/pages/SettingsPage/SettingsCard/BadgedValue.js +3 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.d.ts +2 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.js +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.style.d.ts +19 -0
- package/pages/SettingsPage/SettingsCard/SettingCard.style.js +50 -0
- package/pages/SettingsPage/SettingsCard/SettingCardButton.d.ts +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCardButton.js +4 -0
- package/pages/SettingsPage/SettingsCard/SettingCardExpandable.d.ts +7 -0
- package/pages/SettingsPage/SettingsCard/SettingCardExpandable.js +12 -0
- package/pages/SettingsPage/SettingsCard/SettingsAccordian.d.ts +6 -0
- package/pages/SettingsPage/SettingsCard/SettingsAccordian.js +31 -0
- package/pages/SettingsPage/SettingsCard/index.d.ts +6 -0
- package/pages/SettingsPage/SettingsCard/index.js +6 -0
- package/pages/SettingsPage/SettingsCard/types.d.ts +5 -0
- package/pages/SettingsPage/SettingsPage.js +10 -9
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.d.ts +2 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.js +47 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.d.ts +16 -0
- package/pages/SettingsPage/SlippageSettings/SlippageSettings.style.js +71 -0
- package/pages/SettingsPage/SlippageSettings/index.d.ts +1 -0
- package/pages/SettingsPage/SlippageSettings/index.js +1 -0
- package/pages/SettingsPage/ThemeSettings.d.ts +2 -0
- package/pages/SettingsPage/ThemeSettings.js +35 -0
- package/pages/TransactionDetailsPage/ContactSupportButton.js +2 -2
- package/pages/TransactionDetailsPage/TransactionDetailsPage.js +38 -33
- package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.d.ts +1 -0
- package/pages/TransactionDetailsPage/TransactionDetailsSkeleton.js +27 -0
- package/pages/TransactionHistoryPage/TransactionHistoryItem.d.ts +4 -2
- package/pages/TransactionHistoryPage/TransactionHistoryItem.js +34 -7
- package/pages/TransactionHistoryPage/TransactionHistoryPage.js +24 -25
- package/pages/TransactionHistoryPage/TransactionHistorySkeleton.d.ts +1 -0
- package/pages/TransactionHistoryPage/TransactionHistorySkeleton.js +22 -0
- package/pages/TransactionHistoryPage/constants.d.ts +1 -0
- package/pages/TransactionHistoryPage/constants.js +1 -0
- package/pages/TransactionPage/ExchangeRateBottomSheet.js +11 -10
- package/pages/TransactionPage/StartTransactionButton.js +2 -2
- package/pages/TransactionPage/StatusBottomSheet.js +14 -10
- package/pages/TransactionPage/TransactionPage.js +1 -1
- package/providers/FormProvider/FormUpdater.js +4 -4
- package/providers/I18nProvider/I18nProvider.js +4 -8
- package/providers/I18nProvider/types.d.ts +4 -3
- package/providers/WalletProvider/EVMProvider.d.ts +3 -0
- package/providers/WalletProvider/EVMProvider.js +74 -0
- package/providers/WalletProvider/SDKProviders.d.ts +1 -0
- package/providers/WalletProvider/SDKProviders.js +27 -0
- package/providers/WalletProvider/SolanaProvider.d.ts +3 -0
- package/providers/WalletProvider/SolanaProvider.js +30 -0
- package/providers/WalletProvider/WalletProvider.d.ts +1 -15
- package/providers/WalletProvider/WalletProvider.js +5 -181
- package/providers/WalletProvider/index.d.ts +1 -1
- package/providers/WalletProvider/index.js +1 -1
- package/providers/WalletProvider/utils.d.ts +3 -0
- package/providers/WalletProvider/utils.js +21 -0
- package/providers/WidgetProvider/WidgetProvider.js +52 -36
- package/providers/index.d.ts +0 -1
- package/providers/index.js +0 -1
- package/stores/chains/ChainOrderStore.js +25 -1
- package/stores/header/useHeaderStore.d.ts +1 -1
- package/stores/header/useHeaderStore.js +2 -2
- package/stores/routes/createRouteExecutionStore.js +6 -60
- package/stores/routes/index.d.ts +0 -1
- package/stores/routes/index.js +0 -1
- package/stores/routes/types.d.ts +2 -2
- package/stores/routes/utils.d.ts +8 -8
- package/stores/routes/utils.js +5 -3
- package/stores/settings/useSettingsStore.js +2 -4
- package/stores/settings/useSplitSubvariantStore.d.ts +1 -1
- package/stores/settings/useSplitSubvariantStore.js +2 -2
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/types/events.d.ts +6 -5
- package/types/events.js +1 -1
- package/types/widget.d.ts +7 -14
- package/utils/colors.d.ts +3 -0
- package/utils/colors.js +10 -1
- package/utils/converters.d.ts +3 -0
- package/utils/converters.js +168 -0
- package/utils/format.d.ts +1 -1
- package/utils/format.js +5 -12
- package/utils/index.d.ts +1 -0
- package/utils/index.js +1 -0
- package/utils/navigationRoutes.d.ts +1 -0
- package/utils/navigationRoutes.js +3 -1
- package/utils/svm.d.ts +1 -0
- package/utils/svm.js +10 -0
- package/cjs/components/LiFiLogo.d.ts +0 -5
- package/cjs/components/LiFiLogo.js +0 -10
- package/cjs/fonts/Inter-Black.woff +0 -0
- package/cjs/fonts/Inter-Black.woff2 +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff +0 -0
- package/cjs/fonts/Inter-BlackItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Bold.woff +0 -0
- package/cjs/fonts/Inter-Bold.woff2 +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff +0 -0
- package/cjs/fonts/Inter-BoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff +0 -0
- package/cjs/fonts/Inter-ExtraBold.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff +0 -0
- package/cjs/fonts/Inter-ExtraLight.woff2 +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/cjs/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Italic.woff +0 -0
- package/cjs/fonts/Inter-Italic.woff2 +0 -0
- package/cjs/fonts/Inter-Light.woff +0 -0
- package/cjs/fonts/Inter-Light.woff2 +0 -0
- package/cjs/fonts/Inter-LightItalic.woff +0 -0
- package/cjs/fonts/Inter-LightItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Medium.woff +0 -0
- package/cjs/fonts/Inter-Medium.woff2 +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff +0 -0
- package/cjs/fonts/Inter-MediumItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Regular.woff +0 -0
- package/cjs/fonts/Inter-Regular.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBold.woff +0 -0
- package/cjs/fonts/Inter-SemiBold.woff2 +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/cjs/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/cjs/fonts/Inter-Thin.woff +0 -0
- package/cjs/fonts/Inter-Thin.woff2 +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff +0 -0
- package/cjs/fonts/Inter-ThinItalic.woff2 +0 -0
- package/cjs/fonts/Inter-italic.var.woff2 +0 -0
- package/cjs/fonts/Inter-roman.var.woff2 +0 -0
- package/cjs/fonts/Inter.var.woff2 +0 -0
- package/cjs/fonts/inter.css +0 -217
- package/cjs/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
- package/cjs/hooks/useGetTokenBalancesWithRetry.js +0 -33
- package/cjs/icons/LiFiFullLogo.d.ts +0 -2
- package/cjs/icons/LiFiFullLogo.js +0 -6
- package/cjs/icons/LiFiLogo.d.ts +0 -2
- package/cjs/icons/LiFiLogo.js +0 -6
- package/cjs/icons/LiFiToolLogo.d.ts +0 -2
- package/cjs/icons/LiFiToolLogo.js +0 -6
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -8
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -27
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -19
- package/cjs/pages/SettingsPage/EnabledToolsButton.js +0 -25
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
- package/cjs/pages/SettingsPage/EnabledToolsButton.style.js +0 -17
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.js +0 -17
- package/cjs/pages/SettingsPage/LanguageSelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/LanguageSelect.js +0 -37
- package/cjs/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +0 -23
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.js +0 -30
- package/cjs/providers/SDKProvider/SDKProvider.d.ts +0 -4
- package/cjs/providers/SDKProvider/SDKProvider.js +0 -41
- package/cjs/providers/SDKProvider/index.d.ts +0 -1
- package/cjs/providers/WalletProvider/types.d.ts +0 -17
- package/cjs/stores/routes/useTransactionHistory.d.ts +0 -2
- package/cjs/stores/routes/useTransactionHistory.js +0 -15
- package/components/Header/NavigationTabs.style.js +0 -58
- package/components/LiFiLogo.d.ts +0 -5
- package/components/LiFiLogo.js +0 -6
- package/fonts/Inter-Black.woff +0 -0
- package/fonts/Inter-Black.woff2 +0 -0
- package/fonts/Inter-BlackItalic.woff +0 -0
- package/fonts/Inter-BlackItalic.woff2 +0 -0
- package/fonts/Inter-Bold.woff +0 -0
- package/fonts/Inter-Bold.woff2 +0 -0
- package/fonts/Inter-BoldItalic.woff +0 -0
- package/fonts/Inter-BoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraBold.woff +0 -0
- package/fonts/Inter-ExtraBold.woff2 +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff +0 -0
- package/fonts/Inter-ExtraBoldItalic.woff2 +0 -0
- package/fonts/Inter-ExtraLight.woff +0 -0
- package/fonts/Inter-ExtraLight.woff2 +0 -0
- package/fonts/Inter-ExtraLightItalic.woff +0 -0
- package/fonts/Inter-ExtraLightItalic.woff2 +0 -0
- package/fonts/Inter-Italic.woff +0 -0
- package/fonts/Inter-Italic.woff2 +0 -0
- package/fonts/Inter-Light.woff +0 -0
- package/fonts/Inter-Light.woff2 +0 -0
- package/fonts/Inter-LightItalic.woff +0 -0
- package/fonts/Inter-LightItalic.woff2 +0 -0
- package/fonts/Inter-Medium.woff +0 -0
- package/fonts/Inter-Medium.woff2 +0 -0
- package/fonts/Inter-MediumItalic.woff +0 -0
- package/fonts/Inter-MediumItalic.woff2 +0 -0
- package/fonts/Inter-Regular.woff +0 -0
- package/fonts/Inter-Regular.woff2 +0 -0
- package/fonts/Inter-SemiBold.woff +0 -0
- package/fonts/Inter-SemiBold.woff2 +0 -0
- package/fonts/Inter-SemiBoldItalic.woff +0 -0
- package/fonts/Inter-SemiBoldItalic.woff2 +0 -0
- package/fonts/Inter-Thin.woff +0 -0
- package/fonts/Inter-Thin.woff2 +0 -0
- package/fonts/Inter-ThinItalic.woff +0 -0
- package/fonts/Inter-ThinItalic.woff2 +0 -0
- package/fonts/Inter-italic.var.woff2 +0 -0
- package/fonts/Inter-roman.var.woff2 +0 -0
- package/fonts/Inter.var.woff2 +0 -0
- package/fonts/inter.css +0 -217
- package/hooks/useGetTokenBalancesWithRetry.d.ts +0 -3
- package/hooks/useGetTokenBalancesWithRetry.js +0 -29
- package/icons/LiFiFullLogo.d.ts +0 -2
- package/icons/LiFiFullLogo.js +0 -2
- package/icons/LiFiLogo.d.ts +0 -2
- package/icons/LiFiLogo.js +0 -2
- package/icons/LiFiToolLogo.d.ts +0 -2
- package/icons/LiFiToolLogo.js +0 -2
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +0 -5
- package/pages/SettingsPage/ColorSchemeButtonGroup.d.ts +0 -2
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +0 -23
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +0 -4
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.js +0 -16
- package/pages/SettingsPage/EnabledToolsButton.js +0 -21
- package/pages/SettingsPage/EnabledToolsButton.style.d.ts +0 -5
- package/pages/SettingsPage/EnabledToolsButton.style.js +0 -14
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/GasPriceSelect.js +0 -13
- package/pages/SettingsPage/LanguageSelect.d.ts +0 -2
- package/pages/SettingsPage/LanguageSelect.js +0 -33
- package/pages/SettingsPage/RoutePrioritySelect.d.ts +0 -2
- package/pages/SettingsPage/RoutePrioritySelect.js +0 -19
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.js +0 -26
- package/providers/SDKProvider/SDKProvider.d.ts +0 -4
- package/providers/SDKProvider/SDKProvider.js +0 -36
- package/providers/SDKProvider/index.d.ts +0 -1
- package/providers/SDKProvider/index.js +0 -1
- package/providers/WalletProvider/types.d.ts +0 -17
- package/stores/routes/useTransactionHistory.d.ts +0 -2
- package/stores/routes/useTransactionHistory.js +0 -11
- /package/cjs/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
- /package/{providers/WalletProvider → pages/SettingsPage/SettingsCard}/types.js +0 -0
|
@@ -2,6 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import EvStationIcon from '@mui/icons-material/EvStation';
|
|
3
3
|
import { Typography } from '@mui/material';
|
|
4
4
|
import { useTranslation } from 'react-i18next';
|
|
5
|
+
import { formatUnits } from 'viem';
|
|
5
6
|
import { WarningMessageCard, WarningMessageCardTitle, } from './GasMessage.style';
|
|
6
7
|
export const GasSufficiencyMessage = ({ insufficientGas, }) => {
|
|
7
8
|
const { t } = useTranslation();
|
|
@@ -10,7 +11,7 @@ export const GasSufficiencyMessage = ({ insufficientGas, }) => {
|
|
|
10
11
|
} }), _jsx(Typography, { variant: "body2", fontWeight: 700, children: t(`warning.title.insufficientGas`) })] }), _jsx(Typography, { variant: "body2", px: 2, pt: 1, children: t(`warning.message.insufficientGas`) }), insufficientGas?.map((item, index) => (_jsx(Typography
|
|
11
12
|
// eslint-disable-next-line react/no-array-index-key
|
|
12
13
|
, { variant: "body2", px: 2, pb: insufficientGas?.length - 1 === index ? 2 : 0, pt: 0.5, children: t(`main.tokenOnChainAmount`, {
|
|
13
|
-
amount: item.insufficientAmount
|
|
14
|
+
amount: formatUnits(item.insufficientAmount ?? 0n, item.token.decimals),
|
|
14
15
|
tokenSymbol: item.token.symbol,
|
|
15
16
|
chainName: item.chain?.name,
|
|
16
17
|
}) }, index)))] }));
|
|
@@ -13,3 +13,11 @@ export declare const WalletButton: import("@emotion/styled").StyledComponent<imp
|
|
|
13
13
|
export declare const DrawerWalletContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
14
14
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
15
15
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
16
|
+
export declare const HeaderControlsContainer: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
18
|
+
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
19
|
+
export declare const SplitTabs: import("@emotion/styled").StyledComponent<import("@mui/material").TabsOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
20
|
+
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
21
|
+
}, "className" | "style" | "classes" | "action" | "children" | "sx" | "aria-label" | "aria-labelledby" | "onChange" | "variant" | "value" | "slots" | "slotProps" | "orientation" | "allowScrollButtonsMobile" | "centered" | "indicatorColor" | "ScrollButtonComponent" | "scrollButtons" | "selectionFollowsFocus" | "TabIndicatorProps" | "TabScrollButtonProps" | "textColor" | "visibleScrollbar"> & {
|
|
22
|
+
component?: import("react").ElementType<any> | undefined;
|
|
23
|
+
} & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { AppBar, Box, Button } from '@mui/material';
|
|
1
|
+
import { AppBar, Box, Button, badgeClasses } from '@mui/material';
|
|
2
2
|
import { buttonClasses } from '@mui/material/Button';
|
|
3
3
|
import { alpha, styled } from '@mui/material/styles';
|
|
4
|
+
import { Tabs } from '../Tabs';
|
|
4
5
|
export const HeaderAppBar = styled(AppBar)(({ theme }) => ({
|
|
5
6
|
backgroundColor: 'transparent',
|
|
6
7
|
color: theme.palette.text.primary,
|
|
@@ -42,6 +43,11 @@ export const WalletButton = styled(Button)(({ theme }) => ({
|
|
|
42
43
|
[`.${buttonClasses.startIcon} > *:nth-of-type(1)`]: {
|
|
43
44
|
fontSize: '24px',
|
|
44
45
|
},
|
|
46
|
+
[`&:hover .${badgeClasses.badge} > div`]: {
|
|
47
|
+
borderColor: theme.palette.mode === 'light'
|
|
48
|
+
? alpha(theme.palette.common.black, 0.04)
|
|
49
|
+
: alpha(theme.palette.common.white, 0.08),
|
|
50
|
+
},
|
|
45
51
|
}));
|
|
46
52
|
export const DrawerWalletContainer = styled(Box)(() => ({
|
|
47
53
|
width: '100%',
|
|
@@ -51,3 +57,12 @@ export const DrawerWalletContainer = styled(Box)(() => ({
|
|
|
51
57
|
marginLeft: '-0.5rem',
|
|
52
58
|
},
|
|
53
59
|
}));
|
|
60
|
+
export const HeaderControlsContainer = styled(Box)(({ theme }) => ({
|
|
61
|
+
display: 'flex',
|
|
62
|
+
gap: theme.spacing(0.5),
|
|
63
|
+
}));
|
|
64
|
+
export const SplitTabs = styled(Tabs)(({ theme }) => ({
|
|
65
|
+
backgroundColor: theme.palette.mode === 'dark'
|
|
66
|
+
? theme.palette.background.paper
|
|
67
|
+
: alpha(theme.palette.common.black, 0.04),
|
|
68
|
+
}));
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
2
|
import ArrowBackIcon from '@mui/icons-material/ArrowBack';
|
|
3
|
-
import ReceiptLongIcon from '@mui/icons-material/ReceiptLong';
|
|
4
|
-
import SettingsIcon from '@mui/icons-material/Settings';
|
|
5
3
|
import { Box, IconButton, Tooltip, Typography } from '@mui/material';
|
|
6
4
|
import { useTranslation } from 'react-i18next';
|
|
7
5
|
import { Route, Routes, useLocation } from 'react-router-dom';
|
|
8
|
-
import { useNavigateBack } from '../../hooks';
|
|
9
|
-
import {
|
|
6
|
+
import { useAccount, useNavigateBack } from '../../hooks';
|
|
7
|
+
import { useWidgetConfig } from '../../providers';
|
|
10
8
|
import { useHeaderStore } from '../../stores';
|
|
11
9
|
import { HiddenUI } from '../../types';
|
|
12
10
|
import { backButtonRoutes, navigationRoutes, navigationRoutesValues, } from '../../utils';
|
|
13
|
-
import { HeaderAppBar } from './Header.style';
|
|
11
|
+
import { HeaderAppBar, HeaderControlsContainer } from './Header.style';
|
|
14
12
|
import { NavigationTabs } from './NavigationTabs';
|
|
15
13
|
import { WalletMenuButton } from './WalletHeader';
|
|
14
|
+
import { SettingsButton } from './SettingsButton';
|
|
15
|
+
import ReceiptLongIcon from '@mui/icons-material/ReceiptLong';
|
|
16
|
+
export const TransactionHistoryButton = () => {
|
|
17
|
+
const { t } = useTranslation();
|
|
18
|
+
const { navigate } = useNavigateBack();
|
|
19
|
+
return (_jsx(Tooltip, { title: t(`header.transactionHistory`), enterDelay: 400, arrow: true, children: _jsx(IconButton, { size: "medium", edge: "start", onClick: () => navigate(navigationRoutes.transactionHistory), children: _jsx(ReceiptLongIcon, {}) }) }));
|
|
20
|
+
};
|
|
16
21
|
export const NavigationHeader = () => {
|
|
17
22
|
const { t } = useTranslation();
|
|
18
23
|
const { subvariant, hiddenUI, variant } = useWidgetConfig();
|
|
19
|
-
const {
|
|
20
|
-
const { account } =
|
|
24
|
+
const { navigateBack } = useNavigateBack();
|
|
25
|
+
const { account } = useAccount();
|
|
21
26
|
const { element, title } = useHeaderStore((state) => state);
|
|
22
27
|
const { pathname } = useLocation();
|
|
23
28
|
const cleanedPathname = pathname.endsWith('/')
|
|
@@ -36,6 +41,8 @@ export const NavigationHeader = () => {
|
|
|
36
41
|
return t(`settings.enabledBridges`);
|
|
37
42
|
case navigationRoutes.exchanges:
|
|
38
43
|
return t(`settings.enabledExchanges`);
|
|
44
|
+
case navigationRoutes.languages:
|
|
45
|
+
return t(`language.title`);
|
|
39
46
|
case navigationRoutes.transactionHistory:
|
|
40
47
|
return t(`header.transactionHistory`);
|
|
41
48
|
case navigationRoutes.fromToken: {
|
|
@@ -78,7 +85,6 @@ export const NavigationHeader = () => {
|
|
|
78
85
|
}
|
|
79
86
|
}
|
|
80
87
|
};
|
|
81
|
-
return (_jsxs(_Fragment, { children: [_jsxs(HeaderAppBar, { elevation: 0, children: [backButtonRoutes.includes(path) ? (_jsx(IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: _jsx(ArrowBackIcon, {}) })) : null, splitSubvariant ? (_jsx(Box, { flex: 1, children: !hiddenUI?.includes(HiddenUI.WalletMenu) ? (_jsx(WalletMenuButton, {})) : null })) : (_jsx(Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: title || handleHeaderTitle() })), _jsxs(Routes, { children: [_jsx(Route, { path: navigationRoutes.home, element: _jsxs(
|
|
82
|
-
|
|
83
|
-
}, children: _jsx(SettingsIcon, {}) }) })] }) }), _jsx(Route, { path: "*", element: element || _jsx(Box, { width: 28, height: 40 }) })] })] }), splitSubvariant ? _jsx(NavigationTabs, {}) : null] }));
|
|
88
|
+
return (_jsxs(_Fragment, { children: [_jsxs(HeaderAppBar, { elevation: 0, children: [backButtonRoutes.includes(path) ? (_jsx(IconButton, { size: "medium", edge: "start", onClick: navigateBack, children: _jsx(ArrowBackIcon, {}) })) : null, splitSubvariant ? (_jsx(Box, { flex: 1, children: !hiddenUI?.includes(HiddenUI.WalletMenu) ? (_jsx(WalletMenuButton, {})) : null })) : (_jsx(Typography, { fontSize: hasPath ? 18 : 24, align: hasPath ? 'center' : 'left', fontWeight: "700", flex: 1, noWrap: true, children: title || handleHeaderTitle() })), _jsxs(Routes, { children: [_jsx(Route, { path: navigationRoutes.home, element: _jsxs(HeaderControlsContainer, { paddingRight: variant === 'drawer' && subvariant === 'split' ? 5 : 0, children: [account.isConnected &&
|
|
89
|
+
!hiddenUI?.includes(HiddenUI.History) ? (_jsx(TransactionHistoryButton, {})) : null, _jsx(SettingsButton, {})] }) }), _jsx(Route, { path: "*", element: element || _jsx(Box, { width: 28, height: 40 }) })] })] }), splitSubvariant ? _jsx(NavigationTabs, {}) : null] }));
|
|
84
90
|
};
|
|
@@ -3,8 +3,8 @@ import { useFormContext } from 'react-hook-form';
|
|
|
3
3
|
import { useTranslation } from 'react-i18next';
|
|
4
4
|
import { FormKey } from '../../providers';
|
|
5
5
|
import { useSplitSubvariantStore } from '../../stores';
|
|
6
|
-
import { HeaderAppBar } from './Header.style';
|
|
7
|
-
import {
|
|
6
|
+
import { HeaderAppBar, SplitTabs } from './Header.style';
|
|
7
|
+
import { Tab } from '../Tabs';
|
|
8
8
|
export const NavigationTabs = () => {
|
|
9
9
|
const { t } = useTranslation();
|
|
10
10
|
const [state, setState] = useSplitSubvariantStore((state) => [
|
|
@@ -18,5 +18,5 @@ export const NavigationTabs = () => {
|
|
|
18
18
|
setValue(FormKey.ToToken, '');
|
|
19
19
|
setState(value === 0 ? 'swap' : 'bridge');
|
|
20
20
|
};
|
|
21
|
-
return (_jsx(HeaderAppBar, { elevation: 0, sx: { py: 1 }, children: _jsxs(
|
|
21
|
+
return (_jsx(HeaderAppBar, { elevation: 0, sx: { py: 1 }, children: _jsxs(SplitTabs, { value: state === 'swap' ? 0 : 1, onChange: handleChange, "aria-label": "tabs", indicatorColor: "primary", children: [_jsx(Tab, { label: t('header.swap'), disableRipple: true }), _jsx(Tab, { label: t('header.bridge'), disableRipple: true })] }) }));
|
|
22
22
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SettingsButton: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useTranslation } from 'react-i18next';
|
|
3
|
+
import { Tooltip } from '@mui/material';
|
|
4
|
+
import SettingsIcon from '@mui/icons-material/Settings';
|
|
5
|
+
import { useNavigateBack, useSettingMonitor } from '../../hooks';
|
|
6
|
+
import { navigationRoutes } from '../../utils';
|
|
7
|
+
import { SettingsIconBadge, SettingsIconButton } from './SettingsButton.style';
|
|
8
|
+
export const SettingsButton = () => {
|
|
9
|
+
const { t } = useTranslation();
|
|
10
|
+
const { navigate } = useNavigateBack();
|
|
11
|
+
const { isCustomRouteSettings, isRouteSettingsWithWarnings } = useSettingMonitor();
|
|
12
|
+
const notification = isRouteSettingsWithWarnings
|
|
13
|
+
? 'warning'
|
|
14
|
+
: isCustomRouteSettings
|
|
15
|
+
? 'info'
|
|
16
|
+
: undefined;
|
|
17
|
+
const tooltipMessage = notification
|
|
18
|
+
? t(`tooltip.settingsModified`)
|
|
19
|
+
: t(`header.settings`);
|
|
20
|
+
return (_jsx(Tooltip, { title: tooltipMessage, enterDelay: 400, arrow: true, children: _jsx(SettingsIconButton, { size: "medium", onClick: () => navigate(navigationRoutes.settings), notification: notification, children: notification ? (_jsx(SettingsIconBadge, { variant: "dot", color: notification, children: _jsx(SettingsIcon, {}) })) : (_jsx(SettingsIcon, {})) }) }));
|
|
21
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const SettingsIconBadge: import("@emotion/styled").StyledComponent<import("@mui/material").BadgeOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
3
|
+
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
4
|
+
}, "className" | "style" | "classes" | "children" | "sx" | "color" | "variant" | "max" | "components" | "componentsProps" | "slots" | "slotProps" | "invisible" | "anchorOrigin" | "badgeContent" | "overlap" | "showZero"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
5
|
+
interface SettingsIconButtonProps {
|
|
6
|
+
notification?: 'info' | 'warning';
|
|
7
|
+
}
|
|
8
|
+
export declare const SettingsIconButton: import("@emotion/styled").StyledComponent<import("@mui/material").IconButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").ButtonHTMLAttributes<HTMLButtonElement>, HTMLButtonElement>, "ref"> & {
|
|
9
|
+
ref?: ((instance: HTMLButtonElement | null) => void) | import("react").RefObject<HTMLButtonElement> | null | undefined;
|
|
10
|
+
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "color" | "disableFocusRipple" | "size" | "edge"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & SettingsIconButtonProps, {}, {}>;
|
|
11
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { IconButton, Badge as MuiBadge } from '@mui/material';
|
|
2
|
+
import { badgeClasses } from '@mui/material/Badge';
|
|
3
|
+
import { darken, styled } from '@mui/material/styles';
|
|
4
|
+
import { getInfoBackgroundColor, getWarningBackgroundColor } from '../../utils';
|
|
5
|
+
export const SettingsIconBadge = styled(MuiBadge)(({ theme }) => ({
|
|
6
|
+
display: 'flex',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
gap: theme.spacing(1.25),
|
|
9
|
+
[`.${badgeClasses.badge}`]: {
|
|
10
|
+
width: 10,
|
|
11
|
+
height: 10,
|
|
12
|
+
borderRadius: '50%',
|
|
13
|
+
transform: 'translate(70%, -70%)',
|
|
14
|
+
},
|
|
15
|
+
}));
|
|
16
|
+
export const SettingsIconButton = styled(IconButton, {
|
|
17
|
+
shouldForwardProp: (props) => props !== 'notification',
|
|
18
|
+
})(({ theme, notification }) => {
|
|
19
|
+
const notificationStyles = {
|
|
20
|
+
info: {
|
|
21
|
+
backgroundColor: getInfoBackgroundColor(theme),
|
|
22
|
+
'&:hover': {
|
|
23
|
+
backgroundColor: darken(getInfoBackgroundColor(theme), 0.2),
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
warning: {
|
|
27
|
+
backgroundColor: getWarningBackgroundColor(theme),
|
|
28
|
+
'&:hover': {
|
|
29
|
+
backgroundColor: darken(getWarningBackgroundColor(theme), 0.2),
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
default: {
|
|
33
|
+
marginRight: theme.spacing(-1.25),
|
|
34
|
+
},
|
|
35
|
+
};
|
|
36
|
+
return {
|
|
37
|
+
borderRadius: 20,
|
|
38
|
+
...notificationStyles[notification ?? 'default'],
|
|
39
|
+
};
|
|
40
|
+
});
|
|
@@ -1,38 +1,36 @@
|
|
|
1
|
-
import { jsx as _jsx,
|
|
2
|
-
import ContentCopyIcon from '@mui/icons-material/ContentCopyRounded';
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
3
2
|
import ExpandMoreIcon from '@mui/icons-material/ExpandMore';
|
|
4
|
-
import OpenInNewIcon from '@mui/icons-material/OpenInNewRounded';
|
|
5
|
-
import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNewRounded';
|
|
6
3
|
import WalletIcon from '@mui/icons-material/Wallet';
|
|
7
|
-
import { Avatar,
|
|
4
|
+
import { Avatar, Badge } from '@mui/material';
|
|
8
5
|
import { useState } from 'react';
|
|
9
6
|
import { useTranslation } from 'react-i18next';
|
|
10
7
|
import { useLocation, useNavigate } from 'react-router-dom';
|
|
11
|
-
import { useChain } from '../../hooks';
|
|
12
|
-
import {
|
|
8
|
+
import { useAccount, useChain } from '../../hooks';
|
|
9
|
+
import { useWidgetConfig } from '../../providers';
|
|
13
10
|
import { navigationRoutes, shortenAddress } from '../../utils';
|
|
11
|
+
import { SmallAvatar } from '../SmallAvatar';
|
|
14
12
|
import { DrawerWalletContainer, HeaderAppBar, WalletButton, } from './Header.style';
|
|
15
13
|
import { WalletMenu } from './WalletMenu';
|
|
14
|
+
import { WalletMenuContainer } from './WalletMenu.style';
|
|
16
15
|
export const WalletHeader = () => {
|
|
17
16
|
return (_jsx(HeaderAppBar, { elevation: 0, sx: { justifyContent: 'flex-end' }, children: _jsx(WalletMenuButton, {}) }));
|
|
18
17
|
};
|
|
19
18
|
export const WalletMenuButton = () => {
|
|
20
|
-
const { account } =
|
|
19
|
+
const { account } = useAccount();
|
|
21
20
|
const { variant } = useWidgetConfig();
|
|
22
21
|
if (variant === 'drawer') {
|
|
23
|
-
return (_jsx(DrawerWalletContainer, { children: account.
|
|
22
|
+
return (_jsx(DrawerWalletContainer, { children: account.isConnected ? (_jsx(ConnectedButton, { account: account })) : (_jsx(ConnectButton, {})) }));
|
|
24
23
|
}
|
|
25
|
-
return account.
|
|
24
|
+
return account.isConnected ? (_jsx(ConnectedButton, { account: account })) : (_jsx(ConnectButton, {}));
|
|
26
25
|
};
|
|
27
26
|
const ConnectButton = () => {
|
|
28
27
|
const { t } = useTranslation();
|
|
29
28
|
const { pathname } = useLocation();
|
|
30
29
|
const { walletManagement, subvariant, variant } = useWidgetConfig();
|
|
31
|
-
const { connect: connectWallet } = useWallet();
|
|
32
30
|
const navigate = useNavigate();
|
|
33
31
|
const connect = async () => {
|
|
34
32
|
if (walletManagement) {
|
|
35
|
-
await
|
|
33
|
+
await walletManagement.connect();
|
|
36
34
|
return;
|
|
37
35
|
}
|
|
38
36
|
navigate(navigationRoutes.selectWallet);
|
|
@@ -42,31 +40,20 @@ const ConnectButton = () => {
|
|
|
42
40
|
marginLeft: subvariant === 'split' ? -1.25 : 0,
|
|
43
41
|
}, children: t(`button.connectWallet`) }));
|
|
44
42
|
};
|
|
45
|
-
const ConnectedButton = () => {
|
|
46
|
-
const { t } = useTranslation();
|
|
43
|
+
const ConnectedButton = ({ account }) => {
|
|
47
44
|
const { subvariant } = useWidgetConfig();
|
|
48
|
-
const { account, disconnect } = useWallet();
|
|
49
|
-
const walletAddress = shortenAddress(account.address);
|
|
50
45
|
const { chain } = useChain(account.chainId);
|
|
51
46
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
47
|
+
const walletAddress = shortenAddress(account.address);
|
|
52
48
|
const handleClick = (event) => {
|
|
53
49
|
setAnchorEl(event.currentTarget);
|
|
54
50
|
};
|
|
55
51
|
const handleClose = () => {
|
|
56
52
|
setAnchorEl(null);
|
|
57
53
|
};
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
handleClose();
|
|
61
|
-
};
|
|
62
|
-
const handleCopyAddress = async () => {
|
|
63
|
-
await navigator.clipboard.writeText(account.address ?? '');
|
|
64
|
-
handleClose();
|
|
65
|
-
};
|
|
66
|
-
return (_jsxs(_Fragment, { children: [_jsx(WalletButton, { endIcon: _jsx(ExpandMoreIcon, {}), startIcon: _jsx(Avatar, { src: chain?.logoURI, alt: chain?.key, sx: { width: 24, height: 24 }, children: chain?.name[0] }), sx: {
|
|
54
|
+
const avatar = (_jsx(Avatar, { src: account.connector?.icon, alt: account.connector?.name, sx: { width: 24, height: 24 }, children: account.connector?.name[0] }));
|
|
55
|
+
return (_jsxs(_Fragment, { children: [_jsx(WalletButton, { endIcon: _jsx(ExpandMoreIcon, {}), startIcon: chain?.logoURI ? (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(SmallAvatar, { src: chain?.logoURI, alt: chain?.name, children: chain?.name[0] }), children: avatar })) : (avatar), sx: {
|
|
67
56
|
marginRight: subvariant === 'split' ? 0 : -1.25,
|
|
68
57
|
marginLeft: subvariant === 'split' ? -1 : 0,
|
|
69
|
-
}, onClick: handleClick, children: walletAddress }),
|
|
70
|
-
marginTop: 1,
|
|
71
|
-
}, children: t(`button.disconnect`) })] })] }));
|
|
58
|
+
}, onClick: handleClick, children: walletAddress }), _jsx(WalletMenuContainer, { anchorEl: anchorEl, open: Boolean(anchorEl), onClose: handleClose, children: _jsx(WalletMenu, { onClose: handleClose }) })] }));
|
|
72
59
|
};
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
export declare const WalletMenu:
|
|
1
|
+
export declare const WalletMenu: ({ onClose }: {
|
|
2
|
+
onClose: () => void;
|
|
3
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,25 +1,58 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { ChainType } from '@lifi/sdk';
|
|
3
|
+
import ContentCopyIcon from '@mui/icons-material/ContentCopyRounded';
|
|
4
|
+
import OpenInNewIcon from '@mui/icons-material/OpenInNewRounded';
|
|
5
|
+
import PowerSettingsNewIcon from '@mui/icons-material/PowerSettingsNewRounded';
|
|
6
|
+
import { Avatar, Badge, Box, Button, IconButton, MenuItem, } from '@mui/material';
|
|
7
|
+
import { useWallet } from '@solana/wallet-adapter-react';
|
|
8
|
+
import { useTranslation } from 'react-i18next';
|
|
9
|
+
import { useLocation, useNavigate } from 'react-router-dom';
|
|
10
|
+
import { useDisconnect } from 'wagmi';
|
|
11
|
+
import { useAccount, useAvailableChains } from '../../hooks';
|
|
12
|
+
import { navigationRoutes, shortenAddress } from '../../utils';
|
|
13
|
+
import { SmallAvatar } from '../SmallAvatar';
|
|
14
|
+
export const WalletMenu = ({ onClose }) => {
|
|
15
|
+
const { t } = useTranslation();
|
|
16
|
+
const navigate = useNavigate();
|
|
17
|
+
const { pathname } = useLocation();
|
|
18
|
+
const { accounts } = useAccount();
|
|
19
|
+
const { getChainById } = useAvailableChains();
|
|
20
|
+
const connect = async () => {
|
|
21
|
+
navigate(navigationRoutes.selectWallet);
|
|
22
|
+
onClose();
|
|
23
|
+
};
|
|
24
|
+
return (_jsxs(Box, { children: [_jsx(Box, { display: "flex", flexDirection: "column", children: accounts
|
|
25
|
+
.filter((account) => account.isConnected)
|
|
26
|
+
.map((account) => {
|
|
27
|
+
const chain = getChainById(account.chainId);
|
|
28
|
+
const walletAddress = shortenAddress(account.address);
|
|
29
|
+
const handleCopyAddress = async () => {
|
|
30
|
+
await navigator.clipboard.writeText(account.address ?? '');
|
|
31
|
+
onClose();
|
|
32
|
+
};
|
|
33
|
+
const avatar = (_jsx(Avatar, { src: account.connector?.icon, alt: account.connector?.name, sx: {
|
|
34
|
+
width: 32,
|
|
35
|
+
height: 32,
|
|
36
|
+
marginRight: chain?.logoURI ? 0 : 1.5,
|
|
37
|
+
}, children: account.connector?.name[0] }));
|
|
38
|
+
return (_jsxs(MenuItem, { children: [_jsxs(Box, { flex: 1, display: "flex", alignItems: "center", children: [chain?.logoURI ? (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(SmallAvatar, { src: chain?.logoURI, alt: chain?.name, children: chain?.name[0] }), sx: { marginRight: 1.5 }, children: avatar })) : (avatar), walletAddress] }), _jsxs(Box, { ml: 1, children: [_jsx(IconButton, { size: "medium", onClick: handleCopyAddress, children: _jsx(ContentCopyIcon, {}) }), _jsx(IconButton, { size: "medium", component: "a", onClick: onClose, href: `${chain?.metamask.blockExplorerUrls[0]}address/${account.address}`, target: "_blank", children: _jsx(OpenInNewIcon, {}) }), account.chainType === ChainType.EVM ? (_jsx(EVMDisconnectIconButton, { connector: account.connector })) : account.chainType === ChainType.SVM ? (_jsx(SVMDisconnectIconButton, {})) : null] })] }, account.address));
|
|
39
|
+
}) }), !pathname.includes(navigationRoutes.selectWallet) ? (_jsx(Button, { onClick: connect, fullWidth: true, startIcon: _jsx(PowerSettingsNewIcon, {}), sx: {
|
|
40
|
+
marginTop: 1,
|
|
41
|
+
}, children: accounts.filter((account) => account.isConnected).length > 1
|
|
42
|
+
? t(`button.changeWallet`)
|
|
43
|
+
: t(`button.connectWallet`) })) : null] }));
|
|
44
|
+
};
|
|
45
|
+
const EVMDisconnectIconButton = ({ connector }) => {
|
|
46
|
+
const { disconnect } = useDisconnect();
|
|
47
|
+
return (_jsx(IconButton, { size: "medium", onClick: (e) => {
|
|
48
|
+
e.stopPropagation();
|
|
49
|
+
disconnect({ connector });
|
|
50
|
+
}, children: _jsx(PowerSettingsNewIcon, {}) }));
|
|
51
|
+
};
|
|
52
|
+
const SVMDisconnectIconButton = () => {
|
|
53
|
+
const { disconnect } = useWallet();
|
|
54
|
+
return (_jsx(IconButton, { size: "medium", onClick: (e) => {
|
|
55
|
+
e.stopPropagation();
|
|
56
|
+
disconnect();
|
|
57
|
+
}, children: _jsx(PowerSettingsNewIcon, {}) }));
|
|
58
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const WalletMenuContainer: import("@emotion/styled").StyledComponent<import("@mui/material").MenuProps & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { Menu as MuiMenu } from '@mui/material';
|
|
2
|
+
import { menuClasses } from '@mui/material/Menu';
|
|
3
|
+
import { menuItemClasses } from '@mui/material/MenuItem';
|
|
4
|
+
import { styled } from '@mui/material/styles';
|
|
5
|
+
import { svgIconClasses } from '@mui/material/SvgIcon';
|
|
6
|
+
export const WalletMenuContainer = styled(MuiMenu)(({ theme }) => ({
|
|
7
|
+
[`& .${menuClasses.paper}`]: {
|
|
8
|
+
borderRadius: theme.shape.borderRadius,
|
|
9
|
+
color: theme.palette.text.primary,
|
|
10
|
+
boxShadow: '0px 2px 4px rgb(0 0 0 / 8%), 0px 8px 16px rgb(0 0 0 / 8%)',
|
|
11
|
+
padding: theme.spacing(2),
|
|
12
|
+
[`& .${menuClasses.list}`]: {
|
|
13
|
+
padding: 0,
|
|
14
|
+
},
|
|
15
|
+
[`& .${menuItemClasses.root}`]: {
|
|
16
|
+
borderRadius: theme.shape.borderRadiusSecondary,
|
|
17
|
+
padding: theme.spacing(1, 2, 1, 1),
|
|
18
|
+
[`& .${svgIconClasses.root}`]: {
|
|
19
|
+
fontSize: 20,
|
|
20
|
+
color: theme.palette.text.primary,
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
@@ -22,5 +22,5 @@ export const InsuranceCollapsed = ({ status, insurableRouteId, onChange, ...prop
|
|
|
22
22
|
if (!insuredRoute) {
|
|
23
23
|
return null;
|
|
24
24
|
}
|
|
25
|
-
return (_jsx(Collapse, { timeout: 225, in: insuredRoute.insurance.state === 'INSURED', unmountOnExit: true, mountOnEnter: true, appear: status === RouteExecutionStatus.Idle, children: _jsx(InsuranceCard, { ...props, status: status, insuredAmount: formatTokenAmount(insuredRoute.toAmountMin, insuredRoute.toToken.decimals), insuredTokenSymbol: insuredRoute.toToken.symbol, onChange: toggleInsurance }) }));
|
|
25
|
+
return (_jsx(Collapse, { timeout: 225, in: insuredRoute.insurance.state === 'INSURED', unmountOnExit: true, mountOnEnter: true, appear: status === RouteExecutionStatus.Idle, children: _jsx(InsuranceCard, { ...props, status: status, insuredAmount: formatTokenAmount(BigInt(insuredRoute.toAmountMin), insuredRoute.toToken.decimals), insuredTokenSymbol: insuredRoute.toToken.symbol, onChange: toggleInsurance }) }));
|
|
26
26
|
};
|
package/components/NFT/NFT.js
CHANGED
|
@@ -9,7 +9,9 @@ export const NFT = ({ imageUrl, isLoading, collectionName, assetName, owner, tok
|
|
|
9
9
|
if (token) {
|
|
10
10
|
setValue(FormKey.ToChain, token.chainId, { shouldTouch: true });
|
|
11
11
|
setValue(FormKey.ToToken, token.address, { shouldTouch: true });
|
|
12
|
-
setValue(FormKey.ToAmount, token.amount, {
|
|
12
|
+
setValue(FormKey.ToAmount, token.amount?.toString(), {
|
|
13
|
+
shouldTouch: true,
|
|
14
|
+
});
|
|
13
15
|
}
|
|
14
16
|
if (contract) {
|
|
15
17
|
setValue(FormKey.ToContractAddress, contract.address, {
|
|
@@ -10,7 +10,8 @@ export const PoweredBy = () => {
|
|
|
10
10
|
const { hiddenUI } = useWidgetConfig();
|
|
11
11
|
const { pathname } = useLocation();
|
|
12
12
|
if (pathname.includes(navigationRoutes.fromToken) ||
|
|
13
|
-
pathname.includes(navigationRoutes.toToken)
|
|
13
|
+
pathname.includes(navigationRoutes.toToken) ||
|
|
14
|
+
pathname.includes(navigationRoutes.transactionHistory)) {
|
|
14
15
|
return null;
|
|
15
16
|
}
|
|
16
17
|
return (_jsx(Box, { px: 3, pt: 1, pb: hiddenUI?.includes(HiddenUI.PoweredBy) ? 1 : 2, sx: {
|
|
@@ -21,10 +21,10 @@ export const RouteCard = ({ route, active, variant = 'default', expanded, ...oth
|
|
|
21
21
|
setCardExpanded((expanded) => !expanded);
|
|
22
22
|
};
|
|
23
23
|
const token = subvariant === 'nft'
|
|
24
|
-
? { ...route.fromToken, amount: route.fromAmount }
|
|
25
|
-
: { ...route.toToken, amount: route.toAmount };
|
|
24
|
+
? { ...route.fromToken, amount: BigInt(route.fromAmount) }
|
|
25
|
+
: { ...route.toToken, amount: BigInt(route.toAmount) };
|
|
26
26
|
const RecommendedTagTooltip = route.tags?.[0] === 'RECOMMENDED' ? RecommendedTooltip : Fragment;
|
|
27
|
-
const cardContent = (_jsxs(Box, { flex: 1, children: [subvariant !== 'refuel' && (insurable || route.tags?.length) ? (_jsxs(Box, { display: "flex", alignItems: "center", mb: 2, children: [insurable ? (_jsx(InsuranceTooltip, { insuredAmount: formatTokenAmount(route.toAmountMin, route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, children: _jsxs(CardLabel, { type: route.tags?.length && !cardExpanded
|
|
27
|
+
const cardContent = (_jsxs(Box, { flex: 1, children: [subvariant !== 'refuel' && (insurable || route.tags?.length) ? (_jsxs(Box, { display: "flex", alignItems: "center", mb: 2, children: [insurable ? (_jsx(InsuranceTooltip, { insuredAmount: formatTokenAmount(BigInt(route.toAmountMin), route.toToken.decimals), insuredTokenSymbol: route.toToken.symbol, children: _jsxs(CardLabel, { type: route.tags?.length && !cardExpanded
|
|
28
28
|
? 'insurance-icon'
|
|
29
29
|
: 'insurance', children: [_jsx(VerifiedUserIcon, { fontSize: "inherit" }), cardExpanded || !route.tags?.length ? (_jsx(CardLabelTypography, { type: "icon", children: t(`main.tags.insurable`) })) : null] }) })) : null, route.tags?.length ? (_jsx(RecommendedTagTooltip, { children: _jsx(CardLabel, { type: active ? 'active' : undefined, children: _jsx(CardLabelTypography, { children: t(`main.tags.${route.tags[0].toLowerCase()}`) }) }) })) : null] })) : null, _jsxs(Box, { display: "flex", justifyContent: "space-between", alignItems: "start", children: [_jsx(Token, { token: token, step: !cardExpanded ? route.steps[0] : undefined }), !expanded ? (_jsx(CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? _jsx(ExpandLessIcon, {}) : _jsx(ExpandMoreIcon, {}) })) : null] }), _jsx(Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: route.steps.map((step) => (_jsx(StepActions, { step: step, mt: 2 }, step.id))) }), _jsx(RouteCardEssentials, { route: route })] }));
|
|
30
30
|
return subvariant === 'refuel' || variant === 'cardless' ? (cardContent) : (_jsx(Card, { variant: active ? 'selected' : 'default', selectionColor: "secondary", indented: true, ...other, children: cardContent }));
|
|
@@ -5,6 +5,7 @@ import LayersIcon from '@mui/icons-material/Layers';
|
|
|
5
5
|
import MonetizationOnIcon from '@mui/icons-material/MonetizationOn';
|
|
6
6
|
import { Box, Tooltip, Typography } from '@mui/material';
|
|
7
7
|
import { useTranslation } from 'react-i18next';
|
|
8
|
+
import { formatUnits } from 'viem';
|
|
8
9
|
import { IconTypography } from './RouteCard.style';
|
|
9
10
|
import { getFeeCostsBreakdown, getGasCostsBreakdown } from './utils';
|
|
10
11
|
export const RouteCardEssentials = ({ route, dense, }) => {
|
|
@@ -15,7 +16,7 @@ export const RouteCardEssentials = ({ route, dense, }) => {
|
|
|
15
16
|
const gasCostUSD = parseFloat(route.gasCostUSD ?? '') || 0.01;
|
|
16
17
|
const gasCosts = getGasCostsBreakdown(route);
|
|
17
18
|
const feeCosts = getFeeCostsBreakdown(route, false);
|
|
18
|
-
return (_jsxs(Box, { display: "flex", justifyContent: 'space-between', flex: 1, mt: 2, children: [_jsx(Tooltip, { title: _jsxs(Box, { component: "span", children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas, index) => (_jsxs(Typography, { fontSize: 12, fontWeight: "500", children: [gas.amount?.toFixed(9),
|
|
19
|
+
return (_jsxs(Box, { display: "flex", justifyContent: 'space-between', flex: 1, mt: 2, children: [_jsx(Tooltip, { title: _jsxs(Box, { component: "span", children: [t(`tooltip.estimatedNetworkFee`), gasCosts.map((gas, index) => (_jsxs(Typography, { fontSize: 12, fontWeight: "500", children: [parseFloat(formatUnits(gas.amount, gas.token.decimals))?.toFixed(9), ' ', gas.token.symbol, " (", t(`format.currency`, { value: gas.amountUSD }), ")"] }, `${gas.token.address}${index}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [_jsx(IconTypography, { children: _jsx(EvStationIcon, { fontSize: "small" }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, { value: gasCostUSD }) })] }) }), _jsx(Tooltip, { title: _jsxs(Box, { component: "span", children: [t(`tooltip.additionalProviderFee`), feeCosts.map((fee, index) => (_jsxs(Typography, { fontSize: 12, fontWeight: "500", children: [parseFloat(formatUnits(fee.amount, fee.token.decimals))?.toFixed(9), ' ', fee.token.symbol, " (", t(`format.currency`, { value: fee.amountUSD }), ")"] }, `${fee.token.address}${index}`)))] }), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [_jsx(IconTypography, { children: _jsx(MonetizationOnIcon, { fontSize: "small" }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t(`format.currency`, {
|
|
19
20
|
value: feeCosts.reduce((sum, feeCost) => sum + feeCost.amountUSD, 0),
|
|
20
21
|
}) })] }) }), _jsx(Tooltip, { title: t(`tooltip.estimatedTime`), placement: "top", enterDelay: 400, arrow: true, children: _jsxs(Box, { display: "flex", alignItems: "center", mr: dense ? 0 : 2, children: [_jsx(IconTypography, { children: _jsx(AccessTimeIcon, { fontSize: "small" }) }), _jsx(Typography, { fontSize: 14, color: "text.primary", fontWeight: "500", lineHeight: 1, children: t('main.estimatedTime', {
|
|
21
22
|
value: executionTimeMinutes,
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import type { Route, Token } from '@lifi/sdk';
|
|
2
|
-
import Big from 'big.js';
|
|
3
2
|
export declare const getGasCostsBreakdown: (route: Route) => {
|
|
4
|
-
amount:
|
|
3
|
+
amount: bigint;
|
|
5
4
|
amountUSD: number;
|
|
6
5
|
token: Token;
|
|
7
6
|
}[];
|
|
8
7
|
export declare const getFeeCostsBreakdown: (route: Route, included?: boolean) => {
|
|
9
|
-
amount:
|
|
8
|
+
amount: bigint;
|
|
10
9
|
amountUSD: number;
|
|
11
10
|
token: Token;
|
|
12
11
|
}[];
|
|
@@ -1,15 +1,12 @@
|
|
|
1
|
-
import Big from 'big.js';
|
|
2
1
|
export const getGasCostsBreakdown = (route) => {
|
|
3
2
|
return Object.values(route.steps.reduce((groupedGasCosts, step) => {
|
|
4
3
|
if (step.estimate.gasCosts?.length) {
|
|
5
4
|
const { token } = step.estimate.gasCosts[0];
|
|
6
|
-
const gasCostAmount = step.estimate.gasCosts
|
|
7
|
-
.reduce((amount, gasCost) => amount.plus(Big(gasCost.amount || 0)), Big(0))
|
|
8
|
-
.div(10 ** token.decimals);
|
|
5
|
+
const gasCostAmount = step.estimate.gasCosts.reduce((amount, gasCost) => amount + BigInt(gasCost.amount || 0), 0n);
|
|
9
6
|
const gasCostAmountUSD = step.estimate.gasCosts.reduce((amount, gasCost) => amount + parseFloat(gasCost.amountUSD || '0'), 0);
|
|
10
7
|
const groupedGasCost = groupedGasCosts[token.chainId];
|
|
11
8
|
const amount = groupedGasCost
|
|
12
|
-
? groupedGasCost.amount
|
|
9
|
+
? groupedGasCost.amount + gasCostAmount
|
|
13
10
|
: gasCostAmount;
|
|
14
11
|
const amountUSD = groupedGasCost
|
|
15
12
|
? groupedGasCost.amountUSD + gasCostAmountUSD
|
|
@@ -32,13 +29,11 @@ export const getFeeCostsBreakdown = (route, included) => {
|
|
|
32
29
|
}
|
|
33
30
|
if (feeCosts?.length) {
|
|
34
31
|
const { token } = feeCosts[0];
|
|
35
|
-
const feeCostAmount = feeCosts
|
|
36
|
-
.reduce((amount, feeCost) => amount.plus(Big(feeCost.amount || 0)), Big(0))
|
|
37
|
-
.div(10 ** token.decimals);
|
|
32
|
+
const feeCostAmount = feeCosts.reduce((amount, feeCost) => amount + BigInt(feeCost.amount || 0), 0n);
|
|
38
33
|
const feeCostAmountUSD = feeCosts.reduce((amount, feeCost) => amount + parseFloat(feeCost.amountUSD || '0'), 0);
|
|
39
34
|
const groupedFeeCost = groupedFeeCosts[token.chainId];
|
|
40
35
|
const amount = groupedFeeCost
|
|
41
|
-
? groupedFeeCost.amount
|
|
36
|
+
? groupedFeeCost.amount + feeCostAmount
|
|
42
37
|
: feeCostAmount;
|
|
43
38
|
const amountUSD = groupedFeeCost
|
|
44
39
|
? groupedFeeCost.amountUSD + feeCostAmountUSD
|