@rango-dev/widget-embedded 0.12.1-next.2 → 0.12.1-next.21
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/dist/Wallets.d.ts +4 -3
- package/dist/Wallets.d.ts.map +1 -1
- package/dist/Widget.d.ts +3 -2
- package/dist/Widget.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +3 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +307 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts +8 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts.map +1 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts +3 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/index.d.ts +2 -0
- package/dist/components/BlockchainList/index.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts +5 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts +156 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts +6 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/index.d.ts +2 -0
- package/dist/components/BlockchainsChip/index.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts +3 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts +4 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +154 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts +9 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/index.d.ts +2 -0
- package/dist/components/BlockchainsSection/index.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +6 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +2597 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +11 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +460 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +12 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -0
- package/dist/components/HeaderButtons/BackButton.d.ts +5 -0
- package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts +5 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +895 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +12 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts +4 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts +3 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts +5 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/index.d.ts +5 -0
- package/dist/components/HeaderButtons/index.d.ts.map +1 -0
- package/dist/components/Layout/Layout.d.ts +7 -0
- package/dist/components/Layout/Layout.d.ts.map +1 -0
- package/dist/components/Layout/Layout.styles.d.ts +464 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -0
- package/dist/components/Layout/Layout.types.d.ts +17 -0
- package/dist/components/Layout/Layout.types.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts +3 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +155 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts +2 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts +3 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +460 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/index.d.ts +2 -0
- package/dist/components/LoadingSwapDetails/index.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts +460 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.types.d.ts +20 -0
- package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
- package/dist/components/NoRoutes/index.d.ts +2 -0
- package/dist/components/NoRoutes/index.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts +3 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +613 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts +3 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts.map +1 -0
- package/dist/components/NotificationContent/index.d.ts +2 -0
- package/dist/components/NotificationContent/index.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts +613 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
- package/dist/components/RouteErrors/index.d.ts +2 -0
- package/dist/components/RouteErrors/index.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.d.ts +4 -0
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts +154 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +10 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -0
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/SearchInput/index.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +460 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts +12 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/index.d.ts +2 -0
- package/dist/components/SelectableCategoryList/index.d.ts.map +1 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +766 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -0
- package/dist/components/SettingsContainer/index.d.ts +2 -0
- package/dist/components/SettingsContainer/index.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.d.ts +3 -0
- package/dist/components/Slippage/Slippage.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.styles.d.ts +613 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts +3 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts.map +1 -0
- package/dist/components/Slippage/index.d.ts +2 -0
- package/dist/components/Slippage/index.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +8 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +919 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts +12 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts.map +1 -0
- package/dist/components/SwapDetails/index.d.ts +2 -0
- package/dist/components/SwapDetails/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +154 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +20 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts +3 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +154 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +46 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/index.d.ts +4 -0
- package/dist/components/SwapDetailsModal/index.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts +4 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +613 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts +12 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +1 -0
- package/dist/components/SwapsGroup/index.d.ts +2 -0
- package/dist/components/SwapsGroup/index.d.ts.map +1 -0
- package/dist/components/SwitchFromAndTo.d.ts +1 -1
- package/dist/components/SwitchFromAndTo.d.ts.map +1 -1
- package/dist/components/TokenList/LoadingTokenList.d.ts +4 -0
- package/dist/components/TokenList/LoadingTokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.d.ts +4 -0
- package/dist/components/TokenList/TokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts +3 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.styles.d.ts +1532 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.types.d.ts +41 -0
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -0
- package/dist/components/TokenList/index.d.ts +3 -0
- package/dist/components/TokenList/index.d.ts.map +1 -0
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModal.d.ts +4 -0
- package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +613 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -0
- package/dist/components/WalletModal/index.d.ts +2 -0
- package/dist/components/WalletModal/index.d.ts.map +1 -0
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +29 -0
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +7 -0
- package/dist/constants/messages.d.ts.map +1 -0
- package/dist/constants/navigationRoutes.d.ts +8 -4
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/routing.d.ts +13 -0
- package/dist/constants/routing.d.ts.map +1 -0
- package/dist/constants/searchParams.d.ts +2 -2
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/constants/swapSettings.d.ts.map +1 -1
- package/dist/constants/wallets.d.ts +3 -0
- package/dist/constants/wallets.d.ts.map +1 -0
- package/dist/constants/warnings.d.ts +3 -0
- package/dist/constants/warnings.d.ts.map +1 -0
- package/dist/globalStyles.d.ts +1 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap.d.ts +14 -6
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useFetchBestRoute.d.ts +9 -0
- package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts +12 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts +3 -29
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts +20 -0
- package/dist/hooks/useWalletList.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +6 -3
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts +3 -0
- package/dist/pages/LanguagePage.d.ts.map +1 -0
- package/dist/pages/LiquiditySourcePage.d.ts +8 -0
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -0
- package/dist/pages/SelectBlockchainPage.d.ts +8 -0
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -0
- package/dist/pages/SelectSwapItemsPage.d.ts +11 -0
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts +3 -0
- package/dist/pages/ThemePage.d.ts.map +1 -0
- package/dist/pages/WalletsPage.d.ts +4 -2
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +32 -19
- package/dist/store/bestRoute.d.ts.map +1 -1
- package/dist/store/meta.d.ts +10 -3
- package/dist/store/meta.d.ts.map +1 -1
- package/dist/store/notification.d.ts +38 -0
- package/dist/store/notification.d.ts.map +1 -0
- package/dist/store/settings.d.ts +2 -2
- package/dist/store/settings.d.ts.map +1 -1
- package/dist/store/ui.d.ts +0 -2
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -12
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +11 -6
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/notification.d.ts +22 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/routing.d.ts +30 -23
- package/dist/types/routing.d.ts.map +1 -1
- package/dist/types/swap.d.ts +8 -1
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/utils/common.d.ts +5 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +3 -0
- package/dist/utils/meta.d.ts.map +1 -0
- package/dist/utils/numbers.d.ts +2 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +10 -7
- package/dist/utils/routing.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +10 -0
- package/dist/utils/settings.d.ts.map +1 -0
- package/dist/utils/swap.d.ts +29 -14
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +20 -14
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Wallets.tsx +23 -17
- package/src/Widget.tsx +88 -28
- package/src/components/AppRouter.tsx +36 -6
- package/src/components/AppRoutes.tsx +54 -19
- package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
- package/src/components/BlockchainList/BlockchainList.styles.ts +19 -0
- package/src/components/BlockchainList/BlockchainList.tsx +73 -0
- package/src/components/BlockchainList/BlockchainList.types.ts +8 -0
- package/src/components/BlockchainList/LoadingBlockchainList.tsx +20 -0
- package/src/components/BlockchainList/index.ts +1 -0
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +30 -0
- package/src/components/BlockchainsChip/BlockchainsChip.tsx +15 -0
- package/src/components/BlockchainsChip/BlockchainsChip.types.ts +4 -0
- package/src/components/BlockchainsChip/index.ts +1 -0
- package/src/components/BlockchainsSection/BlockchainSection.helpers.ts +20 -0
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +100 -0
- package/src/components/BlockchainsSection/BlockchainsSection.types.ts +9 -0
- package/src/components/BlockchainsSection/index.ts +1 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +86 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +169 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +460 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +11 -0
- package/src/components/ConfirmWalletsModal/WalletList.styles.ts +34 -0
- package/src/components/ConfirmWalletsModal/WalletList.tsx +250 -0
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +12 -0
- package/src/components/HeaderButtons/BackButton.tsx +16 -0
- package/src/components/HeaderButtons/CancelButton.tsx +21 -0
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +40 -0
- package/src/components/HeaderButtons/HeaderButtons.types.ts +11 -0
- package/src/components/HeaderButtons/HomeButtons.tsx +68 -0
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +20 -0
- package/src/components/HeaderButtons/WalletButton.tsx +20 -0
- package/src/components/HeaderButtons/index.ts +4 -0
- package/src/components/Layout/Layout.styles.ts +50 -0
- package/src/components/Layout/Layout.tsx +72 -0
- package/src/components/Layout/Layout.types.ts +20 -0
- package/src/components/Layout/index.ts +1 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +5 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +23 -0
- package/src/components/LoadingLiquiditySourceList/index.ts +1 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +78 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +53 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
- package/src/components/LoadingSwapDetails/index.ts +1 -0
- package/src/components/NoRoutes/NoRoutes.helper.ts +50 -0
- package/src/components/NoRoutes/NoRoutes.styles.ts +15 -0
- package/src/components/NoRoutes/NoRoutes.tsx +81 -0
- package/src/components/NoRoutes/NoRoutes.types.ts +21 -0
- package/src/components/NoRoutes/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.styles.ts +34 -0
- package/src/components/NotificationContent/NotificationContent.tsx +107 -0
- package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
- package/src/components/NotificationContent/index.ts +1 -0
- package/src/components/RouteErrors/RouteErrors.styles.ts +28 -0
- package/src/components/RouteErrors/RouteErrors.tsx +79 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +128 -0
- package/src/components/RouteErrors/RouteErrorsModalItem.tsx +24 -0
- package/src/components/RouteErrors/index.ts +1 -0
- package/src/components/SearchInput/SearchInput.styles.ts +9 -0
- package/src/components/SearchInput/SearchInput.tsx +51 -0
- package/src/components/SearchInput/SearchInput.types.ts +10 -0
- package/src/components/SearchInput/index.ts +1 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +20 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.styles.ts +21 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +79 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.types.ts +12 -0
- package/src/components/SelectableCategoryList/index.ts +1 -0
- package/src/components/SettingsContainer/SettingsContainer.style.ts +33 -0
- package/src/components/SettingsContainer/index.ts +7 -0
- package/src/components/Slippage/Slippage.styles.ts +24 -0
- package/src/components/Slippage/Slippage.tsx +90 -0
- package/src/components/Slippage/SlippageTooltipContent.tsx +23 -0
- package/src/components/Slippage/index.ts +1 -0
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +79 -0
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +85 -0
- package/src/components/SwapDetails/SwapDetails.styles.ts +68 -0
- package/src/components/SwapDetails/SwapDetails.tsx +419 -0
- package/src/components/SwapDetails/SwapDetails.types.ts +12 -0
- package/src/components/SwapDetails/index.ts +1 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +36 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +55 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +7 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +74 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +28 -0
- package/src/components/SwapDetailsAlerts/index.ts +2 -0
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +101 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +31 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +22 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +6 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +45 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +54 -0
- package/src/components/SwapDetailsModal/index.ts +3 -0
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +26 -0
- package/src/components/SwapsGroup/SwapsGroup.tsx +125 -0
- package/src/components/SwapsGroup/SwapsGroup.types.ts +13 -0
- package/src/components/SwapsGroup/index.ts +1 -0
- package/src/components/SwitchFromAndTo.tsx +23 -41
- package/src/components/TokenList/LoadingTokenList.tsx +34 -0
- package/src/components/TokenList/TokenList.helpers.ts +13 -0
- package/src/components/TokenList/TokenList.styles.ts +121 -0
- package/src/components/TokenList/TokenList.tsx +271 -0
- package/src/components/TokenList/TokenList.types.ts +48 -0
- package/src/components/TokenList/index.ts +2 -0
- package/src/components/UpdateUrl.tsx +40 -22
- package/src/components/WalletModal/WalletModal.tsx +20 -0
- package/src/components/WalletModal/WalletModal.types.ts +11 -0
- package/src/components/WalletModal/WalletModalContent.styles.ts +44 -0
- package/src/components/WalletModal/WalletModalContent.tsx +54 -0
- package/src/components/WalletModal/index.ts +1 -0
- package/src/components/WidgetEvents.tsx +37 -5
- package/src/constants/errors.ts +56 -1
- package/src/constants/messages.ts +8 -0
- package/src/constants/navigationRoutes.ts +8 -4
- package/src/constants/routing.ts +17 -0
- package/src/constants/searchParams.ts +2 -2
- package/src/constants/swapSettings.ts +5 -1
- package/src/constants/wallets.ts +3 -0
- package/src/constants/warnings.ts +26 -0
- package/src/globalStyles.ts +1 -4
- package/src/hooks/useConfirmSwap.ts +251 -220
- package/src/hooks/useFetchBestRoute.ts +38 -0
- package/src/hooks/useNavigateBack.ts +25 -9
- package/src/hooks/useSwapInput.ts +116 -0
- package/src/hooks/useTheme.ts +35 -74
- package/src/hooks/useWalletList.ts +125 -0
- package/src/pages/ConfirmSwapPage.tsx +492 -228
- package/src/pages/HistoryPage.tsx +104 -15
- package/src/pages/Home.tsx +392 -110
- package/src/pages/LanguagePage.tsx +83 -0
- package/src/pages/LiquiditySourcePage.tsx +160 -0
- package/src/pages/SelectBlockchainPage.tsx +77 -0
- package/src/pages/SelectSwapItemsPage.tsx +169 -0
- package/src/pages/SettingsPage.tsx +144 -72
- package/src/pages/SwapDetailsPage.tsx +40 -141
- package/src/pages/ThemePage.tsx +96 -0
- package/src/pages/WalletsPage.tsx +73 -124
- package/src/store/bestRoute.ts +85 -180
- package/src/store/meta.ts +23 -3
- package/src/store/notification.ts +77 -0
- package/src/store/settings.ts +20 -13
- package/src/store/ui.ts +1 -5
- package/src/store/wallets.ts +92 -76
- package/src/types/config.ts +12 -7
- package/src/types/notification.ts +33 -0
- package/src/types/routing.ts +29 -28
- package/src/types/swap.ts +9 -1
- package/src/utils/common.ts +53 -3
- package/src/utils/configs.ts +3 -0
- package/src/utils/date.ts +15 -18
- package/src/utils/meta.ts +9 -0
- package/src/utils/numbers.ts +63 -18
- package/src/utils/routing.ts +105 -27
- package/src/utils/settings.ts +57 -0
- package/src/utils/swap.ts +200 -113
- package/src/utils/wallets.ts +165 -116
- package/dist/components/ConfirmSwapErrors.d.ts +0 -4
- package/dist/components/ConfirmSwapErrors.d.ts.map +0 -1
- package/dist/components/ConfirmSwapWarnings.d.ts +0 -3
- package/dist/components/ConfirmSwapWarnings.d.ts.map +0 -1
- package/dist/components/Layout.d.ts +0 -7
- package/dist/components/Layout.d.ts.map +0 -1
- package/dist/pages/LiquiditySourcesPage.d.ts +0 -7
- package/dist/pages/LiquiditySourcesPage.d.ts.map +0 -1
- package/dist/pages/SelectChainPage.d.ts +0 -8
- package/dist/pages/SelectChainPage.d.ts.map +0 -1
- package/dist/pages/SelectTokenPage.d.ts +0 -15
- package/dist/pages/SelectTokenPage.d.ts.map +0 -1
- package/src/components/ConfirmSwapErrors.tsx +0 -34
- package/src/components/ConfirmSwapWarnings.tsx +0 -22
- package/src/components/Layout.tsx +0 -105
- package/src/pages/LiquiditySourcesPage.tsx +0 -63
- package/src/pages/SelectChainPage.tsx +0 -42
- package/src/pages/SelectTokenPage.tsx +0 -64
|
@@ -0,0 +1,160 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
LiquiditySourceType,
|
|
3
|
+
UniqueSwappersGroupType,
|
|
4
|
+
} from '../utils/settings';
|
|
5
|
+
|
|
6
|
+
import { i18n } from '@lingui/core';
|
|
7
|
+
import {
|
|
8
|
+
Button,
|
|
9
|
+
Checkbox,
|
|
10
|
+
Image,
|
|
11
|
+
ListItemButton,
|
|
12
|
+
NotFound,
|
|
13
|
+
Typography,
|
|
14
|
+
} from '@rango-dev/ui';
|
|
15
|
+
import React, { useState } from 'react';
|
|
16
|
+
|
|
17
|
+
import { Layout } from '../components/Layout';
|
|
18
|
+
import { LoadingLiquiditySourceList } from '../components/LoadingLiquiditySourceList';
|
|
19
|
+
import { SearchInput } from '../components/SearchInput';
|
|
20
|
+
import {
|
|
21
|
+
LiquiditySourceDivider,
|
|
22
|
+
LiquiditySourceList,
|
|
23
|
+
LiquiditySourceSuffix,
|
|
24
|
+
NotFoundContainer,
|
|
25
|
+
SettingsContainer,
|
|
26
|
+
} from '../components/SettingsContainer';
|
|
27
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
28
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
29
|
+
import { useMetaStore } from '../store/meta';
|
|
30
|
+
import { useSettingsStore } from '../store/settings';
|
|
31
|
+
import { containsText } from '../utils/numbers';
|
|
32
|
+
import { getUniqueSwappersGroups } from '../utils/settings';
|
|
33
|
+
|
|
34
|
+
interface PropTypes {
|
|
35
|
+
supportedSwappers?: string[];
|
|
36
|
+
sourceType: 'Exchanges' | 'Bridges';
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export function LiquiditySourcePage({
|
|
40
|
+
supportedSwappers,
|
|
41
|
+
sourceType,
|
|
42
|
+
}: PropTypes) {
|
|
43
|
+
const [searchedFor, setSearchedFor] = useState<string>('');
|
|
44
|
+
const toggleLiquiditySource = useSettingsStore.use.toggleLiquiditySource();
|
|
45
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
46
|
+
const loadingMetaStatus = useMetaStore.use.loadingStatus();
|
|
47
|
+
|
|
48
|
+
const supportedUniqueSwappersGroups: Array<UniqueSwappersGroupType> =
|
|
49
|
+
getUniqueSwappersGroups(supportedSwappers);
|
|
50
|
+
|
|
51
|
+
const validTypes: Array<LiquiditySourceType> = [];
|
|
52
|
+
if (sourceType === 'Exchanges') {
|
|
53
|
+
validTypes.push('DEX');
|
|
54
|
+
}
|
|
55
|
+
if (sourceType === 'Bridges') {
|
|
56
|
+
validTypes.push('BRIDGE');
|
|
57
|
+
validTypes.push('AGGREGATOR');
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const liquiditySources = supportedUniqueSwappersGroups.filter((uniqueItem) =>
|
|
61
|
+
validTypes.includes(uniqueItem.type)
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const hasSelectAll =
|
|
65
|
+
liquiditySources.length ===
|
|
66
|
+
liquiditySources.filter((sourceItem) => sourceItem.selected).length;
|
|
67
|
+
|
|
68
|
+
const toggleAllSources = () => {
|
|
69
|
+
liquiditySources.forEach((sourceItem) => {
|
|
70
|
+
if (hasSelectAll) {
|
|
71
|
+
toggleLiquiditySource(sourceItem.groupTitle);
|
|
72
|
+
} else {
|
|
73
|
+
if (!sourceItem.selected) {
|
|
74
|
+
toggleLiquiditySource(sourceItem.groupTitle);
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
const list = liquiditySources.map((sourceItem) => {
|
|
81
|
+
const { selected, groupTitle, logo } = sourceItem;
|
|
82
|
+
return {
|
|
83
|
+
start: <Image src={logo} size={22} type="circular" />,
|
|
84
|
+
onClick: () => toggleLiquiditySource(groupTitle),
|
|
85
|
+
end: <Checkbox checked={selected} />,
|
|
86
|
+
title: (
|
|
87
|
+
<Typography variant="title" size="xmedium">
|
|
88
|
+
{i18n.t(groupTitle)}
|
|
89
|
+
</Typography>
|
|
90
|
+
),
|
|
91
|
+
...sourceItem,
|
|
92
|
+
};
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
const searchHandler = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
96
|
+
const value = event.target.value;
|
|
97
|
+
setSearchedFor(value);
|
|
98
|
+
};
|
|
99
|
+
|
|
100
|
+
let filteredList = list;
|
|
101
|
+
if (searchedFor) {
|
|
102
|
+
filteredList = list.filter((sourceItem) =>
|
|
103
|
+
containsText(sourceItem.groupTitle, searchedFor)
|
|
104
|
+
);
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
return (
|
|
108
|
+
<Layout
|
|
109
|
+
header={{
|
|
110
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
|
|
111
|
+
title: i18n.t(sourceType),
|
|
112
|
+
suffix: (
|
|
113
|
+
<LiquiditySourceSuffix>
|
|
114
|
+
<Button variant="ghost" size="xsmall" onClick={toggleAllSources}>
|
|
115
|
+
{i18n.t(hasSelectAll ? 'Deselect all' : 'Select all')}
|
|
116
|
+
</Button>
|
|
117
|
+
</LiquiditySourceSuffix>
|
|
118
|
+
),
|
|
119
|
+
}}>
|
|
120
|
+
<SettingsContainer>
|
|
121
|
+
<SearchInput
|
|
122
|
+
value={searchedFor}
|
|
123
|
+
setValue={setSearchedFor}
|
|
124
|
+
fullWidth
|
|
125
|
+
color="light"
|
|
126
|
+
variant="contained"
|
|
127
|
+
placeholder={i18n.t('Swap {sourceType}', { sourceType })}
|
|
128
|
+
onChange={searchHandler}
|
|
129
|
+
/>
|
|
130
|
+
{loadingMetaStatus === 'loading' && <LoadingLiquiditySourceList />}
|
|
131
|
+
|
|
132
|
+
{!filteredList.length && !!searchedFor ? (
|
|
133
|
+
<NotFoundContainer>
|
|
134
|
+
<NotFound
|
|
135
|
+
title={i18n.t('No results found')}
|
|
136
|
+
description={i18n.t('Try using different keywords')}
|
|
137
|
+
/>
|
|
138
|
+
</NotFoundContainer>
|
|
139
|
+
) : (
|
|
140
|
+
loadingMetaStatus === 'success' && (
|
|
141
|
+
<LiquiditySourceList>
|
|
142
|
+
{filteredList.map((sourceItem) => {
|
|
143
|
+
return (
|
|
144
|
+
<React.Fragment key={sourceItem.id}>
|
|
145
|
+
<ListItemButton
|
|
146
|
+
style={{ height: '61px' }}
|
|
147
|
+
{...sourceItem}
|
|
148
|
+
selected={false}
|
|
149
|
+
/>
|
|
150
|
+
<LiquiditySourceDivider />
|
|
151
|
+
</React.Fragment>
|
|
152
|
+
);
|
|
153
|
+
})}
|
|
154
|
+
</LiquiditySourceList>
|
|
155
|
+
)
|
|
156
|
+
)}
|
|
157
|
+
</SettingsContainer>
|
|
158
|
+
</Layout>
|
|
159
|
+
);
|
|
160
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core';
|
|
2
|
+
import { Divider } from '@rango-dev/ui';
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
|
|
5
|
+
import { BlockchainList } from '../components/BlockchainList';
|
|
6
|
+
import { Layout } from '../components/Layout';
|
|
7
|
+
import { SearchInput } from '../components/SearchInput';
|
|
8
|
+
import { SelectableCategoryList } from '../components/SelectableCategoryList';
|
|
9
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
10
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
11
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
12
|
+
import { useMetaStore } from '../store/meta';
|
|
13
|
+
|
|
14
|
+
interface PropTypes {
|
|
15
|
+
type: 'from' | 'to';
|
|
16
|
+
supportedBlockchains?: string[];
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function SelectBlockchainPage(props: PropTypes) {
|
|
20
|
+
const { type, supportedBlockchains } = props;
|
|
21
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
22
|
+
const [searchedFor, setSearchedFor] = useState<string>('');
|
|
23
|
+
const [blockchainCategory, setBlockchainCategory] = useState<string>('ALL');
|
|
24
|
+
const setToBlockchain = useBestRouteStore.use.setToBlockchain();
|
|
25
|
+
const setFromBlockchain = useBestRouteStore.use.setFromBlockchain();
|
|
26
|
+
|
|
27
|
+
const blockchains = supportedBlockchains
|
|
28
|
+
? useMetaStore.use
|
|
29
|
+
.meta()
|
|
30
|
+
.blockchains.filter((chain) =>
|
|
31
|
+
supportedBlockchains.includes(chain.name)
|
|
32
|
+
)
|
|
33
|
+
: useMetaStore.use.meta().blockchains;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Layout
|
|
37
|
+
header={{
|
|
38
|
+
onBack: navigateBackFrom.bind(
|
|
39
|
+
null,
|
|
40
|
+
navigationRoutes[`${type}Blockchain`]
|
|
41
|
+
),
|
|
42
|
+
title: i18n.t(`Select Blockchain`),
|
|
43
|
+
}}>
|
|
44
|
+
<Divider size={12} />
|
|
45
|
+
<SelectableCategoryList
|
|
46
|
+
setCategory={setBlockchainCategory}
|
|
47
|
+
category={blockchainCategory}
|
|
48
|
+
/>
|
|
49
|
+
<Divider size={24} />
|
|
50
|
+
<SearchInput
|
|
51
|
+
value={searchedFor}
|
|
52
|
+
autoFocus
|
|
53
|
+
placeholder={i18n.t('Search Blockchain')}
|
|
54
|
+
color="light"
|
|
55
|
+
variant="contained"
|
|
56
|
+
size="large"
|
|
57
|
+
setValue={() => setSearchedFor('')}
|
|
58
|
+
onChange={(event) => setSearchedFor(event.target.value)}
|
|
59
|
+
/>
|
|
60
|
+
<Divider size={16} />
|
|
61
|
+
|
|
62
|
+
<BlockchainList
|
|
63
|
+
list={blockchains}
|
|
64
|
+
searchedFor={searchedFor}
|
|
65
|
+
blockchainCategory={blockchainCategory}
|
|
66
|
+
onChange={(blockchain) => {
|
|
67
|
+
if (type === 'from') {
|
|
68
|
+
setFromBlockchain(blockchain, true);
|
|
69
|
+
} else {
|
|
70
|
+
setToBlockchain(blockchain, true);
|
|
71
|
+
}
|
|
72
|
+
navigateBackFrom(navigationRoutes[`${type}Blockchain`]);
|
|
73
|
+
}}
|
|
74
|
+
/>
|
|
75
|
+
</Layout>
|
|
76
|
+
);
|
|
77
|
+
}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
import type { Asset, Token } from 'rango-sdk';
|
|
3
|
+
|
|
4
|
+
import { i18n } from '@lingui/core';
|
|
5
|
+
import { Divider } from '@rango-dev/ui';
|
|
6
|
+
import React, { useEffect, useState } from 'react';
|
|
7
|
+
import { useNavigate } from 'react-router-dom';
|
|
8
|
+
|
|
9
|
+
import { BlockchainsSection } from '../components/BlockchainsSection';
|
|
10
|
+
import { Layout } from '../components/Layout';
|
|
11
|
+
import { SearchInput } from '../components/SearchInput';
|
|
12
|
+
import { TokenList } from '../components/TokenList/TokenList';
|
|
13
|
+
import { filterTokens } from '../components/TokenList/TokenList.helpers';
|
|
14
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
15
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
16
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
17
|
+
import { useMetaStore } from '../store/meta';
|
|
18
|
+
import { useWalletsStore } from '../store/wallets';
|
|
19
|
+
import { findCommonTokens } from '../utils/routing';
|
|
20
|
+
import { tokensAreEqual } from '../utils/wallets';
|
|
21
|
+
|
|
22
|
+
interface PropTypes {
|
|
23
|
+
type: 'from' | 'to';
|
|
24
|
+
supportedBlockchains?: string[];
|
|
25
|
+
supportedTokens?: Asset[];
|
|
26
|
+
pinnedTokens?: Asset[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function SelectSwapItemsPage(props: PropTypes) {
|
|
30
|
+
const { type, supportedBlockchains, supportedTokens, pinnedTokens } = props;
|
|
31
|
+
const [selectedBlockchain, setSelectedBlockchain] = useState('');
|
|
32
|
+
const navigate = useNavigate();
|
|
33
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
34
|
+
const {
|
|
35
|
+
meta: { tokens },
|
|
36
|
+
setTokensWithBalance,
|
|
37
|
+
} = useMetaStore();
|
|
38
|
+
const {
|
|
39
|
+
sourceTokens,
|
|
40
|
+
destinationTokens,
|
|
41
|
+
fromBlockchain,
|
|
42
|
+
toBlockchain,
|
|
43
|
+
setFromToken,
|
|
44
|
+
setToToken,
|
|
45
|
+
setFromBlockchain,
|
|
46
|
+
setToBlockchain,
|
|
47
|
+
} = useBestRouteStore();
|
|
48
|
+
const { connectedWallets, loading: loadingWallet } = useWalletsStore();
|
|
49
|
+
const [searchedFor, setSearchedFor] = useState<string>('');
|
|
50
|
+
|
|
51
|
+
const blockchains = supportedBlockchains
|
|
52
|
+
? useMetaStore.use
|
|
53
|
+
.meta()
|
|
54
|
+
.blockchains.filter((chain) =>
|
|
55
|
+
supportedBlockchains.includes(chain.name)
|
|
56
|
+
)
|
|
57
|
+
: useMetaStore.use.meta().blockchains;
|
|
58
|
+
|
|
59
|
+
const allTokens = supportedTokens
|
|
60
|
+
? findCommonTokens(supportedTokens, tokens)
|
|
61
|
+
: tokens.filter((token) =>
|
|
62
|
+
new Set(blockchains.map((blockchain) => blockchain.name)).has(
|
|
63
|
+
token.blockchain
|
|
64
|
+
)
|
|
65
|
+
);
|
|
66
|
+
|
|
67
|
+
const supportedSourceTokens = supportedTokens
|
|
68
|
+
? findCommonTokens(supportedTokens, sourceTokens)
|
|
69
|
+
: sourceTokens;
|
|
70
|
+
|
|
71
|
+
const supportedDestinationTokens = supportedTokens
|
|
72
|
+
? findCommonTokens(supportedTokens, destinationTokens)
|
|
73
|
+
: destinationTokens;
|
|
74
|
+
|
|
75
|
+
const tokensByType =
|
|
76
|
+
type === 'from' ? supportedSourceTokens : supportedDestinationTokens;
|
|
77
|
+
|
|
78
|
+
let tokenList: Token[] = [];
|
|
79
|
+
|
|
80
|
+
const noBlockchainSelected =
|
|
81
|
+
(type === 'from' && !fromBlockchain) || (type === 'to' && !toBlockchain);
|
|
82
|
+
|
|
83
|
+
if (noBlockchainSelected) {
|
|
84
|
+
tokenList = allTokens;
|
|
85
|
+
} else if (tokensByType.length) {
|
|
86
|
+
tokenList = tokensByType.map((token) => ({
|
|
87
|
+
...token,
|
|
88
|
+
pin: pinnedTokens?.some((pinnedToken) =>
|
|
89
|
+
tokensAreEqual(pinnedToken, token)
|
|
90
|
+
),
|
|
91
|
+
}));
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
if (connectedWallets.length && !loadingWallet) {
|
|
96
|
+
setTokensWithBalance();
|
|
97
|
+
}
|
|
98
|
+
}, [connectedWallets, loadingWallet]);
|
|
99
|
+
|
|
100
|
+
return (
|
|
101
|
+
<Layout
|
|
102
|
+
header={{
|
|
103
|
+
onBack: () =>
|
|
104
|
+
navigateBackFrom(
|
|
105
|
+
type === 'from'
|
|
106
|
+
? navigationRoutes.fromSwap
|
|
107
|
+
: navigationRoutes.toSwap
|
|
108
|
+
),
|
|
109
|
+
title: i18n.t('Swap {type}', { type }),
|
|
110
|
+
}}>
|
|
111
|
+
<BlockchainsSection
|
|
112
|
+
blockchains={blockchains}
|
|
113
|
+
type={type}
|
|
114
|
+
blockchain={type === 'from' ? fromBlockchain : toBlockchain}
|
|
115
|
+
onMoreClick={() =>
|
|
116
|
+
navigate(
|
|
117
|
+
type === 'from'
|
|
118
|
+
? navigationRoutes.fromBlockchain
|
|
119
|
+
: navigationRoutes.toBlockchain
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
onChange={(blockchain) => {
|
|
123
|
+
{
|
|
124
|
+
if (type === 'from') {
|
|
125
|
+
setFromBlockchain(blockchain, true);
|
|
126
|
+
} else {
|
|
127
|
+
setToBlockchain(blockchain, true);
|
|
128
|
+
}
|
|
129
|
+
setSelectedBlockchain(blockchain.name);
|
|
130
|
+
}
|
|
131
|
+
}}
|
|
132
|
+
/>
|
|
133
|
+
<Divider size={24} />
|
|
134
|
+
<SearchInput
|
|
135
|
+
value={searchedFor}
|
|
136
|
+
autoFocus
|
|
137
|
+
placeholder={i18n.t('Search Token')}
|
|
138
|
+
color="light"
|
|
139
|
+
variant="contained"
|
|
140
|
+
size="large"
|
|
141
|
+
setValue={() => setSearchedFor('')}
|
|
142
|
+
onChange={(event) => setSearchedFor(event.target.value)}
|
|
143
|
+
/>
|
|
144
|
+
<Divider size={16} />
|
|
145
|
+
<TokenList
|
|
146
|
+
list={filterTokens(tokenList, searchedFor)}
|
|
147
|
+
selectedBlockchain={selectedBlockchain}
|
|
148
|
+
searchedFor={searchedFor}
|
|
149
|
+
onChange={(token) => {
|
|
150
|
+
const blockchain = blockchains.find(
|
|
151
|
+
(chain) => token.blockchain === chain.name
|
|
152
|
+
);
|
|
153
|
+
if (type === 'from') {
|
|
154
|
+
setFromToken(token);
|
|
155
|
+
if (!!blockchain) {
|
|
156
|
+
setFromBlockchain(blockchain, true);
|
|
157
|
+
}
|
|
158
|
+
} else {
|
|
159
|
+
setToToken(token);
|
|
160
|
+
if (!!blockchain) {
|
|
161
|
+
setToBlockchain(blockchain, true);
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
navigateBackFrom(navigationRoutes.fromSwap);
|
|
165
|
+
}}
|
|
166
|
+
/>
|
|
167
|
+
</Layout>
|
|
168
|
+
);
|
|
169
|
+
}
|
|
@@ -1,30 +1,31 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core';
|
|
2
|
+
import {
|
|
3
|
+
ChevronRightIcon,
|
|
4
|
+
Divider,
|
|
5
|
+
List,
|
|
6
|
+
ListItemButton,
|
|
7
|
+
Skeleton,
|
|
8
|
+
Switch,
|
|
9
|
+
Typography,
|
|
10
|
+
} from '@rango-dev/ui';
|
|
1
11
|
import React from 'react';
|
|
2
|
-
import { Settings } from '@rango-dev/ui';
|
|
3
|
-
import { useSettingsStore } from '../store/settings';
|
|
4
|
-
import { useMetaStore } from '../store/meta';
|
|
5
12
|
import { useNavigate } from 'react-router-dom';
|
|
13
|
+
|
|
14
|
+
import { Layout } from '../components/Layout';
|
|
15
|
+
import { SettingsContainer } from '../components/SettingsContainer';
|
|
16
|
+
import { Slippage } from '../components/Slippage';
|
|
6
17
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
7
|
-
import { removeDuplicateFrom } from '../utils/common';
|
|
8
|
-
import {
|
|
9
|
-
MAX_SLIPPAGE,
|
|
10
|
-
MIN_SLIPPGAE,
|
|
11
|
-
SLIPPAGES,
|
|
12
|
-
} from '../constants/swapSettings';
|
|
13
18
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
19
|
+
import { useMetaStore } from '../store/meta';
|
|
20
|
+
import { useSettingsStore } from '../store/settings';
|
|
21
|
+
import { getUniqueSwappersGroups } from '../utils/settings';
|
|
22
|
+
|
|
14
23
|
interface PropTypes {
|
|
15
24
|
supportedSwappers?: string[];
|
|
16
25
|
singleTheme?: boolean;
|
|
17
26
|
}
|
|
27
|
+
|
|
18
28
|
export function SettingsPage({ supportedSwappers, singleTheme }: PropTypes) {
|
|
19
|
-
const slippage = useSettingsStore.use.slippage();
|
|
20
|
-
const setSlippage = useSettingsStore.use.setSlippage();
|
|
21
|
-
const disabledLiquiditySources =
|
|
22
|
-
useSettingsStore.use.disabledLiquiditySources();
|
|
23
|
-
const customSlippage = useSettingsStore.use.customSlippage();
|
|
24
|
-
const setCustomSlippage = useSettingsStore.use.setCustomSlippage();
|
|
25
|
-
const theme = useSettingsStore.use.theme();
|
|
26
|
-
const setTheme = useSettingsStore.use.setTheme();
|
|
27
|
-
const swappers = useMetaStore.use.meta().swappers;
|
|
28
29
|
const navigate = useNavigate();
|
|
29
30
|
const { navigateBackFrom } = useNavigateBack();
|
|
30
31
|
|
|
@@ -32,62 +33,133 @@ export function SettingsPage({ supportedSwappers, singleTheme }: PropTypes) {
|
|
|
32
33
|
const toggleInfiniteApprove = useSettingsStore.use.toggleInfiniteApprove();
|
|
33
34
|
const loadingMetaStatus = useMetaStore.use.loadingStatus();
|
|
34
35
|
|
|
35
|
-
const
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
36
|
+
const supportedUniqueSwappersGroups =
|
|
37
|
+
getUniqueSwappersGroups(supportedSwappers);
|
|
38
|
+
|
|
39
|
+
const bridgeSources = supportedUniqueSwappersGroups.filter(
|
|
40
|
+
(uniqueItem) =>
|
|
41
|
+
uniqueItem.type === 'BRIDGE' || uniqueItem.type === 'AGGREGATOR'
|
|
42
|
+
);
|
|
43
|
+
const totalBridgeSources = bridgeSources.length;
|
|
44
|
+
const totalSelectedBridgeSources = bridgeSources.filter(
|
|
45
|
+
(uniqueItem) => uniqueItem.selected
|
|
46
|
+
).length;
|
|
47
|
+
|
|
48
|
+
const exchangeSources = supportedUniqueSwappersGroups.filter(
|
|
49
|
+
(uniqueItem) => uniqueItem.type === 'DEX'
|
|
50
|
+
);
|
|
51
|
+
const totalExchangeSources = exchangeSources.length;
|
|
52
|
+
const totalSelectedExchangeSources = exchangeSources.filter(
|
|
53
|
+
(uniqueItem) => uniqueItem.selected
|
|
54
|
+
).length;
|
|
55
|
+
|
|
56
|
+
const handleEndItem = (totalSelected: number, total: number) => {
|
|
57
|
+
switch (loadingMetaStatus) {
|
|
58
|
+
case 'loading':
|
|
59
|
+
return <Skeleton variant="text" size="medium" width={50} />;
|
|
60
|
+
case 'failed':
|
|
61
|
+
return (
|
|
62
|
+
<Typography variant="body" size="medium" color="$error500">
|
|
63
|
+
Loading failed
|
|
64
|
+
</Typography>
|
|
65
|
+
);
|
|
66
|
+
default:
|
|
67
|
+
return (
|
|
68
|
+
<Typography variant="body" size="medium">
|
|
69
|
+
{`${totalSelected} / ${total}`}
|
|
70
|
+
</Typography>
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
const bridgeItem = {
|
|
76
|
+
id: 'bridge-item',
|
|
77
|
+
title: (
|
|
78
|
+
<Typography variant="title" size="xmedium">
|
|
79
|
+
{i18n.t('Enabled bridges')}
|
|
80
|
+
</Typography>
|
|
81
|
+
),
|
|
82
|
+
end: (
|
|
83
|
+
<>
|
|
84
|
+
{handleEndItem(totalSelectedBridgeSources, totalBridgeSources)}
|
|
85
|
+
<Divider direction="horizontal" size={8} />
|
|
86
|
+
<ChevronRightIcon color="black" />
|
|
87
|
+
</>
|
|
88
|
+
),
|
|
89
|
+
onClick: () => navigate(navigationRoutes.bridges),
|
|
90
|
+
};
|
|
91
|
+
|
|
92
|
+
const exchangeItem = {
|
|
93
|
+
id: 'exchange-item',
|
|
94
|
+
title: (
|
|
95
|
+
<Typography variant="title" size="xmedium">
|
|
96
|
+
{i18n.t('Enabled exchanges')}
|
|
97
|
+
</Typography>
|
|
98
|
+
),
|
|
99
|
+
end: (
|
|
100
|
+
<>
|
|
101
|
+
{handleEndItem(totalSelectedExchangeSources, totalExchangeSources)}
|
|
102
|
+
<Divider direction="horizontal" size={8} />
|
|
103
|
+
<ChevronRightIcon color="gray" />
|
|
104
|
+
</>
|
|
105
|
+
),
|
|
106
|
+
onClick: () => navigate(navigationRoutes.exchanges),
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const languageItem = {
|
|
110
|
+
id: 'language-item',
|
|
111
|
+
title: (
|
|
112
|
+
<Typography variant="title" size="xmedium">
|
|
113
|
+
{i18n.t('Language')}
|
|
114
|
+
</Typography>
|
|
115
|
+
),
|
|
116
|
+
end: <ChevronRightIcon color="gray" />,
|
|
117
|
+
onClick: () => navigate(navigationRoutes.languages),
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
const themeItem = {
|
|
121
|
+
id: 'theme-item',
|
|
122
|
+
title: (
|
|
123
|
+
<Typography variant="title" size="xmedium">
|
|
124
|
+
{i18n.t('Theme')}
|
|
125
|
+
</Typography>
|
|
126
|
+
),
|
|
127
|
+
end: <ChevronRightIcon color="gray" />,
|
|
128
|
+
onClick: () => navigate(navigationRoutes.themes),
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const infiniteApprovalItem = {
|
|
132
|
+
id: 'infinite-approval-item',
|
|
133
|
+
title: (
|
|
134
|
+
<Typography variant="title" size="xmedium">
|
|
135
|
+
{i18n.t('Infinite Approval')}
|
|
136
|
+
</Typography>
|
|
137
|
+
),
|
|
138
|
+
end: <Switch checked={infiniteApprove} />,
|
|
139
|
+
onClick: toggleInfiniteApprove,
|
|
140
|
+
};
|
|
61
141
|
|
|
62
|
-
const
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
142
|
+
const settingItems = [bridgeItem, exchangeItem, languageItem];
|
|
143
|
+
if (!singleTheme) {
|
|
144
|
+
settingItems.push(themeItem);
|
|
145
|
+
}
|
|
146
|
+
settingItems.push(infiniteApprovalItem);
|
|
67
147
|
|
|
68
148
|
return (
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
minSlippage={MIN_SLIPPGAE}
|
|
85
|
-
maxSlippage={MAX_SLIPPAGE}
|
|
86
|
-
selectedTheme={theme}
|
|
87
|
-
onThemeChange={setTheme}
|
|
88
|
-
infiniteApprove={infiniteApprove}
|
|
89
|
-
toggleInfiniteApprove={toggleInfiniteApprove}
|
|
90
|
-
loadingStatus={loadingMetaStatus}
|
|
91
|
-
/>
|
|
149
|
+
<Layout
|
|
150
|
+
header={{
|
|
151
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
|
|
152
|
+
title: i18n.t('Setting'),
|
|
153
|
+
}}>
|
|
154
|
+
<SettingsContainer>
|
|
155
|
+
<Slippage />
|
|
156
|
+
<List
|
|
157
|
+
type={
|
|
158
|
+
<ListItemButton title="_" id="_" onClick={() => console.log()} />
|
|
159
|
+
}
|
|
160
|
+
items={settingItems}
|
|
161
|
+
/>
|
|
162
|
+
</SettingsContainer>
|
|
163
|
+
</Layout>
|
|
92
164
|
);
|
|
93
165
|
}
|