@rango-dev/widget-embedded 0.19.0 → 0.19.1-next.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 +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 +20 -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 +13 -11
- 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 +249 -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 +53 -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
|
@@ -18,16 +18,17 @@ import {
|
|
|
18
18
|
import React, { useEffect, useLayoutEffect, useRef, useState } from 'react';
|
|
19
19
|
import { useNavigate } from 'react-router-dom';
|
|
20
20
|
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import { useMetaStore } from '../../store/meta';
|
|
21
|
+
import { getQuoteErrorMessage } from '../../constants/errors';
|
|
22
|
+
import { getQuoteUpdateWarningMessage } from '../../constants/warnings';
|
|
23
|
+
import { useAppStore } from '../../store/AppStore';
|
|
24
|
+
import { useQuoteStore } from '../../store/quote';
|
|
26
25
|
import { useWalletsStore } from '../../store/wallets';
|
|
26
|
+
import { getBlockchainShortNameFor } from '../../utils/meta';
|
|
27
27
|
import { confirmSwapDisabled } from '../../utils/swap';
|
|
28
28
|
|
|
29
29
|
import { getRequiredWallets, isValidAddress } from './ConfirmWallets.helpers';
|
|
30
30
|
import {
|
|
31
|
+
alarmsStyles,
|
|
31
32
|
CollapsibleContent,
|
|
32
33
|
CollapsibleRoot,
|
|
33
34
|
ConfirmButton,
|
|
@@ -43,6 +44,7 @@ import {
|
|
|
43
44
|
Trigger,
|
|
44
45
|
Wallets,
|
|
45
46
|
WalletsContainer,
|
|
47
|
+
walletsListStyles,
|
|
46
48
|
} from './ConfirmWallets.styles';
|
|
47
49
|
import { WalletList } from './WalletList';
|
|
48
50
|
|
|
@@ -50,23 +52,24 @@ const NUMBER_OF_WALLETS_TO_DISPLAY = 2;
|
|
|
50
52
|
|
|
51
53
|
export function ConfirmWalletsModal(props: PropTypes) {
|
|
52
54
|
//TODO: move component's logics to a custom hook
|
|
53
|
-
const { open, onClose, onCancel, onCheckBalance,
|
|
54
|
-
const
|
|
55
|
+
const { open, onClose, onCancel, onCheckBalance, loading } = props;
|
|
56
|
+
const config = useAppStore().config;
|
|
57
|
+
const blockchains = useAppStore().blockchains();
|
|
55
58
|
const {
|
|
56
|
-
|
|
57
|
-
setSelectedWallets:
|
|
58
|
-
|
|
59
|
-
|
|
59
|
+
quote,
|
|
60
|
+
setSelectedWallets: selectQuoteWallets,
|
|
61
|
+
quoteWalletsConfirmed: quoteWalletsConfirmed,
|
|
62
|
+
setQuoteWalletConfirmed: setQuoteWalletConfirmed,
|
|
60
63
|
customDestination,
|
|
61
64
|
setCustomDestination,
|
|
62
|
-
} =
|
|
65
|
+
} = useQuoteStore();
|
|
63
66
|
const { connectedWallets, selectWallets } = useWalletsStore();
|
|
64
67
|
|
|
65
68
|
const [showMoreWalletFor, setShowMoreWalletFor] = useState('');
|
|
66
69
|
const [balanceWarnings, setBalanceWarnings] = useState<string[]>([]);
|
|
67
70
|
const [error, setError] = useState('');
|
|
68
|
-
const [
|
|
69
|
-
ConfirmSwapWarnings['
|
|
71
|
+
const [quoteWarning, setQuoteWarning] = useState<
|
|
72
|
+
ConfirmSwapWarnings['quoteUpdate'] | null
|
|
70
73
|
>(null);
|
|
71
74
|
const [destination, setDestination] = useState(customDestination);
|
|
72
75
|
const [showCustomDestination, setShowCustomDestination] = useState(
|
|
@@ -74,22 +77,15 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
74
77
|
);
|
|
75
78
|
const customDestinationRef = useRef<HTMLDivElement | null>(null);
|
|
76
79
|
|
|
77
|
-
const requiredWallets = getRequiredWallets(
|
|
78
|
-
const customDestinationEnabled =
|
|
79
|
-
typeof config?.customDestination === 'undefined'
|
|
80
|
-
? true
|
|
81
|
-
: config.customDestination;
|
|
80
|
+
const requiredWallets = getRequiredWallets(quote);
|
|
82
81
|
|
|
83
82
|
const lastStepToBlockchain = blockchains.find(
|
|
84
83
|
(blockchain) =>
|
|
85
84
|
blockchain.name ===
|
|
86
|
-
|
|
87
|
-
.blockchain
|
|
85
|
+
quote?.result?.swaps[quote?.result?.swaps.length - 1].to.blockchain
|
|
88
86
|
);
|
|
89
87
|
const isWalletRequiredFor = (blockchain: string) =>
|
|
90
|
-
!!
|
|
91
|
-
(swap) => swap.from.blockchain === blockchain
|
|
92
|
-
);
|
|
88
|
+
!!quote?.result?.swaps.find((swap) => swap.from.blockchain === blockchain);
|
|
93
89
|
|
|
94
90
|
const [selectableWallets, setSelectableWallets] = useState<ConnectedWallet[]>(
|
|
95
91
|
connectedWallets.filter((connectedWallet) => {
|
|
@@ -175,16 +171,16 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
175
171
|
(wallet) => wallet.selected
|
|
176
172
|
);
|
|
177
173
|
selectWallets(lastSelectedWallets);
|
|
178
|
-
|
|
174
|
+
selectQuoteWallets(lastSelectedWallets);
|
|
179
175
|
setCustomDestination(destination);
|
|
180
|
-
|
|
176
|
+
setQuoteWalletConfirmed(true);
|
|
181
177
|
onClose();
|
|
182
178
|
};
|
|
183
179
|
|
|
184
180
|
const onConfirmWallets = async () => {
|
|
185
181
|
setBalanceWarnings([]);
|
|
186
182
|
setError('');
|
|
187
|
-
|
|
183
|
+
setQuoteWarning(null);
|
|
188
184
|
const selectedWallets = connectedWallets.filter((connectedWallet) =>
|
|
189
185
|
selectableWallets.find(
|
|
190
186
|
(selectableWallet) =>
|
|
@@ -201,11 +197,11 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
201
197
|
if (warnings?.balance?.messages) {
|
|
202
198
|
setBalanceWarnings(warnings.balance.messages);
|
|
203
199
|
}
|
|
204
|
-
if (warnings?.
|
|
205
|
-
|
|
200
|
+
if (warnings?.quoteUpdate) {
|
|
201
|
+
setQuoteWarning(warnings.quoteUpdate);
|
|
206
202
|
}
|
|
207
203
|
if (result.error) {
|
|
208
|
-
setError(
|
|
204
|
+
setError(getQuoteErrorMessage(result.error));
|
|
209
205
|
}
|
|
210
206
|
|
|
211
207
|
if (!result.error && (!warnings?.balance?.messages.length || 0 > 0)) {
|
|
@@ -249,8 +245,9 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
249
245
|
<Modal
|
|
250
246
|
open={open}
|
|
251
247
|
onClose={() => {
|
|
252
|
-
if (!
|
|
253
|
-
|
|
248
|
+
if (!quoteWalletsConfirmed) {
|
|
249
|
+
const home = '../';
|
|
250
|
+
navigate(home, { replace: true });
|
|
254
251
|
}
|
|
255
252
|
onClose();
|
|
256
253
|
}}
|
|
@@ -265,7 +262,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
265
262
|
loading,
|
|
266
263
|
showCustomDestination,
|
|
267
264
|
destination,
|
|
268
|
-
|
|
265
|
+
quote,
|
|
269
266
|
selectableWallets,
|
|
270
267
|
lastStepToBlockchain
|
|
271
268
|
)}
|
|
@@ -291,7 +288,12 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
291
288
|
<Typography variant="headline" size="small">
|
|
292
289
|
{i18n.t({
|
|
293
290
|
id: 'Your {blockchainName} wallets',
|
|
294
|
-
values: {
|
|
291
|
+
values: {
|
|
292
|
+
blockchainName: getBlockchainShortNameFor(
|
|
293
|
+
showMoreWalletFor,
|
|
294
|
+
blockchains
|
|
295
|
+
),
|
|
296
|
+
},
|
|
295
297
|
})}
|
|
296
298
|
</Typography>
|
|
297
299
|
</ShowMoreHeader>
|
|
@@ -318,14 +320,11 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
318
320
|
</Modal>
|
|
319
321
|
{showMoreWalletFor && (
|
|
320
322
|
<WalletsContainer>
|
|
321
|
-
<div className=
|
|
323
|
+
<div className={walletsListStyles()}>
|
|
322
324
|
<WalletList
|
|
323
325
|
chain={showMoreWalletFor}
|
|
324
326
|
isSelected={isSelected}
|
|
325
327
|
selectWallet={onChange}
|
|
326
|
-
multiWallets={config?.multiWallets ?? true}
|
|
327
|
-
supportedWallets={config?.wallets ?? []}
|
|
328
|
-
config={config}
|
|
329
328
|
onShowMore={setShowMoreWalletFor.bind(null, showMoreWalletFor)}
|
|
330
329
|
/>
|
|
331
330
|
</div>
|
|
@@ -339,12 +338,12 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
339
338
|
<Divider size={12} />
|
|
340
339
|
</>
|
|
341
340
|
)}
|
|
342
|
-
{
|
|
341
|
+
{quoteWarning && (
|
|
343
342
|
<>
|
|
344
343
|
<Alert
|
|
345
344
|
variant="alarm"
|
|
346
345
|
type="warning"
|
|
347
|
-
title={
|
|
346
|
+
title={getQuoteUpdateWarningMessage(quoteWarning)}
|
|
348
347
|
/>
|
|
349
348
|
<Divider size={12} />
|
|
350
349
|
</>
|
|
@@ -364,7 +363,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
364
363
|
<Typography variant="title" size="xmedium">
|
|
365
364
|
{i18n.t({
|
|
366
365
|
id: 'Your {blockchainName} wallets',
|
|
367
|
-
values: { blockchainName: blockchain?.
|
|
366
|
+
values: { blockchainName: blockchain?.shortName },
|
|
368
367
|
})}
|
|
369
368
|
</Typography>
|
|
370
369
|
<Typography
|
|
@@ -373,7 +372,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
373
372
|
size="medium">
|
|
374
373
|
{i18n.t({
|
|
375
374
|
id: 'You need to connect a {blockchainName} wallet.',
|
|
376
|
-
values: { blockchainName: blockchain?.
|
|
375
|
+
values: { blockchainName: blockchain?.shortName },
|
|
377
376
|
})}
|
|
378
377
|
</Typography>
|
|
379
378
|
</Title>
|
|
@@ -383,9 +382,6 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
383
382
|
chain={requiredWallet}
|
|
384
383
|
isSelected={isSelected}
|
|
385
384
|
selectWallet={onChange}
|
|
386
|
-
multiWallets={config?.multiWallets ?? true}
|
|
387
|
-
supportedWallets={config?.wallets ?? []}
|
|
388
|
-
config={config}
|
|
389
385
|
limit={NUMBER_OF_WALLETS_TO_DISPLAY}
|
|
390
386
|
onShowMore={() =>
|
|
391
387
|
setShowMoreWalletFor(blockchain?.name ?? '')
|
|
@@ -393,7 +389,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
393
389
|
/>
|
|
394
390
|
</ListContainer>
|
|
395
391
|
{!isLastWallet && <Divider size={32} />}
|
|
396
|
-
{isLastWallet &&
|
|
392
|
+
{isLastWallet && config?.customDestination && (
|
|
397
393
|
<CustomDestination>
|
|
398
394
|
<CollapsibleRoot
|
|
399
395
|
ref={customDestinationRef}
|
|
@@ -464,7 +460,7 @@ export function ConfirmWalletsModal(props: PropTypes) {
|
|
|
464
460
|
</CollapsibleContent>
|
|
465
461
|
</CollapsibleRoot>
|
|
466
462
|
{isAddressMatched && (
|
|
467
|
-
<div className=
|
|
463
|
+
<div className={alarmsStyles()}>
|
|
468
464
|
<Alert
|
|
469
465
|
variant="alarm"
|
|
470
466
|
type="error"
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
import type { ConfirmSwap } from '../../hooks/useConfirmSwap';
|
|
1
|
+
import type { ConfirmSwap } from '../../hooks/useConfirmSwap/useConfirmSwap.types';
|
|
3
2
|
|
|
4
3
|
export type PropTypes = {
|
|
5
4
|
open: boolean;
|
|
6
5
|
onClose: () => void;
|
|
7
6
|
onCancel: () => void;
|
|
8
7
|
onCheckBalance: ConfirmSwap['fetch'];
|
|
9
|
-
config?: WidgetConfig;
|
|
10
8
|
loading: boolean;
|
|
11
9
|
};
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
TIME_TO_CLOSE_MODAL,
|
|
24
24
|
TIME_TO_IGNORE_MODAL,
|
|
25
25
|
} from '../../pages/WalletsPage';
|
|
26
|
-
import {
|
|
26
|
+
import { useAppStore } from '../../store/AppStore';
|
|
27
27
|
import { useWalletsStore } from '../../store/wallets';
|
|
28
28
|
import { getBlockchainDisplayNameFor } from '../../utils/meta';
|
|
29
29
|
import {
|
|
@@ -33,7 +33,7 @@ import {
|
|
|
33
33
|
} from '../../utils/wallets';
|
|
34
34
|
import { WalletModal } from '../WalletModal';
|
|
35
35
|
|
|
36
|
-
import {
|
|
36
|
+
import { ShowMoreWallets } from './ConfirmWallets.styles';
|
|
37
37
|
import {
|
|
38
38
|
LogoContainer,
|
|
39
39
|
Spinner,
|
|
@@ -41,10 +41,11 @@ import {
|
|
|
41
41
|
} from './WalletList.styles';
|
|
42
42
|
|
|
43
43
|
export function WalletList(props: PropTypes) {
|
|
44
|
-
const {
|
|
44
|
+
const { chain, isSelected, selectWallet, limit, onShowMore } = props;
|
|
45
|
+
const { config } = useAppStore();
|
|
45
46
|
|
|
46
47
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
47
|
-
const { blockchains } =
|
|
48
|
+
const { blockchains } = useAppStore();
|
|
48
49
|
const [openWalletStateModal, setOpenWalletStateModal] =
|
|
49
50
|
useState<WalletType>('');
|
|
50
51
|
const [experimentalChainWallet, setExperimentalChainWallet] =
|
|
@@ -137,7 +138,7 @@ export function WalletList(props: PropTypes) {
|
|
|
137
138
|
});
|
|
138
139
|
const conciseAddress = address ? getConciseAddress(address) : '';
|
|
139
140
|
|
|
140
|
-
const experimentalChain = isExperimentalChain(blockchains, chain);
|
|
141
|
+
const experimentalChain = isExperimentalChain(blockchains(), chain);
|
|
141
142
|
|
|
142
143
|
const experimentalChainNotAdded = !connectedWallets.find(
|
|
143
144
|
(connectedWallet) =>
|
|
@@ -180,7 +181,7 @@ export function WalletList(props: PropTypes) {
|
|
|
180
181
|
experimentalChainWallet?.chain
|
|
181
182
|
? getBlockchainDisplayNameFor(
|
|
182
183
|
experimentalChainWallet.chain,
|
|
183
|
-
blockchains
|
|
184
|
+
blockchains()
|
|
184
185
|
)
|
|
185
186
|
: undefined;
|
|
186
187
|
return (
|
|
@@ -291,14 +292,14 @@ export function WalletList(props: PropTypes) {
|
|
|
291
292
|
);
|
|
292
293
|
})}
|
|
293
294
|
{shouldShowMoreWallets && (
|
|
294
|
-
<
|
|
295
|
+
<ShowMoreWallets selected={false} onClick={onShowMore}>
|
|
295
296
|
<Typography variant="label" size="medium">
|
|
296
297
|
{i18n.t('Show more wallets')}
|
|
297
298
|
<Typography variant="label" size="medium" color="$primary">
|
|
298
299
|
+{numberOfSupportedWallets - (limit ?? 0)}
|
|
299
300
|
</Typography>
|
|
300
301
|
</Typography>
|
|
301
|
-
</
|
|
302
|
+
</ShowMoreWallets>
|
|
302
303
|
)}
|
|
303
304
|
</>
|
|
304
305
|
);
|
|
@@ -1,12 +1,9 @@
|
|
|
1
|
-
import type { Wallet
|
|
1
|
+
import type { Wallet } from '../../types';
|
|
2
2
|
|
|
3
3
|
export type PropTypes = {
|
|
4
4
|
chain: string;
|
|
5
|
-
supportedWallets: WidgetConfig['wallets'];
|
|
6
5
|
isSelected: (walletType: string, chain: string) => boolean;
|
|
7
6
|
selectWallet: (wallet: Wallet) => void;
|
|
8
|
-
multiWallets: boolean;
|
|
9
|
-
config?: WidgetConfig;
|
|
10
7
|
limit?: number;
|
|
11
8
|
onShowMore: () => void;
|
|
12
9
|
};
|
|
@@ -11,7 +11,9 @@ import {
|
|
|
11
11
|
} from '@rango-dev/ui';
|
|
12
12
|
import React from 'react';
|
|
13
13
|
|
|
14
|
+
import { useAppStore } from '../../store/AppStore';
|
|
14
15
|
import { getContainer } from '../../utils/common';
|
|
16
|
+
import { isFeatureHidden } from '../../utils/settings';
|
|
15
17
|
import { NotificationContent } from '../NotificationContent';
|
|
16
18
|
|
|
17
19
|
import { HeaderButton } from './HeaderButtons.styles';
|
|
@@ -26,6 +28,12 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
|
|
|
26
28
|
onClickNotifications,
|
|
27
29
|
} = props;
|
|
28
30
|
|
|
31
|
+
const {
|
|
32
|
+
config: { features },
|
|
33
|
+
} = useAppStore();
|
|
34
|
+
|
|
35
|
+
const isNotificationsHidden = isFeatureHidden('notification', features);
|
|
36
|
+
|
|
29
37
|
return (
|
|
30
38
|
<>
|
|
31
39
|
<Tooltip
|
|
@@ -41,25 +49,27 @@ export function HomeButtons(props: HomeButtonsPropTypes) {
|
|
|
41
49
|
</HeaderButton>
|
|
42
50
|
</Tooltip>
|
|
43
51
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
side="top"
|
|
47
|
-
content={i18n.t('Notifications')}>
|
|
48
|
-
<Popover
|
|
49
|
-
align="center"
|
|
50
|
-
collisionBoundary={layoutRef}
|
|
51
|
-
collisionPadding={{ right: 20, left: 20 }}
|
|
52
|
+
{!isNotificationsHidden && (
|
|
53
|
+
<Tooltip
|
|
52
54
|
container={getContainer()}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
55
|
+
side="top"
|
|
56
|
+
content={i18n.t('Notifications')}>
|
|
57
|
+
<Popover
|
|
58
|
+
align="center"
|
|
59
|
+
collisionBoundary={layoutRef}
|
|
60
|
+
collisionPadding={{ right: 20, left: 20 }}
|
|
61
|
+
container={getContainer()}
|
|
62
|
+
content={<NotificationContent />}>
|
|
63
|
+
<HeaderButton
|
|
64
|
+
size="small"
|
|
65
|
+
variant="ghost"
|
|
66
|
+
onClick={onClickNotifications}>
|
|
67
|
+
<NotificationsIcon size={18} color="black" />
|
|
68
|
+
<UnreadNotificationsBadge />
|
|
69
|
+
</HeaderButton>
|
|
70
|
+
</Popover>
|
|
71
|
+
</Tooltip>
|
|
72
|
+
)}
|
|
63
73
|
<Tooltip
|
|
64
74
|
container={getContainer()}
|
|
65
75
|
side="top"
|
|
@@ -8,8 +8,10 @@ export const Container = styled('div', {
|
|
|
8
8
|
overflow: 'hidden !important',
|
|
9
9
|
boxShadow: '15px 15px 15px 0px rgba(0, 0, 0, 0.05)',
|
|
10
10
|
width: '95vw',
|
|
11
|
+
minWidth: '300px',
|
|
11
12
|
maxWidth: '390px',
|
|
12
13
|
maxHeight: '700px',
|
|
14
|
+
textAlign: 'left',
|
|
13
15
|
$$color: '$colors$neutral100',
|
|
14
16
|
[`.${darkTheme} &`]: {
|
|
15
17
|
$$color: '$colors$neutral300',
|
|
@@ -3,12 +3,13 @@ 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';
|
|
7
6
|
|
|
8
|
-
import {
|
|
7
|
+
import { useNavigateBack } from '../../hooks/useNavigateBack';
|
|
8
|
+
import { useAppStore } from '../../store/AppStore';
|
|
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';
|
|
12
13
|
import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
|
|
13
14
|
|
|
14
15
|
import { Container, Content, Footer } from './Layout.styles';
|
|
@@ -23,25 +24,37 @@ function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
|
|
|
23
24
|
fixedHeight = true,
|
|
24
25
|
} = props;
|
|
25
26
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
27
|
+
const {
|
|
28
|
+
config: { features },
|
|
29
|
+
} = useAppStore();
|
|
30
|
+
|
|
31
|
+
const isConnectWalletHidden = isFeatureHidden(
|
|
32
|
+
'connectWalletButton',
|
|
33
|
+
features
|
|
34
|
+
);
|
|
26
35
|
|
|
27
36
|
const connectWalletsButtonDisabled =
|
|
28
37
|
useUiStore.use.connectWalletsButtonDisabled();
|
|
29
|
-
const
|
|
38
|
+
const navigateBack = useNavigateBack();
|
|
30
39
|
|
|
31
40
|
const onConnectWallet = () => {
|
|
32
|
-
if (!connectWalletsButtonDisabled) {
|
|
33
|
-
|
|
41
|
+
if (!connectWalletsButtonDisabled && header.onWallet) {
|
|
42
|
+
header.onWallet();
|
|
34
43
|
}
|
|
35
44
|
};
|
|
45
|
+
|
|
46
|
+
const showBackButton =
|
|
47
|
+
typeof header.hasBackButton === 'undefined' || header.hasBackButton;
|
|
48
|
+
|
|
36
49
|
return (
|
|
37
50
|
<Container ref={ref} fixedHeight={fixedHeight} id="swap-box">
|
|
38
51
|
<Header
|
|
39
|
-
prefix={<>{
|
|
52
|
+
prefix={<>{showBackButton && <BackButton onClick={navigateBack} />}</>}
|
|
40
53
|
title={header.title}
|
|
41
54
|
suffix={
|
|
42
55
|
<>
|
|
43
56
|
{header.suffix}
|
|
44
|
-
{header.
|
|
57
|
+
{header.onWallet && !isConnectWalletHidden && (
|
|
45
58
|
<WalletButton
|
|
46
59
|
container={getContainer()}
|
|
47
60
|
onClick={onConnectWallet}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export interface PropTypes {
|
|
2
2
|
header: {
|
|
3
3
|
title: string;
|
|
4
|
-
|
|
4
|
+
onWallet?: () => void;
|
|
5
5
|
hasSettings?: boolean;
|
|
6
6
|
suffix?: React.ReactNode;
|
|
7
|
-
|
|
7
|
+
hasBackButton?: boolean;
|
|
8
8
|
onCancel?: () => void;
|
|
9
9
|
};
|
|
10
10
|
hasLogo?: boolean;
|
|
@@ -1,78 +1,82 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
width: '100%',
|
|
5
5
|
height: '100%',
|
|
6
|
-
padding: '$
|
|
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
|
-
},
|
|
6
|
+
padding: '$10 $20',
|
|
39
7
|
});
|
|
40
8
|
|
|
41
9
|
export const StepContainer = styled('div', {
|
|
42
10
|
backgroundColor: '$neutral100',
|
|
43
11
|
borderRadius: '$xm',
|
|
44
12
|
padding: '$10 $15',
|
|
45
|
-
|
|
46
|
-
'.step-title': {
|
|
47
|
-
display: 'flex',
|
|
48
|
-
justifyContent: 'start',
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
},
|
|
51
|
-
'.step-tokens': {
|
|
52
|
-
paddingTop: '$5',
|
|
53
|
-
display: 'flex',
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
},
|
|
56
|
-
'.step-token-info': {
|
|
57
|
-
display: 'flex',
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
},
|
|
60
|
-
'.step-icon-container': {
|
|
61
|
-
padding: '$4 $6',
|
|
62
|
-
display: 'flex',
|
|
63
|
-
justifyContent: 'center',
|
|
64
|
-
alignItems: 'center',
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
'.extra-info': {
|
|
68
|
-
display: 'flex',
|
|
69
|
-
paddingTop: '$10',
|
|
70
|
-
paddingBottom: '$5',
|
|
71
|
-
},
|
|
72
13
|
});
|
|
14
|
+
|
|
73
15
|
export const StepSeparator = styled('div', {
|
|
74
16
|
width: '0px',
|
|
75
17
|
height: '$20',
|
|
76
18
|
borderLeft: '1px dashed $neutral700',
|
|
77
19
|
marginLeft: '25px',
|
|
78
20
|
});
|
|
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
|
+
});
|