@lifi/widget 2.9.4 → 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/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 +2 -13
- 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/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- 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 +5 -8
- 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 -36
- package/cjs/providers/index.d.ts +0 -1
- package/cjs/providers/index.js +0 -1
- 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/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 +4 -15
- 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/SelectTokenPage/SelectTokenPage.d.ts +1 -1
- 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 +5 -8
- 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 -37
- package/providers/index.d.ts +0 -1
- package/providers/index.js +0 -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
|
@@ -8,12 +8,12 @@ const react_1 = require("react");
|
|
|
8
8
|
const react_i18next_1 = require("react-i18next");
|
|
9
9
|
const ActiveTransactions_1 = require("../../components/ActiveTransactions");
|
|
10
10
|
const Dialog_1 = require("../../components/Dialog");
|
|
11
|
-
const
|
|
11
|
+
const hooks_1 = require("../../hooks");
|
|
12
12
|
const stores_1 = require("../../stores");
|
|
13
13
|
const ActiveTransactionsEmpty_1 = require("./ActiveTransactionsEmpty");
|
|
14
14
|
const ActiveTransactionsPage = () => {
|
|
15
15
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
16
|
-
const { account } = (0,
|
|
16
|
+
const { account } = (0, hooks_1.useAccount)();
|
|
17
17
|
const executingRoutes = (0, stores_1.useExecutingRoutesIds)(account.address);
|
|
18
18
|
const deleteRoutes = (0, stores_1.useRouteExecutionStore)((store) => store.deleteRoutes);
|
|
19
19
|
const headerStoreContext = (0, stores_1.useHeaderStoreContext)();
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LanguagesPage = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_i18next_1 = require("react-i18next");
|
|
6
|
+
const Check_1 = require("@mui/icons-material/Check");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const ListItemText_1 = require("../../components/ListItemText");
|
|
9
|
+
const SettingsListItemButton_1 = require("../../components/SettingsListItemButton");
|
|
10
|
+
const hooks_1 = require("../../hooks");
|
|
11
|
+
const LanguagesPage = () => {
|
|
12
|
+
const { selectedLanguageCode, availableLanguages, setLanguageWithCode } = (0, hooks_1.useLanguages)();
|
|
13
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
14
|
+
if (availableLanguages.length < 1) {
|
|
15
|
+
return null;
|
|
16
|
+
}
|
|
17
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
|
|
18
|
+
paddingLeft: 1.5,
|
|
19
|
+
paddingRight: 1.5,
|
|
20
|
+
}, children: availableLanguages.map((language) => ((0, jsx_runtime_1.jsxs)(SettingsListItemButton_1.SettingsListItemButton, { onClick: () => setLanguageWithCode(language), children: [(0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: t('language.name', { lng: language }) }), selectedLanguageCode === language && (0, jsx_runtime_1.jsx)(Check_1.default, { color: "primary" })] }, language))) }) }));
|
|
21
|
+
};
|
|
22
|
+
exports.LanguagesPage = LanguagesPage;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LanguagesPage';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./LanguagesPage"), exports);
|
|
@@ -2,17 +2,25 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.SelectEnabledToolsPage = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const
|
|
5
|
+
const react_1 = require("react");
|
|
6
|
+
const react_i18next_1 = require("react-i18next");
|
|
7
|
+
const Check_1 = require("@mui/icons-material/Check");
|
|
6
8
|
const CheckBoxOutlineBlankOutlined_1 = require("@mui/icons-material/CheckBoxOutlineBlankOutlined");
|
|
7
9
|
const CheckBoxOutlined_1 = require("@mui/icons-material/CheckBoxOutlined");
|
|
8
10
|
const IndeterminateCheckBoxOutlined_1 = require("@mui/icons-material/IndeterminateCheckBoxOutlined");
|
|
9
11
|
const material_1 = require("@mui/material");
|
|
10
|
-
const react_1 = require("react");
|
|
11
12
|
const shallow_1 = require("zustand/shallow");
|
|
12
13
|
const ListItemText_1 = require("../../components/ListItemText");
|
|
13
14
|
const hooks_1 = require("../../hooks");
|
|
14
15
|
const stores_1 = require("../../stores");
|
|
15
|
-
const
|
|
16
|
+
const SettingsListItemButton_1 = require("../../components/SettingsListItemButton");
|
|
17
|
+
const SelectAllCheckbox = ({ allCheckboxesSelected, anyCheckboxesSelected, onClick, }) => {
|
|
18
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
19
|
+
const tooltipTitle = allCheckboxesSelected
|
|
20
|
+
? t('tooltip.deselectAll')
|
|
21
|
+
: t('tooltip.selectAll');
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Tooltip, { title: tooltipTitle, arrow: true, children: (0, jsx_runtime_1.jsx)(material_1.IconButton, { size: "medium", edge: "end", onClick: onClick, children: allCheckboxesSelected ? ((0, jsx_runtime_1.jsx)(CheckBoxOutlined_1.default, {})) : anyCheckboxesSelected ? ((0, jsx_runtime_1.jsx)(IndeterminateCheckBoxOutlined_1.default, {})) : ((0, jsx_runtime_1.jsx)(CheckBoxOutlineBlankOutlined_1.default, {})) }) }));
|
|
23
|
+
};
|
|
16
24
|
const SelectEnabledToolsPage = ({ type }) => {
|
|
17
25
|
const typeKey = type.toLowerCase();
|
|
18
26
|
const { tools } = (0, hooks_1.useTools)();
|
|
@@ -44,11 +52,13 @@ const SelectEnabledToolsPage = ({ type }) => {
|
|
|
44
52
|
setTools(type, toolKeys, toolKeys);
|
|
45
53
|
}
|
|
46
54
|
};
|
|
47
|
-
return headerStoreContext
|
|
55
|
+
return headerStoreContext
|
|
56
|
+
.getState()
|
|
57
|
+
.setAction((0, jsx_runtime_1.jsx)(SelectAllCheckbox, { allCheckboxesSelected: allToolsSelected, anyCheckboxesSelected: !!enabledTools.length, onClick: toggleCheckboxes }));
|
|
48
58
|
}, [enabledTools.length, headerStoreContext, setTools, tools, type, typeKey]);
|
|
49
59
|
return ((0, jsx_runtime_1.jsx)(material_1.Container, { disableGutters: true, children: (0, jsx_runtime_1.jsx)(material_1.List, { sx: {
|
|
50
60
|
paddingLeft: 1.5,
|
|
51
61
|
paddingRight: 1.5,
|
|
52
|
-
}, children: tools?.[typeKey].map((tool) => ((0, jsx_runtime_1.jsxs)(
|
|
62
|
+
}, children: tools?.[typeKey].map((tool) => ((0, jsx_runtime_1.jsxs)(SettingsListItemButton_1.SettingsListItemButton, { onClick: () => handleClick(tool.key), children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: tool.logoURI, alt: tool.name, children: tool.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: tool.name }), enabledTools?.includes(tool.key) && (0, jsx_runtime_1.jsx)(Check_1.default, { color: "primary" })] }, tool.name))) }) }));
|
|
53
63
|
};
|
|
54
64
|
exports.SelectEnabledToolsPage = SelectEnabledToolsPage;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { Connector } from 'wagmi';
|
|
2
|
+
interface EVMListItemButtonProps {
|
|
3
|
+
connectedConnector?: Connector;
|
|
4
|
+
connector: Connector;
|
|
5
|
+
onNotInstalled(connector: Connector): void;
|
|
6
|
+
}
|
|
7
|
+
export declare const EVMListItemButton: ({ connectedConnector, connector, onNotInstalled, }: EVMListItemButtonProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.EVMListItemButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const sdk_1 = require("@lifi/sdk");
|
|
6
|
+
const wallet_management_1 = require("@lifi/wallet-management");
|
|
7
|
+
const material_1 = require("@mui/material");
|
|
8
|
+
const wagmi_1 = require("wagmi");
|
|
9
|
+
const ListItemButton_1 = require("../../components/ListItemButton");
|
|
10
|
+
const ListItemText_1 = require("../../components/ListItemText");
|
|
11
|
+
const hooks_1 = require("../../hooks");
|
|
12
|
+
const types_1 = require("../../types");
|
|
13
|
+
const EVMListItemButton = ({ connectedConnector, connector, onNotInstalled, }) => {
|
|
14
|
+
const { navigateBack } = (0, hooks_1.useNavigateBack)();
|
|
15
|
+
const emitter = (0, hooks_1.useWidgetEvents)();
|
|
16
|
+
const { connectAsync } = (0, wagmi_1.useConnect)();
|
|
17
|
+
const { disconnectAsync } = (0, wagmi_1.useDisconnect)();
|
|
18
|
+
const handleEVMConnect = async () => {
|
|
19
|
+
const identityCheckPassed = await (0, wallet_management_1.isWalletInstalledAsync)(connector.id);
|
|
20
|
+
if (!identityCheckPassed) {
|
|
21
|
+
onNotInstalled(connector);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
if (connectedConnector) {
|
|
25
|
+
await disconnectAsync({ connector: connectedConnector });
|
|
26
|
+
}
|
|
27
|
+
await connectAsync({ connector }, {
|
|
28
|
+
onSuccess(data) {
|
|
29
|
+
emitter.emit(types_1.WidgetEvent.WalletConnected, {
|
|
30
|
+
address: data.accounts[0],
|
|
31
|
+
chainId: data.chainId,
|
|
32
|
+
chainType: sdk_1.ChainType.EVM,
|
|
33
|
+
});
|
|
34
|
+
},
|
|
35
|
+
});
|
|
36
|
+
navigateBack();
|
|
37
|
+
};
|
|
38
|
+
return ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: handleEVMConnect, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: connector.icon || (0, wallet_management_1.getWalletIcon)(connector.id), alt: connector.name, children: connector.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: connector.name })] }, connector.uid));
|
|
39
|
+
};
|
|
40
|
+
exports.EVMListItemButton = EVMListItemButton;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SVMListItemButton = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const sdk_1 = require("@lifi/sdk");
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const wallet_adapter_react_1 = require("@solana/wallet-adapter-react");
|
|
8
|
+
const ListItemButton_1 = require("../../components/ListItemButton");
|
|
9
|
+
const ListItemText_1 = require("../../components/ListItemText");
|
|
10
|
+
const hooks_1 = require("../../hooks");
|
|
11
|
+
const types_1 = require("../../types");
|
|
12
|
+
const SVMListItemButton = ({ wallet }) => {
|
|
13
|
+
const { navigateBack } = (0, hooks_1.useNavigateBack)();
|
|
14
|
+
const emitter = (0, hooks_1.useWidgetEvents)();
|
|
15
|
+
const { select, disconnect, connected } = (0, wallet_adapter_react_1.useWallet)();
|
|
16
|
+
const connect = async () => {
|
|
17
|
+
if (connected) {
|
|
18
|
+
await disconnect();
|
|
19
|
+
}
|
|
20
|
+
select(wallet.adapter.name);
|
|
21
|
+
// We use autoConnect on wallet selection
|
|
22
|
+
// await solanaConnect();
|
|
23
|
+
wallet.adapter.once('connect', (publicKey) => {
|
|
24
|
+
emitter.emit(types_1.WidgetEvent.WalletConnected, {
|
|
25
|
+
address: publicKey?.toString(),
|
|
26
|
+
chainId: sdk_1.ChainId.SOL,
|
|
27
|
+
chainType: sdk_1.ChainType.SVM,
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
navigateBack();
|
|
31
|
+
};
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(ListItemButton_1.ListItemButton, { onClick: connect, children: [(0, jsx_runtime_1.jsx)(material_1.ListItemAvatar, { children: (0, jsx_runtime_1.jsx)(material_1.Avatar, { src: wallet.adapter.icon, alt: wallet.adapter.name, children: wallet.adapter.name[0] }) }), (0, jsx_runtime_1.jsx)(ListItemText_1.ListItemText, { primary: `${wallet.adapter.name} (Solana)` })] }, wallet.adapter.name));
|
|
33
|
+
};
|
|
34
|
+
exports.SVMListItemButton = SVMListItemButton;
|
|
@@ -4,19 +4,21 @@ exports.SelectWalletPage = void 0;
|
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const wallet_management_1 = require("@lifi/wallet-management");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
|
+
const wallet_adapter_base_1 = require("@solana/wallet-adapter-base");
|
|
8
|
+
const wallet_adapter_react_1 = require("@solana/wallet-adapter-react");
|
|
7
9
|
const react_1 = require("react");
|
|
8
10
|
const react_i18next_1 = require("react-i18next");
|
|
11
|
+
const wagmi_1 = require("wagmi");
|
|
9
12
|
const Dialog_1 = require("../../components/Dialog");
|
|
10
|
-
const
|
|
11
|
-
const
|
|
12
|
-
const
|
|
13
|
-
const providers_1 = require("../../providers");
|
|
13
|
+
const EVMListItemButton_1 = require("./EVMListItemButton");
|
|
14
|
+
const SVMListItemButton_1 = require("./SVMListItemButton");
|
|
15
|
+
const utils_1 = require("./utils");
|
|
14
16
|
const SelectWalletPage = () => {
|
|
15
17
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
16
|
-
const
|
|
17
|
-
const {
|
|
18
|
+
const account = (0, wagmi_1.useAccount)();
|
|
19
|
+
const { connectors } = (0, wagmi_1.useConnect)();
|
|
18
20
|
const [walletIdentity, setWalletIdentity] = (0, react_1.useState)({ show: false });
|
|
19
|
-
const
|
|
21
|
+
const { wallets: solanaWallets } = (0, wallet_adapter_react_1.useWallet)();
|
|
20
22
|
const isDesktopView = (0, material_1.useMediaQuery)((theme) => theme.breakpoints.up('sm'));
|
|
21
23
|
const closeDialog = () => {
|
|
22
24
|
setWalletIdentity((state) => ({
|
|
@@ -24,36 +26,33 @@ const SelectWalletPage = () => {
|
|
|
24
26
|
show: false,
|
|
25
27
|
}));
|
|
26
28
|
};
|
|
27
|
-
const
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
show: true,
|
|
32
|
-
wallet,
|
|
33
|
-
});
|
|
34
|
-
return;
|
|
35
|
-
}
|
|
36
|
-
navigateBack();
|
|
37
|
-
await connect(wallet);
|
|
38
|
-
}, [connect, navigateBack]);
|
|
39
|
-
(0, react_1.useEffect)(() => {
|
|
40
|
-
Promise.all(wallet_management_1.supportedWallets.map((wallet) => wallet.installed())).then((installed) => {
|
|
41
|
-
// separate into installed and not installed wallets
|
|
42
|
-
const installedWallets = wallet_management_1.supportedWallets.filter((_, index) => installed[index]);
|
|
43
|
-
// always remove Default Wallet from not installed Wallets
|
|
44
|
-
const notInstalledWallets = wallet_management_1.supportedWallets.filter((wallet, index) => !installed[index] && wallet.name !== 'Default Wallet');
|
|
45
|
-
const allowedWallets = [...installedWallets];
|
|
46
|
-
if (isDesktopView) {
|
|
47
|
-
allowedWallets.push(...notInstalledWallets);
|
|
48
|
-
}
|
|
49
|
-
setWallets(allowedWallets);
|
|
29
|
+
const handleNotInstalled = (0, react_1.useCallback)(async (connector) => {
|
|
30
|
+
setWalletIdentity({
|
|
31
|
+
show: true,
|
|
32
|
+
connector,
|
|
50
33
|
});
|
|
51
34
|
}, []);
|
|
35
|
+
const wallets = (0, react_1.useMemo)(() => {
|
|
36
|
+
const evmInstalled = connectors.filter((connector) => (0, wallet_management_1.isWalletInstalled)(connector.id) &&
|
|
37
|
+
// We should not show already connected connectors
|
|
38
|
+
account.connector?.id !== connector.id);
|
|
39
|
+
const evmNotDetected = connectors.filter((connector) => !(0, wallet_management_1.isWalletInstalled)(connector.id));
|
|
40
|
+
const svmInstalled = solanaWallets?.filter((connector) => connector.adapter.readyState === wallet_adapter_base_1.WalletReadyState.Installed &&
|
|
41
|
+
// We should not show already connected connectors
|
|
42
|
+
!connector.adapter.connected);
|
|
43
|
+
const svmNotDetected = solanaWallets?.filter((connector) => connector.adapter.readyState !== wallet_adapter_base_1.WalletReadyState.Installed);
|
|
44
|
+
const installedWallets = [...evmInstalled, ...svmInstalled].sort(utils_1.walletComparator);
|
|
45
|
+
if (isDesktopView) {
|
|
46
|
+
const notDetectedWallets = [...evmNotDetected, ...svmNotDetected].sort(utils_1.walletComparator);
|
|
47
|
+
installedWallets.push(...notDetectedWallets);
|
|
48
|
+
}
|
|
49
|
+
return installedWallets;
|
|
50
|
+
}, [account.connector?.id, connectors, isDesktopView, solanaWallets]);
|
|
52
51
|
return ((0, jsx_runtime_1.jsxs)(material_1.Container, { disableGutters: true, children: [(0, jsx_runtime_1.jsx)(material_1.List, { sx: {
|
|
53
52
|
paddingLeft: 1.5,
|
|
54
53
|
paddingRight: 1.5,
|
|
55
|
-
}, children: wallets?.map((
|
|
56
|
-
name: walletIdentity.
|
|
54
|
+
}, children: wallets?.map((connector) => connector.uid ? ((0, jsx_runtime_1.jsx)(EVMListItemButton_1.EVMListItemButton, { connector: connector, connectedConnector: account.connector, onNotInstalled: handleNotInstalled }, connector.uid)) : ((0, jsx_runtime_1.jsx)(SVMListItemButton_1.SVMListItemButton, { wallet: connector }, connector.adapter.name))) }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: walletIdentity.show, onClose: closeDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('wallet.extensionNotFound', {
|
|
55
|
+
name: walletIdentity.connector?.name,
|
|
57
56
|
}) }) }), (0, jsx_runtime_1.jsx)(material_1.DialogActions, { children: (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: closeDialog, autoFocus: true, children: t('button.ok') }) })] })] }));
|
|
58
57
|
};
|
|
59
58
|
exports.SelectWalletPage = SelectWalletPage;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.walletComparator = void 0;
|
|
4
|
+
const wallet_management_1 = require("@lifi/wallet-management");
|
|
5
|
+
const walletComparator = (a, b) => {
|
|
6
|
+
let aId = a.id || a.adapter?.name;
|
|
7
|
+
let bId = b.id || b.adapter?.name;
|
|
8
|
+
const priorityA = (0, wallet_management_1.getWalletPriority)(aId);
|
|
9
|
+
const priorityB = (0, wallet_management_1.getWalletPriority)(bId);
|
|
10
|
+
if (priorityA !== priorityB) {
|
|
11
|
+
return priorityA - priorityB;
|
|
12
|
+
}
|
|
13
|
+
if (aId < bId) {
|
|
14
|
+
return -1;
|
|
15
|
+
}
|
|
16
|
+
if (aId > bId) {
|
|
17
|
+
return 1;
|
|
18
|
+
}
|
|
19
|
+
return 0;
|
|
20
|
+
};
|
|
21
|
+
exports.walletComparator = walletComparator;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BridgeAndExchangeSettings = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_i18next_1 = require("react-i18next");
|
|
6
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
7
|
+
const shallow_1 = require("zustand/shallow");
|
|
8
|
+
const AirlineStops_1 = require("@mui/icons-material/AirlineStops");
|
|
9
|
+
const SwapHoriz_1 = require("@mui/icons-material/SwapHoriz");
|
|
10
|
+
const stores_1 = require("../../stores");
|
|
11
|
+
const utils_1 = require("../../utils");
|
|
12
|
+
const hooks_1 = require("../../hooks");
|
|
13
|
+
const SettingsCard_1 = require("./SettingsCard");
|
|
14
|
+
const supportedIcons = {
|
|
15
|
+
Bridges: AirlineStops_1.default,
|
|
16
|
+
Exchanges: SwapHoriz_1.default,
|
|
17
|
+
};
|
|
18
|
+
const BridgeAndExchangeSettings = ({ type }) => {
|
|
19
|
+
const { isBridgesChanged, isExchangesChanged } = (0, hooks_1.useSettingMonitor)();
|
|
20
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
21
|
+
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
22
|
+
const [enabledTools, tools] = (0, stores_1.useSettingsStore)((state) => {
|
|
23
|
+
const enabledTools = Object.values(state[`_enabled${type}`] ?? {});
|
|
24
|
+
return [enabledTools.filter(Boolean).length, enabledTools.length];
|
|
25
|
+
}, shallow_1.shallow);
|
|
26
|
+
const customisationLookUp = {
|
|
27
|
+
Bridges: isBridgesChanged,
|
|
28
|
+
Exchanges: isExchangesChanged,
|
|
29
|
+
};
|
|
30
|
+
const handleClick = () => {
|
|
31
|
+
navigate(utils_1.navigationRoutes[type.toLowerCase()]);
|
|
32
|
+
};
|
|
33
|
+
const Icon = supportedIcons[type];
|
|
34
|
+
return ((0, jsx_runtime_1.jsx)(SettingsCard_1.SettingCardButton, { onClick: handleClick, icon: (0, jsx_runtime_1.jsx)(Icon, {}), title: t(`settings.enabled${type}`), children: (0, jsx_runtime_1.jsx)(SettingsCard_1.BadgedValue, { badgeColor: "info", showBadge: customisationLookUp[type], children: `${enabledTools}/${tools}` }) }));
|
|
35
|
+
};
|
|
36
|
+
exports.BridgeAndExchangeSettings = BridgeAndExchangeSettings;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GasPriceSettings = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const EvStation_1 = require("@mui/icons-material/EvStation");
|
|
6
|
+
const react_i18next_1 = require("react-i18next");
|
|
7
|
+
const stores_1 = require("../../stores");
|
|
8
|
+
const Tabs_1 = require("../../components/Tabs");
|
|
9
|
+
const hooks_1 = require("../../hooks");
|
|
10
|
+
const SettingsCard_1 = require("./SettingsCard");
|
|
11
|
+
const GasPriceSettings = () => {
|
|
12
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
|
+
const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
|
|
14
|
+
const { isGasPriceChanged } = (0, hooks_1.useSettingMonitor)();
|
|
15
|
+
const { gasPrice } = (0, stores_1.useSettings)(['gasPrice']);
|
|
16
|
+
const handleGasPriceChange = (_, gasPrice) => {
|
|
17
|
+
setValue('gasPrice', gasPrice);
|
|
18
|
+
};
|
|
19
|
+
return ((0, jsx_runtime_1.jsx)(SettingsCard_1.SettingCardExpandable, { value: (0, jsx_runtime_1.jsx)(SettingsCard_1.BadgedValue, { badgeColor: "info", showBadge: isGasPriceChanged, children: t(`settings.gasPrice.${gasPrice}`) }), icon: (0, jsx_runtime_1.jsx)(EvStation_1.default, {}), title: t(`settings.gasPrice.title`), children: (0, jsx_runtime_1.jsxs)(Tabs_1.Tabs, { value: gasPrice, "aria-label": "tabs", indicatorColor: "primary", onChange: handleGasPriceChange, sx: { mt: 1.5 }, children: [(0, jsx_runtime_1.jsx)(Tabs_1.Tab, { label: t(`settings.gasPrice.slow`), value: "slow", disableRipple: true }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { label: t(`settings.gasPrice.normal`), value: "normal", disableRipple: true }), (0, jsx_runtime_1.jsx)(Tabs_1.Tab, { label: t(`settings.gasPrice.fast`), value: "fast", disableRipple: true })] }) }));
|
|
20
|
+
};
|
|
21
|
+
exports.GasPriceSettings = GasPriceSettings;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LanguageSetting = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
6
|
+
const react_i18next_1 = require("react-i18next");
|
|
7
|
+
const Language_1 = require("@mui/icons-material/Language");
|
|
8
|
+
const providers_1 = require("../../providers");
|
|
9
|
+
const types_1 = require("../../types");
|
|
10
|
+
const utils_1 = require("../../utils");
|
|
11
|
+
const hooks_1 = require("../../hooks");
|
|
12
|
+
const SettingsCard_1 = require("./SettingsCard");
|
|
13
|
+
const LanguageSetting = () => {
|
|
14
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
15
|
+
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
16
|
+
const { hiddenUI } = (0, providers_1.useWidgetConfig)();
|
|
17
|
+
const { selectedLanguageDisplayName } = (0, hooks_1.useLanguages)();
|
|
18
|
+
if (hiddenUI?.includes(types_1.HiddenUI.Language)) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
const handleClick = () => {
|
|
22
|
+
navigate(utils_1.navigationRoutes.languages);
|
|
23
|
+
};
|
|
24
|
+
return ((0, jsx_runtime_1.jsx)(SettingsCard_1.SettingCardButton, { onClick: handleClick, icon: (0, jsx_runtime_1.jsx)(Language_1.default, {}), title: t(`language.title`), children: (0, jsx_runtime_1.jsx)(SettingsCard_1.SummaryValue, { children: selectedLanguageDisplayName }) }));
|
|
25
|
+
};
|
|
26
|
+
exports.LanguageSetting = LanguageSetting;
|
|
@@ -7,50 +7,23 @@ const react_1 = require("react");
|
|
|
7
7
|
const react_i18next_1 = require("react-i18next");
|
|
8
8
|
const Dialog_1 = require("../../components/Dialog");
|
|
9
9
|
const hooks_1 = require("../../hooks");
|
|
10
|
-
const providers_1 = require("../../providers");
|
|
11
|
-
const stores_1 = require("../../stores");
|
|
12
10
|
const ResetSettingsButton_style_1 = require("./ResetSettingsButton.style");
|
|
13
11
|
const icons_material_1 = require("@mui/icons-material");
|
|
14
|
-
const shallow_1 = require("zustand/shallow");
|
|
15
12
|
const ResetSettingsButton = () => {
|
|
16
|
-
const [enabledBridges, enabledExchanges, routePriority, slippage, gasPrice] = (0, stores_1.useSettingsStore)((state) => [
|
|
17
|
-
state.enabledBridges,
|
|
18
|
-
state.enabledExchanges,
|
|
19
|
-
state.routePriority,
|
|
20
|
-
state.slippage,
|
|
21
|
-
state.gasPrice,
|
|
22
|
-
], shallow_1.shallow);
|
|
23
13
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
24
|
-
const {
|
|
25
|
-
const config = (0, providers_1.useWidgetConfig)();
|
|
26
|
-
const resetSettings = (0, stores_1.useSettingsStore)((state) => state.reset);
|
|
14
|
+
const { isCustomRouteSettings, reset } = (0, hooks_1.useSettingMonitor)();
|
|
27
15
|
const [open, setOpen] = (0, react_1.useState)(false);
|
|
28
16
|
const toggleDialog = (0, react_1.useCallback)(() => {
|
|
29
17
|
setOpen((open) => !open);
|
|
30
18
|
}, []);
|
|
31
19
|
const handleReset = () => {
|
|
32
|
-
|
|
33
|
-
resetSettings(config, tools.bridges.map((tool) => tool.key), tools.exchanges.map((tool) => tool.key));
|
|
34
|
-
(0, stores_1.setDefaultSettings)(config);
|
|
35
|
-
}
|
|
20
|
+
reset();
|
|
36
21
|
toggleDialog();
|
|
37
22
|
};
|
|
38
|
-
const isSlippageChanged = config.slippage
|
|
39
|
-
? Number(slippage) !== config.slippage * 100
|
|
40
|
-
: slippage !== stores_1.defaultConfigurableSettings.slippage;
|
|
41
|
-
const isRoutePriorityChanged = config.routePriority
|
|
42
|
-
? routePriority !== config.routePriority
|
|
43
|
-
: routePriority !== stores_1.defaultConfigurableSettings.routePriority;
|
|
44
|
-
const isGasPriceChanged = gasPrice !== stores_1.defaultConfigurableSettings.gasPrice;
|
|
45
|
-
const isCustomRouteSettings = tools?.bridges?.length !== enabledBridges?.length ||
|
|
46
|
-
tools?.exchanges?.length !== enabledExchanges?.length ||
|
|
47
|
-
isSlippageChanged ||
|
|
48
|
-
isRoutePriorityChanged ||
|
|
49
|
-
isGasPriceChanged;
|
|
50
23
|
if (!isCustomRouteSettings) {
|
|
51
24
|
return null;
|
|
52
25
|
}
|
|
53
|
-
return ((0, jsx_runtime_1.jsx)(material_1.Box, { px: 3,
|
|
26
|
+
return ((0, jsx_runtime_1.jsx)(material_1.Box, { px: 3, mb: 1, children: (0, jsx_runtime_1.jsxs)(ResetSettingsButton_style_1.ResetButtonContainer, { children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", marginBottom: "12px", children: [(0, jsx_runtime_1.jsx)(icons_material_1.InfoRounded, { sx: {
|
|
54
27
|
marginRight: '8px',
|
|
55
28
|
} }), (0, jsx_runtime_1.jsx)(material_1.Box, { fontSize: 14, children: t(`settings.resetSettings`) })] }), (0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, fullWidth: true, children: t('button.resetSettings') }), (0, jsx_runtime_1.jsxs)(Dialog_1.Dialog, { open: open, onClose: toggleDialog, children: [(0, jsx_runtime_1.jsx)(material_1.DialogTitle, { children: t('warning.title.resetSettings') }), (0, jsx_runtime_1.jsx)(material_1.DialogContent, { children: (0, jsx_runtime_1.jsx)(material_1.DialogContentText, { children: t('warning.message.resetSettings') }) }), (0, jsx_runtime_1.jsxs)(material_1.DialogActions, { children: [(0, jsx_runtime_1.jsx)(material_1.Button, { onClick: toggleDialog, children: t('button.cancel') }), (0, jsx_runtime_1.jsx)(material_1.Button, { variant: "contained", onClick: handleReset, autoFocus: true, children: t('button.reset') })] })] })] }) }));
|
|
56
29
|
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RoutePrioritySettings = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const react_i18next_1 = require("react-i18next");
|
|
6
|
+
const Route_1 = require("@mui/icons-material/Route");
|
|
7
|
+
const sdk_1 = require("@lifi/sdk");
|
|
8
|
+
const Tabs_1 = require("../../components/Tabs");
|
|
9
|
+
const stores_1 = require("../../stores");
|
|
10
|
+
const hooks_1 = require("../../hooks");
|
|
11
|
+
const SettingsCard_1 = require("./SettingsCard");
|
|
12
|
+
const RoutePrioritySettings = () => {
|
|
13
|
+
const { t } = (0, react_i18next_1.useTranslation)();
|
|
14
|
+
const setValue = (0, stores_1.useSettingsStore)((state) => state.setValue);
|
|
15
|
+
const { isRoutePriorityChanged } = (0, hooks_1.useSettingMonitor)();
|
|
16
|
+
const { routePriority } = (0, stores_1.useSettings)(['routePriority']);
|
|
17
|
+
const currentRoutePriority = routePriority ?? '';
|
|
18
|
+
const handleRoutePriorityChange = (_, routePriority) => {
|
|
19
|
+
setValue('routePriority', routePriority);
|
|
20
|
+
};
|
|
21
|
+
return ((0, jsx_runtime_1.jsx)(SettingsCard_1.SettingCardExpandable, { value: (0, jsx_runtime_1.jsx)(SettingsCard_1.BadgedValue, { badgeColor: "info", showBadge: isRoutePriorityChanged, children: t(`main.tags.${currentRoutePriority.toLowerCase()}`) }), icon: (0, jsx_runtime_1.jsx)(Route_1.default, {}), title: t(`settings.routePriority`), children: (0, jsx_runtime_1.jsx)(Tabs_1.Tabs, { value: currentRoutePriority, "aria-label": "tabs", indicatorColor: "primary", onChange: handleRoutePriorityChange, orientation: "vertical", sx: { mt: 1.5 }, children: sdk_1.Orders.map((order) => {
|
|
22
|
+
return ((0, jsx_runtime_1.jsx)(Tabs_1.Tab, { label: t(`main.tags.${order.toLowerCase()}`), value: order, disableRipple: true }, order));
|
|
23
|
+
}) }) }));
|
|
24
|
+
};
|
|
25
|
+
exports.RoutePrioritySettings = RoutePrioritySettings;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SendToWalletOptionSetting: () => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.SendToWalletOptionSetting = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
-
const material_1 = require("@mui/material");
|
|
6
5
|
const react_i18next_1 = require("react-i18next");
|
|
6
|
+
const Wallet_1 = require("@mui/icons-material/Wallet");
|
|
7
7
|
const Switch_1 = require("../../components/Switch");
|
|
8
8
|
const providers_1 = require("../../providers");
|
|
9
9
|
const stores_1 = require("../../stores");
|
|
10
10
|
const types_1 = require("../../types");
|
|
11
|
-
const
|
|
11
|
+
const SettingsCard_1 = require("./SettingsCard");
|
|
12
|
+
const SendToWalletOptionSetting = () => {
|
|
12
13
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
13
14
|
const { hiddenUI } = (0, providers_1.useWidgetConfig)();
|
|
14
15
|
const setSendToWallet = (0, stores_1.useSendToWalletStore)((state) => state.setSendToWallet);
|
|
@@ -21,10 +22,6 @@ const ShowDestinationWallet = () => {
|
|
|
21
22
|
setValue('showDestinationWallet', checked);
|
|
22
23
|
setSendToWallet(false);
|
|
23
24
|
};
|
|
24
|
-
return ((0, jsx_runtime_1.jsx)(
|
|
25
|
-
display: 'flex',
|
|
26
|
-
justifyContent: 'space-between',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
}, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { sx: { display: 'flex', alignItems: 'center' }, children: (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "subtitle1", color: "text.primary", lineHeight: "normal", children: t(`settings.showDestinationWallet`) }) }), (0, jsx_runtime_1.jsx)(Switch_1.Switch, { checked: showDestinationWallet, onChange: onChange })] }) }));
|
|
25
|
+
return ((0, jsx_runtime_1.jsx)(SettingsCard_1.SettingCard, { children: (0, jsx_runtime_1.jsxs)(SettingsCard_1.SummaryRowContainer, { children: [(0, jsx_runtime_1.jsxs)(SettingsCard_1.SummaryTitleContainer, { children: [(0, jsx_runtime_1.jsx)(Wallet_1.default, {}), (0, jsx_runtime_1.jsx)(SettingsCard_1.SummaryValue, { children: t(`settings.sendToWalletOption`) })] }), (0, jsx_runtime_1.jsx)(Switch_1.Switch, { checked: showDestinationWallet, onChange: onChange })] }) }));
|
|
29
26
|
};
|
|
30
|
-
exports.
|
|
27
|
+
exports.SendToWalletOptionSetting = SendToWalletOptionSetting;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { PropsWithChildren } from 'react';
|
|
2
|
+
import type { BadgeProps } from '@mui/material';
|
|
3
|
+
interface BadgedValueProps {
|
|
4
|
+
showBadge: boolean;
|
|
5
|
+
badgeColor?: BadgeProps['color'];
|
|
6
|
+
}
|
|
7
|
+
export declare const BadgedValue: React.FC<PropsWithChildren<BadgedValueProps>>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BadgedValue = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const SettingCard_style_1 = require("./SettingCard.style");
|
|
6
|
+
const BadgedValue = ({ showBadge, badgeColor, children, }) => showBadge && badgeColor ? ((0, jsx_runtime_1.jsx)(SettingCard_style_1.Badge, { variant: "dot", color: badgeColor, children: (0, jsx_runtime_1.jsx)(SettingCard_style_1.SummaryValue, { children: children }) })) : ((0, jsx_runtime_1.jsx)(SettingCard_style_1.SummaryValue, { children: children }));
|
|
7
|
+
exports.BadgedValue = BadgedValue;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SettingCard = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const Card_1 = require("../../../components/Card");
|
|
6
|
+
const SettingCard = ({ children }) => {
|
|
7
|
+
return ((0, jsx_runtime_1.jsx)(Card_1.Card, { variant: "default", selectionColor: "primary", sx: {
|
|
8
|
+
p: 2,
|
|
9
|
+
}, children: children }));
|
|
10
|
+
};
|
|
11
|
+
exports.SettingCard = SettingCard;
|