@lifi/widget 1.31.0 → 1.32.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/App.js +4 -16
- package/AppDrawer.js +13 -7
- package/AppDrawer.style.d.ts +2 -2
- package/AppDrawer.style.js +1 -1
- package/AppProvider.js +2 -2
- package/AppRoutes.js +9 -0
- package/cjs/App.js +4 -16
- package/cjs/AppDrawer.js +13 -7
- package/cjs/AppDrawer.style.d.ts +2 -2
- package/cjs/AppDrawer.style.js +1 -1
- package/cjs/AppProvider.js +1 -1
- package/cjs/AppRoutes.js +9 -0
- package/cjs/components/ActiveSwaps/ActiveSwapItem.js +9 -7
- package/cjs/components/ActiveSwaps/ActiveSwaps.js +3 -3
- package/cjs/components/ActiveSwaps/ActiveSwaps.style.d.ts +3 -3
- package/cjs/components/AppContainer.d.ts +2 -2
- package/cjs/components/AppContainer.js +1 -1
- package/cjs/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/cjs/components/BottomSheet/BottomSheet.js +2 -2
- package/cjs/components/Card/Card.d.ts +2 -2
- package/cjs/components/Card/CardHeader.d.ts +1 -1
- package/cjs/components/Card/CardTitle.d.ts +1 -1
- package/cjs/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/cjs/components/ChainSelect/ChainSelect.js +3 -4
- package/cjs/components/ChainSelect/ChainSelect.style.d.ts +3 -3
- package/cjs/components/ContractComponent/ContractComponent.js +1 -1
- package/cjs/components/Dialog.js +1 -1
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.js +13 -28
- package/cjs/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +1 -1
- package/cjs/components/Header/Header.js +1 -1
- package/cjs/components/Header/Header.style.d.ts +3 -3
- package/cjs/components/Header/NavigationHeader.js +6 -2
- package/cjs/components/Header/WalletHeader.js +12 -22
- package/cjs/{pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts → components/ListItemButton.d.ts} +1 -2
- package/cjs/{pages/SelectWalletPage/SelectWalletPage.style.js → components/ListItemButton.js} +2 -8
- package/cjs/components/ListItemText.d.ts +2 -0
- package/cjs/{pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js → components/ListItemText.js} +1 -10
- package/cjs/components/NFT/NFT.js +2 -14
- package/cjs/components/NFT/NFT.style.d.ts +1 -1
- package/cjs/components/NotFound.js +2 -2
- package/cjs/components/PoweredBy/PoweredBy.js +2 -2
- package/cjs/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/cjs/components/ProgressToNextUpdate/ProgressToNextUpdate.js +5 -17
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
- package/cjs/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/cjs/components/Select.js +1 -0
- package/cjs/components/SelectChainAndToken.js +4 -4
- package/cjs/components/SelectTokenButton/SelectTokenButton.js +2 -2
- package/cjs/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWallet.js +9 -19
- package/cjs/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/cjs/components/SendToWallet/SendToWalletButton.js +5 -5
- package/cjs/components/SmallAvatar.d.ts +3 -3
- package/cjs/components/Step/CircularProgress.d.ts +0 -1
- package/cjs/components/Step/CircularProgress.js +2 -2
- package/cjs/components/Step/CircularProgress.style.d.ts +1 -1
- package/cjs/components/Step/DestinationWalletAddress.js +6 -7
- package/cjs/components/Step/GasStepProcess.js +8 -8
- package/cjs/components/Step/Step.js +4 -5
- package/cjs/components/Step/StepList.d.ts +0 -1
- package/cjs/components/Step/StepList.js +8 -4
- package/cjs/components/Step/StepProcess.js +3 -3
- package/cjs/components/Step/StepProcess.style.d.ts +2 -2
- package/cjs/components/Step/StepTimer.js +4 -8
- package/cjs/components/StepActions/StepActions.js +20 -37
- package/cjs/components/StepActions/StepActions.style.d.ts +1 -1
- package/cjs/components/StepDivider/StepDivider.style.d.ts +1 -1
- package/cjs/components/SwapButton/SwapButton.js +5 -14
- package/cjs/components/SwapInput/FormPriceHelperText.js +6 -6
- package/cjs/components/SwapInput/SwapInput.js +4 -16
- package/cjs/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/cjs/components/SwapInput/SwapInputEndAdornment.js +2 -3
- package/cjs/components/SwapRouteCard/SwapRouteCard.js +9 -25
- package/cjs/components/SwapRouteCard/SwapRouteCard.style.d.ts +2 -2
- package/cjs/components/SwapRouteCard/SwapRouteCardSkeleton.js +4 -16
- package/cjs/components/SwapRouteCard/SwapRouteNotFoundCard.js +2 -2
- package/cjs/components/SwapRouteCard/utils.js +1 -1
- package/cjs/components/SwapRoutes/SwapRoutes.js +4 -4
- package/cjs/components/SwapRoutes/SwapRoutes.style.d.ts +5 -5
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/cjs/components/SwapRoutes/SwapRoutesExpanded.js +3 -3
- package/cjs/components/TextFitter/TextFitter.js +3 -3
- package/cjs/components/Token/Token.js +19 -33
- package/cjs/components/Token/Token.style.d.ts +3 -3
- package/cjs/components/TokenAvatar/TokenAvatar.js +6 -7
- package/cjs/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
- package/cjs/components/TokenList/TokenList.js +3 -4
- package/cjs/components/TokenList/TokenList.style.d.ts +2 -2
- package/cjs/components/TokenList/TokenList.style.js +2 -6
- package/cjs/components/TokenList/TokenListItem.js +9 -9
- package/cjs/components/TokenList/TokenNotFound.js +4 -5
- package/cjs/components/TokenList/VirtualizedTokenList.js +10 -11
- package/cjs/components/TokenList/useTokenSelect.js +2 -2
- package/cjs/config/env.js +1 -1
- package/cjs/config/sentry.js +3 -12
- package/cjs/config/theme.js +44 -16
- package/cjs/config/version.d.ts +1 -1
- package/cjs/config/version.js +1 -1
- package/cjs/hooks/useChain.js +1 -1
- package/cjs/hooks/useChains.js +5 -14
- package/cjs/hooks/useContentHeight.js +1 -2
- package/cjs/hooks/useFeaturedTokens.js +1 -4
- package/cjs/hooks/useGasSufficiency.js +28 -34
- package/cjs/hooks/useProcessMessage.js +7 -11
- package/cjs/hooks/useRouteExecution.js +17 -28
- package/cjs/hooks/useSwapRoutes.js +16 -26
- package/cjs/hooks/useToken.js +2 -2
- package/cjs/hooks/useTokenAddressBalance.js +1 -2
- package/cjs/hooks/useTokenBalance.js +24 -27
- package/cjs/hooks/useTokenBalances.d.ts +1 -1
- package/cjs/hooks/useTokenBalances.js +8 -20
- package/cjs/hooks/useTokenSearch.d.ts +1 -1
- package/cjs/hooks/useTokenSearch.js +12 -21
- package/cjs/hooks/useTokens.d.ts +1 -1
- package/cjs/hooks/useTokens.js +36 -38
- package/cjs/hooks/useTools.d.ts +2 -11
- package/cjs/hooks/useTools.js +10 -19
- package/cjs/i18n/en.json +8 -4
- package/cjs/icons/LiFiFullLogo.js +1 -1
- package/cjs/icons/LiFiLogo.js +1 -1
- package/cjs/icons/LiFiToolLogo.js +1 -1
- package/cjs/index.d.ts +1 -0
- package/cjs/index.js +2 -0
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +2 -2
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/cjs/pages/ActiveSwapsPage/ActiveSwapsPage.js +3 -3
- package/cjs/pages/MainPage/MainPage.js +1 -1
- package/cjs/pages/MainPage/MainPage.style.d.ts +1 -1
- package/cjs/pages/MainPage/MainSwapButton.js +3 -12
- package/cjs/pages/SelectChainPage/SelectChainPage.js +6 -14
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.d.ts +4 -0
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +51 -0
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +20 -0
- package/cjs/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +8 -0
- package/cjs/pages/SelectEnabledToolsPage/index.d.ts +1 -0
- package/cjs/pages/SelectEnabledToolsPage/index.js +17 -0
- package/cjs/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +4 -3
- package/cjs/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/cjs/pages/SelectTokenPage/SearchTokenInput.js +4 -1
- package/cjs/pages/SelectTokenPage/SelectTokenPage.js +2 -3
- package/cjs/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/cjs/pages/SelectWalletPage/SelectWalletPage.js +13 -19
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -3
- package/cjs/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/cjs/pages/SettingsPage/EnabledToolsButton.d.ts +4 -0
- package/cjs/pages/SettingsPage/EnabledToolsButton.js +25 -0
- package/cjs/pages/{SelectChainPage/SelectChainPage.style.d.ts → SettingsPage/EnabledToolsButton.style.d.ts} +1 -1
- package/cjs/pages/{SelectChainPage/SelectChainPage.style.js → SettingsPage/EnabledToolsButton.style.js} +7 -10
- package/cjs/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/cjs/pages/SettingsPage/GasPriceSelect.js +1 -1
- package/cjs/pages/SettingsPage/LanguageSelect.js +5 -6
- package/cjs/pages/SettingsPage/ResetSettingsButton.d.ts +2 -0
- package/cjs/pages/SettingsPage/ResetSettingsButton.js +27 -0
- package/cjs/pages/SettingsPage/RoutePrioritySelect.js +4 -4
- package/cjs/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/cjs/pages/SettingsPage/SettingsPage.js +3 -2
- package/cjs/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/cjs/pages/SettingsPage/ShowDestinationWallet.js +3 -3
- package/cjs/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/cjs/pages/SettingsPage/SlippageInput.js +3 -3
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.js +14 -22
- package/cjs/pages/SwapDetailsPage/SwapDetailsPage.style.d.ts +1 -1
- package/cjs/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
- package/cjs/pages/SwapHistoryPage/SwapHistoryItem.js +9 -7
- package/cjs/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/cjs/pages/SwapPage/ExchangeRateBottomSheet.js +21 -26
- package/cjs/pages/SwapPage/StartSwapButton.js +1 -1
- package/cjs/pages/SwapPage/StatusBottomSheet.js +21 -19
- package/cjs/pages/SwapPage/StatusBottomSheet.style.d.ts +2 -2
- package/cjs/pages/SwapPage/SwapPage.js +9 -21
- package/cjs/pages/SwapPage/SwapPage.style.d.ts +1 -1
- package/cjs/pages/SwapPage/TokenValueBottomSheet.js +8 -9
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.js +3 -3
- package/cjs/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
- package/cjs/providers/I18nProvider/I18nProvider.js +7 -8
- package/cjs/providers/SDKProvider/SDKProvider.js +15 -4
- package/cjs/providers/SwapFormProvider/SwapFormProvider.js +12 -6
- package/cjs/providers/SwapFormProvider/URLSearchParamsBuilder.js +3 -12
- package/cjs/providers/TelemetryProvider/TelemetryProvider.js +1 -1
- package/cjs/providers/ThemeProvider/ThemeProvider.js +2 -2
- package/cjs/providers/WalletProvider/WalletProvider.js +30 -39
- package/cjs/providers/WidgetProvider/WidgetProvider.js +18 -23
- package/cjs/providers/WidgetProvider/utils.js +2 -3
- package/cjs/stores/StoreProvider.js +2 -2
- package/cjs/stores/chains/ChainOrderStore.js +2 -14
- package/cjs/stores/routes/RouteExecutionStore.js +2 -14
- package/cjs/stores/routes/createRouteExecutionStore.js +27 -16
- package/cjs/stores/routes/useExecutingRoutesIds.js +2 -5
- package/cjs/stores/routes/useSwapHistory.js +3 -6
- package/cjs/stores/routes/utils.js +4 -4
- package/cjs/stores/settings/SettingsStore.js +10 -20
- package/cjs/stores/settings/createSettingsStore.js +29 -25
- package/cjs/stores/settings/types.d.ts +6 -6
- package/cjs/utils/colors.js +1 -1
- package/cjs/utils/format.js +3 -3
- package/cjs/utils/index.d.ts +0 -1
- package/cjs/utils/index.js +0 -1
- package/cjs/utils/navigationRoutes.d.ts +2 -0
- package/cjs/utils/navigationRoutes.js +6 -0
- package/components/ActiveSwaps/ActiveSwapItem.js +9 -7
- package/components/ActiveSwaps/ActiveSwaps.js +3 -3
- package/components/ActiveSwaps/ActiveSwaps.style.d.ts +3 -3
- package/components/AppContainer.d.ts +2 -2
- package/components/AppContainer.js +1 -1
- package/components/BottomSheet/BottomSheet.d.ts +1 -1
- package/components/BottomSheet/BottomSheet.js +2 -2
- package/components/Card/Card.d.ts +2 -2
- package/components/Card/CardHeader.d.ts +1 -1
- package/components/Card/CardTitle.d.ts +1 -1
- package/components/ChainSelect/ChainSelect.d.ts +0 -1
- package/components/ChainSelect/ChainSelect.js +3 -4
- package/components/ChainSelect/ChainSelect.style.d.ts +3 -3
- package/components/ContractComponent/ContractComponent.js +1 -1
- package/components/Dialog.js +1 -1
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.js +13 -28
- package/components/GasSufficiencyMessage/GasSufficiencyMessage.style.d.ts +1 -1
- package/components/Header/Header.js +1 -1
- package/components/Header/Header.style.d.ts +3 -3
- package/components/Header/NavigationHeader.js +6 -2
- package/components/Header/WalletHeader.js +12 -22
- package/{pages/SelectChainPage/SelectChainPage.style.d.ts → components/ListItemButton.d.ts} +1 -2
- package/components/ListItemButton.js +11 -0
- package/components/ListItemText.d.ts +2 -0
- package/components/ListItemText.js +8 -0
- package/components/NFT/NFT.js +2 -14
- package/components/NFT/NFT.style.d.ts +1 -1
- package/components/NotFound.js +2 -2
- package/components/PoweredBy/PoweredBy.js +2 -2
- package/components/PoweredBy/PoweredBy.style.d.ts +1 -1
- package/components/ProgressToNextUpdate/ProgressToNextUpdate.js +5 -17
- package/components/ReverseTokensButton/ReverseTokensButton.js +1 -1
- package/components/ReverseTokensButton/ReverseTokensButton.style.d.ts +1 -1
- package/components/Select.js +1 -0
- package/components/SelectChainAndToken.js +4 -4
- package/components/SelectTokenButton/SelectTokenButton.js +2 -2
- package/components/SelectTokenButton/SelectTokenButton.style.d.ts +1 -1
- package/components/SendToWallet/SendToWallet.js +9 -19
- package/components/SendToWallet/SendToWallet.style.d.ts +1 -1
- package/components/SendToWallet/SendToWalletButton.js +5 -5
- package/components/SmallAvatar.d.ts +3 -3
- package/components/Step/CircularProgress.d.ts +0 -1
- package/components/Step/CircularProgress.js +2 -2
- package/components/Step/CircularProgress.style.d.ts +1 -1
- package/components/Step/DestinationWalletAddress.js +6 -7
- package/components/Step/GasStepProcess.js +8 -8
- package/components/Step/Step.js +4 -5
- package/components/Step/StepList.d.ts +0 -1
- package/components/Step/StepList.js +8 -4
- package/components/Step/StepProcess.js +3 -3
- package/components/Step/StepProcess.style.d.ts +2 -2
- package/components/Step/StepTimer.js +4 -8
- package/components/StepActions/StepActions.js +20 -37
- package/components/StepActions/StepActions.style.d.ts +1 -1
- package/components/StepDivider/StepDivider.style.d.ts +1 -1
- package/components/SwapButton/SwapButton.js +5 -14
- package/components/SwapInput/FormPriceHelperText.js +6 -6
- package/components/SwapInput/SwapInput.js +4 -16
- package/components/SwapInput/SwapInput.style.d.ts +1 -1
- package/components/SwapInput/SwapInputAdornment.style.d.ts +1 -1
- package/components/SwapInput/SwapInputEndAdornment.d.ts +0 -1
- package/components/SwapInput/SwapInputEndAdornment.js +2 -3
- package/components/SwapRouteCard/SwapRouteCard.js +9 -25
- package/components/SwapRouteCard/SwapRouteCard.style.d.ts +2 -2
- package/components/SwapRouteCard/SwapRouteCardSkeleton.js +4 -16
- package/components/SwapRouteCard/SwapRouteNotFoundCard.js +2 -2
- package/components/SwapRouteCard/utils.js +1 -1
- package/components/SwapRoutes/SwapRoutes.js +4 -4
- package/components/SwapRoutes/SwapRoutes.style.d.ts +5 -5
- package/components/SwapRoutes/SwapRoutesExpanded.d.ts +0 -1
- package/components/SwapRoutes/SwapRoutesExpanded.js +3 -3
- package/components/TextFitter/TextFitter.js +3 -3
- package/components/Token/Token.js +19 -33
- package/components/Token/Token.style.d.ts +3 -3
- package/components/TokenAvatar/TokenAvatar.js +6 -7
- package/components/TokenAvatar/TokenAvatar.style.d.ts +2 -2
- package/components/TokenList/TokenList.js +3 -4
- package/components/TokenList/TokenList.style.d.ts +2 -2
- package/components/TokenList/TokenList.style.js +3 -7
- package/components/TokenList/TokenListItem.js +9 -9
- package/components/TokenList/TokenNotFound.js +4 -5
- package/components/TokenList/VirtualizedTokenList.js +10 -11
- package/components/TokenList/useTokenSelect.js +2 -2
- package/config/env.js +1 -1
- package/config/sentry.js +3 -12
- package/config/theme.js +44 -16
- package/config/version.d.ts +1 -1
- package/config/version.js +1 -1
- package/hooks/useChain.js +1 -1
- package/hooks/useChains.js +5 -14
- package/hooks/useContentHeight.js +1 -2
- package/hooks/useFeaturedTokens.js +1 -4
- package/hooks/useGasSufficiency.js +28 -34
- package/hooks/useProcessMessage.js +7 -11
- package/hooks/useRouteExecution.js +17 -28
- package/hooks/useSwapRoutes.js +16 -26
- package/hooks/useToken.js +2 -2
- package/hooks/useTokenAddressBalance.js +1 -2
- package/hooks/useTokenBalance.js +24 -27
- package/hooks/useTokenBalances.d.ts +1 -1
- package/hooks/useTokenBalances.js +8 -20
- package/hooks/useTokenSearch.d.ts +1 -1
- package/hooks/useTokenSearch.js +12 -21
- package/hooks/useTokens.d.ts +1 -1
- package/hooks/useTokens.js +36 -38
- package/hooks/useTools.d.ts +2 -11
- package/hooks/useTools.js +10 -19
- package/i18n/en.json +8 -4
- package/icons/LiFiFullLogo.js +1 -1
- package/icons/LiFiLogo.js +1 -1
- package/icons/LiFiToolLogo.js +1 -1
- package/index.d.ts +1 -0
- package/index.js +2 -0
- package/package.json +9 -9
- package/pages/ActiveSwapsPage/ActiveSwapsEmpty.js +2 -2
- package/pages/ActiveSwapsPage/ActiveSwapsPage.d.ts +0 -1
- package/pages/ActiveSwapsPage/ActiveSwapsPage.js +3 -3
- package/pages/MainPage/MainPage.js +1 -1
- package/pages/MainPage/MainPage.style.d.ts +1 -1
- package/pages/MainPage/MainSwapButton.js +3 -12
- package/pages/SelectChainPage/SelectChainPage.js +6 -14
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.d.ts +4 -0
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.js +47 -0
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.d.ts +20 -0
- package/pages/SelectEnabledToolsPage/SelectEnabledToolsPage.style.js +5 -0
- package/pages/SelectEnabledToolsPage/index.d.ts +1 -0
- package/pages/SelectEnabledToolsPage/index.js +1 -0
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.js +4 -3
- package/pages/SelectTokenPage/SearchTokenInput.d.ts +0 -1
- package/pages/SelectTokenPage/SearchTokenInput.js +4 -1
- package/pages/SelectTokenPage/SelectTokenPage.js +2 -3
- package/pages/SelectWalletPage/SelectWalletPage.d.ts +0 -1
- package/pages/SelectWalletPage/SelectWalletPage.js +13 -19
- package/pages/SettingsPage/ColorSchemeButtonGroup.js +3 -3
- package/pages/SettingsPage/ColorSchemeButtonGroup.style.d.ts +1 -1
- package/pages/SettingsPage/EnabledToolsButton.d.ts +4 -0
- package/pages/SettingsPage/EnabledToolsButton.js +21 -0
- package/{cjs/pages/SelectWalletPage/SelectWalletPage.style.d.ts → pages/SettingsPage/EnabledToolsButton.style.d.ts} +1 -1
- package/pages/SettingsPage/EnabledToolsButton.style.js +14 -0
- package/pages/SettingsPage/GasPriceSelect.d.ts +0 -1
- package/pages/SettingsPage/GasPriceSelect.js +1 -1
- package/pages/SettingsPage/LanguageSelect.js +5 -6
- package/pages/SettingsPage/ResetSettingsButton.d.ts +2 -0
- package/pages/SettingsPage/ResetSettingsButton.js +23 -0
- package/pages/SettingsPage/RoutePrioritySelect.js +4 -4
- package/pages/SettingsPage/SettingsPage.d.ts +0 -1
- package/pages/SettingsPage/SettingsPage.js +3 -2
- package/pages/SettingsPage/ShowDestinationWallet.d.ts +0 -1
- package/pages/SettingsPage/ShowDestinationWallet.js +3 -3
- package/pages/SettingsPage/SlippageInput.d.ts +0 -1
- package/pages/SettingsPage/SlippageInput.js +3 -3
- package/pages/SwapDetailsPage/SwapDetailsPage.js +14 -22
- package/pages/SwapDetailsPage/SwapDetailsPage.style.d.ts +1 -1
- package/pages/SwapHistoryPage/SwapHistoryEmpty.js +2 -2
- package/pages/SwapHistoryPage/SwapHistoryItem.js +9 -7
- package/pages/SwapHistoryPage/SwapHistoryPage.js +2 -2
- package/pages/SwapPage/ExchangeRateBottomSheet.js +21 -26
- package/pages/SwapPage/StartSwapButton.js +1 -1
- package/pages/SwapPage/StatusBottomSheet.js +21 -19
- package/pages/SwapPage/StatusBottomSheet.style.d.ts +2 -2
- package/pages/SwapPage/SwapPage.js +9 -21
- package/pages/SwapPage/SwapPage.style.d.ts +1 -1
- package/pages/SwapPage/TokenValueBottomSheet.js +8 -9
- package/pages/SwapRoutesPage/SwapRoutesPage.js +3 -3
- package/pages/SwapRoutesPage/SwapRoutesPage.style.d.ts +1 -1
- package/providers/I18nProvider/I18nProvider.js +7 -8
- package/providers/SDKProvider/SDKProvider.js +15 -4
- package/providers/SwapFormProvider/SwapFormProvider.js +12 -6
- package/providers/SwapFormProvider/URLSearchParamsBuilder.js +3 -12
- package/providers/TelemetryProvider/TelemetryProvider.js +1 -1
- package/providers/ThemeProvider/ThemeProvider.js +2 -2
- package/providers/WalletProvider/WalletProvider.js +30 -39
- package/providers/WidgetProvider/WidgetProvider.js +18 -23
- package/providers/WidgetProvider/utils.js +2 -3
- package/stores/StoreProvider.js +2 -2
- package/stores/chains/ChainOrderStore.js +2 -14
- package/stores/routes/RouteExecutionStore.js +2 -14
- package/stores/routes/createRouteExecutionStore.js +27 -16
- package/stores/routes/useExecutingRoutesIds.js +2 -5
- package/stores/routes/useSwapHistory.js +3 -6
- package/stores/routes/utils.js +4 -4
- package/stores/settings/SettingsStore.js +10 -20
- package/stores/settings/createSettingsStore.js +29 -25
- package/stores/settings/types.d.ts +6 -6
- package/tsconfig.cjs.tsbuildinfo +1 -1
- package/utils/colors.js +1 -1
- package/utils/format.js +3 -3
- package/utils/index.d.ts +0 -1
- package/utils/index.js +0 -1
- package/utils/navigationRoutes.d.ts +2 -0
- package/utils/navigationRoutes.js +6 -0
- package/cjs/pages/SettingsPage/AdvancedPreferences.d.ts +0 -2
- package/cjs/pages/SettingsPage/AdvancedPreferences.js +0 -24
- package/cjs/pages/SettingsPage/EnabledBridgesSelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/EnabledBridgesSelect.js +0 -24
- package/cjs/pages/SettingsPage/EnabledExchangesSelect.d.ts +0 -2
- package/cjs/pages/SettingsPage/EnabledExchangesSelect.js +0 -24
- package/cjs/utils/deepClone.d.ts +0 -1
- package/cjs/utils/deepClone.js +0 -7
- package/pages/SelectChainPage/SelectChainPage.style.js +0 -17
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.d.ts +0 -21
- package/pages/SelectNativeTokenPage/SelectNativeTokenPage.style.js +0 -17
- package/pages/SelectWalletPage/SelectWalletPage.style.d.ts +0 -21
- package/pages/SelectWalletPage/SelectWalletPage.style.js +0 -17
- package/pages/SettingsPage/AdvancedPreferences.d.ts +0 -2
- package/pages/SettingsPage/AdvancedPreferences.js +0 -20
- package/pages/SettingsPage/EnabledBridgesSelect.d.ts +0 -2
- package/pages/SettingsPage/EnabledBridgesSelect.js +0 -20
- package/pages/SettingsPage/EnabledExchangesSelect.d.ts +0 -2
- package/pages/SettingsPage/EnabledExchangesSelect.js +0 -20
- package/utils/deepClone.d.ts +0 -1
- package/utils/deepClone.js +0 -3
|
@@ -18,7 +18,7 @@ export const SwapRoutes = (props) => {
|
|
|
18
18
|
const navigate = useNavigate();
|
|
19
19
|
const { isValid, isValidating } = useFormState();
|
|
20
20
|
const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = useSwapRoutes();
|
|
21
|
-
const currentRoute = routes
|
|
21
|
+
const currentRoute = routes?.[0];
|
|
22
22
|
useSetRecommendedRoute(currentRoute, isFetching);
|
|
23
23
|
if (!currentRoute && !isLoading && !isFetching && !isFetched) {
|
|
24
24
|
return null;
|
|
@@ -28,15 +28,15 @@ export const SwapRoutes = (props) => {
|
|
|
28
28
|
};
|
|
29
29
|
const routeNotFound = !currentRoute && !isLoading && !isFetching;
|
|
30
30
|
const onlyRecommendedRoute = variant === 'refuel' || useRecommendedRoute;
|
|
31
|
-
return (_jsxs(Card,
|
|
31
|
+
return (_jsxs(Card, { ...props, children: [_jsx(CardTitle, { children: t('swap.routes') }), _jsx(ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: {
|
|
32
32
|
position: 'absolute',
|
|
33
33
|
top: 8,
|
|
34
34
|
right: 8,
|
|
35
|
-
} }), _jsxs(Box,
|
|
35
|
+
} }), _jsxs(Box, { sx: { display: 'flex' }, children: [_jsx(Stack, { direction: "row", spacing: 2, my: 2, ml: 2, mr: onlyRecommendedRoute || routeNotFound ? 2 : 1, sx: {
|
|
36
36
|
borderRightWidth: !onlyRecommendedRoute &&
|
|
37
37
|
!routeNotFound &&
|
|
38
38
|
(isFetching || (routes && routes.length > 1))
|
|
39
39
|
? 1
|
|
40
40
|
: 0,
|
|
41
|
-
}
|
|
41
|
+
}, children: isLoading ? (_jsxs(_Fragment, { children: [_jsx(SwapRouteCardSkeleton, { minWidth: !onlyRecommendedRoute ? '80%' : '100%', variant: "dense" }), !onlyRecommendedRoute ? (_jsx(SwapRouteCardSkeleton, { minWidth: "80%", variant: "dense" })) : null] })) : !currentRoute ? (_jsx(SwapRouteNotFoundCard, {})) : (_jsxs(_Fragment, { children: [_jsx(SwapRouteCard, { minWidth: !onlyRecommendedRoute && routes.length > 1 ? '80%' : '100%', route: currentRoute, variant: "dense", active: true }), !onlyRecommendedRoute && routes.length > 1 ? (_jsx(SwapRouteCard, { minWidth: "80%", route: routes[1], variant: "dense", pointerEvents: "none" })) : null] })) }), _jsx(Box, { sx: { display: 'flex', alignItems: 'center' }, children: !onlyRecommendedRoute && !routeNotFound ? (_jsx(Box, { py: 1, pr: 1, children: _jsx(IconButton, { onClick: handleCardClick, size: "medium", disabled: isValidating || !isValid, children: _jsx(KeyboardArrowRightIcon, {}) }) })) : null })] })] }));
|
|
42
42
|
};
|
|
@@ -4,7 +4,7 @@ export declare const CollapseContainer: import("@emotion/styled").StyledComponen
|
|
|
4
4
|
component?: import("react").ElementType<any> | undefined;
|
|
5
5
|
ref?: import("react").Ref<unknown> | undefined;
|
|
6
6
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
-
} & Omit<
|
|
7
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
8
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
9
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
10
10
|
export declare const ScrollableContainer: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
@@ -12,7 +12,7 @@ export declare const ScrollableContainer: import("@emotion/styled").StyledCompon
|
|
|
12
12
|
component?: import("react").ElementType<any> | undefined;
|
|
13
13
|
ref?: import("react").Ref<unknown> | undefined;
|
|
14
14
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
15
|
-
} & Omit<
|
|
15
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
16
16
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
17
17
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
18
18
|
export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
@@ -20,7 +20,7 @@ export declare const Container: import("@emotion/styled").StyledComponent<{
|
|
|
20
20
|
classes?: Partial<import("@mui/material").ScopedCssBaselineClasses> | undefined;
|
|
21
21
|
enableColorScheme?: boolean | undefined;
|
|
22
22
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
23
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
23
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
24
24
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
25
25
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "enableColorScheme"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
26
26
|
export declare const Header: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
@@ -28,7 +28,7 @@ export declare const Header: import("@emotion/styled").StyledComponent<import("@
|
|
|
28
28
|
component?: import("react").ElementType<any> | undefined;
|
|
29
29
|
ref?: import("react").Ref<unknown> | undefined;
|
|
30
30
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
31
|
-
} & Omit<
|
|
31
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
32
32
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
33
33
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
34
34
|
export declare const Stack: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
@@ -38,6 +38,6 @@ export declare const Stack: import("@emotion/styled").StyledComponent<import("@m
|
|
|
38
38
|
spacing?: import("@mui/system").ResponsiveStyleValue<string | number> | undefined;
|
|
39
39
|
divider?: import("react").ReactNode;
|
|
40
40
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
41
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
41
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
42
42
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
43
43
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "ref" | "direction" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "divider" | "spacing"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -19,7 +19,7 @@ export const SwapRoutesExpanded = () => {
|
|
|
19
19
|
element: null,
|
|
20
20
|
},
|
|
21
21
|
]);
|
|
22
|
-
return (_jsx(CollapseContainer, { children: _jsx(Collapse,
|
|
22
|
+
return (_jsx(CollapseContainer, { children: _jsx(Collapse, { timeout: timeout, in: !!element, orientation: "horizontal", children: _jsx(Grow, { timeout: timeout, in: !!element, mountOnEnter: true, unmountOnExit: true, children: _jsx("div", { children: _jsx(SwapRoutesExpandedElement, {}) }) }) }) }));
|
|
23
23
|
};
|
|
24
24
|
export const SwapRoutesExpandedElement = () => {
|
|
25
25
|
const { t } = useTranslation();
|
|
@@ -28,7 +28,7 @@ export const SwapRoutesExpandedElement = () => {
|
|
|
28
28
|
const { containerStyle } = useWidgetConfig();
|
|
29
29
|
const { isValid, isValidating } = useFormState();
|
|
30
30
|
const { routes, isLoading, isFetching, isFetched, dataUpdatedAt, refetchTime, refetch, } = useSwapRoutes();
|
|
31
|
-
const currentRoute = routes
|
|
31
|
+
const currentRoute = routes?.[0];
|
|
32
32
|
useSetRecommendedRoute(currentRoute, isFetching);
|
|
33
33
|
const handleRouteClick = (route) => {
|
|
34
34
|
if (isValid && !isValidating) {
|
|
@@ -40,5 +40,5 @@ export const SwapRoutesExpandedElement = () => {
|
|
|
40
40
|
};
|
|
41
41
|
const expanded = Boolean(currentRoute || isLoading || isFetching || isFetched);
|
|
42
42
|
const routeNotFound = !currentRoute && !isLoading && !isFetching && expanded;
|
|
43
|
-
return (_jsx(Collapse,
|
|
43
|
+
return (_jsx(Collapse, { timeout: timeout.enter, in: expanded, orientation: "horizontal", children: _jsx(Grow, { timeout: timeout.enter, in: expanded, mountOnEnter: true, unmountOnExit: true, children: _jsx(Container, { sx: containerStyle, enableColorScheme: true, children: _jsxs(ScrollableContainer, { children: [_jsxs(Header, { children: [_jsx(Typography, { fontSize: 18, fontWeight: "700", flex: 1, noWrap: true, children: t('swap.routes') }), _jsx(ProgressToNextUpdate, { updatedAt: dataUpdatedAt || new Date().getTime(), timeToUpdate: refetchTime, isLoading: isFetching, onClick: () => refetch(), sx: { marginRight: -1 } })] }), _jsx(Stack, { direction: "column", spacing: 2, flex: 1, paddingX: 3, paddingBottom: 3, children: routeNotFound ? (_jsx(SwapRouteNotFoundCard, {})) : isLoading ? (Array.from({ length: 3 }).map((_, index) => (_jsx(SwapRouteCardSkeleton, { variant: "stretched" }, index)))) : (routes?.map((route, index) => (_jsx(SwapRouteCard, { route: route, onClick: () => handleRouteClick(route), active: index === 0, variant: "stretched", expanded: routes?.length <= 2 }, route.id)))) })] }) }) }) }));
|
|
44
44
|
};
|
|
@@ -26,7 +26,7 @@ export const TextFitter = ({ children, width = '100%', height, maxHeight, preser
|
|
|
26
26
|
}
|
|
27
27
|
setViewBox(box);
|
|
28
28
|
// setTextRect(textRef.current.getBoundingClientRect());
|
|
29
|
-
onFit
|
|
29
|
+
onFit?.();
|
|
30
30
|
}, [cropBottom, cropTop, onFit]);
|
|
31
31
|
useLayoutEffect(() => {
|
|
32
32
|
calculateBox();
|
|
@@ -38,11 +38,11 @@ export const TextFitter = ({ children, width = '100%', height, maxHeight, preser
|
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
40
|
}, [calculateBox]);
|
|
41
|
-
return (_jsx("svg",
|
|
41
|
+
return (_jsx("svg", { style: svgStyle, viewBox: `${viewBox.x} ${viewBox.y} ${viewBox.width} ${viewBox.height}`, width: width, height: height,
|
|
42
42
|
// height={
|
|
43
43
|
// textRect.height && maxHeight && textRect.height >= maxHeight
|
|
44
44
|
// ? maxHeight
|
|
45
45
|
// : height
|
|
46
46
|
// }
|
|
47
|
-
preserveAspectRatio: preserveAspectRatio, fill: theme.palette.text.primary
|
|
47
|
+
preserveAspectRatio: preserveAspectRatio, fill: theme.palette.text.primary, children: _jsx("text", { x: 0, y: 0, style: textStyle, ref: textRef, children: children }) }));
|
|
48
48
|
};
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
2
|
-
var t = {};
|
|
3
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
4
|
-
t[p] = s[p];
|
|
5
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
6
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
7
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
8
|
-
t[p[i]] = s[p[i]];
|
|
9
|
-
}
|
|
10
|
-
return t;
|
|
11
|
-
};
|
|
12
1
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
2
|
import { Box, Skeleton } from '@mui/material';
|
|
14
3
|
import { useTranslation } from 'react-i18next';
|
|
@@ -18,35 +7,32 @@ import { SmallAvatar } from '../SmallAvatar';
|
|
|
18
7
|
import { TextFitter } from '../TextFitter';
|
|
19
8
|
import { TokenAvatar } from '../TokenAvatar';
|
|
20
9
|
import { TextSecondary, TextSecondaryContainer } from './Token.style';
|
|
21
|
-
export const Token = (
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return _jsx(TokenFallback, Object.assign({ token: token }, other));
|
|
10
|
+
export const Token = ({ token, ...other }) => {
|
|
11
|
+
if (!token?.priceUSD || !token.logoURI) {
|
|
12
|
+
return _jsx(TokenFallback, { token: token, ...other });
|
|
25
13
|
}
|
|
26
|
-
return _jsx(TokenBase,
|
|
14
|
+
return _jsx(TokenBase, { token: token, ...other });
|
|
27
15
|
};
|
|
28
|
-
export const TokenFallback = (
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
return (_jsx(TokenBase, Object.assign({ token: Object.assign(Object.assign({}, token), chainToken), isLoading: isLoading || isLoadingToken }, other)));
|
|
16
|
+
export const TokenFallback = ({ token, connected, step, disableDescription, isLoading, ...other }) => {
|
|
17
|
+
const { token: chainToken, isLoading: isLoadingToken } = useToken(token?.chainId, token?.address);
|
|
18
|
+
return (_jsx(TokenBase, { token: { ...token, ...chainToken }, isLoading: isLoading || isLoadingToken, ...other }));
|
|
32
19
|
};
|
|
33
|
-
export const TokenBase = (
|
|
34
|
-
var { token, connected, step, disableDescription, isLoading } = _a, other = __rest(_a, ["token", "connected", "step", "disableDescription", "isLoading"]);
|
|
20
|
+
export const TokenBase = ({ token, connected, step, disableDescription, isLoading, ...other }) => {
|
|
35
21
|
const { t } = useTranslation();
|
|
36
|
-
const { chain } = useChain(token
|
|
37
|
-
const formattedTokenAmount = formatTokenAmount(token
|
|
38
|
-
const formattedTokenPrice = formatTokenPrice(formattedTokenAmount, token
|
|
39
|
-
return (_jsxs(Box,
|
|
22
|
+
const { chain } = useChain(token?.chainId);
|
|
23
|
+
const formattedTokenAmount = formatTokenAmount(token?.amount, token?.decimals);
|
|
24
|
+
const formattedTokenPrice = formatTokenPrice(formattedTokenAmount, token?.priceUSD);
|
|
25
|
+
return (_jsxs(Box, { flex: 1, ...other, children: [_jsxs(Box, { display: "flex", flex: 1, alignItems: "center", children: [_jsx(TokenAvatar, { token: token, chain: chain, isLoading: isLoading, sx: { marginRight: 2 } }), isLoading ? (_jsx(Skeleton, { width: 112, height: 32, variant: "text" })) : (_jsx(TextFitter, { height: 30, textStyle: {
|
|
40
26
|
fontWeight: 700,
|
|
41
|
-
}
|
|
27
|
+
}, children: t('format.number', {
|
|
42
28
|
value: formattedTokenAmount,
|
|
43
|
-
}) }))
|
|
29
|
+
}) }))] }), _jsxs(TextSecondaryContainer, { connected: connected, component: "span", children: [isLoading ? (_jsx(Skeleton, { width: 48, height: 12, variant: "rounded", sx: { marginTop: 0.5 } })) : (_jsx(TextSecondary, { connected: connected, children: t(`format.currency`, {
|
|
44
30
|
value: formattedTokenPrice,
|
|
45
|
-
}) }))
|
|
46
|
-
tokenSymbol: token
|
|
47
|
-
chainName: chain
|
|
48
|
-
}) })))
|
|
31
|
+
}) })), !disableDescription ? (_jsx(TextSecondary, { connected: connected, px: 0.5, dot: true, children: "\u2022" })) : null, !step && !disableDescription ? (isLoading ? (_jsx(Skeleton, { width: 96, height: 12, variant: "rounded", sx: { marginTop: 0.5 } })) : (_jsx(TextSecondary, { connected: connected, children: t(`swap.tokenOnChain`, {
|
|
32
|
+
tokenSymbol: token?.symbol,
|
|
33
|
+
chainName: chain?.name,
|
|
34
|
+
}) }))) : null, step ? (_jsxs(Box, { display: "flex", alignItems: "flex-end", height: 12, mt: 0.5, children: [_jsx(Box, { pr: 0.75, children: _jsx(SmallAvatar, { src: step.toolDetails.logoURI, alt: step.toolDetails.name, sx: {
|
|
49
35
|
border: 0,
|
|
50
36
|
marginBottom: -0.25,
|
|
51
|
-
}
|
|
37
|
+
}, children: step.toolDetails.name[0] }) }), _jsx(TextSecondary, { connected: true, children: step.toolDetails.name })] })) : null] })] }));
|
|
52
38
|
};
|
|
@@ -4,7 +4,7 @@ export declare const TextSecondaryContainer: import("@emotion/styled").StyledCom
|
|
|
4
4
|
component?: import("react").ElementType<any> | undefined;
|
|
5
5
|
ref?: import("react").Ref<unknown> | undefined;
|
|
6
6
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
7
|
-
} & Omit<
|
|
7
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
8
8
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
9
9
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
10
10
|
connected?: boolean | undefined;
|
|
@@ -19,7 +19,7 @@ export declare const TextSecondary: import("@emotion/styled").StyledComponent<im
|
|
|
19
19
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
20
20
|
variant?: "button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)" | undefined;
|
|
21
21
|
variantMapping?: Partial<Record<"button" | "caption" | "h1" | "h2" | "h3" | "h4" | "h5" | "h6" | "inherit" | "subtitle1" | "subtitle2" | "body1" | "body2" | "overline" | "@supports (font-variation-settings: normal)", string>> | undefined;
|
|
22
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
22
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "ref"> & {
|
|
23
23
|
ref?: ((instance: HTMLSpanElement | null) => void) | import("react").RefObject<HTMLSpanElement> | null | undefined;
|
|
24
24
|
}, keyof import("@mui/material/OverridableComponent").CommonProps | "children" | "sx" | "variant" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "align" | "gutterBottom" | "noWrap" | "paragraph" | "variantMapping"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
|
|
25
25
|
connected?: boolean | undefined;
|
|
@@ -30,6 +30,6 @@ export declare const TokenDivider: import("@emotion/styled").StyledComponent<imp
|
|
|
30
30
|
component?: import("react").ElementType<any> | undefined;
|
|
31
31
|
ref?: import("react").Ref<unknown> | undefined;
|
|
32
32
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
33
|
-
} & Omit<
|
|
33
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
34
34
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
35
35
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -4,20 +4,19 @@ import { useChain, useToken } from '../../hooks';
|
|
|
4
4
|
import { SmallAvatar, SmallAvatarSkeleton } from '../SmallAvatar';
|
|
5
5
|
import { AvatarDefault, AvatarDefaultBadge } from './TokenAvatar.style';
|
|
6
6
|
export const TokenAvatarFallback = ({ token, isLoading, sx }) => {
|
|
7
|
-
const { chain } = useChain(token
|
|
8
|
-
const { token: chainToken, isLoading: isLoadingToken } = useToken(token
|
|
9
|
-
return (_jsx(TokenAvatarBase, { token: chainToken
|
|
7
|
+
const { chain } = useChain(token?.chainId);
|
|
8
|
+
const { token: chainToken, isLoading: isLoadingToken } = useToken(token?.chainId, token?.address);
|
|
9
|
+
return (_jsx(TokenAvatarBase, { token: chainToken ?? token, isLoading: isLoading || isLoadingToken, chain: chain, sx: sx }));
|
|
10
10
|
};
|
|
11
11
|
export const TokenAvatarBase = ({ token, chain, isLoading, sx }) => {
|
|
12
|
-
|
|
13
|
-
return (_jsx(Badge, Object.assign({ overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain && !isLoading ? (_jsx(SmallAvatar, Object.assign({ src: chain.logoURI, alt: chain.name }, { children: chain.name[0] }))) : (_jsx(SmallAvatarSkeleton, {})), sx: sx }, { children: isLoading ? (_jsx(Skeleton, { width: 32, height: 32, variant: "circular" })) : (_jsx(Avatar, Object.assign({ src: token === null || token === void 0 ? void 0 : token.logoURI, alt: token === null || token === void 0 ? void 0 : token.symbol }, { children: (_a = token === null || token === void 0 ? void 0 : token.symbol) === null || _a === void 0 ? void 0 : _a[0] }))) })));
|
|
12
|
+
return (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: chain && !isLoading ? (_jsx(SmallAvatar, { src: chain.logoURI, alt: chain.name, children: chain.name[0] })) : (_jsx(SmallAvatarSkeleton, {})), sx: sx, children: isLoading ? (_jsx(Skeleton, { width: 32, height: 32, variant: "circular" })) : (_jsx(Avatar, { src: token?.logoURI, alt: token?.symbol, children: token?.symbol?.[0] })) }));
|
|
14
13
|
};
|
|
15
14
|
export const TokenAvatar = ({ token, chain, isLoading, sx }) => {
|
|
16
|
-
if (!chain || !
|
|
15
|
+
if (!chain || !token?.logoURI) {
|
|
17
16
|
return _jsx(TokenAvatarFallback, { token: token, isLoading: isLoading, sx: sx });
|
|
18
17
|
}
|
|
19
18
|
return (_jsx(TokenAvatarBase, { token: token, chain: chain, isLoading: isLoading, sx: sx }));
|
|
20
19
|
};
|
|
21
20
|
export const TokenAvatarDefault = ({ sx }) => {
|
|
22
|
-
return (_jsx(Badge,
|
|
21
|
+
return (_jsx(Badge, { overlap: "circular", anchorOrigin: { vertical: 'bottom', horizontal: 'right' }, badgeContent: _jsx(AvatarDefaultBadge, { width: 16, height: 16 }), sx: sx, children: _jsx(AvatarDefault, { width: 32, height: 32 }) }));
|
|
23
22
|
};
|
|
@@ -5,7 +5,7 @@ export declare const AvatarDefault: import("@emotion/styled").StyledComponent<im
|
|
|
5
5
|
component?: import("react").ElementType<any> | undefined;
|
|
6
6
|
ref?: import("react").Ref<unknown> | undefined;
|
|
7
7
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
8
|
-
} & Omit<
|
|
8
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
9
9
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
10
10
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
11
11
|
export declare const AvatarDefaultBadge: import("@emotion/styled").StyledComponent<import("@mui/system").SystemProps<import("@mui/material").Theme> & {
|
|
@@ -13,6 +13,6 @@ export declare const AvatarDefaultBadge: import("@emotion/styled").StyledCompone
|
|
|
13
13
|
component?: import("react").ElementType<any> | undefined;
|
|
14
14
|
ref?: import("react").Ref<unknown> | undefined;
|
|
15
15
|
sx?: import("@mui/material").SxProps<import("@mui/material").Theme> | undefined;
|
|
16
|
-
} & Omit<
|
|
16
|
+
} & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
17
17
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
18
18
|
}, "children" | "sx" | "ref" | ("p" | "color" | "border" | "boxShadow" | "fontWeight" | "zIndex" | "alignContent" | "alignItems" | "alignSelf" | "bottom" | "boxSizing" | "columnGap" | "display" | "flexBasis" | "flexDirection" | "flexGrow" | "flexShrink" | "flexWrap" | "fontFamily" | "fontSize" | "fontStyle" | "gridAutoColumns" | "gridAutoFlow" | "gridAutoRows" | "gridTemplateAreas" | "gridTemplateColumns" | "gridTemplateRows" | "height" | "justifyContent" | "justifyItems" | "justifySelf" | "left" | "letterSpacing" | "lineHeight" | "marginBottom" | "marginLeft" | "marginRight" | "marginTop" | "maxHeight" | "maxWidth" | "minHeight" | "minWidth" | "order" | "paddingBottom" | "paddingLeft" | "paddingRight" | "paddingTop" | "position" | "right" | "rowGap" | "textAlign" | "textOverflow" | "textTransform" | "top" | "visibility" | "whiteSpace" | "width" | "borderBottom" | "borderColor" | "borderLeft" | "borderRadius" | "borderRight" | "borderTop" | "flex" | "gap" | "gridArea" | "gridColumn" | "gridRow" | "margin" | "overflow" | "padding" | "bgcolor" | "m" | "mt" | "mr" | "mb" | "ml" | "mx" | "marginX" | "my" | "marginY" | "pt" | "pr" | "pb" | "pl" | "px" | "paddingX" | "py" | "paddingY" | "typography" | "displayPrint") | "component"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -8,7 +8,6 @@ import { TokenNotFound } from './TokenNotFound';
|
|
|
8
8
|
import { useTokenSelect } from './useTokenSelect';
|
|
9
9
|
import { VirtualizedTokenList } from './VirtualizedTokenList';
|
|
10
10
|
export const TokenList = ({ formType, height, onClick, }) => {
|
|
11
|
-
var _a, _b;
|
|
12
11
|
const parentRef = useRef(null);
|
|
13
12
|
const { account } = useWallet();
|
|
14
13
|
const [selectedChainId] = useWatch({
|
|
@@ -16,8 +15,8 @@ export const TokenList = ({ formType, height, onClick, }) => {
|
|
|
16
15
|
});
|
|
17
16
|
const [tokenSearchFilter] = useDebouncedWatch([SwapFormKey.TokenSearchFilter], 320);
|
|
18
17
|
const { tokens: chainTokens, tokensWithBalance, isLoading: isTokensLoading, isBalanceLoading, featuredTokens, } = useTokenBalances(selectedChainId);
|
|
19
|
-
let filteredTokens = (
|
|
20
|
-
const searchFilter =
|
|
18
|
+
let filteredTokens = (tokensWithBalance ?? chainTokens ?? []);
|
|
19
|
+
const searchFilter = tokenSearchFilter?.toUpperCase() ?? '';
|
|
21
20
|
filteredTokens = tokenSearchFilter
|
|
22
21
|
? filteredTokens.filter((token) => token.name.toUpperCase().includes(searchFilter) ||
|
|
23
22
|
token.symbol.toUpperCase().includes(searchFilter) ||
|
|
@@ -35,5 +34,5 @@ export const TokenList = ({ formType, height, onClick, }) => {
|
|
|
35
34
|
? [searchedToken]
|
|
36
35
|
: filteredTokens;
|
|
37
36
|
const handleTokenClick = useTokenSelect(formType, onClick);
|
|
38
|
-
return (_jsxs(Box,
|
|
37
|
+
return (_jsxs(Box, { ref: parentRef, style: { height, overflow: 'auto' }, children: [!tokens.length && !isLoading ? (_jsx(TokenNotFound, { formType: formType })) : null, _jsx(VirtualizedTokenList, { tokens: tokens, featuredTokensLength: featuredTokens?.length, scrollElementRef: parentRef, chainId: selectedChainId, isLoading: isLoading, isBalanceLoading: isBalanceLoading, showBalance: account.isActive, showFeatured: !tokenSearchFilter, onClick: handleTokenClick })] }));
|
|
39
38
|
};
|
|
@@ -15,7 +15,7 @@ export declare const ListItemButton: import("@emotion/styled").StyledComponent<i
|
|
|
15
15
|
tabIndex?: number | undefined;
|
|
16
16
|
TouchRippleProps?: Partial<import("@mui/material/ButtonBase/TouchRipple").TouchRippleProps> | undefined;
|
|
17
17
|
touchRippleRef?: import("react").Ref<import("@mui/material/ButtonBase/TouchRipple").TouchRippleActions> | undefined;
|
|
18
|
-
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
18
|
+
}, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "ref"> & {
|
|
19
19
|
ref?: import("react").RefObject<HTMLDivElement> | ((instance: HTMLDivElement | null) => void) | null | undefined;
|
|
20
20
|
}, "className" | "style" | "classes" | "tabIndex" | "children" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "alignItems" | "autoFocus" | "dense" | "divider" | "selected" | "disableGutters"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
21
21
|
export declare const ListItem: import("@emotion/styled").StyledComponent<{
|
|
@@ -33,6 +33,6 @@ export declare const ListItem: import("@emotion/styled").StyledComponent<{
|
|
|
33
33
|
slots?: {
|
|
34
34
|
root?: import("react").ElementType<any> | undefined;
|
|
35
35
|
} | undefined;
|
|
36
|
-
} & import("@mui/material/OverridableComponent").CommonProps & Omit<
|
|
36
|
+
} & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
|
|
37
37
|
ref?: ((instance: HTMLLIElement | null) => void) | import("react").RefObject<HTMLLIElement> | null | undefined;
|
|
38
38
|
}, "button" | "className" | "style" | "classes" | "children" | "disabled" | "sx" | "alignItems" | "autoFocus" | "dense" | "divider" | "components" | "componentsProps" | "slotProps" | "slots" | "selected" | "disableGutters" | "ContainerComponent" | "ContainerProps" | "disablePadding" | "secondaryAction"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import { ListItem as MuiListItem
|
|
1
|
+
import { ListItem as MuiListItem } from '@mui/material';
|
|
2
2
|
import { listItemSecondaryActionClasses } from '@mui/material/ListItemSecondaryAction';
|
|
3
3
|
import { listItemTextClasses } from '@mui/material/ListItemText';
|
|
4
4
|
import { styled } from '@mui/material/styles';
|
|
5
|
-
import {
|
|
6
|
-
export const ListItemButton = styled(
|
|
7
|
-
borderRadius: theme.shape.borderRadius,
|
|
5
|
+
import { ListItemButton as ListItemButtonBase } from '../ListItemButton';
|
|
6
|
+
export const ListItemButton = styled(ListItemButtonBase)(({ theme }) => ({
|
|
8
7
|
paddingLeft: theme.spacing(1.5),
|
|
9
8
|
paddingRight: theme.spacing(1.5),
|
|
10
9
|
height: 64,
|
|
11
10
|
width: '100%',
|
|
12
|
-
'&:hover': {
|
|
13
|
-
backgroundColor: getContrastAlphaColor(theme, '4%'),
|
|
14
|
-
},
|
|
15
11
|
}));
|
|
16
12
|
export const ListItem = styled(MuiListItem)(({ theme }) => ({
|
|
17
13
|
position: 'absolute',
|
|
@@ -5,28 +5,28 @@ import { useTranslation } from 'react-i18next';
|
|
|
5
5
|
import { formatTokenPrice } from '../../utils';
|
|
6
6
|
import { ListItem, ListItemButton } from './TokenList.style';
|
|
7
7
|
export const TokenListItem = memo(({ onClick, size, start, token, showBalance, isBalanceLoading, startAdornment, endAdornment, }) => {
|
|
8
|
-
const handleClick = () => onClick
|
|
9
|
-
return (_jsxs(ListItem,
|
|
8
|
+
const handleClick = () => onClick?.(token.address);
|
|
9
|
+
return (_jsxs(ListItem, { disablePadding: true, style: {
|
|
10
10
|
height: `${size}px`,
|
|
11
11
|
transform: `translateY(${start}px)`,
|
|
12
|
-
}
|
|
12
|
+
}, children: [startAdornment, _jsx(TokenListItemButton, { token: token, showBalance: showBalance, isBalanceLoading: isBalanceLoading, onClick: handleClick }), endAdornment] }));
|
|
13
13
|
});
|
|
14
14
|
export const TokenListItemButton = ({ onClick, token, showBalance, isBalanceLoading, }) => {
|
|
15
15
|
const { t } = useTranslation();
|
|
16
16
|
const tokenPrice = formatTokenPrice(token.amount, token.priceUSD);
|
|
17
|
-
return (_jsxs(ListItemButton,
|
|
17
|
+
return (_jsxs(ListItemButton, { onClick: onClick, dense: true, disableRipple: true, children: [_jsx(ListItemAvatar, { children: _jsx(Avatar, { src: token.logoURI, alt: token.symbol, children: token.symbol[0] }) }), _jsx(ListItemText, { primary: token.symbol, secondary: token.name }), showBalance ? (isBalanceLoading ? (_jsx(TokenAmountSkeleton, {})) : (_jsxs(Box, { sx: { textAlign: 'right' }, children: [Number(token.amount) ? (_jsx(Typography, { variant: "body1", noWrap: true, children: t('format.number', {
|
|
18
18
|
value: token.amount,
|
|
19
|
-
}) }))
|
|
19
|
+
}) })) : null, tokenPrice ? (_jsx(Typography, { fontWeight: 400, fontSize: 12, color: "text.secondary", "data-price": token.priceUSD, children: t(`format.currency`, {
|
|
20
20
|
value: tokenPrice,
|
|
21
|
-
}) }))
|
|
21
|
+
}) })) : null] }))) : null] }));
|
|
22
22
|
};
|
|
23
23
|
export const TokenListItemSkeleton = () => {
|
|
24
|
-
return (_jsxs(ListItem,
|
|
24
|
+
return (_jsxs(ListItem, { secondaryAction: _jsx(TokenAmountSkeleton, {}), disablePadding: true, sx: { position: 'relative', flexDirection: 'row', alignItems: 'center' }, children: [_jsx(ListItemAvatar, { children: _jsx(Skeleton, { variant: "circular", width: 32, height: 32, sx: { marginLeft: 1.5, marginRight: 2 } }) }), _jsx(ListItemText, { primary: _jsx(Skeleton, { variant: "text", width: 48, height: 20 }), secondary: _jsx(Skeleton, { variant: "text", width: 96, height: 20 }) })] }));
|
|
25
25
|
};
|
|
26
26
|
export const TokenAmountSkeleton = () => {
|
|
27
|
-
return (_jsxs(Box,
|
|
27
|
+
return (_jsxs(Box, { sx: {
|
|
28
28
|
display: 'flex',
|
|
29
29
|
flexDirection: 'column',
|
|
30
30
|
alignItems: 'flex-end',
|
|
31
|
-
}
|
|
31
|
+
}, children: [_jsx(Skeleton, { variant: "text", width: 56, height: 24 }), _jsx(Skeleton, { variant: "text", width: 48, height: 18 })] }));
|
|
32
32
|
};
|
|
@@ -6,20 +6,19 @@ import { useTranslation } from 'react-i18next';
|
|
|
6
6
|
import { useChains } from '../../hooks';
|
|
7
7
|
import { SwapFormKeyHelper } from '../../providers';
|
|
8
8
|
export const TokenNotFound = ({ formType }) => {
|
|
9
|
-
var _a;
|
|
10
9
|
const { t } = useTranslation();
|
|
11
10
|
const [selectedChainId] = useWatch({
|
|
12
11
|
name: [SwapFormKeyHelper.getChainKey(formType)],
|
|
13
12
|
});
|
|
14
13
|
const { getChainById } = useChains();
|
|
15
|
-
return (_jsxs(Box,
|
|
14
|
+
return (_jsxs(Box, { sx: {
|
|
16
15
|
display: 'flex',
|
|
17
16
|
justifyContent: 'center',
|
|
18
17
|
alignItems: 'center',
|
|
19
18
|
flexDirection: 'column',
|
|
20
19
|
flex: 1,
|
|
21
20
|
padding: 3,
|
|
22
|
-
}
|
|
23
|
-
chainName:
|
|
24
|
-
}) })
|
|
21
|
+
}, children: [_jsx(Typography, { fontSize: 48, lineHeight: 1, children: _jsx(SearchOffIcon, { fontSize: "inherit" }) }), _jsx(Typography, { fontSize: 14, color: "text.secondary", textAlign: "center", mt: 2, px: 2, children: t('swap.info.message.emptyTokenList', {
|
|
22
|
+
chainName: getChainById(selectedChainId)?.name,
|
|
23
|
+
}) })] }));
|
|
25
24
|
};
|
|
@@ -7,7 +7,7 @@ import { TokenListItem, TokenListItemSkeleton } from './TokenListItem';
|
|
|
7
7
|
export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollElementRef, chainId, isLoading, isBalanceLoading, showBalance, showFeatured, onClick, }) => {
|
|
8
8
|
const { t } = useTranslation();
|
|
9
9
|
const hasFeaturedTokens = !!featuredTokensLength && showFeatured;
|
|
10
|
-
const featuredTokensLastIndex = (featuredTokensLength
|
|
10
|
+
const featuredTokensLastIndex = (featuredTokensLength ?? 0) - 1;
|
|
11
11
|
const tokensLastIndex = tokens.length - 1;
|
|
12
12
|
const { getVirtualItems, getTotalSize, scrollToIndex } = useVirtualizer({
|
|
13
13
|
count: tokens.length,
|
|
@@ -15,25 +15,24 @@ export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollEleme
|
|
|
15
15
|
overscan: 10,
|
|
16
16
|
paddingEnd: 12,
|
|
17
17
|
estimateSize: (index) => {
|
|
18
|
-
var _a, _b;
|
|
19
18
|
// heigth of TokenListItem
|
|
20
19
|
let size = 64;
|
|
21
20
|
if (!hasFeaturedTokens) {
|
|
22
21
|
return size;
|
|
23
22
|
}
|
|
24
|
-
if (index === 0 &&
|
|
23
|
+
if (index === 0 && tokens[index]?.featured) {
|
|
25
24
|
// height of startAdornment
|
|
26
25
|
size += 24;
|
|
27
26
|
}
|
|
28
27
|
if (index === featuredTokensLastIndex &&
|
|
29
28
|
index !== tokensLastIndex &&
|
|
30
|
-
|
|
29
|
+
tokens[index]?.featured) {
|
|
31
30
|
// height of endAdornment
|
|
32
31
|
size += 32;
|
|
33
32
|
}
|
|
34
33
|
return size;
|
|
35
34
|
},
|
|
36
|
-
getItemKey: (index) =>
|
|
35
|
+
getItemKey: (index) => tokens[index].address ?? index,
|
|
37
36
|
});
|
|
38
37
|
useEffect(() => {
|
|
39
38
|
if (getVirtualItems().length) {
|
|
@@ -41,15 +40,15 @@ export const VirtualizedTokenList = ({ tokens, featuredTokensLength, scrollEleme
|
|
|
41
40
|
}
|
|
42
41
|
}, [scrollToIndex, chainId, getVirtualItems]);
|
|
43
42
|
if (isLoading) {
|
|
44
|
-
return (_jsx(List,
|
|
43
|
+
return (_jsx(List, { disablePadding: true, children: Array.from({ length: 3 }).map((_, index) => (
|
|
45
44
|
// eslint-disable-next-line react/no-array-index-key
|
|
46
|
-
_jsx(TokenListItemSkeleton, {}, index))) }))
|
|
45
|
+
_jsx(TokenListItemSkeleton, {}, index))) }));
|
|
47
46
|
}
|
|
48
|
-
return (_jsx(List,
|
|
47
|
+
return (_jsx(List, { style: { height: getTotalSize() }, disablePadding: true, children: getVirtualItems().map((item) => {
|
|
49
48
|
const token = tokens[item.index];
|
|
50
|
-
return (_jsx(TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? (_jsx(Typography,
|
|
49
|
+
return (_jsx(TokenListItem, { onClick: onClick, size: item.size, start: item.start, token: token, isBalanceLoading: isBalanceLoading, showBalance: showBalance, startAdornment: hasFeaturedTokens && token.featured && item.index === 0 ? (_jsx(Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, pb: 1.25, children: t('swap.featuredTokens') })) : null, endAdornment: hasFeaturedTokens &&
|
|
51
50
|
token.featured &&
|
|
52
51
|
item.index === featuredTokensLastIndex &&
|
|
53
|
-
item.index !== tokensLastIndex ? (_jsx(Typography,
|
|
54
|
-
}) }))
|
|
52
|
+
item.index !== tokensLastIndex ? (_jsx(Typography, { fontSize: 14, fontWeight: 600, lineHeight: 1, px: 2, py: 1.25, children: t('swap.otherTokens') })) : null }, item.key));
|
|
53
|
+
}) }));
|
|
55
54
|
};
|
|
@@ -8,7 +8,7 @@ export const useTokenSelect = (formType, onClick) => {
|
|
|
8
8
|
return useCallback((tokenAddress, chainId) => {
|
|
9
9
|
onChange(tokenAddress);
|
|
10
10
|
onBlur();
|
|
11
|
-
const selectedChainId = chainId
|
|
11
|
+
const selectedChainId = chainId ?? getValues(SwapFormKeyHelper.getChainKey(formType));
|
|
12
12
|
// Set chain again to trigger URL builder update
|
|
13
13
|
setValue(SwapFormKeyHelper.getChainKey(formType), selectedChainId, {
|
|
14
14
|
shouldDirty: true,
|
|
@@ -27,6 +27,6 @@ export const useTokenSelect = (formType, onClick) => {
|
|
|
27
27
|
shouldTouch: true,
|
|
28
28
|
});
|
|
29
29
|
}
|
|
30
|
-
onClick
|
|
30
|
+
onClick?.();
|
|
31
31
|
}, [formType, getValues, onBlur, onChange, onClick, setValue]);
|
|
32
32
|
};
|
package/config/env.js
CHANGED
package/config/sentry.js
CHANGED
|
@@ -1,20 +1,11 @@
|
|
|
1
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
-
});
|
|
9
|
-
};
|
|
10
1
|
import { version } from './version';
|
|
11
2
|
let sentryLoaded = false;
|
|
12
|
-
export const initSentry = (enabled) =>
|
|
3
|
+
export const initSentry = async (enabled) => {
|
|
13
4
|
if (process.env.NODE_ENV === 'development') {
|
|
14
5
|
return;
|
|
15
6
|
}
|
|
16
7
|
if (enabled || sentryLoaded) {
|
|
17
|
-
const [Sentry, { CaptureConsole }, { BrowserTracing }] =
|
|
8
|
+
const [Sentry, { CaptureConsole }, { BrowserTracing }] = await Promise.all([
|
|
18
9
|
import('@sentry/react'),
|
|
19
10
|
import('@sentry/integrations'),
|
|
20
11
|
import('@sentry/tracing'),
|
|
@@ -35,4 +26,4 @@ export const initSentry = (enabled) => __awaiter(void 0, void 0, void 0, functio
|
|
|
35
26
|
});
|
|
36
27
|
sentryLoaded = true;
|
|
37
28
|
}
|
|
38
|
-
}
|
|
29
|
+
};
|