@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
package/AppProvider.js
CHANGED
|
@@ -3,10 +3,10 @@ import { QueryClientProvider } from '@tanstack/react-query';
|
|
|
3
3
|
import { Fragment } from 'react';
|
|
4
4
|
import { MemoryRouter, useInRouterContext } from 'react-router-dom';
|
|
5
5
|
import { queryClient } from './config/queryClient';
|
|
6
|
-
import { FormProvider, I18nProvider,
|
|
6
|
+
import { FormProvider, I18nProvider, ThemeProvider, URLSearchParamsBuilder, WalletProvider, WidgetProvider, useWidgetConfig, } from './providers';
|
|
7
7
|
import { StoreProvider } from './stores';
|
|
8
8
|
export const AppProvider = ({ children, config, }) => {
|
|
9
|
-
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(
|
|
9
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(WidgetProvider, { config: config, children: _jsx(ThemeProvider, { children: _jsx(I18nProvider, { children: _jsx(WalletProvider, { children: _jsx(FormProvider, { children: _jsx(StoreProvider, { config: config, children: _jsx(AppRouter, { children: children }) }) }) }) }) }) }) }));
|
|
10
10
|
};
|
|
11
11
|
export const AppRouter = ({ children }) => {
|
|
12
12
|
const { buildUrl } = useWidgetConfig();
|
package/AppRoutes.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { useRoutes } from 'react-router-dom';
|
|
2
|
+
import { useLocation, useRoutes } from 'react-router-dom';
|
|
3
3
|
import { NotFound } from './components/NotFound';
|
|
4
4
|
import { ActiveTransactionsPage } from './pages/ActiveTransactionsPage';
|
|
5
|
+
import { LanguagesPage } from './pages/LanguagesPage';
|
|
5
6
|
import { MainPage } from './pages/MainPage';
|
|
6
7
|
import { RoutesPage } from './pages/RoutesPage';
|
|
7
8
|
import { SelectChainPage } from './pages/SelectChainPage';
|
|
@@ -13,72 +14,79 @@ import { TransactionDetailsPage } from './pages/TransactionDetailsPage';
|
|
|
13
14
|
import { TransactionHistoryPage } from './pages/TransactionHistoryPage';
|
|
14
15
|
import { TransactionPage } from './pages/TransactionPage';
|
|
15
16
|
import { navigationRoutes } from './utils';
|
|
17
|
+
// SelectWalletPage should be accessible from every page and this handler helps avoid creating multiple paths.
|
|
18
|
+
// Avoid using it for anything else, we need to come up with a better solution once we have one more page accessible from everywhere.
|
|
19
|
+
const NotFoundRouteHandler = () => {
|
|
20
|
+
const { pathname } = useLocation();
|
|
21
|
+
return pathname.includes(navigationRoutes.selectWallet) ? (_jsx(SelectWalletPage, {})) : (_jsx(NotFound, {}));
|
|
22
|
+
};
|
|
23
|
+
const routes = [
|
|
24
|
+
{
|
|
25
|
+
path: '/',
|
|
26
|
+
element: _jsx(MainPage, {}),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
path: navigationRoutes.settings,
|
|
30
|
+
element: _jsx(SettingsPage, {}),
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
path: `${navigationRoutes.settings}/${navigationRoutes.bridges}`,
|
|
34
|
+
element: _jsx(SelectEnabledToolsPage, { type: "Bridges" }),
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
path: `${navigationRoutes.settings}/${navigationRoutes.exchanges}`,
|
|
38
|
+
element: _jsx(SelectEnabledToolsPage, { type: "Exchanges" }),
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
path: `${navigationRoutes.settings}/${navigationRoutes.languages}`,
|
|
42
|
+
element: _jsx(LanguagesPage, {}),
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
path: navigationRoutes.fromToken,
|
|
46
|
+
element: _jsx(SelectTokenPage, { formType: "from" }),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
path: navigationRoutes.toToken,
|
|
50
|
+
element: _jsx(SelectTokenPage, { formType: "to" }),
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
path: navigationRoutes.toTokenNative,
|
|
54
|
+
element: _jsx(SelectChainPage, { formType: "to", selectNativeToken: true }),
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
path: `${navigationRoutes.fromToken}?/${navigationRoutes.fromChain}`,
|
|
58
|
+
element: _jsx(SelectChainPage, { formType: "from" }),
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
path: `${navigationRoutes.toToken}?/${navigationRoutes.toChain}`,
|
|
62
|
+
element: _jsx(SelectChainPage, { formType: "to" }),
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
path: navigationRoutes.routes,
|
|
66
|
+
element: _jsx(RoutesPage, {}),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
path: navigationRoutes.activeTransactions,
|
|
70
|
+
element: _jsx(ActiveTransactionsPage, {}),
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
path: navigationRoutes.transactionHistory,
|
|
74
|
+
element: _jsx(TransactionHistoryPage, {}),
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
path: `${navigationRoutes.transactionHistory}?/${navigationRoutes.routes}?/${navigationRoutes.transactionExecution}?/${navigationRoutes.transactionDetails}`,
|
|
78
|
+
element: _jsx(TransactionDetailsPage, {}),
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
path: `${navigationRoutes.routes}?/${navigationRoutes.activeTransactions}?/${navigationRoutes.transactionExecution}`,
|
|
82
|
+
element: _jsx(TransactionPage, {}),
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
path: '*',
|
|
86
|
+
element: _jsx(NotFoundRouteHandler, {}),
|
|
87
|
+
},
|
|
88
|
+
];
|
|
16
89
|
export const AppRoutes = () => {
|
|
17
|
-
const element = useRoutes(
|
|
18
|
-
{
|
|
19
|
-
path: '/',
|
|
20
|
-
element: _jsx(MainPage, {}),
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
path: navigationRoutes.settings,
|
|
24
|
-
element: _jsx(SettingsPage, {}),
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
path: `${navigationRoutes.settings}/${navigationRoutes.bridges}`,
|
|
28
|
-
element: _jsx(SelectEnabledToolsPage, { type: "Bridges" }),
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
path: `${navigationRoutes.settings}/${navigationRoutes.exchanges}`,
|
|
32
|
-
element: _jsx(SelectEnabledToolsPage, { type: "Exchanges" }),
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
path: navigationRoutes.fromToken,
|
|
36
|
-
element: _jsx(SelectTokenPage, { formType: "from" }),
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
path: navigationRoutes.toToken,
|
|
40
|
-
element: _jsx(SelectTokenPage, { formType: "to" }),
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
path: navigationRoutes.toTokenNative,
|
|
44
|
-
element: _jsx(SelectChainPage, { formType: "to", selectNativeToken: true }),
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
path: `${navigationRoutes.fromToken}?/${navigationRoutes.fromChain}`,
|
|
48
|
-
element: _jsx(SelectChainPage, { formType: "from" }),
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
path: `${navigationRoutes.toToken}?/${navigationRoutes.toChain}`,
|
|
52
|
-
element: _jsx(SelectChainPage, { formType: "to" }),
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
path: navigationRoutes.routes,
|
|
56
|
-
element: _jsx(RoutesPage, {}),
|
|
57
|
-
},
|
|
58
|
-
{
|
|
59
|
-
path: navigationRoutes.activeTransactions,
|
|
60
|
-
element: _jsx(ActiveTransactionsPage, {}),
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
path: navigationRoutes.transactionHistory,
|
|
64
|
-
element: _jsx(TransactionHistoryPage, {}),
|
|
65
|
-
},
|
|
66
|
-
{
|
|
67
|
-
path: `${navigationRoutes.transactionHistory}?/${navigationRoutes.routes}?/${navigationRoutes.transactionExecution}?/${navigationRoutes.transactionDetails}`,
|
|
68
|
-
element: _jsx(TransactionDetailsPage, {}),
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
path: `${navigationRoutes.routes}?/${navigationRoutes.transactionExecution}?/${navigationRoutes.selectWallet}`,
|
|
72
|
-
element: _jsx(SelectWalletPage, {}),
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
path: `${navigationRoutes.routes}?/${navigationRoutes.activeTransactions}?/${navigationRoutes.transactionExecution}`,
|
|
76
|
-
element: _jsx(TransactionPage, {}),
|
|
77
|
-
},
|
|
78
|
-
{
|
|
79
|
-
path: '*',
|
|
80
|
-
element: _jsx(NotFound, {}),
|
|
81
|
-
},
|
|
82
|
-
]);
|
|
90
|
+
const element = useRoutes(routes);
|
|
83
91
|
return element;
|
|
84
92
|
};
|
package/cjs/AppProvider.js
CHANGED
|
@@ -9,7 +9,7 @@ const queryClient_1 = require("./config/queryClient");
|
|
|
9
9
|
const providers_1 = require("./providers");
|
|
10
10
|
const stores_1 = require("./stores");
|
|
11
11
|
const AppProvider = ({ children, config, }) => {
|
|
12
|
-
return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient_1.queryClient, children: (0, jsx_runtime_1.jsx)(
|
|
12
|
+
return ((0, jsx_runtime_1.jsx)(react_query_1.QueryClientProvider, { client: queryClient_1.queryClient, children: (0, jsx_runtime_1.jsx)(providers_1.WidgetProvider, { config: config, children: (0, jsx_runtime_1.jsx)(providers_1.ThemeProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.I18nProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.WalletProvider, { children: (0, jsx_runtime_1.jsx)(providers_1.FormProvider, { children: (0, jsx_runtime_1.jsx)(stores_1.StoreProvider, { config: config, children: (0, jsx_runtime_1.jsx)(exports.AppRouter, { children: children }) }) }) }) }) }) }) }));
|
|
13
13
|
};
|
|
14
14
|
exports.AppProvider = AppProvider;
|
|
15
15
|
const AppRouter = ({ children }) => {
|
package/cjs/AppRoutes.js
CHANGED
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const react_router_dom_1 = require("react-router-dom");
|
|
6
6
|
const NotFound_1 = require("./components/NotFound");
|
|
7
7
|
const ActiveTransactionsPage_1 = require("./pages/ActiveTransactionsPage");
|
|
8
|
+
const LanguagesPage_1 = require("./pages/LanguagesPage");
|
|
8
9
|
const MainPage_1 = require("./pages/MainPage");
|
|
9
10
|
const RoutesPage_1 = require("./pages/RoutesPage");
|
|
10
11
|
const SelectChainPage_1 = require("./pages/SelectChainPage");
|
|
@@ -16,73 +17,80 @@ const TransactionDetailsPage_1 = require("./pages/TransactionDetailsPage");
|
|
|
16
17
|
const TransactionHistoryPage_1 = require("./pages/TransactionHistoryPage");
|
|
17
18
|
const TransactionPage_1 = require("./pages/TransactionPage");
|
|
18
19
|
const utils_1 = require("./utils");
|
|
20
|
+
// SelectWalletPage should be accessible from every page and this handler helps avoid creating multiple paths.
|
|
21
|
+
// Avoid using it for anything else, we need to come up with a better solution once we have one more page accessible from everywhere.
|
|
22
|
+
const NotFoundRouteHandler = () => {
|
|
23
|
+
const { pathname } = (0, react_router_dom_1.useLocation)();
|
|
24
|
+
return pathname.includes(utils_1.navigationRoutes.selectWallet) ? ((0, jsx_runtime_1.jsx)(SelectWalletPage_1.SelectWalletPage, {})) : ((0, jsx_runtime_1.jsx)(NotFound_1.NotFound, {}));
|
|
25
|
+
};
|
|
26
|
+
const routes = [
|
|
27
|
+
{
|
|
28
|
+
path: '/',
|
|
29
|
+
element: (0, jsx_runtime_1.jsx)(MainPage_1.MainPage, {}),
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
path: utils_1.navigationRoutes.settings,
|
|
33
|
+
element: (0, jsx_runtime_1.jsx)(SettingsPage_1.SettingsPage, {}),
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
path: `${utils_1.navigationRoutes.settings}/${utils_1.navigationRoutes.bridges}`,
|
|
37
|
+
element: (0, jsx_runtime_1.jsx)(SelectEnabledToolsPage_1.SelectEnabledToolsPage, { type: "Bridges" }),
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
path: `${utils_1.navigationRoutes.settings}/${utils_1.navigationRoutes.exchanges}`,
|
|
41
|
+
element: (0, jsx_runtime_1.jsx)(SelectEnabledToolsPage_1.SelectEnabledToolsPage, { type: "Exchanges" }),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
path: `${utils_1.navigationRoutes.settings}/${utils_1.navigationRoutes.languages}`,
|
|
45
|
+
element: (0, jsx_runtime_1.jsx)(LanguagesPage_1.LanguagesPage, {}),
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
path: utils_1.navigationRoutes.fromToken,
|
|
49
|
+
element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "from" }),
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
path: utils_1.navigationRoutes.toToken,
|
|
53
|
+
element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "to" }),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
path: utils_1.navigationRoutes.toTokenNative,
|
|
57
|
+
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to", selectNativeToken: true }),
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
path: `${utils_1.navigationRoutes.fromToken}?/${utils_1.navigationRoutes.fromChain}`,
|
|
61
|
+
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "from" }),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
path: `${utils_1.navigationRoutes.toToken}?/${utils_1.navigationRoutes.toChain}`,
|
|
65
|
+
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to" }),
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
path: utils_1.navigationRoutes.routes,
|
|
69
|
+
element: (0, jsx_runtime_1.jsx)(RoutesPage_1.RoutesPage, {}),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
path: utils_1.navigationRoutes.activeTransactions,
|
|
73
|
+
element: (0, jsx_runtime_1.jsx)(ActiveTransactionsPage_1.ActiveTransactionsPage, {}),
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
path: utils_1.navigationRoutes.transactionHistory,
|
|
77
|
+
element: (0, jsx_runtime_1.jsx)(TransactionHistoryPage_1.TransactionHistoryPage, {}),
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
path: `${utils_1.navigationRoutes.transactionHistory}?/${utils_1.navigationRoutes.routes}?/${utils_1.navigationRoutes.transactionExecution}?/${utils_1.navigationRoutes.transactionDetails}`,
|
|
81
|
+
element: (0, jsx_runtime_1.jsx)(TransactionDetailsPage_1.TransactionDetailsPage, {}),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
path: `${utils_1.navigationRoutes.routes}?/${utils_1.navigationRoutes.activeTransactions}?/${utils_1.navigationRoutes.transactionExecution}`,
|
|
85
|
+
element: (0, jsx_runtime_1.jsx)(TransactionPage_1.TransactionPage, {}),
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
path: '*',
|
|
89
|
+
element: (0, jsx_runtime_1.jsx)(NotFoundRouteHandler, {}),
|
|
90
|
+
},
|
|
91
|
+
];
|
|
19
92
|
const AppRoutes = () => {
|
|
20
|
-
const element = (0, react_router_dom_1.useRoutes)(
|
|
21
|
-
{
|
|
22
|
-
path: '/',
|
|
23
|
-
element: (0, jsx_runtime_1.jsx)(MainPage_1.MainPage, {}),
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
path: utils_1.navigationRoutes.settings,
|
|
27
|
-
element: (0, jsx_runtime_1.jsx)(SettingsPage_1.SettingsPage, {}),
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
path: `${utils_1.navigationRoutes.settings}/${utils_1.navigationRoutes.bridges}`,
|
|
31
|
-
element: (0, jsx_runtime_1.jsx)(SelectEnabledToolsPage_1.SelectEnabledToolsPage, { type: "Bridges" }),
|
|
32
|
-
},
|
|
33
|
-
{
|
|
34
|
-
path: `${utils_1.navigationRoutes.settings}/${utils_1.navigationRoutes.exchanges}`,
|
|
35
|
-
element: (0, jsx_runtime_1.jsx)(SelectEnabledToolsPage_1.SelectEnabledToolsPage, { type: "Exchanges" }),
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
path: utils_1.navigationRoutes.fromToken,
|
|
39
|
-
element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "from" }),
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
path: utils_1.navigationRoutes.toToken,
|
|
43
|
-
element: (0, jsx_runtime_1.jsx)(SelectTokenPage_1.SelectTokenPage, { formType: "to" }),
|
|
44
|
-
},
|
|
45
|
-
{
|
|
46
|
-
path: utils_1.navigationRoutes.toTokenNative,
|
|
47
|
-
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to", selectNativeToken: true }),
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
path: `${utils_1.navigationRoutes.fromToken}?/${utils_1.navigationRoutes.fromChain}`,
|
|
51
|
-
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "from" }),
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
path: `${utils_1.navigationRoutes.toToken}?/${utils_1.navigationRoutes.toChain}`,
|
|
55
|
-
element: (0, jsx_runtime_1.jsx)(SelectChainPage_1.SelectChainPage, { formType: "to" }),
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
path: utils_1.navigationRoutes.routes,
|
|
59
|
-
element: (0, jsx_runtime_1.jsx)(RoutesPage_1.RoutesPage, {}),
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
path: utils_1.navigationRoutes.activeTransactions,
|
|
63
|
-
element: (0, jsx_runtime_1.jsx)(ActiveTransactionsPage_1.ActiveTransactionsPage, {}),
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
path: utils_1.navigationRoutes.transactionHistory,
|
|
67
|
-
element: (0, jsx_runtime_1.jsx)(TransactionHistoryPage_1.TransactionHistoryPage, {}),
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
path: `${utils_1.navigationRoutes.transactionHistory}?/${utils_1.navigationRoutes.routes}?/${utils_1.navigationRoutes.transactionExecution}?/${utils_1.navigationRoutes.transactionDetails}`,
|
|
71
|
-
element: (0, jsx_runtime_1.jsx)(TransactionDetailsPage_1.TransactionDetailsPage, {}),
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
path: `${utils_1.navigationRoutes.routes}?/${utils_1.navigationRoutes.transactionExecution}?/${utils_1.navigationRoutes.selectWallet}`,
|
|
75
|
-
element: (0, jsx_runtime_1.jsx)(SelectWalletPage_1.SelectWalletPage, {}),
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
path: `${utils_1.navigationRoutes.routes}?/${utils_1.navigationRoutes.activeTransactions}?/${utils_1.navigationRoutes.transactionExecution}`,
|
|
79
|
-
element: (0, jsx_runtime_1.jsx)(TransactionPage_1.TransactionPage, {}),
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
path: '*',
|
|
83
|
-
element: (0, jsx_runtime_1.jsx)(NotFound_1.NotFound, {}),
|
|
84
|
-
},
|
|
85
|
-
]);
|
|
93
|
+
const element = (0, react_router_dom_1.useRoutes)(routes);
|
|
86
94
|
return element;
|
|
87
95
|
};
|
|
88
96
|
exports.AppRoutes = AppRoutes;
|
|
@@ -19,11 +19,7 @@ const ActiveTransactionItem = ({ routeId, dense }) => {
|
|
|
19
19
|
routeId,
|
|
20
20
|
executeInBackground: true,
|
|
21
21
|
});
|
|
22
|
-
|
|
23
|
-
const lastActiveStep = route?.steps
|
|
24
|
-
.slice()
|
|
25
|
-
.reverse()
|
|
26
|
-
.find((step) => step.execution);
|
|
22
|
+
const lastActiveStep = route?.steps.findLast((step) => step.execution);
|
|
27
23
|
const lastActiveProcess = lastActiveStep?.execution?.process.at(-1);
|
|
28
24
|
const { title } = (0, hooks_1.useProcessMessage)(lastActiveStep, lastActiveProcess);
|
|
29
25
|
if (!route || !lastActiveStep) {
|
|
@@ -5,7 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
6
|
const react_i18next_1 = require("react-i18next");
|
|
7
7
|
const react_router_dom_1 = require("react-router-dom");
|
|
8
|
-
const
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
9
9
|
const stores_1 = require("../../stores");
|
|
10
10
|
const utils_1 = require("../../utils");
|
|
11
11
|
const Card_1 = require("../Card");
|
|
@@ -14,7 +14,7 @@ const ActiveTransactions_style_1 = require("./ActiveTransactions.style");
|
|
|
14
14
|
const ActiveTransactions = (props) => {
|
|
15
15
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
16
16
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
17
|
-
const { account } = (0,
|
|
17
|
+
const { account } = (0, hooks_1.useAccount)();
|
|
18
18
|
const executingRoutes = (0, stores_1.useExecutingRoutesIds)(account.address);
|
|
19
19
|
if (!executingRoutes?.length) {
|
|
20
20
|
return null;
|
|
@@ -3,23 +3,24 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.AmountInputEndAdornment = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
-
const big_js_1 = require("big.js");
|
|
7
6
|
const react_hook_form_1 = require("react-hook-form");
|
|
8
7
|
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const viem_1 = require("viem");
|
|
9
9
|
const hooks_1 = require("../../hooks");
|
|
10
10
|
const providers_1 = require("../../providers");
|
|
11
|
-
const utils_1 = require("../../utils");
|
|
12
11
|
const AmountInputAdornment_style_1 = require("./AmountInputAdornment.style");
|
|
13
12
|
const AmountInputEndAdornment = ({ formType }) => {
|
|
14
13
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
15
14
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
16
|
-
const { getChainById } = (0, hooks_1.
|
|
15
|
+
const { getChainById } = (0, hooks_1.useAvailableChains)();
|
|
17
16
|
const [chainId, tokenAddress] = (0, react_hook_form_1.useWatch)({
|
|
18
17
|
name: [
|
|
19
18
|
providers_1.FormKeyHelper.getChainKey(formType),
|
|
20
19
|
providers_1.FormKeyHelper.getTokenKey(formType),
|
|
21
20
|
],
|
|
22
21
|
});
|
|
22
|
+
// We get gas recommendations for the source chain to make sure that after pressing the Max button
|
|
23
|
+
// the user will have enough funds remaining to cover gas costs
|
|
23
24
|
const { data } = (0, hooks_1.useGasRecommendation)(chainId);
|
|
24
25
|
const { token, isLoading } = (0, hooks_1.useTokenAddressBalance)(chainId, tokenAddress);
|
|
25
26
|
const handleMax = () => {
|
|
@@ -28,15 +29,13 @@ const AmountInputEndAdornment = ({ formType }) => {
|
|
|
28
29
|
if (chain?.nativeToken.address === tokenAddress &&
|
|
29
30
|
data?.available &&
|
|
30
31
|
data?.recommended) {
|
|
31
|
-
const tokenAmount =
|
|
32
|
-
const recommendedAmount = (
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
if (tokenAmount.gt(recommendedAmount)) {
|
|
36
|
-
maxAmount = (0, utils_1.formatTokenAmount)(tokenAmount.minus(recommendedAmount).toString());
|
|
32
|
+
const tokenAmount = token?.amount ?? 0n;
|
|
33
|
+
const recommendedAmount = BigInt(data.recommended.amount) / 2n;
|
|
34
|
+
if (tokenAmount > recommendedAmount) {
|
|
35
|
+
maxAmount = tokenAmount - recommendedAmount;
|
|
37
36
|
}
|
|
38
37
|
}
|
|
39
|
-
setValue(providers_1.FormKeyHelper.getAmountKey(formType), maxAmount
|
|
38
|
+
setValue(providers_1.FormKeyHelper.getAmountKey(formType), maxAmount && token ? (0, viem_1.formatUnits)(maxAmount, token.decimals) : '', {
|
|
40
39
|
shouldTouch: true,
|
|
41
40
|
});
|
|
42
41
|
};
|
|
@@ -31,7 +31,7 @@ const FormPriceHelperTextBase = ({ formType, isLoading, tokenAddress, token }) =
|
|
|
31
31
|
}, children: t(`format.currency`, {
|
|
32
32
|
value: fromAmountTokenPrice,
|
|
33
33
|
}) }), isLoading && tokenAddress ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { variant: "text", width: 48, height: 16, sx: { borderRadius: 0.25 } })) : token?.amount ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", lineHeight: 1.3334, pl: 0.25, children: `/ ${t(`format.number`, {
|
|
34
|
-
value: (0, utils_1.formatTokenAmount)(token
|
|
34
|
+
value: (0, utils_1.formatTokenAmount)(token.amount, token.decimals),
|
|
35
35
|
})}` })) : null] }));
|
|
36
36
|
};
|
|
37
37
|
exports.FormPriceHelperTextBase = FormPriceHelperTextBase;
|
|
@@ -5,26 +5,27 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const lab_1 = require("@mui/lab");
|
|
6
6
|
const react_i18next_1 = require("react-i18next");
|
|
7
7
|
const react_router_dom_1 = require("react-router-dom");
|
|
8
|
+
const hooks_1 = require("../../hooks");
|
|
8
9
|
const providers_1 = require("../../providers");
|
|
9
10
|
const utils_1 = require("../../utils");
|
|
10
11
|
const BaseTransactionButton = ({ onClick, text, disabled, loading, }) => {
|
|
11
12
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
12
13
|
const navigate = (0, react_router_dom_1.useNavigate)();
|
|
13
14
|
const { walletManagement } = (0, providers_1.useWidgetConfig)();
|
|
14
|
-
const { account
|
|
15
|
+
const { account } = (0, hooks_1.useAccount)();
|
|
15
16
|
const handleClick = async () => {
|
|
16
|
-
if (account.
|
|
17
|
+
if (account.isConnected) {
|
|
17
18
|
onClick?.();
|
|
18
19
|
}
|
|
19
20
|
else if (walletManagement) {
|
|
20
|
-
await connect();
|
|
21
|
+
await walletManagement.connect();
|
|
21
22
|
}
|
|
22
23
|
else {
|
|
23
24
|
navigate(utils_1.navigationRoutes.selectWallet);
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
27
|
const getButtonText = () => {
|
|
27
|
-
if (account.
|
|
28
|
+
if (account.isConnected) {
|
|
28
29
|
if (text) {
|
|
29
30
|
return text;
|
|
30
31
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
export declare const CardLabel: import("@emotion/styled").StyledComponent<import("@mui/system").BoxOwnProps<import("@mui/material").Theme> & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
3
3
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
4
4
|
}, keyof import("@mui/system").BoxOwnProps<import("@mui/material").Theme>> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
5
|
-
type?: "
|
|
5
|
+
type?: "insurance" | "active" | "insurance-icon" | undefined;
|
|
6
6
|
}, {}, {}>;
|
|
7
7
|
export declare const CardLabelTypography: import("@emotion/styled").StyledComponent<import("@mui/material").TypographyOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
8
8
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ChainSelect = void 0;
|
|
4
4
|
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
5
|
const material_1 = require("@mui/material");
|
|
6
|
+
const react_1 = require("react");
|
|
6
7
|
const react_hook_form_1 = require("react-hook-form");
|
|
7
8
|
const react_router_dom_1 = require("react-router-dom");
|
|
8
9
|
const providers_1 = require("../../providers");
|
|
@@ -16,11 +17,13 @@ const ChainSelect = ({ formType }) => {
|
|
|
16
17
|
const [chainId] = (0, react_hook_form_1.useWatch)({
|
|
17
18
|
name: [providers_1.FormKeyHelper.getChainKey(formType)],
|
|
18
19
|
});
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
(0, react_1.useEffect)(() => {
|
|
21
|
+
const hasChainInOrderedList = chainOrder.includes(chainId);
|
|
22
|
+
// If we don't have a chain in the ordered chain list we should add it.
|
|
23
|
+
if (!hasChainInOrderedList) {
|
|
24
|
+
setChainOrder(chainId);
|
|
25
|
+
}
|
|
26
|
+
}, [chainId, chainOrder, setChainOrder]);
|
|
24
27
|
const showAllChains = () => {
|
|
25
28
|
navigate(utils_1.navigationRoutes[`${formType}Chain`]);
|
|
26
29
|
};
|
|
@@ -5,11 +5,13 @@ const react_hook_form_1 = require("react-hook-form");
|
|
|
5
5
|
const hooks_1 = require("../../hooks");
|
|
6
6
|
const providers_1 = require("../../providers");
|
|
7
7
|
const stores_1 = require("../../stores");
|
|
8
|
+
const types_1 = require("../../types");
|
|
8
9
|
const useChainSelect = (formType) => {
|
|
10
|
+
const { requiredUI } = (0, providers_1.useWidgetConfig)();
|
|
9
11
|
const chainKey = providers_1.FormKeyHelper.getChainKey(formType);
|
|
10
12
|
const { field: { onChange, onBlur }, } = (0, react_hook_form_1.useController)({ name: chainKey });
|
|
11
|
-
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
12
|
-
const { chains, isLoading } = (0, hooks_1.useChains)();
|
|
13
|
+
const { setValue, getValues } = (0, react_hook_form_1.useFormContext)();
|
|
14
|
+
const { chains, isLoading, getChainById } = (0, hooks_1.useChains)();
|
|
13
15
|
const [chainOrder, setChainOrder] = (0, stores_1.useChainOrder)();
|
|
14
16
|
const swapOnly = (0, hooks_1.useSwapOnly)();
|
|
15
17
|
const getChains = () => {
|
|
@@ -32,6 +34,23 @@ const useChainSelect = (formType) => {
|
|
|
32
34
|
setValue(providers_1.FormKeyHelper.getTokenKey(formType), '');
|
|
33
35
|
setValue(providers_1.FormKeyHelper.getAmountKey(formType), '');
|
|
34
36
|
setValue(providers_1.FormKey.TokenSearchFilter, '');
|
|
37
|
+
const [fromChainId, toChainId] = getValues([
|
|
38
|
+
providers_1.FormKey.FromChain,
|
|
39
|
+
providers_1.FormKey.ToChain,
|
|
40
|
+
]);
|
|
41
|
+
const fromChain = getChainById(fromChainId);
|
|
42
|
+
const toChain = getChainById(toChainId);
|
|
43
|
+
const differentChainType = fromChain && toChain && fromChain.chainType !== toChain.chainType;
|
|
44
|
+
const requiredToAddress = requiredUI?.includes(types_1.RequiredUI.ToAddress) || differentChainType;
|
|
45
|
+
// toAddress field is required (always visible) when bridging between
|
|
46
|
+
// two ecosystems (fromChain and toChain have different chain types).
|
|
47
|
+
// We clean up toAddress on every chain change if toAddress is not required.
|
|
48
|
+
// This is used when we switch between different chain ecosystems (chain types) and
|
|
49
|
+
// prevents cases when after we switch the chain from one type to another "Send to wallet" field hides,
|
|
50
|
+
// but it keeps toAddress value set for the previous chain pair.
|
|
51
|
+
if (!requiredToAddress) {
|
|
52
|
+
setValue(providers_1.FormKey.ToAddress, '');
|
|
53
|
+
}
|
|
35
54
|
setChainOrder(chainId);
|
|
36
55
|
};
|
|
37
56
|
return {
|
|
@@ -5,15 +5,14 @@ const material_1 = require("@mui/material");
|
|
|
5
5
|
const Switch_1 = require("@mui/material/Switch");
|
|
6
6
|
const styles_1 = require("@mui/material/styles");
|
|
7
7
|
const Switch_2 = require("../Switch");
|
|
8
|
+
const utils_1 = require("../../utils");
|
|
8
9
|
const MessageCard = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
9
10
|
borderRadius: theme.shape.borderRadius,
|
|
10
11
|
position: 'relative',
|
|
11
12
|
whiteSpace: 'pre-line',
|
|
12
13
|
}));
|
|
13
14
|
exports.WarningMessageCard = (0, styles_1.styled)(MessageCard)(({ theme }) => ({
|
|
14
|
-
backgroundColor: theme
|
|
15
|
-
? (0, styles_1.alpha)(theme.palette.warning.main, 0.32)
|
|
16
|
-
: (0, styles_1.alpha)(theme.palette.warning.main, 0.16),
|
|
15
|
+
backgroundColor: (0, utils_1.getWarningBackgroundColor)(theme),
|
|
17
16
|
}));
|
|
18
17
|
exports.WarningMessageCardTitle = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
19
18
|
color: theme.palette.mode === 'light'
|
|
@@ -21,9 +20,7 @@ exports.WarningMessageCardTitle = (0, styles_1.styled)(material_1.Box)(({ theme
|
|
|
21
20
|
: (0, styles_1.alpha)(theme.palette.warning.main, 1),
|
|
22
21
|
}));
|
|
23
22
|
exports.InfoMessageCard = (0, styles_1.styled)(MessageCard)(({ theme }) => ({
|
|
24
|
-
backgroundColor: theme
|
|
25
|
-
? (0, styles_1.alpha)(theme.palette.info.main, 0.12)
|
|
26
|
-
: (0, styles_1.alpha)(theme.palette.info.main, 0.16),
|
|
23
|
+
backgroundColor: (0, utils_1.getInfoBackgroundColor)(theme),
|
|
27
24
|
}));
|
|
28
25
|
exports.InfoMessageCardTitle = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
29
26
|
color: theme.palette.mode === 'light'
|
|
@@ -5,6 +5,7 @@ const jsx_runtime_1 = require("react/jsx-runtime");
|
|
|
5
5
|
const EvStation_1 = require("@mui/icons-material/EvStation");
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_i18next_1 = require("react-i18next");
|
|
8
|
+
const viem_1 = require("viem");
|
|
8
9
|
const GasMessage_style_1 = require("./GasMessage.style");
|
|
9
10
|
const GasSufficiencyMessage = ({ insufficientGas, }) => {
|
|
10
11
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
@@ -13,7 +14,7 @@ const GasSufficiencyMessage = ({ insufficientGas, }) => {
|
|
|
13
14
|
} }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", fontWeight: 700, children: t(`warning.title.insufficientGas`) })] }), (0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body2", px: 2, pt: 1, children: t(`warning.message.insufficientGas`) }), insufficientGas?.map((item, index) => ((0, jsx_runtime_1.jsx)(material_1.Typography
|
|
14
15
|
// eslint-disable-next-line react/no-array-index-key
|
|
15
16
|
, { variant: "body2", px: 2, pb: insufficientGas?.length - 1 === index ? 2 : 0, pt: 0.5, children: t(`main.tokenOnChainAmount`, {
|
|
16
|
-
amount: item.insufficientAmount
|
|
17
|
+
amount: (0, viem_1.formatUnits)(item.insufficientAmount ?? 0n, item.token.decimals),
|
|
17
18
|
tokenSymbol: item.token.symbol,
|
|
18
19
|
chainName: item.chain?.name,
|
|
19
20
|
}) }, 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,9 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DrawerWalletContainer = exports.WalletButton = exports.Container = exports.HeaderAppBar = void 0;
|
|
3
|
+
exports.SplitTabs = exports.HeaderControlsContainer = exports.DrawerWalletContainer = exports.WalletButton = exports.Container = exports.HeaderAppBar = void 0;
|
|
4
4
|
const material_1 = require("@mui/material");
|
|
5
5
|
const Button_1 = require("@mui/material/Button");
|
|
6
6
|
const styles_1 = require("@mui/material/styles");
|
|
7
|
+
const Tabs_1 = require("../Tabs");
|
|
7
8
|
exports.HeaderAppBar = (0, styles_1.styled)(material_1.AppBar)(({ theme }) => ({
|
|
8
9
|
backgroundColor: 'transparent',
|
|
9
10
|
color: theme.palette.text.primary,
|
|
@@ -45,6 +46,11 @@ exports.WalletButton = (0, styles_1.styled)(material_1.Button)(({ theme }) => ({
|
|
|
45
46
|
[`.${Button_1.buttonClasses.startIcon} > *:nth-of-type(1)`]: {
|
|
46
47
|
fontSize: '24px',
|
|
47
48
|
},
|
|
49
|
+
[`&:hover .${material_1.badgeClasses.badge} > div`]: {
|
|
50
|
+
borderColor: theme.palette.mode === 'light'
|
|
51
|
+
? (0, styles_1.alpha)(theme.palette.common.black, 0.04)
|
|
52
|
+
: (0, styles_1.alpha)(theme.palette.common.white, 0.08),
|
|
53
|
+
},
|
|
48
54
|
}));
|
|
49
55
|
exports.DrawerWalletContainer = (0, styles_1.styled)(material_1.Box)(() => ({
|
|
50
56
|
width: '100%',
|
|
@@ -54,3 +60,12 @@ exports.DrawerWalletContainer = (0, styles_1.styled)(material_1.Box)(() => ({
|
|
|
54
60
|
marginLeft: '-0.5rem',
|
|
55
61
|
},
|
|
56
62
|
}));
|
|
63
|
+
exports.HeaderControlsContainer = (0, styles_1.styled)(material_1.Box)(({ theme }) => ({
|
|
64
|
+
display: 'flex',
|
|
65
|
+
gap: theme.spacing(0.5),
|
|
66
|
+
}));
|
|
67
|
+
exports.SplitTabs = (0, styles_1.styled)(Tabs_1.Tabs)(({ theme }) => ({
|
|
68
|
+
backgroundColor: theme.palette.mode === 'dark'
|
|
69
|
+
? theme.palette.background.paper
|
|
70
|
+
: (0, styles_1.alpha)(theme.palette.common.black, 0.04),
|
|
71
|
+
}));
|