@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,41 @@
|
|
|
1
|
+
import type { StepSkeletonPropsTypes } from './LoadingSwapDetails.types';
|
|
2
|
+
|
|
3
|
+
import { ChainToken, Divider, NextIcon, Skeleton } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { StepContainer } from './LoadingSwapDetails.styles';
|
|
7
|
+
|
|
8
|
+
export function LoadingSwapDetailStep(props: StepSkeletonPropsTypes) {
|
|
9
|
+
const { extraInfo } = props;
|
|
10
|
+
return (
|
|
11
|
+
<StepContainer>
|
|
12
|
+
<div className="step-title">
|
|
13
|
+
<Skeleton height={28} width={28} variant="circular" />
|
|
14
|
+
<Divider direction="horizontal" size={8} />
|
|
15
|
+
<Skeleton height={15} width={148} variant="rounded" />
|
|
16
|
+
</div>
|
|
17
|
+
<div className="step-tokens">
|
|
18
|
+
<Divider direction="horizontal" size={20} />
|
|
19
|
+
<div className="step-token-info">
|
|
20
|
+
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
21
|
+
<Divider direction="horizontal" size={8} />
|
|
22
|
+
<Skeleton height={12} width={76} variant="rounded" />
|
|
23
|
+
</div>
|
|
24
|
+
<div className="step-icon-container">
|
|
25
|
+
<NextIcon color="gray" size={16} />
|
|
26
|
+
</div>
|
|
27
|
+
<div className="step-token-info">
|
|
28
|
+
<ChainToken size="small" loading chainImage="" tokenImage="" />
|
|
29
|
+
<Divider direction="horizontal" size={8} />
|
|
30
|
+
<Skeleton height={12} width={76} variant="rounded" />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
{extraInfo && (
|
|
34
|
+
<div className="extra-info">
|
|
35
|
+
<Divider direction="horizontal" size={20} />
|
|
36
|
+
<Skeleton height={22} width={297} variant="rectangular" />
|
|
37
|
+
</div>
|
|
38
|
+
)}
|
|
39
|
+
</StepContainer>
|
|
40
|
+
);
|
|
41
|
+
}
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
width: '100%',
|
|
5
|
+
height: '100%',
|
|
6
|
+
padding: '$0 $20',
|
|
7
|
+
|
|
8
|
+
'.cost': {
|
|
9
|
+
paddingTop: '$15',
|
|
10
|
+
display: 'flex',
|
|
11
|
+
},
|
|
12
|
+
|
|
13
|
+
'.route-summary': {
|
|
14
|
+
padding: '$15 $0',
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
'.route-summary-item': {
|
|
18
|
+
display: 'flex',
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
'.token-amount': {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
justifyContent: 'space-between',
|
|
26
|
+
alignItems: 'center',
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
'.route-summary-separator': {
|
|
30
|
+
width: '0px',
|
|
31
|
+
height: '$16',
|
|
32
|
+
borderLeft: '1px solid $neutral400',
|
|
33
|
+
marginLeft: '13px',
|
|
34
|
+
},
|
|
35
|
+
|
|
36
|
+
'.swaps-steps': {
|
|
37
|
+
paddingBottom: '$10',
|
|
38
|
+
},
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export const StepContainer = styled('div', {
|
|
42
|
+
backgroundColor: '$neutral100',
|
|
43
|
+
borderRadius: '$xm',
|
|
44
|
+
padding: '$10 $15',
|
|
45
|
+
|
|
46
|
+
'.step-title': {
|
|
47
|
+
display: 'flex',
|
|
48
|
+
justifyContent: 'start',
|
|
49
|
+
alignItems: 'center',
|
|
50
|
+
},
|
|
51
|
+
'.step-tokens': {
|
|
52
|
+
paddingTop: '$5',
|
|
53
|
+
display: 'flex',
|
|
54
|
+
alignItems: 'center',
|
|
55
|
+
},
|
|
56
|
+
'.step-token-info': {
|
|
57
|
+
display: 'flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
},
|
|
60
|
+
'.step-icon-container': {
|
|
61
|
+
padding: '$4 $6',
|
|
62
|
+
display: 'flex',
|
|
63
|
+
justifyContent: 'center',
|
|
64
|
+
alignItems: 'center',
|
|
65
|
+
},
|
|
66
|
+
|
|
67
|
+
'.extra-info': {
|
|
68
|
+
display: 'flex',
|
|
69
|
+
paddingTop: '$10',
|
|
70
|
+
paddingBottom: '$5',
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
export const StepSeparator = styled('div', {
|
|
74
|
+
width: '0px',
|
|
75
|
+
height: '$20',
|
|
76
|
+
borderLeft: '1px dashed $neutral900',
|
|
77
|
+
marginLeft: '25px',
|
|
78
|
+
});
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core';
|
|
2
|
+
import { ChainToken, Divider, Skeleton, Typography } from '@rango-dev/ui';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { Container, StepSeparator } from './LoadingSwapDetails.styles';
|
|
6
|
+
import { LoadingSwapDetailStep } from './LoadingSwapDetailStep';
|
|
7
|
+
|
|
8
|
+
export function LoadingSwapDetails() {
|
|
9
|
+
const routeSummary = (
|
|
10
|
+
<div className="route-summary-item">
|
|
11
|
+
<div className="token-amount">
|
|
12
|
+
<ChainToken loading size="medium" chainImage="" tokenImage="" />
|
|
13
|
+
<Divider size={8} direction="horizontal" />
|
|
14
|
+
<Skeleton height={15} width={148} variant="rounded" />
|
|
15
|
+
</div>
|
|
16
|
+
<Skeleton height={12} width={64} variant="rounded" />
|
|
17
|
+
</div>
|
|
18
|
+
);
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<Container>
|
|
22
|
+
<div className="cost">
|
|
23
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
24
|
+
<Divider size={4} direction="horizontal" />
|
|
25
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
26
|
+
<Divider size={4} direction="horizontal" />
|
|
27
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
|
+
<div className="route-summary">
|
|
31
|
+
{routeSummary}
|
|
32
|
+
<div className="route-summary-separator"></div>
|
|
33
|
+
{routeSummary}
|
|
34
|
+
</div>
|
|
35
|
+
|
|
36
|
+
<div className="swaps-steps">
|
|
37
|
+
<Typography variant="title" size="small">
|
|
38
|
+
{i18n.t('Swaps steps')}
|
|
39
|
+
</Typography>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<div className="step-container">
|
|
43
|
+
<LoadingSwapDetailStep extraInfo />
|
|
44
|
+
<StepSeparator />
|
|
45
|
+
<LoadingSwapDetailStep />
|
|
46
|
+
<StepSeparator />
|
|
47
|
+
<LoadingSwapDetailStep />
|
|
48
|
+
<StepSeparator />
|
|
49
|
+
<LoadingSwapDetailStep />
|
|
50
|
+
</div>
|
|
51
|
+
</Container>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LoadingSwapDetails } from './LoadingSwapDetails';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { Info } from './NoRoutes.types';
|
|
2
|
+
|
|
3
|
+
import { errorMessages } from '../../constants/errors';
|
|
4
|
+
|
|
5
|
+
export function makeInfo(
|
|
6
|
+
diagnosisMessage: string | null,
|
|
7
|
+
disabledLiquiditySources: string[],
|
|
8
|
+
hasError: boolean,
|
|
9
|
+
toggleAllLiquiditySources: (shouldReset: boolean) => void,
|
|
10
|
+
refetchBestRoute: () => void
|
|
11
|
+
): Info {
|
|
12
|
+
if (hasError) {
|
|
13
|
+
return {
|
|
14
|
+
alert: {
|
|
15
|
+
type: 'warning',
|
|
16
|
+
text: errorMessages.genericServerError,
|
|
17
|
+
action: {
|
|
18
|
+
onClick: refetchBestRoute,
|
|
19
|
+
title: 'Retry',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
description: '',
|
|
23
|
+
};
|
|
24
|
+
} else if (diagnosisMessage) {
|
|
25
|
+
return {
|
|
26
|
+
alert: {
|
|
27
|
+
type: 'error',
|
|
28
|
+
text: diagnosisMessage,
|
|
29
|
+
action: null,
|
|
30
|
+
},
|
|
31
|
+
description: '',
|
|
32
|
+
};
|
|
33
|
+
} else if (disabledLiquiditySources.length) {
|
|
34
|
+
return {
|
|
35
|
+
alert: {
|
|
36
|
+
type: 'warning',
|
|
37
|
+
text: errorMessages.liquiditySourcesError.title,
|
|
38
|
+
action: {
|
|
39
|
+
onClick: () => toggleAllLiquiditySources(true),
|
|
40
|
+
title: 'Reset',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
description: errorMessages.liquiditySourcesError.description,
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
return {
|
|
47
|
+
alert: null,
|
|
48
|
+
description: errorMessages.noRoutesError.description,
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'column',
|
|
6
|
+
alignItems: 'center',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const Footer = styled('div', {
|
|
10
|
+
width: '100%',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const PrefixIcon = styled('div', {
|
|
14
|
+
padding: '$6 $0',
|
|
15
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import type { PropTypes } from './NoRoutes.types';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
Button,
|
|
6
|
+
Divider,
|
|
7
|
+
NoRouteIcon,
|
|
8
|
+
RefreshIcon,
|
|
9
|
+
Typography,
|
|
10
|
+
} from '@rango-dev/ui';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
|
|
13
|
+
import { errorMessages } from '../../constants/errors';
|
|
14
|
+
import { useMetaStore } from '../../store/meta';
|
|
15
|
+
import { useSettingsStore } from '../../store/settings';
|
|
16
|
+
|
|
17
|
+
import { makeInfo } from './NoRoutes.helper';
|
|
18
|
+
import { Container, Footer, PrefixIcon } from './NoRoutes.styles';
|
|
19
|
+
|
|
20
|
+
export function NoRoutes(props: PropTypes) {
|
|
21
|
+
const { diagnosisMessage, fetch, error } = props;
|
|
22
|
+
const disabledLiquiditySources =
|
|
23
|
+
useSettingsStore.use.disabledLiquiditySources();
|
|
24
|
+
const loadingMetaStatus = useMetaStore.use.loadingStatus();
|
|
25
|
+
const toggleAllLiquiditySources =
|
|
26
|
+
useSettingsStore.use.toggleAllLiquiditySources();
|
|
27
|
+
|
|
28
|
+
const hasError = error || loadingMetaStatus === 'failed';
|
|
29
|
+
|
|
30
|
+
const info = makeInfo(
|
|
31
|
+
diagnosisMessage ?? null,
|
|
32
|
+
disabledLiquiditySources,
|
|
33
|
+
hasError,
|
|
34
|
+
toggleAllLiquiditySources,
|
|
35
|
+
fetch
|
|
36
|
+
);
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Container>
|
|
40
|
+
<NoRouteIcon size={24} color="gray" />
|
|
41
|
+
<Divider size={4} />
|
|
42
|
+
<Typography variant="title" size="small">
|
|
43
|
+
{errorMessages.noRoutesError.title}
|
|
44
|
+
</Typography>
|
|
45
|
+
{!!info.description && (
|
|
46
|
+
<Typography
|
|
47
|
+
variant="body"
|
|
48
|
+
size="small"
|
|
49
|
+
align="center"
|
|
50
|
+
color="neutral900">
|
|
51
|
+
{info.description}
|
|
52
|
+
</Typography>
|
|
53
|
+
)}
|
|
54
|
+
<Divider size={4} />
|
|
55
|
+
{!!info.alert && (
|
|
56
|
+
<Footer>
|
|
57
|
+
<Alert
|
|
58
|
+
type={info.alert.type}
|
|
59
|
+
title={info.alert.text}
|
|
60
|
+
action={
|
|
61
|
+
info.alert.action && (
|
|
62
|
+
<Button
|
|
63
|
+
size="xsmall"
|
|
64
|
+
type={info.alert.type}
|
|
65
|
+
prefix={
|
|
66
|
+
<PrefixIcon>
|
|
67
|
+
<RefreshIcon size={8} />
|
|
68
|
+
</PrefixIcon>
|
|
69
|
+
}
|
|
70
|
+
onClick={info.alert.action.onClick}>
|
|
71
|
+
{info.alert.action.title}
|
|
72
|
+
</Button>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
variant="alarm"
|
|
76
|
+
/>
|
|
77
|
+
</Footer>
|
|
78
|
+
)}
|
|
79
|
+
</Container>
|
|
80
|
+
);
|
|
81
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface PropTypes {
|
|
2
|
+
fetch: () => void;
|
|
3
|
+
error: boolean;
|
|
4
|
+
diagnosisMessage?: string;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
type AlertAction = {
|
|
8
|
+
title: string;
|
|
9
|
+
onClick: () => void;
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
type NotFoundAlert = {
|
|
13
|
+
type: 'error' | 'warning';
|
|
14
|
+
text: string;
|
|
15
|
+
action: AlertAction | null;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export interface Info {
|
|
19
|
+
alert: NotFoundAlert | null;
|
|
20
|
+
description: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NoRoutes } from './NoRoutes';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
padding: '$10',
|
|
5
|
+
width: '350px',
|
|
6
|
+
minHeight: '150px',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const List = styled('ul', {
|
|
10
|
+
padding: 0,
|
|
11
|
+
margin: 0,
|
|
12
|
+
listStyle: 'none',
|
|
13
|
+
|
|
14
|
+
'.to-chain-token': {
|
|
15
|
+
transform: 'translateX(-3px)',
|
|
16
|
+
},
|
|
17
|
+
});
|
|
18
|
+
|
|
19
|
+
export const Images = styled('div', {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
padding: 0,
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
alignSelf: 'stretch',
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const NotFoundContainer = styled('div', {
|
|
27
|
+
display: 'flex',
|
|
28
|
+
justifyContent: 'center',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
flexDirection: 'column',
|
|
31
|
+
padding: '$10',
|
|
32
|
+
width: '100%',
|
|
33
|
+
height: '150px',
|
|
34
|
+
});
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
import type { Notification } from '../../types/notification';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
ChainToken,
|
|
5
|
+
ChevronRightIcon,
|
|
6
|
+
ListItemButton,
|
|
7
|
+
Typography,
|
|
8
|
+
} from '@rango-dev/ui';
|
|
9
|
+
import React from 'react';
|
|
10
|
+
import { useNavigate } from 'react-router-dom';
|
|
11
|
+
|
|
12
|
+
import { useMetaStore } from '../../store/meta';
|
|
13
|
+
import { useNotificationStore } from '../../store/notification';
|
|
14
|
+
import { useUiStore } from '../../store/ui';
|
|
15
|
+
|
|
16
|
+
import { Container, Images, List } from './NotificationContent.styles';
|
|
17
|
+
import { NotificationNotFound } from './NotificationNotFound';
|
|
18
|
+
|
|
19
|
+
const MAX_NOTIFICATIONS_DISPLAYED = 4;
|
|
20
|
+
|
|
21
|
+
export function NotificationContent() {
|
|
22
|
+
const navigate = useNavigate();
|
|
23
|
+
const setSelectedSwap = useUiStore.use.setSelectedSwap();
|
|
24
|
+
|
|
25
|
+
const { getUnreadNotifications } = useNotificationStore();
|
|
26
|
+
|
|
27
|
+
const notifications: Notification[] = getUnreadNotifications();
|
|
28
|
+
const { tokens, blockchains } = useMetaStore.use.meta();
|
|
29
|
+
const sortedNotification = notifications
|
|
30
|
+
.sort((a, b) => b.creationTime - a.creationTime)
|
|
31
|
+
.slice(0, MAX_NOTIFICATIONS_DISPLAYED);
|
|
32
|
+
|
|
33
|
+
const handleOnClick = (requestId: Notification['requestId']) => {
|
|
34
|
+
setSelectedSwap(requestId);
|
|
35
|
+
navigate(`/swaps/${requestId}`);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return (
|
|
39
|
+
<Container>
|
|
40
|
+
{sortedNotification.length ? (
|
|
41
|
+
<List>
|
|
42
|
+
{sortedNotification.map((notificationItem) => {
|
|
43
|
+
const fromToken = tokens.find(
|
|
44
|
+
(tokenItem) =>
|
|
45
|
+
tokenItem.address ===
|
|
46
|
+
notificationItem.route.from.tokenAddress &&
|
|
47
|
+
tokenItem.blockchain ===
|
|
48
|
+
notificationItem.route.from.blockchain &&
|
|
49
|
+
tokenItem.symbol === notificationItem.route.from.tokenSymbol
|
|
50
|
+
);
|
|
51
|
+
|
|
52
|
+
const fromBlockchain = blockchains.find(
|
|
53
|
+
(blockchainItem) =>
|
|
54
|
+
blockchainItem.name === notificationItem.route.from.blockchain
|
|
55
|
+
);
|
|
56
|
+
|
|
57
|
+
const toToken = tokens.find(
|
|
58
|
+
(tokenItem) =>
|
|
59
|
+
tokenItem.address === notificationItem.route.to.tokenAddress &&
|
|
60
|
+
tokenItem.blockchain === notificationItem.route.to.blockchain &&
|
|
61
|
+
tokenItem.symbol === notificationItem.route.to.tokenSymbol
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
const toBlockchain = blockchains.find(
|
|
65
|
+
(blockchainItem) =>
|
|
66
|
+
blockchainItem.name === notificationItem.route.to.blockchain
|
|
67
|
+
);
|
|
68
|
+
|
|
69
|
+
return (
|
|
70
|
+
<ListItemButton
|
|
71
|
+
key={notificationItem.requestId}
|
|
72
|
+
onClick={() => handleOnClick(notificationItem.requestId)}
|
|
73
|
+
title={
|
|
74
|
+
<Typography variant="body" size="small" color="$neutral900">
|
|
75
|
+
{notificationItem.event.message}
|
|
76
|
+
</Typography>
|
|
77
|
+
}
|
|
78
|
+
id={notificationItem.requestId}
|
|
79
|
+
start={
|
|
80
|
+
<Images>
|
|
81
|
+
<div className="from-chain-token">
|
|
82
|
+
<ChainToken
|
|
83
|
+
tokenImage={fromToken ? fromToken.image : ''}
|
|
84
|
+
chainImage={fromBlockchain ? fromBlockchain.logo : ''}
|
|
85
|
+
size="small"
|
|
86
|
+
/>
|
|
87
|
+
</div>
|
|
88
|
+
<div className="to-chain-token">
|
|
89
|
+
<ChainToken
|
|
90
|
+
tokenImage={toToken ? toToken.image : ''}
|
|
91
|
+
chainImage={toBlockchain ? toBlockchain.logo : ''}
|
|
92
|
+
size="small"
|
|
93
|
+
/>
|
|
94
|
+
</div>
|
|
95
|
+
</Images>
|
|
96
|
+
}
|
|
97
|
+
end={<ChevronRightIcon size={12} color="gray" />}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
|
+
})}
|
|
101
|
+
</List>
|
|
102
|
+
) : (
|
|
103
|
+
<NotificationNotFound />
|
|
104
|
+
)}
|
|
105
|
+
</Container>
|
|
106
|
+
);
|
|
107
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core';
|
|
2
|
+
import { Divider, NoNotificationIcon, Typography } from '@rango-dev/ui';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { NotFoundContainer } from './NotificationContent.styles';
|
|
6
|
+
|
|
7
|
+
export function NotificationNotFound() {
|
|
8
|
+
return (
|
|
9
|
+
<NotFoundContainer>
|
|
10
|
+
<NoNotificationIcon color="secondary" size={26} />
|
|
11
|
+
<Divider size={12} />
|
|
12
|
+
<Typography variant="body" size="medium" color="neutral900">
|
|
13
|
+
{i18n.t('You have no notification')}
|
|
14
|
+
</Typography>
|
|
15
|
+
</NotFoundContainer>
|
|
16
|
+
);
|
|
17
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NotificationContent } from './NotificationContent';
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Alerts = styled('div', {
|
|
4
|
+
width: '100%',
|
|
5
|
+
paddingTop: '$10',
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const Flex = styled('div', {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
flexDirection: 'column',
|
|
11
|
+
alignItems: 'flex-start',
|
|
12
|
+
gap: 10,
|
|
13
|
+
width: '100%',
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export const Item = styled('div', {
|
|
17
|
+
display: 'flex',
|
|
18
|
+
padding: '$5 0',
|
|
19
|
+
justifyContent: 'space-between',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
width: '100%',
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
export const Action = styled('div', {
|
|
25
|
+
padding: '$2',
|
|
26
|
+
alignSelf: 'flex-start',
|
|
27
|
+
cursor: 'pointer',
|
|
28
|
+
});
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { PropTypes } from './RouteErrors.types';
|
|
2
|
+
|
|
3
|
+
import { Alert, Divider, InfoIcon } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { errorMessages } from '../../constants/errors';
|
|
7
|
+
import { useBestRouteStore } from '../../store/bestRoute';
|
|
8
|
+
import { hasLimitError, LimitErrorMessage } from '../../utils/swap';
|
|
9
|
+
|
|
10
|
+
import { Action, Alerts } from './RouteErrors.styles';
|
|
11
|
+
import { RouteErrorsModal } from './RouteErrorsModal';
|
|
12
|
+
|
|
13
|
+
const WARNING_LEVEL_LIMIT = -10;
|
|
14
|
+
|
|
15
|
+
export function RouteErrors(props: PropTypes) {
|
|
16
|
+
const { bestRoute } = useBestRouteStore();
|
|
17
|
+
const {
|
|
18
|
+
highValueLoss,
|
|
19
|
+
percentageChange,
|
|
20
|
+
priceImpactCanNotBeComputed,
|
|
21
|
+
openModal,
|
|
22
|
+
onToggle,
|
|
23
|
+
totalFeeInUsd,
|
|
24
|
+
outputUsdValue,
|
|
25
|
+
inputUsdValue,
|
|
26
|
+
loading,
|
|
27
|
+
extraSpace,
|
|
28
|
+
} = props;
|
|
29
|
+
const error = hasLimitError(bestRoute);
|
|
30
|
+
const { recommendation } = LimitErrorMessage(bestRoute);
|
|
31
|
+
|
|
32
|
+
const showWarnings = !error && (highValueLoss || priceImpactCanNotBeComputed);
|
|
33
|
+
const showAlerts = showWarnings || error;
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<>
|
|
37
|
+
{(loading || (extraSpace && !showAlerts)) && <Divider size={20} />}
|
|
38
|
+
{showAlerts && (
|
|
39
|
+
<Alerts>
|
|
40
|
+
{showWarnings && (
|
|
41
|
+
<>
|
|
42
|
+
<Alert
|
|
43
|
+
title={
|
|
44
|
+
highValueLoss
|
|
45
|
+
? errorMessages.highValueLossError.title
|
|
46
|
+
: errorMessages.unknownPriceError.title
|
|
47
|
+
}
|
|
48
|
+
type={
|
|
49
|
+
highValueLoss && !!percentageChange?.lt(WARNING_LEVEL_LIMIT)
|
|
50
|
+
? 'error'
|
|
51
|
+
: 'warning'
|
|
52
|
+
}
|
|
53
|
+
variant="alarm"
|
|
54
|
+
action={
|
|
55
|
+
<Action onClick={() => onToggle(true)}>
|
|
56
|
+
<InfoIcon size={12} color="gray" />
|
|
57
|
+
</Action>
|
|
58
|
+
}
|
|
59
|
+
/>
|
|
60
|
+
</>
|
|
61
|
+
)}
|
|
62
|
+
{error && (
|
|
63
|
+
<Alert type="error" variant="alarm" title={recommendation} />
|
|
64
|
+
)}
|
|
65
|
+
</Alerts>
|
|
66
|
+
)}
|
|
67
|
+
|
|
68
|
+
<RouteErrorsModal
|
|
69
|
+
highValueLoss={highValueLoss}
|
|
70
|
+
open={openModal}
|
|
71
|
+
onToggle={onToggle}
|
|
72
|
+
percentageChange={percentageChange}
|
|
73
|
+
inputUsdValue={inputUsdValue}
|
|
74
|
+
outputUsdValue={outputUsdValue}
|
|
75
|
+
totalFeeInUsd={totalFeeInUsd}
|
|
76
|
+
/>
|
|
77
|
+
</>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import type BigNumber from 'bignumber.js';
|
|
2
|
+
|
|
3
|
+
export interface PropTypes {
|
|
4
|
+
openModal: boolean;
|
|
5
|
+
onToggle: (open: boolean) => void;
|
|
6
|
+
totalFeeInUsd: BigNumber | null;
|
|
7
|
+
outputUsdValue: BigNumber | null;
|
|
8
|
+
inputUsdValue: BigNumber | null;
|
|
9
|
+
percentageChange: BigNumber | null;
|
|
10
|
+
highValueLoss: boolean;
|
|
11
|
+
priceImpactCanNotBeComputed: boolean;
|
|
12
|
+
loading: boolean;
|
|
13
|
+
extraSpace: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
type ModalPropTypesKeys = keyof Omit<
|
|
17
|
+
PropTypes,
|
|
18
|
+
'priceImpactCanNotBeComputed' | 'openModal' | 'extraSpace' | 'loading'
|
|
19
|
+
>;
|
|
20
|
+
|
|
21
|
+
export type ModalPropTypes = Pick<PropTypes, ModalPropTypesKeys> & {
|
|
22
|
+
open: boolean;
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export interface ModalContentData {
|
|
26
|
+
title: string;
|
|
27
|
+
value: string;
|
|
28
|
+
valueColor?: string;
|
|
29
|
+
}
|