@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
|
@@ -14,12 +14,13 @@ const SendToWalletButton = () => {
|
|
|
14
14
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
15
15
|
const { setValue } = (0, react_hook_form_1.useFormContext)();
|
|
16
16
|
const emitter = (0, hooks_1.useWidgetEvents)();
|
|
17
|
-
const { disabledUI, hiddenUI
|
|
17
|
+
const { disabledUI, hiddenUI } = (0, providers_1.useWidgetConfig)();
|
|
18
18
|
const { showSendToWallet, toggleSendToWallet } = (0, stores_1.useSendToWalletStore)();
|
|
19
19
|
const { showDestinationWallet } = (0, stores_1.useSettings)(['showDestinationWallet']);
|
|
20
|
+
const requiredToAddress = (0, hooks_1.useRequiredToAddress)();
|
|
20
21
|
if (!showDestinationWallet ||
|
|
21
22
|
hiddenUI?.includes(types_1.HiddenUI.ToAddress) ||
|
|
22
|
-
|
|
23
|
+
requiredToAddress) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
26
|
const handleClick = () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const SettingsListItemButton: import("@emotion/styled").StyledComponent<import("@mui/material").ListItemButtonOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & 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
|
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "autoFocus" | "alignItems" | "divider" | "dense" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material/styles").Theme>, {}, {}>;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SettingsListItemButton = void 0;
|
|
4
|
+
const styles_1 = require("@mui/material/styles");
|
|
5
|
+
const ListItemButton_1 = require("./ListItemButton");
|
|
6
|
+
exports.SettingsListItemButton = (0, styles_1.styled)(ListItemButton_1.ListItemButton)(({ theme }) => ({
|
|
7
|
+
paddingRight: theme.spacing(1),
|
|
8
|
+
}));
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { LiFiStepExtended } from '@lifi/sdk';
|
|
3
3
|
export declare const DestinationWalletAddress: React.FC<{
|
|
4
|
-
step:
|
|
4
|
+
step: LiFiStepExtended;
|
|
5
5
|
toAddress: string;
|
|
6
6
|
toAddressLink: string;
|
|
7
7
|
}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { LiFiStepExtended, TokenAmount } from '@lifi/sdk';
|
|
3
3
|
export declare const Step: React.FC<{
|
|
4
|
-
step:
|
|
4
|
+
step: LiFiStepExtended;
|
|
5
5
|
fromToken?: TokenAmount;
|
|
6
6
|
toToken?: TokenAmount;
|
|
7
7
|
toAddress?: string;
|
|
@@ -16,7 +16,7 @@ const StepProcess_1 = require("./StepProcess");
|
|
|
16
16
|
const StepTimer_1 = require("./StepTimer");
|
|
17
17
|
const Step = ({ step, fromToken, toToken, toAddress }) => {
|
|
18
18
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
19
|
-
const { getChainById } = (0, hooks_1.
|
|
19
|
+
const { getChainById } = (0, hooks_1.useAvailableChains)();
|
|
20
20
|
const { subvariant } = (0, providers_1.useWidgetConfig)();
|
|
21
21
|
const stepHasError = step.execution?.process.some((process) => process.status === 'FAILED');
|
|
22
22
|
const getCardTitle = () => {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { RouteExtended } from '@lifi/sdk';
|
|
2
2
|
import type { WidgetSubvariant } from '../../types';
|
|
3
|
-
export declare const getStepList: (route?:
|
|
3
|
+
export declare const getStepList: (route?: RouteExtended, subvariant?: WidgetSubvariant) => import("react/jsx-runtime").JSX.Element[] | undefined;
|
|
@@ -8,16 +8,16 @@ const Step_1 = require("./Step");
|
|
|
8
8
|
const getStepList = (route, subvariant) => route?.steps.map((step, index, steps) => {
|
|
9
9
|
const lastIndex = steps.length - 1;
|
|
10
10
|
const fromToken = index === 0
|
|
11
|
-
? { ...step.action.fromToken, amount: step.action.fromAmount }
|
|
11
|
+
? { ...step.action.fromToken, amount: BigInt(step.action.fromAmount) }
|
|
12
12
|
: undefined;
|
|
13
13
|
const toToken = index === lastIndex
|
|
14
14
|
? {
|
|
15
15
|
...(step.execution?.toToken ?? step.action?.toToken),
|
|
16
16
|
amount: step.execution?.toAmount
|
|
17
|
-
? step.execution.toAmount
|
|
17
|
+
? BigInt(step.execution.toAmount)
|
|
18
18
|
: subvariant === 'nft'
|
|
19
|
-
? route.toAmount
|
|
20
|
-
: step.estimate.toAmount,
|
|
19
|
+
? BigInt(route.toAmount)
|
|
20
|
+
: BigInt(step.estimate.toAmount),
|
|
21
21
|
}
|
|
22
22
|
: undefined;
|
|
23
23
|
const toAddress = index === lastIndex && route.fromAddress !== route.toAddress
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { LiFiStep, StepExtended } from '@lifi/sdk';
|
|
3
3
|
import type { WidgetSubvariant } from '../../types';
|
|
4
4
|
import type { StepActionsProps, StepDetailsLabelProps } from './types';
|
|
5
5
|
export declare const StepActions: React.FC<StepActionsProps>;
|
|
6
6
|
export declare const IncludedSteps: React.FC<{
|
|
7
|
-
step:
|
|
7
|
+
step: LiFiStep;
|
|
8
8
|
subvariant?: WidgetSubvariant;
|
|
9
9
|
}>;
|
|
10
10
|
export declare const StepDetailsContent: React.FC<{
|
|
11
|
-
step:
|
|
11
|
+
step: StepExtended;
|
|
12
12
|
subvariant?: WidgetSubvariant;
|
|
13
13
|
}>;
|
|
14
14
|
export declare const CustomStepDetailsLabel: React.FC<StepDetailsLabelProps>;
|
|
@@ -6,9 +6,9 @@ const ArrowForward_1 = require("@mui/icons-material/ArrowForward");
|
|
|
6
6
|
const ExpandLess_1 = require("@mui/icons-material/ExpandLess");
|
|
7
7
|
const ExpandMore_1 = require("@mui/icons-material/ExpandMore");
|
|
8
8
|
const material_1 = require("@mui/material");
|
|
9
|
-
const big_js_1 = require("big.js");
|
|
10
9
|
const react_1 = require("react");
|
|
11
10
|
const react_i18next_1 = require("react-i18next");
|
|
11
|
+
const viem_1 = require("viem");
|
|
12
12
|
const hooks_1 = require("../../hooks");
|
|
13
13
|
const icons_1 = require("../../icons");
|
|
14
14
|
const providers_1 = require("../../providers");
|
|
@@ -29,7 +29,7 @@ const StepActions = ({ step, dense, ...other }) => {
|
|
|
29
29
|
const toolDetails = subvariant === 'nft'
|
|
30
30
|
? step.includedSteps.find((step) => step.tool === 'custom' && step.toolDetails.key !== 'custom')?.toolDetails || step.toolDetails
|
|
31
31
|
: step.toolDetails;
|
|
32
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ...other, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: (0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, {
|
|
32
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ...other, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "center", children: [(0, jsx_runtime_1.jsx)(material_1.Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: (0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, { src: icons_1.LiFiToolLogo }), children: (0, jsx_runtime_1.jsx)(StepActions_style_1.StepAvatar, { variant: "circular", src: toolDetails.logoURI ?? icons_1.LiFiToolLogo, alt: toolDetails.name, children: toolDetails.name[0] }) }), (0, jsx_runtime_1.jsx)(material_1.Typography, { ml: 2, fontSize: 18, fontWeight: "500", flex: 1, children: t(`main.stepDetails`, {
|
|
33
33
|
tool: toolDetails.name,
|
|
34
34
|
}) }), hasCollapsedSteps ? ((0, jsx_runtime_1.jsx)(Card_1.CardIconButton, { onClick: handleExpand, size: "small", children: cardExpanded ? (0, jsx_runtime_1.jsx)(ExpandLess_1.default, {}) : (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}) })) : null] }), hasCollapsedSteps ? ((0, jsx_runtime_1.jsx)(material_1.Collapse, { timeout: 225, in: cardExpanded, mountOnEnter: true, unmountOnExit: true, children: (0, jsx_runtime_1.jsx)(exports.IncludedSteps, { step: step, subvariant: subvariant }) })) : ((0, jsx_runtime_1.jsx)(exports.IncludedSteps, { step: step, subvariant: subvariant }))] }));
|
|
35
35
|
};
|
|
@@ -57,23 +57,20 @@ const StepDetailsContent = ({ step, subvariant }) => {
|
|
|
57
57
|
step.action.fromToken.address === step.action.toToken.address;
|
|
58
58
|
let fromAmount;
|
|
59
59
|
if (sameTokenProtocolStep) {
|
|
60
|
-
const estimatedFromAmount = (
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
: (0, big_js_1.default)(step.estimate.fromAmount)
|
|
66
|
-
.div(10 ** step.action.fromToken.decimals)
|
|
67
|
-
.toString();
|
|
60
|
+
const estimatedFromAmount = BigInt(step.estimate.fromAmount) - BigInt(step.estimate.toAmount);
|
|
61
|
+
fromAmount =
|
|
62
|
+
estimatedFromAmount > 0n
|
|
63
|
+
? (0, viem_1.formatUnits)(estimatedFromAmount, step.action.fromToken.decimals)
|
|
64
|
+
: (0, viem_1.formatUnits)(BigInt(step.estimate.fromAmount), step.action.fromToken.decimals);
|
|
68
65
|
}
|
|
69
66
|
else {
|
|
70
|
-
fromAmount = (0, utils_1.formatTokenAmount)(step.estimate.fromAmount, step.action.fromToken.decimals);
|
|
67
|
+
fromAmount = (0, utils_1.formatTokenAmount)(BigInt(step.estimate.fromAmount), step.action.fromToken.decimals);
|
|
71
68
|
}
|
|
72
69
|
const showToAmount = step.type !== 'custom' && step.tool !== 'custom' && !sameTokenProtocolStep;
|
|
73
70
|
return ((0, jsx_runtime_1.jsxs)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", alignItems: "center", display: "flex", children: [t('format.number', {
|
|
74
71
|
value: fromAmount,
|
|
75
72
|
}), ' ', step.action.fromToken.symbol, showToAmount ? ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)(ArrowForward_1.default, { sx: { fontSize: 18, paddingX: 0.5 } }), t('format.number', {
|
|
76
|
-
value: (0, utils_1.formatTokenAmount)(step.execution?.toAmount ?? step.estimate.toAmount, step.execution?.toToken?.decimals ?? step.action.toToken.decimals),
|
|
73
|
+
value: (0, utils_1.formatTokenAmount)(BigInt(step.execution?.toAmount ?? step.estimate.toAmount), step.execution?.toToken?.decimals ?? step.action.toToken.decimals),
|
|
77
74
|
}), ' ', step.execution?.toToken?.symbol ?? step.action.toToken.symbol] })) : null] }));
|
|
78
75
|
};
|
|
79
76
|
exports.StepDetailsContent = StepDetailsContent;
|
|
@@ -94,7 +91,7 @@ const CustomStepDetailsLabel = ({ step, subvariant, }) => {
|
|
|
94
91
|
exports.CustomStepDetailsLabel = CustomStepDetailsLabel;
|
|
95
92
|
const CrossStepDetailsLabel = ({ step }) => {
|
|
96
93
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
97
|
-
const { getChainById } = (0, hooks_1.
|
|
94
|
+
const { getChainById } = (0, hooks_1.useAvailableChains)();
|
|
98
95
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", children: t('main.crossStepDetails', {
|
|
99
96
|
from: getChainById(step.action.fromChainId)?.name,
|
|
100
97
|
to: getChainById(step.action.toChainId)?.name,
|
|
@@ -104,7 +101,7 @@ const CrossStepDetailsLabel = ({ step }) => {
|
|
|
104
101
|
exports.CrossStepDetailsLabel = CrossStepDetailsLabel;
|
|
105
102
|
const SwapStepDetailsLabel = ({ step }) => {
|
|
106
103
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
107
|
-
const { getChainById } = (0, hooks_1.
|
|
104
|
+
const { getChainById } = (0, hooks_1.useAvailableChains)();
|
|
108
105
|
return ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontSize: 12, fontWeight: "500", color: "text.secondary", children: t('main.swapStepDetails', {
|
|
109
106
|
chain: getChainById(step.action.fromChainId)?.name,
|
|
110
107
|
tool: step.toolDetails.name,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { LiFiStep, Step } from '@lifi/sdk';
|
|
2
2
|
import type { BoxProps } from '@mui/material';
|
|
3
3
|
import type { WidgetSubvariant } from '../../types';
|
|
4
4
|
export interface StepActionsProps extends BoxProps {
|
|
5
|
-
step:
|
|
5
|
+
step: LiFiStep;
|
|
6
6
|
dense?: boolean;
|
|
7
7
|
}
|
|
8
8
|
export interface StepDetailsLabelProps {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import type { StyledComponent } from '@emotion/styled';
|
|
3
3
|
import type { TabsProps } from '@mui/material';
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const
|
|
4
|
+
export declare const Tabs: StyledComponent<TabsProps>;
|
|
5
|
+
export declare const Tab: StyledComponent<import("@mui/material").TabOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
6
6
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
7
7
|
}, "className" | "style" | "classes" | "action" | "centerRipple" | "children" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "tabIndex" | "TouchRippleProps" | "touchRippleRef" | "label" | "disableFocusRipple" | "value" | "icon" | "iconPosition" | "wrapped"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
8
8
|
component?: import("react").ElementType<any> | undefined;
|
|
@@ -1,61 +1,39 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Tab = exports.Tabs = void 0;
|
|
4
4
|
const material_1 = require("@mui/material");
|
|
5
5
|
const styles_1 = require("@mui/material/styles");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
: (0, styles_1.alpha)(theme.palette.common.black, 0.04),
|
|
6
|
+
const utils_1 = require("../../utils");
|
|
7
|
+
exports.Tabs = (0, styles_1.styled)(material_1.Tabs)(({ theme }) => ({
|
|
8
|
+
backgroundColor: (0, utils_1.getCardFieldsetBackgroundColor)(theme),
|
|
10
9
|
borderRadius: Math.max(theme.shape.borderRadius, theme.shape.borderRadiusSecondary),
|
|
11
10
|
padding: theme.spacing(0.5),
|
|
12
11
|
flex: 1,
|
|
13
|
-
display: 'flex',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
height: 56,
|
|
16
|
-
[`.${material_1.tabsClasses.flexContainer}`]: {
|
|
17
|
-
alignItems: 'center',
|
|
18
|
-
},
|
|
19
|
-
[`.${material_1.tabsClasses.scroller}`]: {
|
|
20
|
-
overflow: 'initial !important',
|
|
21
|
-
},
|
|
22
12
|
[`.${material_1.tabsClasses.indicator}`]: {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
transform: 'translateY(-50%)',
|
|
26
|
-
height: 48,
|
|
13
|
+
height: '100%',
|
|
14
|
+
width: '100%',
|
|
27
15
|
backgroundColor: theme.palette.mode === 'dark'
|
|
28
16
|
? theme.palette.background.default
|
|
29
17
|
: theme.palette.common.white,
|
|
30
|
-
borderRadius: theme.shape.borderRadiusSecondary
|
|
18
|
+
borderRadius: Math.max(theme.shape.borderRadius, theme.shape.borderRadiusSecondary) -
|
|
19
|
+
4,
|
|
31
20
|
boxShadow: `0px 2px 4px ${(0, styles_1.alpha)(theme.palette.common.black, 0.04)}`,
|
|
32
21
|
},
|
|
33
22
|
}));
|
|
34
|
-
exports.
|
|
23
|
+
exports.Tab = (0, styles_1.styled)(material_1.Tab, {
|
|
35
24
|
shouldForwardProp: (prop) => prop !== 'isDarkMode',
|
|
36
25
|
})(({ theme }) => ({
|
|
37
26
|
zIndex: 1,
|
|
38
|
-
display: 'flex',
|
|
39
27
|
flex: 1,
|
|
40
|
-
justifyContent: 'center',
|
|
41
|
-
alignItems: 'center',
|
|
42
|
-
flexDirection: 'row',
|
|
43
28
|
textTransform: 'none',
|
|
44
|
-
height: 48,
|
|
45
|
-
minHeight: 48,
|
|
46
29
|
fontSize: '1rem',
|
|
47
30
|
fontWeight: 700,
|
|
48
31
|
color: theme.palette.mode === 'dark'
|
|
49
32
|
? theme.palette.common.white
|
|
50
33
|
: theme.palette.common.black,
|
|
51
|
-
textDecoration: 'none',
|
|
52
34
|
[`&.${material_1.tabClasses.selected}`]: {
|
|
53
35
|
color: theme.palette.mode === 'dark'
|
|
54
36
|
? theme.palette.common.white
|
|
55
37
|
: theme.palette.common.black,
|
|
56
|
-
backgroundColor: 'transparent',
|
|
57
|
-
},
|
|
58
|
-
[`.${material_1.tabClasses.iconWrapper}`]: {
|
|
59
|
-
margin: theme.spacing(0, 1, 0, 0),
|
|
60
38
|
},
|
|
61
39
|
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './Tabs.style';
|
|
@@ -14,4 +14,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./Tabs.style"), exports);
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import type {
|
|
2
|
+
import type { LiFiStep, TokenAmount } from '@lifi/sdk';
|
|
3
3
|
import type { BoxProps } from '@mui/material';
|
|
4
4
|
interface TokenProps {
|
|
5
|
-
token
|
|
5
|
+
token: TokenAmount;
|
|
6
6
|
connected?: boolean;
|
|
7
|
-
step?:
|
|
7
|
+
step?: LiFiStep;
|
|
8
8
|
disableDescription?: boolean;
|
|
9
9
|
isLoading?: boolean;
|
|
10
10
|
}
|
|
@@ -11,22 +11,22 @@ const TextFitter_1 = require("../TextFitter");
|
|
|
11
11
|
const TokenAvatar_1 = require("../TokenAvatar");
|
|
12
12
|
const Token_style_1 = require("./Token.style");
|
|
13
13
|
const Token = ({ token, ...other }) => {
|
|
14
|
-
if (!token
|
|
14
|
+
if (!token.priceUSD || !token.logoURI) {
|
|
15
15
|
return (0, jsx_runtime_1.jsx)(exports.TokenFallback, { token: token, ...other });
|
|
16
16
|
}
|
|
17
17
|
return (0, jsx_runtime_1.jsx)(exports.TokenBase, { token: token, ...other });
|
|
18
18
|
};
|
|
19
19
|
exports.Token = Token;
|
|
20
20
|
const TokenFallback = ({ token, isLoading, ...other }) => {
|
|
21
|
-
const { token: chainToken, isLoading: isLoadingToken } = (0, hooks_1.useToken)(token
|
|
21
|
+
const { token: chainToken, isLoading: isLoadingToken } = (0, hooks_1.useToken)(token.chainId, token.address);
|
|
22
22
|
return ((0, jsx_runtime_1.jsx)(exports.TokenBase, { token: { ...token, ...chainToken }, isLoading: isLoading || isLoadingToken, ...other }));
|
|
23
23
|
};
|
|
24
24
|
exports.TokenFallback = TokenFallback;
|
|
25
25
|
const TokenBase = ({ token, connected, step, disableDescription, isLoading, ...other }) => {
|
|
26
26
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
27
27
|
const { chain } = (0, hooks_1.useChain)(token?.chainId);
|
|
28
|
-
const formattedTokenAmount = (0, utils_1.formatTokenAmount)(token
|
|
29
|
-
const formattedTokenPrice = (0, utils_1.formatTokenPrice)(formattedTokenAmount, token
|
|
28
|
+
const formattedTokenAmount = (0, utils_1.formatTokenAmount)(token.amount, token.decimals);
|
|
29
|
+
const formattedTokenPrice = (0, utils_1.formatTokenPrice)(formattedTokenAmount, token.priceUSD);
|
|
30
30
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { flex: 1, ...other, children: [(0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", flex: 1, alignItems: "center", children: [(0, jsx_runtime_1.jsx)(TokenAvatar_1.TokenAvatar, { token: token, chain: chain, isLoading: isLoading, sx: { marginRight: 2 } }), isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 112, height: 32, variant: "text" })) : ((0, jsx_runtime_1.jsx)(TextFitter_1.TextFitter, { height: 30, textStyle: {
|
|
31
31
|
fontWeight: 700,
|
|
32
32
|
}, children: t('format.number', {
|
|
@@ -34,7 +34,7 @@ const TokenBase = ({ token, connected, step, disableDescription, isLoading, ...o
|
|
|
34
34
|
}) }))] }), (0, jsx_runtime_1.jsxs)(Token_style_1.TextSecondaryContainer, { connected: connected, component: "span", children: [isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 48, height: 12, variant: "rounded", sx: { marginTop: 0.5 } })) : ((0, jsx_runtime_1.jsx)(Token_style_1.TextSecondary, { connected: connected, children: t(`format.currency`, {
|
|
35
35
|
value: formattedTokenPrice,
|
|
36
36
|
}) })), !disableDescription ? ((0, jsx_runtime_1.jsx)(Token_style_1.TextSecondary, { connected: connected, px: 0.5, dot: true, children: "\u2022" })) : null, !step && !disableDescription ? (isLoading ? ((0, jsx_runtime_1.jsx)(material_1.Skeleton, { width: 96, height: 12, variant: "rounded", sx: { marginTop: 0.5 } })) : ((0, jsx_runtime_1.jsx)(Token_style_1.TextSecondary, { connected: connected, children: t(`main.tokenOnChain`, {
|
|
37
|
-
tokenSymbol: token
|
|
37
|
+
tokenSymbol: token.symbol,
|
|
38
38
|
chainName: chain?.name,
|
|
39
39
|
}) }))) : null, step ? ((0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", alignItems: "flex-end", height: 12, mt: 0.5, children: [(0, jsx_runtime_1.jsx)(material_1.Box, { pr: 0.75, children: (0, jsx_runtime_1.jsx)(SmallAvatar_1.SmallAvatar, { src: step.toolDetails.logoURI, alt: step.toolDetails.name, sx: {
|
|
40
40
|
border: 0,
|
|
@@ -12,7 +12,7 @@ const VirtualizedTokenList_1 = require("./VirtualizedTokenList");
|
|
|
12
12
|
const useTokenSelect_1 = require("./useTokenSelect");
|
|
13
13
|
const TokenList = ({ formType, height, onClick, }) => {
|
|
14
14
|
const parentRef = (0, react_1.useRef)(null);
|
|
15
|
-
const { account } = (0,
|
|
15
|
+
const { account } = (0, hooks_1.useAccount)();
|
|
16
16
|
const [selectedChainId] = (0, react_hook_form_1.useWatch)({
|
|
17
17
|
name: [providers_1.FormKeyHelper.getChainKey(formType)],
|
|
18
18
|
});
|
|
@@ -42,6 +42,6 @@ const TokenList = ({ formType, height, onClick, }) => {
|
|
|
42
42
|
? [searchedToken]
|
|
43
43
|
: filteredTokens;
|
|
44
44
|
const handleTokenClick = (0, useTokenSelect_1.useTokenSelect)(formType, onClick);
|
|
45
|
-
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, chain: chain, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.
|
|
45
|
+
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? ((0, jsx_runtime_1.jsx)(TokenNotFound_1.TokenNotFound, { formType: formType })) : null, (0, jsx_runtime_1.jsx)(VirtualizedTokenList_1.VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, chain: chain, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isConnected, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] }));
|
|
46
46
|
};
|
|
47
47
|
exports.TokenList = TokenList;
|
|
@@ -6,18 +6,22 @@ const OpenInNewRounded_1 = require("@mui/icons-material/OpenInNewRounded");
|
|
|
6
6
|
const material_1 = require("@mui/material");
|
|
7
7
|
const react_1 = require("react");
|
|
8
8
|
const react_i18next_1 = require("react-i18next");
|
|
9
|
+
const viem_1 = require("viem");
|
|
9
10
|
const utils_1 = require("../../utils");
|
|
10
11
|
const TokenList_style_1 = require("./TokenList.style");
|
|
11
|
-
|
|
12
|
+
const TokenListItem = ({ onClick, size, start, token, chain, showBalance, isBalanceLoading, startAdornment, endAdornment, }) => {
|
|
12
13
|
const handleClick = () => onClick?.(token.address);
|
|
13
14
|
return ((0, jsx_runtime_1.jsxs)(TokenList_style_1.ListItem, { disablePadding: true, style: {
|
|
14
15
|
height: `${size}px`,
|
|
15
16
|
transform: `translateY(${start}px)`,
|
|
16
17
|
}, children: [startAdornment, (0, jsx_runtime_1.jsx)(exports.TokenListItemButton, { token: token, chain: chain, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] }));
|
|
17
|
-
}
|
|
18
|
+
};
|
|
19
|
+
exports.TokenListItem = TokenListItem;
|
|
18
20
|
const TokenListItemButton = ({ onClick, token, chain, showBalance, isBalanceLoading, }) => {
|
|
19
21
|
const { t } = (0, react_i18next_1.useTranslation)();
|
|
20
|
-
const tokenPrice =
|
|
22
|
+
const tokenPrice = token.amount
|
|
23
|
+
? (0, utils_1.formatTokenPrice)((0, viem_1.formatUnits)(token.amount, token.decimals), token.priceUSD)
|
|
24
|
+
: undefined;
|
|
21
25
|
const container = (0, react_1.useRef)(null);
|
|
22
26
|
const timeoutId = (0, react_1.useRef)();
|
|
23
27
|
const [showAddress, setShowAddress] = (0, react_1.useState)(false);
|
|
@@ -36,8 +40,8 @@ const TokenListItemButton = ({ onClick, token, chain, showBalance, isBalanceLoad
|
|
|
36
40
|
position: 'absolute',
|
|
37
41
|
}, appear: false, children: (0, jsx_runtime_1.jsx)(material_1.Box, { pt: 0.25, children: token.name }) }), (0, jsx_runtime_1.jsx)(material_1.Slide, { direction: "up", in: showAddress, container: container.current, style: {
|
|
38
42
|
position: 'absolute',
|
|
39
|
-
}, appear: false, mountOnEnter: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", alignItems: "center", pt: 0.125, children: (0, utils_1.shortenAddress)(token.address) }), (0, jsx_runtime_1.jsx)(TokenList_style_1.IconButton, { size: "small", LinkComponent: material_1.Link, href: `${chain?.metamask.blockExplorerUrls[0]}address/${token.address}`, target: "_blank", rel: "nofollow noreferrer", onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsx)(OpenInNewRounded_1.default, {}) })] }) })] }) }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [
|
|
40
|
-
value: (0, utils_1.formatTokenAmount)(token.amount),
|
|
43
|
+
}, appear: false, mountOnEnter: true, children: (0, jsx_runtime_1.jsxs)(material_1.Box, { display: "flex", children: [(0, jsx_runtime_1.jsx)(material_1.Box, { display: "flex", alignItems: "center", pt: 0.125, children: (0, utils_1.shortenAddress)(token.address) }), (0, jsx_runtime_1.jsx)(TokenList_style_1.IconButton, { size: "small", LinkComponent: material_1.Link, href: `${chain?.metamask.blockExplorerUrls[0]}address/${token.address}`, target: "_blank", rel: "nofollow noreferrer", onClick: (e) => e.stopPropagation(), children: (0, jsx_runtime_1.jsx)(OpenInNewRounded_1.default, {}) })] }) })] }) }), showBalance ? (isBalanceLoading ? ((0, jsx_runtime_1.jsx)(exports.TokenAmountSkeleton, {})) : ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: { textAlign: 'right' }, children: [token.amount ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { variant: "body1", noWrap: true, children: t('format.number', {
|
|
44
|
+
value: (0, utils_1.formatTokenAmount)(token.amount, token.decimals),
|
|
41
45
|
}) })) : null, tokenPrice ? ((0, jsx_runtime_1.jsx)(material_1.Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
|
|
42
46
|
value: tokenPrice,
|
|
43
47
|
}) })) : null] }))) : null] }));
|
|
@@ -13,7 +13,7 @@ const TokenNotFound = ({ formType }) => {
|
|
|
13
13
|
const [selectedChainId] = (0, react_hook_form_1.useWatch)({
|
|
14
14
|
name: [providers_1.FormKeyHelper.getChainKey(formType)],
|
|
15
15
|
});
|
|
16
|
-
const { getChainById } = (0, hooks_1.
|
|
16
|
+
const { getChainById } = (0, hooks_1.useAvailableChains)();
|
|
17
17
|
return ((0, jsx_runtime_1.jsxs)(material_1.Box, { sx: {
|
|
18
18
|
display: 'flex',
|
|
19
19
|
justifyContent: 'center',
|
|
@@ -14,9 +14,9 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
|
|
|
14
14
|
const tokensLastIndex = tokens.length - 1;
|
|
15
15
|
const { getVirtualItems, getTotalSize, scrollToIndex } = (0, react_virtual_1.useVirtualizer)({
|
|
16
16
|
count: tokens.length,
|
|
17
|
-
getScrollElement: () => scrollElementRef.current,
|
|
18
17
|
overscan: 10,
|
|
19
18
|
paddingEnd: 12,
|
|
19
|
+
getScrollElement: () => scrollElementRef.current,
|
|
20
20
|
estimateSize: (index) => {
|
|
21
21
|
// heigth of TokenListItem
|
|
22
22
|
let size = 64;
|
|
@@ -38,6 +38,7 @@ const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef,
|
|
|
38
38
|
getItemKey: (index) => `${tokens[index].address}-${index}`,
|
|
39
39
|
});
|
|
40
40
|
(0, react_1.useEffect)(() => {
|
|
41
|
+
// Scroll to the top of the list when switching the chains
|
|
41
42
|
if (getVirtualItems().length) {
|
|
42
43
|
scrollToIndex(0, { align: 'start' });
|
|
43
44
|
}
|
|
@@ -7,7 +7,6 @@ exports.queryClient = new react_query_1.QueryClient({
|
|
|
7
7
|
queries: {
|
|
8
8
|
enabled: true,
|
|
9
9
|
staleTime: 3600000,
|
|
10
|
-
cacheTime: Infinity,
|
|
11
10
|
refetchInterval: false,
|
|
12
11
|
refetchIntervalInBackground: false,
|
|
13
12
|
refetchOnWindowFocus: true,
|
|
@@ -15,9 +14,6 @@ exports.queryClient = new react_query_1.QueryClient({
|
|
|
15
14
|
refetchOnMount: true,
|
|
16
15
|
retryOnMount: true,
|
|
17
16
|
// suspense: true,
|
|
18
|
-
onError: (error) => {
|
|
19
|
-
//
|
|
20
|
-
},
|
|
21
17
|
},
|
|
22
18
|
mutations: {
|
|
23
19
|
onError: (error) => {
|
package/cjs/config/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export declare const name = "@lifi/widget";
|
|
2
|
-
export declare const version = "
|
|
2
|
+
export declare const version = "3.0.0-alpha.0";
|
package/cjs/config/version.js
CHANGED
package/cjs/hooks/index.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
export * from './useAccount';
|
|
2
|
+
export * from './useAvailableChains';
|
|
1
3
|
export * from './useChain';
|
|
2
4
|
export * from './useChains';
|
|
3
5
|
export * from './useContentHeight';
|
|
@@ -9,13 +11,15 @@ export * from './useFromTokenSufficiency';
|
|
|
9
11
|
export * from './useGasRecommendation';
|
|
10
12
|
export * from './useGasRefuel';
|
|
11
13
|
export * from './useGasSufficiency';
|
|
12
|
-
export * from './useGetTokenBalancesWithRetry';
|
|
13
14
|
export * from './useInitializer';
|
|
15
|
+
export * from './useLanguages';
|
|
14
16
|
export * from './useNavigateBack';
|
|
15
17
|
export * from './useProcessMessage';
|
|
18
|
+
export * from './useRequiredToAddress';
|
|
16
19
|
export * from './useRouteExecution';
|
|
17
20
|
export * from './useRoutes';
|
|
18
21
|
export * from './useScrollableContainer';
|
|
22
|
+
export * from './useSettingMonitor';
|
|
19
23
|
export * from './useSwapOnly';
|
|
20
24
|
export * from './useToken';
|
|
21
25
|
export * from './useTokenAddressBalance';
|
|
@@ -24,4 +28,6 @@ export * from './useTokenBalances';
|
|
|
24
28
|
export * from './useTokenSearch';
|
|
25
29
|
export * from './useTokens';
|
|
26
30
|
export * from './useTools';
|
|
31
|
+
export * from './useTransactionDetails';
|
|
32
|
+
export * from './useTransactionHistory';
|
|
27
33
|
export * from './useWidgetEvents';
|
package/cjs/hooks/index.js
CHANGED
|
@@ -14,6 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useAccount"), exports);
|
|
18
|
+
__exportStar(require("./useAvailableChains"), exports);
|
|
17
19
|
__exportStar(require("./useChain"), exports);
|
|
18
20
|
__exportStar(require("./useChains"), exports);
|
|
19
21
|
__exportStar(require("./useContentHeight"), exports);
|
|
@@ -25,13 +27,15 @@ __exportStar(require("./useFromTokenSufficiency"), exports);
|
|
|
25
27
|
__exportStar(require("./useGasRecommendation"), exports);
|
|
26
28
|
__exportStar(require("./useGasRefuel"), exports);
|
|
27
29
|
__exportStar(require("./useGasSufficiency"), exports);
|
|
28
|
-
__exportStar(require("./useGetTokenBalancesWithRetry"), exports);
|
|
29
30
|
__exportStar(require("./useInitializer"), exports);
|
|
31
|
+
__exportStar(require("./useLanguages"), exports);
|
|
30
32
|
__exportStar(require("./useNavigateBack"), exports);
|
|
31
33
|
__exportStar(require("./useProcessMessage"), exports);
|
|
34
|
+
__exportStar(require("./useRequiredToAddress"), exports);
|
|
32
35
|
__exportStar(require("./useRouteExecution"), exports);
|
|
33
36
|
__exportStar(require("./useRoutes"), exports);
|
|
34
37
|
__exportStar(require("./useScrollableContainer"), exports);
|
|
38
|
+
__exportStar(require("./useSettingMonitor"), exports);
|
|
35
39
|
__exportStar(require("./useSwapOnly"), exports);
|
|
36
40
|
__exportStar(require("./useToken"), exports);
|
|
37
41
|
__exportStar(require("./useTokenAddressBalance"), exports);
|
|
@@ -40,4 +44,6 @@ __exportStar(require("./useTokenBalances"), exports);
|
|
|
40
44
|
__exportStar(require("./useTokenSearch"), exports);
|
|
41
45
|
__exportStar(require("./useTokens"), exports);
|
|
42
46
|
__exportStar(require("./useTools"), exports);
|
|
47
|
+
__exportStar(require("./useTransactionDetails"), exports);
|
|
48
|
+
__exportStar(require("./useTransactionHistory"), exports);
|
|
43
49
|
__exportStar(require("./useWidgetEvents"), exports);
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { ChainType } from '@lifi/sdk';
|
|
2
|
+
import type { WalletAdapter } from '@solana/wallet-adapter-base';
|
|
3
|
+
import type { Chain } from 'viem';
|
|
4
|
+
import type { Connector } from 'wagmi';
|
|
5
|
+
export interface AccountBase {
|
|
6
|
+
address?: string;
|
|
7
|
+
addresses?: readonly string[];
|
|
8
|
+
chain?: Chain;
|
|
9
|
+
chainId?: number;
|
|
10
|
+
chainType?: ChainType;
|
|
11
|
+
isConnected: boolean;
|
|
12
|
+
isConnecting: boolean;
|
|
13
|
+
isDisconnected: boolean;
|
|
14
|
+
isReconnecting: boolean;
|
|
15
|
+
status: 'connected' | 'reconnecting' | 'connecting' | 'disconnected';
|
|
16
|
+
}
|
|
17
|
+
export interface EVMAccount extends AccountBase {
|
|
18
|
+
chainType: ChainType.EVM;
|
|
19
|
+
connector?: Connector;
|
|
20
|
+
}
|
|
21
|
+
export interface SVMAccount extends AccountBase {
|
|
22
|
+
chainType: ChainType.SVM;
|
|
23
|
+
connector?: WalletAdapter;
|
|
24
|
+
}
|
|
25
|
+
export type Account = EVMAccount | SVMAccount;
|
|
26
|
+
export interface AccountResult {
|
|
27
|
+
account: Account;
|
|
28
|
+
accounts: Account[];
|
|
29
|
+
}
|
|
30
|
+
export declare const useAccount: () => AccountResult;
|
|
31
|
+
export declare const useAccountDisconnect: () => () => void;
|