@rango-dev/widget-embedded 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -113
- package/dist/QueueManager.d.ts +2 -5
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/Wallets.d.ts +17 -0
- package/dist/Wallets.d.ts.map +1 -0
- package/dist/Widget.d.ts +9 -0
- package/dist/Widget.d.ts.map +1 -0
- package/dist/components/AppRouter.d.ts +2 -0
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +6 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +3 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +62 -691
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +3 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +4 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +2 -2
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- 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.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +0 -1727
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.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/{NoResult/NoResult.styles.d.ts → NoRoutes/NoRoutes.styles.d.ts} +1 -1
- package/dist/components/{NoResult/NoResult.styles.d.ts.map → NoRoutes/NoRoutes.styles.d.ts.map} +1 -1
- package/dist/components/{NoResult/NoResult.types.d.ts → NoRoutes/NoRoutes.types.d.ts} +3 -3
- 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.map +1 -1
- package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
- package/dist/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts → RouteErrors/RouteErrors.styles.d.ts} +1 -1
- 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/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +0 -158
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +0 -628
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +0 -157
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +1 -1100
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +9 -4
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/components/TokenList/index.d.ts +1 -0
- package/dist/components/TokenList/index.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts +6 -1
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +4 -4
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +1 -1
- package/dist/constants/navigationRoutes.d.ts +2 -1
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/searchParams.d.ts +1 -2
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/constants/warnings.d.ts +2 -2
- package/dist/constants/warnings.d.ts.map +1 -1
- package/dist/hooks/{useConfirmSwap/useConfirmSwap.types.d.ts → useConfirmSwap.d.ts} +7 -5
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -0
- package/dist/hooks/{useFetchQuote.d.ts → useFetchBestRoute.d.ts} +3 -3
- package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
- package/dist/hooks/useLanguage.d.ts +1 -1
- package/dist/hooks/useLanguage.d.ts.map +1 -1
- package/dist/hooks/useNavigateBack.d.ts +3 -1
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +7 -5
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +0 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +1 -5
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts +2 -4
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts +2 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.d.ts +8 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +6 -1
- 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.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts +2 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +6 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +8 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/app.d.ts +22 -41
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +77 -0
- package/dist/store/bestRoute.d.ts.map +1 -0
- package/dist/store/meta.d.ts +23 -0
- package/dist/store/meta.d.ts.map +1 -0
- package/dist/store/notification.d.ts +3 -4
- package/dist/store/notification.d.ts.map +1 -1
- package/dist/store/settings.d.ts +81 -0
- package/dist/store/settings.d.ts.map +1 -0
- package/dist/store/slices/config.d.ts +2 -3
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +2 -5
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/ui.d.ts +1 -2
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +9 -14
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +8 -41
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/routing.d.ts +65 -0
- package/dist/types/routing.d.ts.map +1 -0
- package/dist/types/swap.d.ts +14 -4
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +1 -15
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +0 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +1 -2
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/numbers.d.ts +1 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +2 -2
- package/dist/utils/providers.d.ts.map +1 -1
- package/dist/utils/queue.d.ts +2 -2
- package/dist/utils/queue.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +28 -0
- package/dist/utils/routing.d.ts.map +1 -0
- package/dist/utils/settings.d.ts +2 -6
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +24 -35
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/time.d.ts +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +10 -9
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +10 -12
- package/src/QueueManager.tsx +17 -18
- package/src/{containers/Wallets/Wallets.tsx → Wallets.tsx} +34 -48
- package/src/Widget.tsx +119 -0
- package/src/components/AppRouter.tsx +32 -8
- package/src/components/AppRoutes.tsx +69 -57
- package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
- package/src/components/BlockchainList/BlockchainList.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +1 -1
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +17 -26
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +64 -2
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +10 -29
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +47 -43
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +3 -1
- package/src/components/ConfirmWalletsModal/WalletList.tsx +8 -9
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +4 -1
- package/src/components/HeaderButtons/HomeButtons.tsx +18 -28
- package/src/components/Layout/Layout.styles.ts +0 -2
- package/src/components/Layout/Layout.tsx +7 -20
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +61 -65
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +34 -28
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
- package/src/components/{NoResult/NoResult.helpers.ts → NoRoutes/NoRoutes.helper.ts} +16 -23
- package/src/components/{NoResult/NoResult.styles.ts → NoRoutes/NoRoutes.styles.ts} +0 -2
- package/src/components/{NoResult/NoResult.tsx → NoRoutes/NoRoutes.tsx} +17 -12
- package/src/components/{NoResult/NoResult.types.ts → NoRoutes/NoRoutes.types.ts} +2 -3
- package/src/components/NoRoutes/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.tsx +3 -5
- package/src/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts → RouteErrors/RouteErrors.styles.ts} +1 -8
- package/src/components/RouteErrors/RouteErrors.tsx +79 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +129 -0
- package/src/components/{QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx → RouteErrors/RouteErrorsModalItem.tsx} +4 -4
- package/src/components/RouteErrors/index.ts +1 -0
- package/src/components/Slippage/Slippage.styles.ts +5 -15
- package/src/components/Slippage/Slippage.tsx +10 -11
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +8 -5
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +33 -36
- package/src/components/SwapDetails/SwapDetails.tsx +56 -41
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +3 -4
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +8 -14
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +1 -10
- package/src/components/SwapsGroup/SwapsGroup.tsx +5 -3
- package/src/components/SwitchFromAndTo.tsx +2 -2
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +38 -74
- package/src/components/TokenList/TokenList.tsx +26 -35
- package/src/components/TokenList/TokenList.types.ts +10 -4
- package/src/components/TokenList/index.ts +1 -0
- package/src/components/UpdateUrl.tsx +30 -35
- package/src/components/WidgetEvents.tsx +2 -4
- package/src/constants/errors.ts +15 -17
- package/src/constants/index.ts +0 -1
- package/src/constants/messages.ts +1 -1
- package/src/constants/navigationRoutes.ts +8 -7
- package/src/constants/searchParams.ts +0 -1
- package/src/constants/warnings.ts +7 -7
- package/src/hooks/useConfirmSwap.ts +303 -0
- package/src/hooks/{useFetchQuote.ts → useFetchBestRoute.ts} +3 -3
- package/src/hooks/useLanguage.ts +5 -4
- package/src/hooks/useNavigateBack.ts +52 -3
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +7 -37
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +0 -60
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +3 -78
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +6 -15
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +1 -6
- package/src/hooks/useSwapInput.ts +48 -141
- package/src/hooks/useSyncStoresWithConfig.ts +24 -40
- package/src/hooks/useTheme.ts +5 -4
- package/src/hooks/useWalletList.ts +5 -3
- package/src/index.ts +5 -53
- package/src/pages/ConfirmSwapPage.tsx +266 -117
- package/src/pages/HistoryPage.tsx +7 -2
- package/src/pages/Home.tsx +303 -88
- package/src/pages/LanguagePage.tsx +5 -0
- package/src/pages/LiquiditySourcePage.tsx +37 -24
- package/src/pages/SelectBlockchainPage.tsx +24 -31
- package/src/pages/SelectSwapItemsPage.tsx +31 -18
- package/src/pages/SettingsPage.tsx +27 -32
- package/src/pages/SwapDetailsPage.tsx +7 -6
- package/src/pages/ThemePage.tsx +7 -2
- package/src/pages/WalletsPage.tsx +19 -9
- package/src/services/httpService.ts +1 -1
- package/src/store/app.ts +6 -44
- package/src/store/{quote.ts → bestRoute.ts} +64 -71
- package/src/store/meta.ts +39 -0
- package/src/store/settings.ts +158 -0
- package/src/store/slices/config.ts +15 -26
- package/src/store/slices/data.ts +35 -74
- package/src/store/wallets.ts +37 -68
- package/src/types/config.ts +8 -53
- package/src/types/index.ts +1 -1
- package/src/types/routing.ts +77 -0
- package/src/types/swap.ts +13 -4
- package/src/types/wallets.ts +1 -18
- package/src/utils/colors.ts +1 -2
- package/src/utils/configs.ts +1 -2
- package/src/utils/date.ts +1 -1
- package/src/utils/meta.ts +1 -8
- package/src/utils/numbers.ts +1 -1
- package/src/utils/providers.ts +5 -8
- package/src/utils/queue.ts +2 -2
- package/src/utils/routing.ts +321 -0
- package/src/utils/settings.ts +10 -17
- package/src/utils/swap.ts +120 -154
- package/src/utils/time.ts +1 -1
- package/src/utils/wallets.ts +161 -156
- package/dist/components/NoResult/NoResult.d.ts +0 -4
- package/dist/components/NoResult/NoResult.d.ts.map +0 -1
- package/dist/components/NoResult/NoResult.helpers.d.ts +0 -4
- package/dist/components/NoResult/NoResult.helpers.d.ts.map +0 -1
- package/dist/components/NoResult/NoResult.types.d.ts.map +0 -1
- package/dist/components/NoResult/index.d.ts +0 -2
- package/dist/components/NoResult/index.d.ts.map +0 -1
- package/dist/components/Quote/Quote.d.ts +0 -4
- package/dist/components/Quote/Quote.d.ts.map +0 -1
- package/dist/components/Quote/Quote.styles.d.ts +0 -2217
- package/dist/components/Quote/Quote.styles.d.ts.map +0 -1
- package/dist/components/Quote/Quote.types.d.ts +0 -21
- package/dist/components/Quote/Quote.types.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSummary.d.ts +0 -11
- package/dist/components/Quote/QuoteSummary.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +0 -315
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +0 -1
- package/dist/components/Quote/index.d.ts +0 -3
- package/dist/components/Quote/index.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts +0 -4
- package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +0 -633
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts +0 -6
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts +0 -4
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +0 -1571
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts +0 -6
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts +0 -4
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +0 -786
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts +0 -4
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/index.d.ts +0 -4
- package/dist/components/QuoteSkeleton/index.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts +0 -4
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts +0 -4
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts +0 -9
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +0 -23
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/index.d.ts +0 -2
- package/dist/components/QuoteWarningsAndErrors/index.d.ts.map +0 -1
- package/dist/containers/App/App.d.ts +0 -3
- package/dist/containers/App/App.d.ts.map +0 -1
- package/dist/containers/App/App.styles.d.ts +0 -158
- package/dist/containers/App/App.styles.d.ts.map +0 -1
- package/dist/containers/App/index.d.ts +0 -2
- package/dist/containers/App/index.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts +0 -4
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +0 -788
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -20
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/index.d.ts +0 -2
- package/dist/containers/QuoteInfo/index.d.ts.map +0 -1
- package/dist/containers/Wallets/Wallets.d.ts +0 -6
- package/dist/containers/Wallets/Wallets.d.ts.map +0 -1
- package/dist/containers/Wallets/Wallets.types.d.ts +0 -11
- package/dist/containers/Wallets/Wallets.types.d.ts.map +0 -1
- package/dist/containers/Wallets/index.d.ts +0 -2
- package/dist/containers/Wallets/index.d.ts.map +0 -1
- package/dist/containers/Widget/Widget.d.ts +0 -5
- package/dist/containers/Widget/Widget.d.ts.map +0 -1
- package/dist/containers/Widget/Widget.types.d.ts +0 -5
- package/dist/containers/Widget/Widget.types.d.ts.map +0 -1
- package/dist/containers/Widget/index.d.ts +0 -3
- package/dist/containers/Widget/index.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts +0 -6
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +0 -20
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +0 -21
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/index.d.ts +0 -2
- package/dist/containers/WidgetInfo/index.d.ts.map +0 -1
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts +0 -5
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +0 -1
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +0 -7
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +0 -1
- package/dist/containers/WidgetProvider/index.d.ts +0 -2
- package/dist/containers/WidgetProvider/index.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/index.d.ts +0 -2
- package/dist/hooks/useConfirmSwap/index.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts +0 -3
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +0 -19
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +0 -1
- package/dist/hooks/useFetchQuote.d.ts.map +0 -1
- package/dist/hooks/useForceAutoConnect.d.ts +0 -2
- package/dist/hooks/useForceAutoConnect.d.ts.map +0 -1
- package/dist/store/AppStore.d.ts +0 -47
- package/dist/store/AppStore.d.ts.map +0 -1
- package/dist/store/quote.d.ts +0 -89
- package/dist/store/quote.d.ts.map +0 -1
- package/dist/store/slices/settings.d.ts +0 -39
- package/dist/store/slices/settings.d.ts.map +0 -1
- package/dist/types/quote.d.ts +0 -82
- package/dist/types/quote.d.ts.map +0 -1
- package/dist/utils/quote.d.ts +0 -32
- package/dist/utils/quote.d.ts.map +0 -1
- package/src/components/NoResult/index.ts +0 -1
- package/src/components/Quote/Quote.styles.ts +0 -249
- package/src/components/Quote/Quote.tsx +0 -414
- package/src/components/Quote/Quote.types.ts +0 -15
- package/src/components/Quote/QuoteSummary.styles.ts +0 -16
- package/src/components/Quote/QuoteSummary.tsx +0 -46
- package/src/components/Quote/index.ts +0 -2
- package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +0 -42
- package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +0 -30
- package/src/components/QuoteSkeleton/QuoteSkeleton.types.ts +0 -5
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +0 -57
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +0 -76
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.types.ts +0 -6
- package/src/components/QuoteSkeleton/StepSkeleton.styles.ts +0 -33
- package/src/components/QuoteSkeleton/StepSkeleton.tsx +0 -44
- package/src/components/QuoteSkeleton/StepSkeleton.types.ts +0 -1
- package/src/components/QuoteSkeleton/index.ts +0 -3
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +0 -107
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +0 -74
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +0 -103
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +0 -25
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +0 -77
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +0 -38
- package/src/components/QuoteWarningsAndErrors/index.ts +0 -1
- package/src/containers/App/App.styles.ts +0 -18
- package/src/containers/App/App.tsx +0 -52
- package/src/containers/App/index.ts +0 -1
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -31
- package/src/containers/QuoteInfo/QuoteInfo.tsx +0 -99
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -20
- package/src/containers/QuoteInfo/index.ts +0 -1
- package/src/containers/Wallets/Wallets.types.ts +0 -12
- package/src/containers/Wallets/index.ts +0 -1
- package/src/containers/Widget/Widget.tsx +0 -19
- package/src/containers/Widget/Widget.types.ts +0 -5
- package/src/containers/Widget/index.ts +0 -2
- package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +0 -64
- package/src/containers/WidgetInfo/WidgetInfo.tsx +0 -62
- package/src/containers/WidgetInfo/WidgetInfo.types.ts +0 -21
- package/src/containers/WidgetInfo/index.ts +0 -1
- package/src/containers/WidgetProvider/WidgetProvider.tsx +0 -28
- package/src/containers/WidgetProvider/WidgetProvider.types.ts +0 -7
- package/src/containers/WidgetProvider/index.ts +0 -1
- package/src/hooks/useConfirmSwap/index.ts +0 -1
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +0 -172
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +0 -137
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +0 -19
- package/src/hooks/useForceAutoConnect.ts +0 -27
- package/src/store/AppStore.tsx +0 -41
- package/src/store/slices/settings.ts +0 -168
- package/src/types/quote.ts +0 -107
- package/src/utils/quote.ts +0 -338
|
@@ -3,13 +3,12 @@ import type { PropsWithChildren } from 'react';
|
|
|
3
3
|
|
|
4
4
|
import { BottomLogo, Divider, Header } from '@rango-dev/ui';
|
|
5
5
|
import React from 'react';
|
|
6
|
+
import { useNavigate } from 'react-router-dom';
|
|
6
7
|
|
|
7
|
-
import {
|
|
8
|
-
import { useAppStore } from '../../store/AppStore';
|
|
8
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
9
9
|
import { useUiStore } from '../../store/ui';
|
|
10
10
|
import { useWalletsStore } from '../../store/wallets';
|
|
11
11
|
import { getContainer } from '../../utils/common';
|
|
12
|
-
import { isFeatureHidden } from '../../utils/settings';
|
|
13
12
|
import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
|
|
14
13
|
|
|
15
14
|
import { Container, Content, Footer } from './Layout.styles';
|
|
@@ -24,37 +23,25 @@ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
|
|
|
24
23
|
fixedHeight = true,
|
|
25
24
|
} = props;
|
|
26
25
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
27
|
-
const {
|
|
28
|
-
config: { features },
|
|
29
|
-
} = useAppStore();
|
|
30
|
-
|
|
31
|
-
const isConnectWalletHidden = isFeatureHidden(
|
|
32
|
-
'connectWalletButton',
|
|
33
|
-
features
|
|
34
|
-
);
|
|
35
26
|
|
|
36
27
|
const connectWalletsButtonDisabled =
|
|
37
28
|
useUiStore.use.connectWalletsButtonDisabled();
|
|
38
|
-
const
|
|
29
|
+
const navigate = useNavigate();
|
|
39
30
|
|
|
40
31
|
const onConnectWallet = () => {
|
|
41
|
-
if (!connectWalletsButtonDisabled
|
|
42
|
-
|
|
32
|
+
if (!connectWalletsButtonDisabled) {
|
|
33
|
+
navigate('/' + navigationRoutes.wallets);
|
|
43
34
|
}
|
|
44
35
|
};
|
|
45
|
-
|
|
46
|
-
const showBackButton =
|
|
47
|
-
typeof header.hasBackButton === 'undefined' || header.hasBackButton;
|
|
48
|
-
|
|
49
36
|
return (
|
|
50
37
|
<Container ref={ref} fixedHeight={fixedHeight} id="swap-box">
|
|
51
38
|
<Header
|
|
52
|
-
prefix={<>{
|
|
39
|
+
prefix={<>{header.onBack && <BackButton onClick={header.onBack} />}</>}
|
|
53
40
|
title={header.title}
|
|
54
41
|
suffix={
|
|
55
42
|
<>
|
|
56
43
|
{header.suffix}
|
|
57
|
-
{header.
|
|
44
|
+
{header.hasConnectWallet && (
|
|
58
45
|
<WalletButton
|
|
59
46
|
container={getContainer()}
|
|
60
47
|
onClick={onConnectWallet}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface PropTypes {
|
|
2
2
|
header: {
|
|
3
3
|
title: string;
|
|
4
|
-
|
|
4
|
+
hasConnectWallet?: boolean;
|
|
5
5
|
hasSettings?: boolean;
|
|
6
6
|
suffix?: React.ReactNode;
|
|
7
|
-
|
|
7
|
+
onBack?: () => void;
|
|
8
8
|
onCancel?: () => void;
|
|
9
9
|
};
|
|
10
10
|
hasLogo?: boolean;
|
|
@@ -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
|
+
}
|
|
@@ -1,82 +1,78 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
width: '100%',
|
|
5
5
|
height: '100%',
|
|
6
|
-
padding: '$
|
|
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
|
+
},
|
|
7
39
|
});
|
|
8
40
|
|
|
9
41
|
export const StepContainer = styled('div', {
|
|
10
42
|
backgroundColor: '$neutral100',
|
|
11
43
|
borderRadius: '$xm',
|
|
12
44
|
padding: '$10 $15',
|
|
13
|
-
});
|
|
14
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
|
+
});
|
|
15
73
|
export const StepSeparator = styled('div', {
|
|
16
74
|
width: '0px',
|
|
17
75
|
height: '$20',
|
|
18
76
|
borderLeft: '1px dashed $neutral700',
|
|
19
77
|
marginLeft: '25px',
|
|
20
78
|
});
|
|
21
|
-
|
|
22
|
-
export const quoteSummaryItemStyles = css({
|
|
23
|
-
display: 'flex',
|
|
24
|
-
justifyContent: 'space-between',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
});
|
|
27
|
-
|
|
28
|
-
export const tokenAmountStyles = css({
|
|
29
|
-
display: 'flex',
|
|
30
|
-
justifyContent: 'space-between',
|
|
31
|
-
alignItems: 'center',
|
|
32
|
-
});
|
|
33
|
-
|
|
34
|
-
export const costStyles = css({
|
|
35
|
-
paddingTop: '$15',
|
|
36
|
-
display: 'flex',
|
|
37
|
-
});
|
|
38
|
-
|
|
39
|
-
export const quoteSummaryStyles = css({
|
|
40
|
-
padding: '$15 $0',
|
|
41
|
-
});
|
|
42
|
-
|
|
43
|
-
export const quoteSummarySeparatorStyles = css({
|
|
44
|
-
width: '0px',
|
|
45
|
-
height: '$16',
|
|
46
|
-
borderLeft: '1px solid $neutral400',
|
|
47
|
-
marginLeft: '13px',
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
export const swapsStepsStyles = css({
|
|
51
|
-
paddingBottom: '$10',
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
export const stepTitleStyles = css({
|
|
55
|
-
display: 'flex',
|
|
56
|
-
justifyContent: 'start',
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
export const stepTokensStyles = css({
|
|
61
|
-
paddingTop: '$5',
|
|
62
|
-
display: 'flex',
|
|
63
|
-
alignItems: 'center',
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
export const stepInfoStyles = css({
|
|
67
|
-
display: 'flex',
|
|
68
|
-
alignItems: 'center',
|
|
69
|
-
});
|
|
70
|
-
|
|
71
|
-
export const stepIconStyles = css({
|
|
72
|
-
padding: '$4 $6',
|
|
73
|
-
display: 'flex',
|
|
74
|
-
justifyContent: 'center',
|
|
75
|
-
alignItems: 'center',
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
export const extraInfoStyles = css({
|
|
79
|
-
display: 'flex',
|
|
80
|
-
paddingTop: '$10',
|
|
81
|
-
paddingBottom: '$5',
|
|
82
|
-
});
|
|
@@ -1,47 +1,53 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core';
|
|
2
|
-
import { Divider, Skeleton, Typography } from '@rango-dev/ui';
|
|
2
|
+
import { ChainToken, Divider, Skeleton, Typography } from '@rango-dev/ui';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
import {
|
|
8
|
-
Container,
|
|
9
|
-
extraInfoStyles,
|
|
10
|
-
StepContainer,
|
|
11
|
-
StepSeparator,
|
|
12
|
-
} from './LoadingSwapDetails.styles';
|
|
5
|
+
import { Container, StepSeparator } from './LoadingSwapDetails.styles';
|
|
6
|
+
import { LoadingSwapDetailStep } from './LoadingSwapDetailStep';
|
|
13
7
|
|
|
14
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
|
+
|
|
15
20
|
return (
|
|
16
21
|
<Container>
|
|
17
|
-
<
|
|
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
|
+
|
|
18
36
|
<div className="swaps-steps">
|
|
19
37
|
<Typography variant="title" size="small">
|
|
20
38
|
{i18n.t('Swaps steps')}
|
|
21
39
|
</Typography>
|
|
22
40
|
</div>
|
|
23
41
|
|
|
24
|
-
|
|
25
|
-
<
|
|
26
|
-
<StepSkeleton separator={false} />
|
|
27
|
-
<div className={extraInfoStyles()}>
|
|
28
|
-
<Divider direction="horizontal" size={20} />
|
|
29
|
-
<Skeleton height={22} variant="rectangular" />
|
|
30
|
-
</div>
|
|
31
|
-
</StepContainer>
|
|
42
|
+
<div className="step-container">
|
|
43
|
+
<LoadingSwapDetailStep extraInfo />
|
|
32
44
|
<StepSeparator />
|
|
33
|
-
<
|
|
34
|
-
<StepSkeleton separator={false} />
|
|
35
|
-
</StepContainer>
|
|
45
|
+
<LoadingSwapDetailStep />
|
|
36
46
|
<StepSeparator />
|
|
37
|
-
<
|
|
38
|
-
<StepSkeleton separator={false} />
|
|
39
|
-
</StepContainer>
|
|
47
|
+
<LoadingSwapDetailStep />
|
|
40
48
|
<StepSeparator />
|
|
41
|
-
<
|
|
42
|
-
|
|
43
|
-
</StepContainer>
|
|
44
|
-
</>
|
|
49
|
+
<LoadingSwapDetailStep />
|
|
50
|
+
</div>
|
|
45
51
|
</Container>
|
|
46
52
|
);
|
|
47
53
|
}
|
|
@@ -1,32 +1,37 @@
|
|
|
1
|
-
import type { Info } from './
|
|
1
|
+
import type { Info } from './NoRoutes.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
4
|
|
|
5
5
|
import { errorMessages } from '../../constants/errors';
|
|
6
|
-
import {
|
|
7
|
-
type NoResultError,
|
|
8
|
-
QuoteErrorType,
|
|
9
|
-
type QuoteRequestFailed,
|
|
10
|
-
} from '../../types';
|
|
11
6
|
|
|
12
7
|
export function makeInfo(
|
|
13
|
-
|
|
8
|
+
diagnosisMessage: string | null,
|
|
14
9
|
disabledLiquiditySources: string[],
|
|
10
|
+
hasError: boolean,
|
|
15
11
|
toggleAllLiquiditySources: (shouldReset: boolean) => void,
|
|
16
|
-
|
|
12
|
+
refetchBestRoute: () => void
|
|
17
13
|
): Info {
|
|
18
|
-
if (
|
|
14
|
+
if (hasError) {
|
|
19
15
|
return {
|
|
20
16
|
alert: {
|
|
21
17
|
type: 'warning',
|
|
22
18
|
text: errorMessages().genericServerError,
|
|
23
19
|
action: {
|
|
24
|
-
onClick:
|
|
20
|
+
onClick: refetchBestRoute,
|
|
25
21
|
title: i18n.t('Retry'),
|
|
26
22
|
},
|
|
27
23
|
},
|
|
28
24
|
description: '',
|
|
29
25
|
};
|
|
26
|
+
} else if (diagnosisMessage) {
|
|
27
|
+
return {
|
|
28
|
+
alert: {
|
|
29
|
+
type: 'error',
|
|
30
|
+
text: diagnosisMessage,
|
|
31
|
+
action: null,
|
|
32
|
+
},
|
|
33
|
+
description: '',
|
|
34
|
+
};
|
|
30
35
|
} else if (disabledLiquiditySources.length) {
|
|
31
36
|
return {
|
|
32
37
|
alert: {
|
|
@@ -39,21 +44,9 @@ export function makeInfo(
|
|
|
39
44
|
},
|
|
40
45
|
description: errorMessages().liquiditySourcesError.description,
|
|
41
46
|
};
|
|
42
|
-
} else if (
|
|
43
|
-
error?.type === QuoteErrorType.NO_RESULT &&
|
|
44
|
-
error.diagnosisMessage
|
|
45
|
-
) {
|
|
46
|
-
return {
|
|
47
|
-
alert: {
|
|
48
|
-
type: 'error',
|
|
49
|
-
text: error.diagnosisMessage,
|
|
50
|
-
action: null,
|
|
51
|
-
},
|
|
52
|
-
description: '',
|
|
53
|
-
};
|
|
54
47
|
}
|
|
55
48
|
return {
|
|
56
49
|
alert: null,
|
|
57
|
-
description: errorMessages().
|
|
50
|
+
description: errorMessages().noRoutesError.description,
|
|
58
51
|
};
|
|
59
52
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PropTypes } from './
|
|
1
|
+
import type { PropTypes } from './NoRoutes.types';
|
|
2
2
|
|
|
3
3
|
import {
|
|
4
4
|
Alert,
|
|
@@ -11,22 +11,27 @@ import {
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
13
|
import { errorMessages } from '../../constants/errors';
|
|
14
|
-
import {
|
|
14
|
+
import { useMetaStore } from '../../store/meta';
|
|
15
|
+
import { useSettingsStore } from '../../store/settings';
|
|
15
16
|
|
|
16
|
-
import { makeInfo } from './
|
|
17
|
-
import { Container, Footer, PrefixIcon } from './
|
|
17
|
+
import { makeInfo } from './NoRoutes.helper';
|
|
18
|
+
import { Container, Footer, PrefixIcon } from './NoRoutes.styles';
|
|
18
19
|
|
|
19
|
-
export function
|
|
20
|
-
const { fetch, error } = props;
|
|
21
|
-
const disabledLiquiditySources =
|
|
22
|
-
|
|
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();
|
|
23
27
|
|
|
24
|
-
const
|
|
28
|
+
const hasError = error || loadingMetaStatus === 'failed';
|
|
25
29
|
|
|
26
30
|
const info = makeInfo(
|
|
27
|
-
|
|
31
|
+
diagnosisMessage ?? null,
|
|
28
32
|
disabledLiquiditySources,
|
|
29
|
-
|
|
33
|
+
hasError,
|
|
34
|
+
toggleAllLiquiditySources,
|
|
30
35
|
fetch
|
|
31
36
|
);
|
|
32
37
|
|
|
@@ -35,7 +40,7 @@ export function NoResult(props: PropTypes) {
|
|
|
35
40
|
<NoRouteIcon size={24} color="gray" />
|
|
36
41
|
<Divider size={4} />
|
|
37
42
|
<Typography variant="title" size="small">
|
|
38
|
-
{errorMessages().
|
|
43
|
+
{errorMessages().noRoutesError.title}
|
|
39
44
|
</Typography>
|
|
40
45
|
{!!info.description && (
|
|
41
46
|
<Typography
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { NoRoutes } from './NoRoutes';
|
|
@@ -10,8 +10,7 @@ import {
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { useNavigate } from 'react-router-dom';
|
|
12
12
|
|
|
13
|
-
import {
|
|
14
|
-
import { useAppStore } from '../../store/AppStore';
|
|
13
|
+
import { useMetaStore } from '../../store/meta';
|
|
15
14
|
import { useNotificationStore } from '../../store/notification';
|
|
16
15
|
import { useUiStore } from '../../store/ui';
|
|
17
16
|
|
|
@@ -27,15 +26,14 @@ export function NotificationContent() {
|
|
|
27
26
|
const { getUnreadNotifications } = useNotificationStore();
|
|
28
27
|
|
|
29
28
|
const notifications: Notification[] = getUnreadNotifications();
|
|
30
|
-
const blockchains =
|
|
31
|
-
const tokens = useAppStore().tokens();
|
|
29
|
+
const { tokens, blockchains } = useMetaStore.use.meta();
|
|
32
30
|
const sortedNotification = notifications
|
|
33
31
|
.sort((a, b) => b.creationTime - a.creationTime)
|
|
34
32
|
.slice(0, MAX_NOTIFICATIONS_DISPLAYED);
|
|
35
33
|
|
|
36
34
|
const handleOnClick = (requestId: Notification['requestId']) => {
|
|
37
35
|
setSelectedSwap(requestId);
|
|
38
|
-
navigate(
|
|
36
|
+
navigate(`/swaps/${requestId}`);
|
|
39
37
|
};
|
|
40
38
|
|
|
41
39
|
return (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Alerts = styled('div', {
|
|
4
4
|
width: '100%',
|
|
@@ -19,13 +19,6 @@ export const Item = styled('div', {
|
|
|
19
19
|
justifyContent: 'space-between',
|
|
20
20
|
alignItems: 'center',
|
|
21
21
|
width: '100%',
|
|
22
|
-
'._title': {
|
|
23
|
-
$$color: '$colors$neutral600',
|
|
24
|
-
[`.${darkTheme} &`]: {
|
|
25
|
-
$$color: '$colors$neutral700',
|
|
26
|
-
},
|
|
27
|
-
color: '$$color',
|
|
28
|
-
},
|
|
29
22
|
});
|
|
30
23
|
|
|
31
24
|
export const Action = styled('div', {
|
|
@@ -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
|
+
}
|