@rango-dev/widget-embedded 0.19.0 → 0.19.1-next.1
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 +0 -4
- package/dist/QueueManager.d.ts +5 -2
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +0 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -6
- 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 +1 -3
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +690 -61
- 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 +1 -3
- 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 +1 -4
- 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/LoadingSwapDetails.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.d.ts +4 -0
- package/dist/components/NoResult/NoResult.d.ts.map +1 -0
- package/dist/components/NoResult/NoResult.helpers.d.ts +4 -0
- package/dist/components/NoResult/NoResult.helpers.d.ts.map +1 -0
- package/dist/components/{NoRoutes/NoRoutes.styles.d.ts → NoResult/NoResult.styles.d.ts} +1 -1
- package/dist/components/{NoRoutes/NoRoutes.styles.d.ts.map → NoResult/NoResult.styles.d.ts.map} +1 -1
- package/dist/components/{NoRoutes/NoRoutes.types.d.ts → NoResult/NoResult.types.d.ts} +3 -3
- package/dist/components/NoResult/NoResult.types.d.ts.map +1 -0
- package/dist/components/NoResult/index.d.ts +2 -0
- package/dist/components/NoResult/index.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts +4 -0
- package/dist/components/Quote/Quote.d.ts.map +1 -0
- package/dist/components/Quote/Quote.styles.d.ts +2217 -0
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -0
- package/dist/components/Quote/Quote.types.d.ts +21 -0
- package/dist/components/Quote/Quote.types.d.ts.map +1 -0
- package/dist/components/Quote/QuoteSummary.d.ts +11 -0
- package/dist/components/Quote/QuoteSummary.d.ts.map +1 -0
- package/dist/components/Quote/QuoteSummary.styles.d.ts +315 -0
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -0
- package/dist/components/Quote/index.d.ts +3 -0
- package/dist/components/Quote/index.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts +4 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +633 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts +6 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts +4 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +1571 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts +6 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts +4 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +786 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts +4 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/index.d.ts +4 -0
- package/dist/components/QuoteSkeleton/index.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +11 -0
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts +4 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts +4 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts +9 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -0
- package/dist/components/{RouteErrors/RouteErrors.styles.d.ts → QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts} +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +23 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +11 -0
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +11 -0
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/index.d.ts +2 -0
- package/dist/components/QuoteWarningsAndErrors/index.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +158 -0
- 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 +628 -0
- 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 +157 -0
- 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 +1100 -1
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +4 -9
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/components/TokenList/index.d.ts +0 -1
- package/dist/components/TokenList/index.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts +1 -6
- 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 +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +1 -1
- package/dist/constants/navigationRoutes.d.ts +1 -2
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/searchParams.d.ts +2 -1
- 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/containers/App/App.d.ts +3 -0
- package/dist/containers/App/App.d.ts.map +1 -0
- package/dist/containers/App/App.styles.d.ts +158 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -0
- package/dist/containers/App/index.d.ts +2 -0
- package/dist/containers/App/index.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts +4 -0
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +788 -0
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +20 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/index.d.ts +2 -0
- package/dist/containers/QuoteInfo/index.d.ts.map +1 -0
- package/dist/containers/Wallets/Wallets.d.ts +6 -0
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
- package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
- package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
- package/dist/containers/Wallets/index.d.ts +2 -0
- package/dist/containers/Wallets/index.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.d.ts +5 -0
- package/dist/containers/Widget/Widget.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.types.d.ts +5 -0
- package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
- package/dist/containers/Widget/index.d.ts +3 -0
- package/dist/containers/Widget/index.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/index.d.ts +2 -0
- package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/index.d.ts +2 -0
- package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
- package/dist/hooks/useConfirmSwap/index.d.ts +2 -0
- package/dist/hooks/useConfirmSwap/index.d.ts.map +1 -0
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts +3 -0
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -0
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +19 -0
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -0
- package/dist/hooks/{useConfirmSwap.d.ts → useConfirmSwap/useConfirmSwap.types.d.ts} +5 -7
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -0
- package/dist/hooks/{useFetchBestRoute.d.ts → useFetchQuote.d.ts} +3 -3
- package/dist/hooks/useFetchQuote.d.ts.map +1 -0
- package/dist/hooks/useForceAutoConnect.d.ts +2 -0
- package/dist/hooks/useForceAutoConnect.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 +1 -3
- 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 +5 -7
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts +4 -2
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts +1 -2
- 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 +21 -8
- 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 +1 -6
- 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 +1 -2
- 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 +1 -6
- 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 +1 -8
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +47 -0
- package/dist/store/AppStore.d.ts.map +1 -0
- package/dist/store/app.d.ts +41 -22
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/notification.d.ts +4 -3
- package/dist/store/notification.d.ts.map +1 -1
- package/dist/store/quote.d.ts +89 -0
- package/dist/store/quote.d.ts.map +1 -0
- package/dist/store/slices/config.d.ts +3 -2
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +5 -2
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts +39 -0
- package/dist/store/slices/settings.d.ts.map +1 -0
- package/dist/store/ui.d.ts +2 -1
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -9
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +41 -8
- 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/quote.d.ts +82 -0
- package/dist/types/quote.d.ts.map +1 -0
- package/dist/types/swap.d.ts +4 -14
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +15 -1
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +1 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +2 -1
- 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/quote.d.ts +32 -0
- package/dist/utils/quote.d.ts.map +1 -0
- package/dist/utils/settings.d.ts +6 -2
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +35 -24
- 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 +9 -10
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/QueueManager.tsx +18 -17
- package/src/components/AppRouter.tsx +8 -32
- package/src/components/AppRoutes.tsx +57 -69
- 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 +26 -17
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +2 -64
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +29 -10
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +43 -47
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +1 -3
- package/src/components/ConfirmWalletsModal/WalletList.tsx +9 -8
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
- package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
- package/src/components/Layout/Layout.styles.ts +2 -0
- package/src/components/Layout/Layout.tsx +20 -7
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +65 -61
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +28 -34
- package/src/components/{NoRoutes/NoRoutes.helper.ts → NoResult/NoResult.helpers.ts} +23 -16
- package/src/components/{NoRoutes/NoRoutes.styles.ts → NoResult/NoResult.styles.ts} +2 -0
- package/src/components/{NoRoutes/NoRoutes.tsx → NoResult/NoResult.tsx} +12 -17
- package/src/components/{NoRoutes/NoRoutes.types.ts → NoResult/NoResult.types.ts} +3 -2
- package/src/components/NoResult/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.tsx +5 -3
- package/src/components/Quote/Quote.styles.ts +250 -0
- package/src/components/Quote/Quote.tsx +414 -0
- package/src/components/Quote/Quote.types.ts +15 -0
- package/src/components/Quote/QuoteSummary.styles.ts +16 -0
- package/src/components/Quote/QuoteSummary.tsx +46 -0
- package/src/components/Quote/index.ts +2 -0
- package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +42 -0
- package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +30 -0
- package/src/components/QuoteSkeleton/QuoteSkeleton.types.ts +5 -0
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +57 -0
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +76 -0
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.types.ts +6 -0
- package/src/components/QuoteSkeleton/StepSkeleton.styles.ts +33 -0
- package/src/components/QuoteSkeleton/StepSkeleton.tsx +44 -0
- package/src/components/QuoteSkeleton/StepSkeleton.types.ts +1 -0
- package/src/components/QuoteSkeleton/index.ts +3 -0
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +107 -0
- package/src/components/{RouteErrors/RouteErrorsModalItem.tsx → QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx} +4 -4
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +74 -0
- package/src/components/{RouteErrors/RouteErrors.styles.ts → QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts} +8 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +103 -0
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +25 -0
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +77 -0
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +38 -0
- package/src/components/QuoteWarningsAndErrors/index.ts +1 -0
- package/src/components/Slippage/Slippage.styles.ts +15 -5
- package/src/components/Slippage/Slippage.tsx +11 -10
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -8
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +36 -33
- package/src/components/SwapDetails/SwapDetails.tsx +41 -56
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +14 -8
- 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 +10 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +3 -5
- package/src/components/SwitchFromAndTo.tsx +2 -2
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +74 -38
- package/src/components/TokenList/TokenList.tsx +35 -26
- package/src/components/TokenList/TokenList.types.ts +4 -10
- package/src/components/TokenList/index.ts +0 -1
- package/src/components/UpdateUrl.tsx +35 -30
- package/src/components/WidgetEvents.tsx +4 -2
- package/src/constants/errors.ts +17 -15
- package/src/constants/index.ts +1 -0
- package/src/constants/messages.ts +1 -1
- package/src/constants/navigationRoutes.ts +7 -8
- package/src/constants/searchParams.ts +1 -0
- package/src/constants/warnings.ts +7 -7
- package/src/containers/App/App.styles.ts +18 -0
- package/src/containers/App/App.tsx +52 -0
- package/src/containers/App/index.ts +1 -0
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +31 -0
- package/src/containers/QuoteInfo/QuoteInfo.tsx +99 -0
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +20 -0
- package/src/containers/QuoteInfo/index.ts +1 -0
- package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
- package/src/containers/Wallets/Wallets.types.ts +12 -0
- package/src/containers/Wallets/index.ts +1 -0
- package/src/containers/Widget/Widget.tsx +19 -0
- package/src/containers/Widget/Widget.types.ts +5 -0
- package/src/containers/Widget/index.ts +2 -0
- package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
- package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
- package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
- package/src/containers/WidgetInfo/index.ts +1 -0
- package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
- package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
- package/src/containers/WidgetProvider/index.ts +1 -0
- package/src/hooks/useConfirmSwap/index.ts +1 -0
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +172 -0
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +137 -0
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +19 -0
- package/src/hooks/{useFetchBestRoute.ts → useFetchQuote.ts} +3 -3
- package/src/hooks/useForceAutoConnect.ts +27 -0
- package/src/hooks/useLanguage.ts +4 -5
- package/src/hooks/useNavigateBack.ts +3 -52
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
- package/src/hooks/useSwapInput.ts +141 -48
- package/src/hooks/useSyncStoresWithConfig.ts +40 -24
- package/src/hooks/useTheme.ts +4 -5
- package/src/hooks/useWalletList.ts +3 -5
- package/src/index.ts +50 -5
- package/src/pages/ConfirmSwapPage.tsx +117 -266
- package/src/pages/HistoryPage.tsx +2 -7
- package/src/pages/Home.tsx +88 -303
- package/src/pages/LanguagePage.tsx +0 -5
- package/src/pages/LiquiditySourcePage.tsx +24 -37
- package/src/pages/SelectBlockchainPage.tsx +31 -24
- package/src/pages/SelectSwapItemsPage.tsx +18 -31
- package/src/pages/SettingsPage.tsx +32 -27
- package/src/pages/SwapDetailsPage.tsx +6 -7
- package/src/pages/ThemePage.tsx +2 -7
- package/src/pages/WalletsPage.tsx +9 -19
- package/src/services/httpService.ts +1 -1
- package/src/store/AppStore.tsx +41 -0
- package/src/store/app.ts +44 -6
- package/src/store/{bestRoute.ts → quote.ts} +71 -64
- package/src/store/slices/config.ts +26 -15
- package/src/store/slices/data.ts +74 -35
- package/src/store/slices/settings.ts +168 -0
- package/src/store/wallets.ts +68 -37
- package/src/types/config.ts +53 -8
- package/src/types/index.ts +1 -1
- package/src/types/quote.ts +107 -0
- package/src/types/swap.ts +4 -13
- package/src/types/wallets.ts +18 -1
- package/src/utils/colors.ts +2 -1
- package/src/utils/configs.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/meta.ts +8 -1
- package/src/utils/numbers.ts +1 -1
- package/src/utils/providers.ts +8 -5
- package/src/utils/queue.ts +2 -2
- package/src/utils/quote.ts +338 -0
- package/src/utils/settings.ts +17 -10
- package/src/utils/swap.ts +154 -120
- package/src/utils/time.ts +1 -1
- package/src/utils/wallets.ts +156 -161
- package/dist/Wallets.d.ts +0 -17
- package/dist/Wallets.d.ts.map +0 -1
- package/dist/Widget.d.ts +0 -9
- package/dist/Widget.d.ts.map +0 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +0 -4
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +0 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +0 -4
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +0 -1
- package/dist/components/NoRoutes/NoRoutes.d.ts +0 -4
- package/dist/components/NoRoutes/NoRoutes.d.ts.map +0 -1
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts +0 -3
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +0 -1
- package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +0 -1
- package/dist/components/NoRoutes/index.d.ts +0 -2
- package/dist/components/NoRoutes/index.d.ts.map +0 -1
- package/dist/components/RouteErrors/RouteErrors.d.ts +0 -4
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +0 -1
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +0 -1
- package/dist/components/RouteErrors/RouteErrors.types.d.ts +0 -24
- package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +0 -1
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts +0 -4
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +0 -1
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +0 -4
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +0 -1
- package/dist/components/RouteErrors/index.d.ts +0 -2
- package/dist/components/RouteErrors/index.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap.d.ts.map +0 -1
- package/dist/hooks/useFetchBestRoute.d.ts.map +0 -1
- package/dist/store/bestRoute.d.ts +0 -77
- package/dist/store/bestRoute.d.ts.map +0 -1
- package/dist/store/meta.d.ts +0 -23
- package/dist/store/meta.d.ts.map +0 -1
- package/dist/store/settings.d.ts +0 -81
- package/dist/store/settings.d.ts.map +0 -1
- package/dist/types/routing.d.ts +0 -65
- package/dist/types/routing.d.ts.map +0 -1
- package/dist/utils/routing.d.ts +0 -28
- package/dist/utils/routing.d.ts.map +0 -1
- package/src/Widget.tsx +0 -119
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +0 -41
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +0 -3
- package/src/components/NoRoutes/index.ts +0 -1
- package/src/components/RouteErrors/RouteErrors.tsx +0 -79
- package/src/components/RouteErrors/RouteErrors.types.ts +0 -29
- package/src/components/RouteErrors/RouteErrorsModal.tsx +0 -129
- package/src/components/RouteErrors/index.ts +0 -1
- package/src/hooks/useConfirmSwap.ts +0 -303
- package/src/store/meta.ts +0 -39
- package/src/store/settings.ts +0 -158
- package/src/types/routing.ts +0 -77
- package/src/utils/routing.ts +0 -321
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core';
|
|
2
2
|
import {
|
|
3
|
-
Chip,
|
|
4
3
|
Divider,
|
|
5
4
|
InfoIcon,
|
|
6
5
|
TextField,
|
|
@@ -14,17 +13,20 @@ import {
|
|
|
14
13
|
MIN_SLIPPGAE,
|
|
15
14
|
SLIPPAGES,
|
|
16
15
|
} from '../../constants/swapSettings';
|
|
17
|
-
import {
|
|
16
|
+
import { useAppStore } from '../../store/AppStore';
|
|
18
17
|
import { getContainer } from '../../utils/common';
|
|
19
18
|
|
|
20
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
BaseContainer,
|
|
21
|
+
Head,
|
|
22
|
+
SlippageChip,
|
|
23
|
+
SlippageChipsContainer,
|
|
24
|
+
} from './Slippage.styles';
|
|
21
25
|
import { SlippageTooltipContent } from './SlippageTooltipContent';
|
|
22
26
|
|
|
23
27
|
export function Slippage() {
|
|
24
|
-
const slippage =
|
|
25
|
-
|
|
26
|
-
const customSlippage = useSettingsStore.use.customSlippage();
|
|
27
|
-
const setCustomSlippage = useSettingsStore.use.setCustomSlippage();
|
|
28
|
+
const { slippage, setSlippage, customSlippage, setCustomSlippage } =
|
|
29
|
+
useAppStore();
|
|
28
30
|
|
|
29
31
|
return (
|
|
30
32
|
<BaseContainer>
|
|
@@ -36,6 +38,7 @@ export function Slippage() {
|
|
|
36
38
|
<Tooltip
|
|
37
39
|
container={getContainer()}
|
|
38
40
|
side="top"
|
|
41
|
+
sideOffset={4}
|
|
39
42
|
content={<SlippageTooltipContent />}>
|
|
40
43
|
<InfoIcon color="gray" />
|
|
41
44
|
</Tooltip>
|
|
@@ -45,8 +48,7 @@ export function Slippage() {
|
|
|
45
48
|
const key = `slippage-${index}`;
|
|
46
49
|
return (
|
|
47
50
|
<>
|
|
48
|
-
<
|
|
49
|
-
style={{ width: '64px', flexShrink: 0 }}
|
|
51
|
+
<SlippageChip
|
|
50
52
|
key={key}
|
|
51
53
|
onClick={() => {
|
|
52
54
|
if (customSlippage) {
|
|
@@ -57,7 +59,6 @@ export function Slippage() {
|
|
|
57
59
|
selected={!customSlippage && slippageItem === slippage}
|
|
58
60
|
label={`${slippageItem.toString()}%`}
|
|
59
61
|
/>
|
|
60
|
-
<Divider direction="horizontal" size={8} />
|
|
61
62
|
</>
|
|
62
63
|
);
|
|
63
64
|
})}
|
|
@@ -10,8 +10,6 @@ import {
|
|
|
10
10
|
} from '@rango-dev/ui';
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
14
|
-
import { useNavigateBack } from '../../hooks/useNavigateBack';
|
|
15
13
|
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
16
14
|
import { Layout } from '../Layout';
|
|
17
15
|
import { LoadingSwapDetails } from '../LoadingSwapDetails';
|
|
@@ -20,28 +18,27 @@ import {
|
|
|
20
18
|
Container,
|
|
21
19
|
HeaderDetails,
|
|
22
20
|
PlaceholderContainer,
|
|
21
|
+
requestIdStyles,
|
|
22
|
+
rowStyles,
|
|
23
23
|
} from './SwapDetails.styles';
|
|
24
24
|
|
|
25
25
|
export function SwapDetailsPlaceholder(props: SwapDetailsPlaceholderPropTypes) {
|
|
26
26
|
const { requestId, showSkeleton } = props;
|
|
27
|
-
const { navigateBackFrom } = useNavigateBack();
|
|
28
|
-
|
|
29
27
|
return (
|
|
30
28
|
<Layout
|
|
31
29
|
noPadding
|
|
32
30
|
header={{
|
|
33
31
|
title: i18n.t('Swap and Bridge'),
|
|
34
|
-
onBack: navigateBackFrom.bind(null, navigationRoutes.swapDetails),
|
|
35
32
|
suffix: <SuffixContainer />,
|
|
36
33
|
}}>
|
|
37
34
|
{showSkeleton && (
|
|
38
35
|
<Container>
|
|
39
36
|
<HeaderDetails>
|
|
40
|
-
<div className=
|
|
37
|
+
<div className={rowStyles()}>
|
|
41
38
|
<Typography variant="label" size="large" color="neutral700">
|
|
42
39
|
{`${i18n.t('Request ID')}:`}
|
|
43
40
|
</Typography>
|
|
44
|
-
<div className=
|
|
41
|
+
<div className={requestIdStyles()}>
|
|
45
42
|
<Typography variant="label" size="small" color="neutral700">
|
|
46
43
|
<Skeleton width={60} height={10} variant="rounded" />
|
|
47
44
|
</Typography>
|
|
@@ -50,7 +47,7 @@ export function SwapDetailsPlaceholder(props: SwapDetailsPlaceholderPropTypes) {
|
|
|
50
47
|
</IconButton>
|
|
51
48
|
</div>
|
|
52
49
|
</div>
|
|
53
|
-
<div className=
|
|
50
|
+
<div className={rowStyles()}>
|
|
54
51
|
<Typography variant="label" size="large" color="neutral700">
|
|
55
52
|
{`${i18n.t('Created at')}:`}
|
|
56
53
|
</Typography>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { GetStep } from '../SwapDetailsAlerts';
|
|
2
|
-
import type { PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
3
2
|
import type { Step, StepDetailsProps } from '@rango-dev/ui';
|
|
3
|
+
import type { PendingSwapStep } from 'rango-types';
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { darkTheme, styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, darkTheme, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
display: 'flex',
|
|
@@ -7,38 +7,6 @@ export const Container = styled('div', {
|
|
|
7
7
|
alignItems: 'center',
|
|
8
8
|
height: '0',
|
|
9
9
|
flexGrow: 1,
|
|
10
|
-
'& .row': {
|
|
11
|
-
display: 'flex',
|
|
12
|
-
width: '100%',
|
|
13
|
-
justifyContent: 'space-between',
|
|
14
|
-
alignItems: 'center',
|
|
15
|
-
padding: '$10 $20',
|
|
16
|
-
borderBottom: '1px solid',
|
|
17
|
-
$$color: '$colors$neutral300',
|
|
18
|
-
[`.${darkTheme} &`]: {
|
|
19
|
-
$$color: '$colors$neutral400',
|
|
20
|
-
},
|
|
21
|
-
borderColor: '$$color',
|
|
22
|
-
color: '$neutral500',
|
|
23
|
-
},
|
|
24
|
-
'& .request-id': {
|
|
25
|
-
display: 'flex',
|
|
26
|
-
justifyContent: 'center',
|
|
27
|
-
alignItems: 'center',
|
|
28
|
-
height: '$24',
|
|
29
|
-
},
|
|
30
|
-
'& .output': {
|
|
31
|
-
display: 'flex',
|
|
32
|
-
width: '100%',
|
|
33
|
-
padding: '$15 $20 $20',
|
|
34
|
-
flexDirection: 'column',
|
|
35
|
-
alignItems: 'start',
|
|
36
|
-
},
|
|
37
|
-
'& .title-steps': {
|
|
38
|
-
textAlign: 'left',
|
|
39
|
-
width: '100%',
|
|
40
|
-
padding: '0 $20 $10',
|
|
41
|
-
},
|
|
42
10
|
});
|
|
43
11
|
|
|
44
12
|
export const HeaderDetails = styled('div', {
|
|
@@ -70,3 +38,38 @@ export const LoaderContainer = styled('div', {
|
|
|
70
38
|
paddingTop: '33%',
|
|
71
39
|
flex: 1,
|
|
72
40
|
});
|
|
41
|
+
|
|
42
|
+
export const rowStyles = css({
|
|
43
|
+
display: 'flex',
|
|
44
|
+
width: '100%',
|
|
45
|
+
justifyContent: 'space-between',
|
|
46
|
+
alignItems: 'center',
|
|
47
|
+
padding: '$10 $20',
|
|
48
|
+
borderBottom: '1px solid',
|
|
49
|
+
$$color: '$colors$neutral300',
|
|
50
|
+
[`.${darkTheme} &`]: {
|
|
51
|
+
$$color: '$colors$neutral400',
|
|
52
|
+
},
|
|
53
|
+
borderColor: '$$color',
|
|
54
|
+
color: '$neutral500',
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
export const requestIdStyles = css({
|
|
58
|
+
display: 'flex',
|
|
59
|
+
justifyContent: 'center',
|
|
60
|
+
alignItems: 'center',
|
|
61
|
+
height: '$24',
|
|
62
|
+
});
|
|
63
|
+
|
|
64
|
+
export const outputStyles = css({
|
|
65
|
+
display: 'flex',
|
|
66
|
+
width: '100%',
|
|
67
|
+
padding: '$15 $20 $20',
|
|
68
|
+
flexDirection: 'column',
|
|
69
|
+
alignItems: 'start',
|
|
70
|
+
});
|
|
71
|
+
|
|
72
|
+
export const titleStepsStyles = css({
|
|
73
|
+
width: '100%',
|
|
74
|
+
padding: '0 $20 $10',
|
|
75
|
+
});
|
|
@@ -6,24 +6,22 @@ import {
|
|
|
6
6
|
getCurrentBlockchainOfOrNull,
|
|
7
7
|
getCurrentStep,
|
|
8
8
|
getRelatedWalletOrNull,
|
|
9
|
-
PendingSwapNetworkStatus,
|
|
10
9
|
} from '@rango-dev/queue-manager-rango-preset';
|
|
11
10
|
import {
|
|
12
11
|
Button,
|
|
13
12
|
CopyIcon,
|
|
14
13
|
Divider,
|
|
15
14
|
IconButton,
|
|
16
|
-
|
|
17
|
-
RouteSummary,
|
|
15
|
+
QuoteCost,
|
|
18
16
|
StepDetails,
|
|
19
17
|
Typography,
|
|
20
18
|
useCopyToClipboard,
|
|
21
19
|
} from '@rango-dev/ui';
|
|
22
20
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
21
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
23
22
|
import React, { useEffect, useRef, useState } from 'react';
|
|
24
23
|
import { useNavigate } from 'react-router-dom';
|
|
25
24
|
|
|
26
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
27
25
|
import {
|
|
28
26
|
GAS_FEE_MAX_DECIMALS,
|
|
29
27
|
GAS_FEE_MIN_DECIMALS,
|
|
@@ -34,49 +32,54 @@ import {
|
|
|
34
32
|
USD_VALUE_MAX_DECIMALS,
|
|
35
33
|
USD_VALUE_MIN_DECIMALS,
|
|
36
34
|
} from '../../constants/routing';
|
|
37
|
-
import {
|
|
38
|
-
import { useBestRouteStore } from '../../store/bestRoute';
|
|
39
|
-
import { useMetaStore } from '../../store/meta';
|
|
35
|
+
import { useAppStore } from '../../store/AppStore';
|
|
40
36
|
import { useNotificationStore } from '../../store/notification';
|
|
37
|
+
import { useQuoteStore } from '../../store/quote';
|
|
41
38
|
import {
|
|
42
39
|
numberToString,
|
|
43
40
|
secondsToString,
|
|
44
41
|
totalArrivalTime,
|
|
45
42
|
} from '../../utils/numbers';
|
|
46
|
-
import { getPriceImpactLevel } from '../../utils/
|
|
43
|
+
import { getPriceImpact, getPriceImpactLevel } from '../../utils/quote';
|
|
47
44
|
import {
|
|
48
45
|
getLastConvertedTokenInFailedSwap,
|
|
49
|
-
getPercentageChange,
|
|
50
46
|
getSwapMessages,
|
|
51
47
|
shouldRetrySwap,
|
|
52
48
|
} from '../../utils/swap';
|
|
53
49
|
import { getSwapDate } from '../../utils/time';
|
|
54
|
-
import { getConciseAddress
|
|
50
|
+
import { getConciseAddress } from '../../utils/wallets';
|
|
55
51
|
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
56
52
|
import { Layout } from '../Layout';
|
|
53
|
+
import { QuoteSummary } from '../Quote';
|
|
57
54
|
import {
|
|
58
55
|
SwapDetailsCompleteModal,
|
|
59
56
|
SwapDetailsModal,
|
|
60
57
|
} from '../SwapDetailsModal';
|
|
61
58
|
|
|
62
59
|
import { getSteps, getStepState, RESET_INTERVAL } from './SwapDetails.helpers';
|
|
63
|
-
import {
|
|
60
|
+
import {
|
|
61
|
+
Container,
|
|
62
|
+
HeaderDetails,
|
|
63
|
+
outputStyles,
|
|
64
|
+
requestIdStyles,
|
|
65
|
+
rowStyles,
|
|
66
|
+
StepsList,
|
|
67
|
+
titleStepsStyles,
|
|
68
|
+
} from './SwapDetails.styles';
|
|
64
69
|
|
|
65
70
|
export function SwapDetails(props: SwapDetailsProps) {
|
|
66
71
|
const { swap, requestId, onDelete, onCancel: onCancelProps } = props;
|
|
67
72
|
const { canSwitchNetworkTo, connect, getWalletInfo } = useWallets();
|
|
68
|
-
const
|
|
73
|
+
const blockchains = useAppStore().blockchains();
|
|
74
|
+
const tokens = useAppStore().tokens();
|
|
75
|
+
const retry = useQuoteStore.use.retry();
|
|
69
76
|
const navigate = useNavigate();
|
|
70
|
-
const { navigateBackFrom } = useNavigateBack();
|
|
71
77
|
const [_, handleCopy] = useCopyToClipboard(RESET_INTERVAL);
|
|
72
78
|
const listRef = useRef<HTMLDivElement | null>(null);
|
|
73
79
|
const [modalState, setModalState] = useState<ModalState>(null);
|
|
74
80
|
const [showCompletedModal, setShowCompletedModal] = useState<
|
|
75
81
|
'success' | 'failed' | null
|
|
76
82
|
>(null);
|
|
77
|
-
const {
|
|
78
|
-
meta: { tokens, blockchains },
|
|
79
|
-
} = useMetaStore();
|
|
80
83
|
|
|
81
84
|
const onCancel = () => {
|
|
82
85
|
onCancelProps();
|
|
@@ -151,7 +154,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
151
154
|
showNetworkModal: currentStepNetworkStatus,
|
|
152
155
|
setNetworkModal: setModalState,
|
|
153
156
|
message: stepMessage,
|
|
154
|
-
blockchains,
|
|
157
|
+
blockchains: blockchains,
|
|
155
158
|
});
|
|
156
159
|
const numberOfSteps = steps.length;
|
|
157
160
|
const [firstStep, lastStep] = [swap.steps[0], swap.steps[numberOfSteps - 1]];
|
|
@@ -168,40 +171,24 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
168
171
|
)?.diagnosisUrl;
|
|
169
172
|
|
|
170
173
|
const outputUsdValue = numberToString(
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
) *
|
|
179
|
-
(getUsdPrice(
|
|
180
|
-
lastStep.toBlockchain,
|
|
181
|
-
lastStep.toSymbol,
|
|
182
|
-
lastStep.toSymbolAddress,
|
|
183
|
-
tokens
|
|
184
|
-
) || 0)
|
|
185
|
-
),
|
|
174
|
+
parseFloat(
|
|
175
|
+
numberToString(
|
|
176
|
+
outputAmount,
|
|
177
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
178
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
179
|
+
)
|
|
180
|
+
) * (lastStep.toUsdPrice || 0),
|
|
186
181
|
USD_VALUE_MIN_DECIMALS,
|
|
187
182
|
USD_VALUE_MAX_DECIMALS
|
|
188
183
|
);
|
|
189
184
|
|
|
190
185
|
const inputUsdValue = numberToString(
|
|
191
|
-
|
|
192
|
-
parseFloat(swap.inputAmount) *
|
|
193
|
-
(getUsdPrice(
|
|
194
|
-
firstStep.fromBlockchain,
|
|
195
|
-
firstStep.fromSymbol,
|
|
196
|
-
firstStep.fromSymbolAddress,
|
|
197
|
-
tokens
|
|
198
|
-
) || 0)
|
|
199
|
-
),
|
|
186
|
+
parseFloat(swap.inputAmount) * (firstStep.fromUsdPrice || 0),
|
|
200
187
|
USD_VALUE_MIN_DECIMALS,
|
|
201
188
|
USD_VALUE_MAX_DECIMALS
|
|
202
189
|
);
|
|
203
190
|
|
|
204
|
-
const percentageChange =
|
|
191
|
+
const percentageChange = getPriceImpact(inputUsdValue, outputUsdValue);
|
|
205
192
|
|
|
206
193
|
const completeModalDesc =
|
|
207
194
|
swap.status === 'success'
|
|
@@ -239,7 +226,6 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
239
226
|
noPadding
|
|
240
227
|
header={{
|
|
241
228
|
title: i18n.t('Swap and Bridge'),
|
|
242
|
-
onBack: navigateBackFrom.bind(null, navigationRoutes.swapDetails),
|
|
243
229
|
onCancel:
|
|
244
230
|
swap.status === 'running' ? () => setModalState('cancel') : undefined,
|
|
245
231
|
suffix: swap.status !== 'running' && (
|
|
@@ -265,9 +251,10 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
265
251
|
type="primary"
|
|
266
252
|
size="large"
|
|
267
253
|
onClick={() => {
|
|
268
|
-
retry(swap);
|
|
254
|
+
retry(swap, { blockchains: blockchains, tokens: tokens });
|
|
269
255
|
setTimeout(() => {
|
|
270
|
-
|
|
256
|
+
const home = '../../';
|
|
257
|
+
navigate(home);
|
|
271
258
|
}, 0);
|
|
272
259
|
}}>
|
|
273
260
|
{i18n.t('Try again')}
|
|
@@ -276,11 +263,11 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
276
263
|
}>
|
|
277
264
|
<Container>
|
|
278
265
|
<HeaderDetails>
|
|
279
|
-
<div className=
|
|
266
|
+
<div className={rowStyles()}>
|
|
280
267
|
<Typography variant="label" size="large" color="neutral700">
|
|
281
268
|
{`${i18n.t('Request ID')}:`}
|
|
282
269
|
</Typography>
|
|
283
|
-
<div className=
|
|
270
|
+
<div className={requestIdStyles()}>
|
|
284
271
|
<Typography variant="label" size="small" color="neutral700">
|
|
285
272
|
{requestId}
|
|
286
273
|
</Typography>
|
|
@@ -291,7 +278,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
291
278
|
</IconButton>
|
|
292
279
|
</div>
|
|
293
280
|
</div>
|
|
294
|
-
<div className=
|
|
281
|
+
<div className={rowStyles()}>
|
|
295
282
|
<Typography variant="label" size="large" color="neutral700">
|
|
296
283
|
{`${i18n.t('Created at')}:`}
|
|
297
284
|
</Typography>
|
|
@@ -301,8 +288,8 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
301
288
|
</div>
|
|
302
289
|
</HeaderDetails>
|
|
303
290
|
|
|
304
|
-
<div className=
|
|
305
|
-
<
|
|
291
|
+
<div className={outputStyles()}>
|
|
292
|
+
<QuoteCost
|
|
306
293
|
fee={numberToString(
|
|
307
294
|
String(totalFee),
|
|
308
295
|
GAS_FEE_MIN_DECIMALS,
|
|
@@ -311,7 +298,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
311
298
|
time={secondsToString(totalArrivalTime(swap.steps))}
|
|
312
299
|
steps={numberOfSteps}
|
|
313
300
|
/>
|
|
314
|
-
<
|
|
301
|
+
<QuoteSummary
|
|
315
302
|
from={{
|
|
316
303
|
price: {
|
|
317
304
|
value: numberToString(
|
|
@@ -353,12 +340,10 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
353
340
|
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
354
341
|
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
355
342
|
)}
|
|
356
|
-
warningLevel={getPriceImpactLevel(
|
|
357
|
-
percentageChange?.toNumber() ?? 0
|
|
358
|
-
)}
|
|
343
|
+
warningLevel={getPriceImpactLevel(percentageChange ?? 0)}
|
|
359
344
|
/>
|
|
360
345
|
</div>
|
|
361
|
-
<div className=
|
|
346
|
+
<div className={titleStepsStyles()}>
|
|
362
347
|
<Typography variant="title" size="small">
|
|
363
348
|
{i18n.t('Swaps steps')}
|
|
364
349
|
</Typography>
|
|
@@ -377,7 +362,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
377
362
|
<StepDetails
|
|
378
363
|
key={key}
|
|
379
364
|
step={step}
|
|
380
|
-
type="
|
|
365
|
+
type="swap-progress"
|
|
381
366
|
ref={listRef}
|
|
382
367
|
state={state}
|
|
383
368
|
hasSeparator={index !== 0}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { WaningAlertsProps } from './SwapDetailsAlerts.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
5
4
|
import { Alert, Button } from '@rango-dev/ui';
|
|
5
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
6
6
|
import React from 'react';
|
|
7
7
|
|
|
8
8
|
export function WarningAlert(props: WaningAlertsProps) {
|
|
@@ -12,8 +12,6 @@ import {
|
|
|
12
12
|
import React from 'react';
|
|
13
13
|
import { useNavigate } from 'react-router-dom';
|
|
14
14
|
|
|
15
|
-
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
16
|
-
|
|
17
15
|
export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
|
|
18
16
|
const {
|
|
19
17
|
open,
|
|
@@ -70,7 +68,10 @@ export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
|
|
|
70
68
|
variant="contained"
|
|
71
69
|
type="primary"
|
|
72
70
|
size="large"
|
|
73
|
-
onClick={() =>
|
|
71
|
+
onClick={() => {
|
|
72
|
+
const home = '../../';
|
|
73
|
+
navigate(home);
|
|
74
|
+
}}>
|
|
74
75
|
<Typography variant="title" size="medium" color="neutral100">
|
|
75
76
|
{i18n.t('Done')}
|
|
76
77
|
</Typography>
|
|
@@ -10,8 +10,8 @@ export const CancelContent = ({ onCancel, onClose }: CancelContentProps) => {
|
|
|
10
10
|
<Divider size={20} />
|
|
11
11
|
<MessageBox
|
|
12
12
|
type="error"
|
|
13
|
-
title={i18n.t('
|
|
14
|
-
description={i18n.t('Are you sure you want to
|
|
13
|
+
title={i18n.t('Cancel Swap')}
|
|
14
|
+
description={i18n.t('Are you sure you want to cancel this swap?')}
|
|
15
15
|
/>
|
|
16
16
|
<Divider size={32} />
|
|
17
17
|
<Button
|
|
@@ -1,30 +1,36 @@
|
|
|
1
1
|
import type { WalletStateContentProps } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { MessageBox, Wallet
|
|
3
|
+
import { MessageBox, Wallet } from '@rango-dev/ui';
|
|
4
4
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { getContainer } from '../../utils/common';
|
|
8
|
+
import { mapStatusToWalletState } from '../../utils/wallets';
|
|
8
9
|
|
|
9
10
|
import { WalletContainer } from './SwapDetailsModal.styles';
|
|
10
11
|
|
|
11
12
|
export const WalletStateContent = (props: WalletStateContentProps) => {
|
|
12
13
|
const { type, title, currentStepWallet, message, showWalletButton } = props;
|
|
13
|
-
const { connect, getWalletInfo, state
|
|
14
|
+
const { connect, getWalletInfo, state } = useWallets();
|
|
14
15
|
const walletType = currentStepWallet?.walletType;
|
|
15
|
-
const
|
|
16
|
-
|
|
16
|
+
const walletState = walletType
|
|
17
|
+
? mapStatusToWalletState(state(walletType))
|
|
18
|
+
: null;
|
|
19
|
+
const walletInfo = walletType ? getWalletInfo(walletType) : null;
|
|
20
|
+
const shouldShowWallet =
|
|
21
|
+
showWalletButton && !!walletType && !!walletState && !!walletInfo;
|
|
17
22
|
return (
|
|
18
23
|
<>
|
|
19
24
|
<MessageBox type={type} title={title} description={message} />
|
|
20
|
-
{
|
|
25
|
+
{shouldShowWallet && (
|
|
21
26
|
<WalletContainer>
|
|
22
27
|
<Wallet
|
|
23
28
|
container={getContainer()}
|
|
24
|
-
title={
|
|
25
|
-
image={
|
|
29
|
+
title={walletInfo.name}
|
|
30
|
+
image={walletInfo.img}
|
|
26
31
|
type={walletType}
|
|
27
|
-
state={
|
|
32
|
+
state={walletState}
|
|
33
|
+
link={walletInfo.installLink}
|
|
28
34
|
onClick={async () => connect(walletType)}
|
|
29
35
|
/>
|
|
30
36
|
</WalletContainer>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalNetworkValueTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { PendingSwapNetworkStatus } from '
|
|
4
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
5
|
|
|
6
6
|
export const modalNetworkValues: Record<
|
|
7
7
|
Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalPropTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
4
3
|
import { Modal } from '@rango-dev/ui';
|
|
4
|
+
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { CancelContent } from './SwapDetailsModal.Cancel';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
2
1
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
2
|
+
import type { PendingSwapNetworkStatus } from 'rango-types';
|
|
3
3
|
|
|
4
4
|
export type ModalState =
|
|
5
5
|
| Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, darkTheme, styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const groupStyles = css();
|
|
2
4
|
|
|
3
5
|
export const Group = styled('div', {
|
|
4
6
|
width: '100%',
|
|
5
7
|
display: 'flex',
|
|
6
8
|
flexDirection: 'column',
|
|
9
|
+
[`& .${groupStyles}`]: {
|
|
10
|
+
$$color: '$colors$neutral600',
|
|
11
|
+
[`.${darkTheme} &`]: {
|
|
12
|
+
$$color: '$colors$neutral700',
|
|
13
|
+
},
|
|
14
|
+
color: '$$color',
|
|
15
|
+
},
|
|
7
16
|
});
|
|
8
17
|
|
|
9
18
|
export const Time = styled('div', {
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { limitDecimalPlaces } from '../../utils/numbers';
|
|
8
8
|
|
|
9
|
-
import { Group, SwapList, Time } from './SwapsGroup.styles';
|
|
9
|
+
import { Group, groupStyles, SwapList, Time } from './SwapsGroup.styles';
|
|
10
10
|
|
|
11
11
|
export function SwapsGroup(props: PropTypes) {
|
|
12
12
|
const { list, onSwapClick, groupBy, isLoading } = props;
|
|
@@ -34,8 +34,7 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
34
34
|
<Typography
|
|
35
35
|
variant="label"
|
|
36
36
|
size="medium"
|
|
37
|
-
|
|
38
|
-
className="group-title">
|
|
37
|
+
className={groupStyles()}>
|
|
39
38
|
{i18n.t(group.title)}
|
|
40
39
|
</Typography>
|
|
41
40
|
</Time>
|
|
@@ -68,8 +67,7 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
68
67
|
<Typography
|
|
69
68
|
variant="label"
|
|
70
69
|
size="medium"
|
|
71
|
-
|
|
72
|
-
className="group-title">
|
|
70
|
+
className={groupStyles()}>
|
|
73
71
|
{i18n.t(group.title)}
|
|
74
72
|
</Typography>
|
|
75
73
|
</Time>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReverseIcon, styled } from '@rango-dev/ui';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { useQuoteStore } from '../store/quote';
|
|
5
5
|
|
|
6
6
|
const SwitchButtonContainer = styled('div', {
|
|
7
7
|
position: 'absolute',
|
|
@@ -27,7 +27,7 @@ const StyledButton = styled('div', {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
export function SwitchFromAndToButton() {
|
|
30
|
-
const switchFromAndTo =
|
|
30
|
+
const switchFromAndTo = useQuoteStore.use.switchFromAndTo();
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<SwitchButtonContainer>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { Token } from 'rango-sdk';
|
|
2
2
|
|
|
3
3
|
import { containsText } from '../../utils/common';
|
|
4
4
|
|
|
5
|
-
export const filterTokens = (list:
|
|
5
|
+
export const filterTokens = (list: Token[], searchedFor: string) =>
|
|
6
6
|
list.filter(
|
|
7
7
|
(token) =>
|
|
8
8
|
containsText(token.symbol, searchedFor) ||
|