@rango-dev/widget-embedded 0.18.0 → 0.19.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +1 -113
- package/dist/QueueManager.d.ts +2 -5
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/Wallets.d.ts +17 -0
- package/dist/Wallets.d.ts.map +1 -0
- package/dist/Widget.d.ts +9 -0
- package/dist/Widget.d.ts.map +1 -0
- package/dist/components/AppRouter.d.ts +2 -0
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +6 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +3 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +62 -691
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +3 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +4 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +2 -2
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +0 -1727
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
- package/dist/components/{NoResult/NoResult.styles.d.ts → NoRoutes/NoRoutes.styles.d.ts} +1 -1
- package/dist/components/{NoResult/NoResult.styles.d.ts.map → NoRoutes/NoRoutes.styles.d.ts.map} +1 -1
- package/dist/components/{NoResult/NoResult.types.d.ts → NoRoutes/NoRoutes.types.d.ts} +3 -3
- package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
- package/dist/components/NoRoutes/index.d.ts +2 -0
- package/dist/components/NoRoutes/index.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
- package/dist/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts → RouteErrors/RouteErrors.styles.d.ts} +1 -1
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
- package/dist/components/RouteErrors/index.d.ts +2 -0
- package/dist/components/RouteErrors/index.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +0 -158
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +0 -628
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +0 -157
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +1 -1100
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +9 -4
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/components/TokenList/index.d.ts +1 -0
- package/dist/components/TokenList/index.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts +6 -1
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +4 -4
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +1 -1
- package/dist/constants/navigationRoutes.d.ts +2 -1
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/searchParams.d.ts +1 -2
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/constants/warnings.d.ts +2 -2
- package/dist/constants/warnings.d.ts.map +1 -1
- package/dist/hooks/{useConfirmSwap/useConfirmSwap.types.d.ts → useConfirmSwap.d.ts} +7 -5
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -0
- package/dist/hooks/{useFetchQuote.d.ts → useFetchBestRoute.d.ts} +3 -3
- package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
- package/dist/hooks/useLanguage.d.ts +1 -1
- package/dist/hooks/useLanguage.d.ts.map +1 -1
- package/dist/hooks/useNavigateBack.d.ts +3 -1
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +7 -5
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +0 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +1 -5
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts +2 -4
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts +2 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts.map +1 -1
- package/dist/index.d.ts +8 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +6 -1
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts +2 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts +6 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts +8 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/app.d.ts +22 -41
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +77 -0
- package/dist/store/bestRoute.d.ts.map +1 -0
- package/dist/store/meta.d.ts +23 -0
- package/dist/store/meta.d.ts.map +1 -0
- package/dist/store/notification.d.ts +3 -4
- package/dist/store/notification.d.ts.map +1 -1
- package/dist/store/settings.d.ts +81 -0
- package/dist/store/settings.d.ts.map +1 -0
- package/dist/store/slices/config.d.ts +2 -3
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +2 -5
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/ui.d.ts +1 -2
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +9 -14
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +8 -41
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/routing.d.ts +65 -0
- package/dist/types/routing.d.ts.map +1 -0
- package/dist/types/swap.d.ts +14 -4
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +1 -15
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +0 -1
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +1 -2
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/numbers.d.ts +1 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +2 -2
- package/dist/utils/providers.d.ts.map +1 -1
- package/dist/utils/queue.d.ts +2 -2
- package/dist/utils/queue.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +28 -0
- package/dist/utils/routing.d.ts.map +1 -0
- package/dist/utils/settings.d.ts +2 -6
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +24 -35
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/time.d.ts +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +10 -9
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +10 -12
- package/src/QueueManager.tsx +17 -18
- package/src/{containers/Wallets/Wallets.tsx → Wallets.tsx} +34 -48
- package/src/Widget.tsx +119 -0
- package/src/components/AppRouter.tsx +32 -8
- package/src/components/AppRoutes.tsx +69 -57
- package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
- package/src/components/BlockchainList/BlockchainList.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +1 -1
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +17 -26
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +64 -2
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +10 -29
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +47 -43
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +3 -1
- package/src/components/ConfirmWalletsModal/WalletList.tsx +8 -9
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +4 -1
- package/src/components/HeaderButtons/HomeButtons.tsx +18 -28
- package/src/components/Layout/Layout.styles.ts +0 -2
- package/src/components/Layout/Layout.tsx +7 -20
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +61 -65
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +34 -28
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
- package/src/components/{NoResult/NoResult.helpers.ts → NoRoutes/NoRoutes.helper.ts} +16 -23
- package/src/components/{NoResult/NoResult.styles.ts → NoRoutes/NoRoutes.styles.ts} +0 -2
- package/src/components/{NoResult/NoResult.tsx → NoRoutes/NoRoutes.tsx} +17 -12
- package/src/components/{NoResult/NoResult.types.ts → NoRoutes/NoRoutes.types.ts} +2 -3
- package/src/components/NoRoutes/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.tsx +3 -5
- package/src/components/{QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts → RouteErrors/RouteErrors.styles.ts} +1 -8
- package/src/components/RouteErrors/RouteErrors.tsx +79 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +129 -0
- package/src/components/{QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx → RouteErrors/RouteErrorsModalItem.tsx} +4 -4
- package/src/components/RouteErrors/index.ts +1 -0
- package/src/components/Slippage/Slippage.styles.ts +5 -15
- package/src/components/Slippage/Slippage.tsx +10 -11
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +8 -5
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +33 -36
- package/src/components/SwapDetails/SwapDetails.tsx +56 -41
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +3 -4
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +8 -14
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +1 -10
- package/src/components/SwapsGroup/SwapsGroup.tsx +5 -3
- package/src/components/SwitchFromAndTo.tsx +2 -2
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +38 -74
- package/src/components/TokenList/TokenList.tsx +26 -35
- package/src/components/TokenList/TokenList.types.ts +10 -4
- package/src/components/TokenList/index.ts +1 -0
- package/src/components/UpdateUrl.tsx +30 -35
- package/src/components/WidgetEvents.tsx +2 -4
- package/src/constants/errors.ts +15 -17
- package/src/constants/index.ts +0 -1
- package/src/constants/messages.ts +1 -1
- package/src/constants/navigationRoutes.ts +8 -7
- package/src/constants/searchParams.ts +0 -1
- package/src/constants/warnings.ts +7 -7
- package/src/hooks/useConfirmSwap.ts +303 -0
- package/src/hooks/{useFetchQuote.ts → useFetchBestRoute.ts} +3 -3
- package/src/hooks/useLanguage.ts +5 -4
- package/src/hooks/useNavigateBack.ts +52 -3
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +7 -37
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +0 -60
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +3 -78
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +6 -15
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +1 -6
- package/src/hooks/useSwapInput.ts +48 -141
- package/src/hooks/useSyncStoresWithConfig.ts +24 -40
- package/src/hooks/useTheme.ts +5 -4
- package/src/hooks/useWalletList.ts +5 -3
- package/src/index.ts +5 -53
- package/src/pages/ConfirmSwapPage.tsx +266 -117
- package/src/pages/HistoryPage.tsx +7 -2
- package/src/pages/Home.tsx +303 -88
- package/src/pages/LanguagePage.tsx +5 -0
- package/src/pages/LiquiditySourcePage.tsx +37 -24
- package/src/pages/SelectBlockchainPage.tsx +24 -31
- package/src/pages/SelectSwapItemsPage.tsx +31 -18
- package/src/pages/SettingsPage.tsx +27 -32
- package/src/pages/SwapDetailsPage.tsx +7 -6
- package/src/pages/ThemePage.tsx +7 -2
- package/src/pages/WalletsPage.tsx +19 -9
- package/src/services/httpService.ts +1 -1
- package/src/store/app.ts +6 -44
- package/src/store/{quote.ts → bestRoute.ts} +64 -71
- package/src/store/meta.ts +39 -0
- package/src/store/settings.ts +158 -0
- package/src/store/slices/config.ts +15 -26
- package/src/store/slices/data.ts +35 -74
- package/src/store/wallets.ts +37 -68
- package/src/types/config.ts +8 -53
- package/src/types/index.ts +1 -1
- package/src/types/routing.ts +77 -0
- package/src/types/swap.ts +13 -4
- package/src/types/wallets.ts +1 -18
- package/src/utils/colors.ts +1 -2
- package/src/utils/configs.ts +1 -2
- package/src/utils/date.ts +1 -1
- package/src/utils/meta.ts +1 -8
- package/src/utils/numbers.ts +1 -1
- package/src/utils/providers.ts +5 -8
- package/src/utils/queue.ts +2 -2
- package/src/utils/routing.ts +321 -0
- package/src/utils/settings.ts +10 -17
- package/src/utils/swap.ts +120 -154
- package/src/utils/time.ts +1 -1
- package/src/utils/wallets.ts +161 -156
- package/dist/components/NoResult/NoResult.d.ts +0 -4
- package/dist/components/NoResult/NoResult.d.ts.map +0 -1
- package/dist/components/NoResult/NoResult.helpers.d.ts +0 -4
- package/dist/components/NoResult/NoResult.helpers.d.ts.map +0 -1
- package/dist/components/NoResult/NoResult.types.d.ts.map +0 -1
- package/dist/components/NoResult/index.d.ts +0 -2
- package/dist/components/NoResult/index.d.ts.map +0 -1
- package/dist/components/Quote/Quote.d.ts +0 -4
- package/dist/components/Quote/Quote.d.ts.map +0 -1
- package/dist/components/Quote/Quote.styles.d.ts +0 -2217
- package/dist/components/Quote/Quote.styles.d.ts.map +0 -1
- package/dist/components/Quote/Quote.types.d.ts +0 -21
- package/dist/components/Quote/Quote.types.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSummary.d.ts +0 -11
- package/dist/components/Quote/QuoteSummary.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +0 -315
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +0 -1
- package/dist/components/Quote/index.d.ts +0 -3
- package/dist/components/Quote/index.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts +0 -4
- package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +0 -633
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts +0 -6
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts +0 -4
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +0 -1571
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts +0 -6
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts +0 -4
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +0 -786
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts +0 -4
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts.map +0 -1
- package/dist/components/QuoteSkeleton/index.d.ts +0 -4
- package/dist/components/QuoteSkeleton/index.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts +0 -4
- package/dist/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts +0 -4
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts +0 -9
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +0 -23
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +0 -11
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +0 -1
- package/dist/components/QuoteWarningsAndErrors/index.d.ts +0 -2
- package/dist/components/QuoteWarningsAndErrors/index.d.ts.map +0 -1
- package/dist/containers/App/App.d.ts +0 -3
- package/dist/containers/App/App.d.ts.map +0 -1
- package/dist/containers/App/App.styles.d.ts +0 -158
- package/dist/containers/App/App.styles.d.ts.map +0 -1
- package/dist/containers/App/index.d.ts +0 -2
- package/dist/containers/App/index.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts +0 -4
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +0 -788
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -20
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +0 -1
- package/dist/containers/QuoteInfo/index.d.ts +0 -2
- package/dist/containers/QuoteInfo/index.d.ts.map +0 -1
- package/dist/containers/Wallets/Wallets.d.ts +0 -6
- package/dist/containers/Wallets/Wallets.d.ts.map +0 -1
- package/dist/containers/Wallets/Wallets.types.d.ts +0 -11
- package/dist/containers/Wallets/Wallets.types.d.ts.map +0 -1
- package/dist/containers/Wallets/index.d.ts +0 -2
- package/dist/containers/Wallets/index.d.ts.map +0 -1
- package/dist/containers/Widget/Widget.d.ts +0 -5
- package/dist/containers/Widget/Widget.d.ts.map +0 -1
- package/dist/containers/Widget/Widget.types.d.ts +0 -5
- package/dist/containers/Widget/Widget.types.d.ts.map +0 -1
- package/dist/containers/Widget/index.d.ts +0 -3
- package/dist/containers/Widget/index.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts +0 -6
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +0 -20
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +0 -21
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +0 -1
- package/dist/containers/WidgetInfo/index.d.ts +0 -2
- package/dist/containers/WidgetInfo/index.d.ts.map +0 -1
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts +0 -5
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +0 -1
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +0 -7
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +0 -1
- package/dist/containers/WidgetProvider/index.d.ts +0 -2
- package/dist/containers/WidgetProvider/index.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/index.d.ts +0 -2
- package/dist/hooks/useConfirmSwap/index.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts +0 -3
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +0 -19
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +0 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +0 -1
- package/dist/hooks/useFetchQuote.d.ts.map +0 -1
- package/dist/hooks/useForceAutoConnect.d.ts +0 -2
- package/dist/hooks/useForceAutoConnect.d.ts.map +0 -1
- package/dist/store/AppStore.d.ts +0 -47
- package/dist/store/AppStore.d.ts.map +0 -1
- package/dist/store/quote.d.ts +0 -89
- package/dist/store/quote.d.ts.map +0 -1
- package/dist/store/slices/settings.d.ts +0 -39
- package/dist/store/slices/settings.d.ts.map +0 -1
- package/dist/types/quote.d.ts +0 -82
- package/dist/types/quote.d.ts.map +0 -1
- package/dist/utils/quote.d.ts +0 -32
- package/dist/utils/quote.d.ts.map +0 -1
- package/src/components/NoResult/index.ts +0 -1
- package/src/components/Quote/Quote.styles.ts +0 -249
- package/src/components/Quote/Quote.tsx +0 -414
- package/src/components/Quote/Quote.types.ts +0 -15
- package/src/components/Quote/QuoteSummary.styles.ts +0 -16
- package/src/components/Quote/QuoteSummary.tsx +0 -46
- package/src/components/Quote/index.ts +0 -2
- package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +0 -42
- package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +0 -30
- package/src/components/QuoteSkeleton/QuoteSkeleton.types.ts +0 -5
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +0 -57
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +0 -76
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.types.ts +0 -6
- package/src/components/QuoteSkeleton/StepSkeleton.styles.ts +0 -33
- package/src/components/QuoteSkeleton/StepSkeleton.tsx +0 -44
- package/src/components/QuoteSkeleton/StepSkeleton.types.ts +0 -1
- package/src/components/QuoteSkeleton/index.ts +0 -3
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +0 -107
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +0 -74
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +0 -103
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +0 -25
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +0 -77
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +0 -38
- package/src/components/QuoteWarningsAndErrors/index.ts +0 -1
- package/src/containers/App/App.styles.ts +0 -18
- package/src/containers/App/App.tsx +0 -52
- package/src/containers/App/index.ts +0 -1
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -31
- package/src/containers/QuoteInfo/QuoteInfo.tsx +0 -99
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -20
- package/src/containers/QuoteInfo/index.ts +0 -1
- package/src/containers/Wallets/Wallets.types.ts +0 -12
- package/src/containers/Wallets/index.ts +0 -1
- package/src/containers/Widget/Widget.tsx +0 -19
- package/src/containers/Widget/Widget.types.ts +0 -5
- package/src/containers/Widget/index.ts +0 -2
- package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +0 -64
- package/src/containers/WidgetInfo/WidgetInfo.tsx +0 -62
- package/src/containers/WidgetInfo/WidgetInfo.types.ts +0 -21
- package/src/containers/WidgetInfo/index.ts +0 -1
- package/src/containers/WidgetProvider/WidgetProvider.tsx +0 -28
- package/src/containers/WidgetProvider/WidgetProvider.types.ts +0 -7
- package/src/containers/WidgetProvider/index.ts +0 -1
- package/src/hooks/useConfirmSwap/index.ts +0 -1
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +0 -172
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +0 -137
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +0 -19
- package/src/hooks/useForceAutoConnect.ts +0 -27
- package/src/store/AppStore.tsx +0 -41
- package/src/store/slices/settings.ts +0 -168
- package/src/types/quote.ts +0 -107
- package/src/utils/quote.ts +0 -338
|
@@ -23,22 +23,32 @@ import {
|
|
|
23
23
|
NotFoundContainer,
|
|
24
24
|
SettingsContainer,
|
|
25
25
|
} from '../components/SettingsContainer';
|
|
26
|
-
import {
|
|
26
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
27
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
28
|
+
import { useMetaStore } from '../store/meta';
|
|
29
|
+
import { useSettingsStore } from '../store/settings';
|
|
27
30
|
import { containsText } from '../utils/numbers';
|
|
28
|
-
import {
|
|
31
|
+
import {
|
|
32
|
+
getUniqueSwappersGroups,
|
|
33
|
+
sortLiquiditySourcesByGroupTitle,
|
|
34
|
+
} from '../utils/settings';
|
|
29
35
|
|
|
30
36
|
interface PropTypes {
|
|
37
|
+
supportedSwappers?: string[];
|
|
31
38
|
sourceType: 'Exchanges' | 'Bridges';
|
|
32
39
|
}
|
|
33
40
|
|
|
34
|
-
export function LiquiditySourcePage({
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
41
|
+
export function LiquiditySourcePage({
|
|
42
|
+
supportedSwappers,
|
|
43
|
+
sourceType,
|
|
44
|
+
}: PropTypes) {
|
|
38
45
|
const [searchedFor, setSearchedFor] = useState<string>('');
|
|
39
|
-
const toggleLiquiditySource =
|
|
46
|
+
const toggleLiquiditySource = useSettingsStore.use.toggleLiquiditySource();
|
|
47
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
48
|
+
const loadingMetaStatus = useMetaStore.use.loadingStatus();
|
|
49
|
+
|
|
40
50
|
const supportedUniqueSwappersGroups: Array<UniqueSwappersGroupType> =
|
|
41
|
-
getUniqueSwappersGroups(
|
|
51
|
+
getUniqueSwappersGroups(supportedSwappers);
|
|
42
52
|
|
|
43
53
|
const validTypes: Array<LiquiditySourceType> = [];
|
|
44
54
|
if (sourceType === 'Exchanges') {
|
|
@@ -69,20 +79,22 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
69
79
|
});
|
|
70
80
|
};
|
|
71
81
|
|
|
72
|
-
const list = liquiditySources
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
<
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
const list = liquiditySources
|
|
83
|
+
.sort(sortLiquiditySourcesByGroupTitle)
|
|
84
|
+
.map((sourceItem) => {
|
|
85
|
+
const { selected, groupTitle, logo } = sourceItem;
|
|
86
|
+
return {
|
|
87
|
+
start: <Image src={logo} size={22} type="circular" />,
|
|
88
|
+
onClick: () => toggleLiquiditySource(groupTitle),
|
|
89
|
+
end: <Checkbox checked={selected} />,
|
|
90
|
+
title: (
|
|
91
|
+
<Typography variant="title" size="xmedium">
|
|
92
|
+
{i18n.t(groupTitle)}
|
|
93
|
+
</Typography>
|
|
94
|
+
),
|
|
95
|
+
...sourceItem,
|
|
96
|
+
};
|
|
97
|
+
});
|
|
86
98
|
|
|
87
99
|
const searchHandler = (event: React.ChangeEvent<HTMLInputElement>) => {
|
|
88
100
|
const value = event.target.value;
|
|
@@ -99,6 +111,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
99
111
|
return (
|
|
100
112
|
<Layout
|
|
101
113
|
header={{
|
|
114
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
|
|
102
115
|
title: i18n.t(sourceType),
|
|
103
116
|
suffix: (
|
|
104
117
|
<LiquiditySourceSuffix>
|
|
@@ -118,7 +131,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
118
131
|
placeholder={i18n.t('Search {sourceType}', { sourceType })}
|
|
119
132
|
onChange={searchHandler}
|
|
120
133
|
/>
|
|
121
|
-
{
|
|
134
|
+
{loadingMetaStatus === 'loading' && <LoadingLiquiditySourceList />}
|
|
122
135
|
|
|
123
136
|
{!filteredList.length && !!searchedFor ? (
|
|
124
137
|
<NotFoundContainer>
|
|
@@ -128,7 +141,7 @@ export function LiquiditySourcePage({ sourceType }: PropTypes) {
|
|
|
128
141
|
/>
|
|
129
142
|
</NotFoundContainer>
|
|
130
143
|
) : (
|
|
131
|
-
|
|
144
|
+
loadingMetaStatus === 'success' && (
|
|
132
145
|
<LiquiditySourceList>
|
|
133
146
|
{filteredList.map((sourceItem) => {
|
|
134
147
|
return (
|
|
@@ -1,17 +1,15 @@
|
|
|
1
1
|
import { i18n } from '@lingui/core';
|
|
2
|
-
import {
|
|
3
|
-
Divider,
|
|
4
|
-
getCountCategories,
|
|
5
|
-
SelectableCategoryList
|
|
6
|
-
} from '@rango-dev/ui';
|
|
2
|
+
import { Divider, SelectableCategoryList } from '@rango-dev/ui';
|
|
7
3
|
import React, { useState } from 'react';
|
|
8
4
|
|
|
9
5
|
import { BlockchainList } from '../components/BlockchainList';
|
|
10
6
|
import { Layout } from '../components/Layout';
|
|
11
7
|
import { SearchInput } from '../components/SearchInput';
|
|
8
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
12
9
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
13
|
-
import { useAppStore } from '../store/
|
|
14
|
-
import {
|
|
10
|
+
import { useAppStore } from '../store/app';
|
|
11
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
12
|
+
import { useMetaStore } from '../store/meta';
|
|
15
13
|
|
|
16
14
|
interface PropTypes {
|
|
17
15
|
type: 'source' | 'destination';
|
|
@@ -19,40 +17,34 @@ interface PropTypes {
|
|
|
19
17
|
|
|
20
18
|
export function SelectBlockchainPage(props: PropTypes) {
|
|
21
19
|
const { type } = props;
|
|
22
|
-
const
|
|
20
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
23
21
|
const [searchedFor, setSearchedFor] = useState<string>('');
|
|
24
22
|
const [blockchainCategory, setBlockchainCategory] = useState<string>('ALL');
|
|
25
|
-
const setToBlockchain =
|
|
26
|
-
const setFromBlockchain =
|
|
27
|
-
const
|
|
23
|
+
const setToBlockchain = useBestRouteStore.use.setToBlockchain();
|
|
24
|
+
const setFromBlockchain = useBestRouteStore.use.setFromBlockchain();
|
|
25
|
+
const { loadingStatus } = useMetaStore();
|
|
28
26
|
|
|
29
27
|
const blockchains = useAppStore().blockchains({
|
|
30
|
-
type: type
|
|
28
|
+
type: type,
|
|
31
29
|
});
|
|
32
|
-
|
|
33
|
-
const countActiveCategories = getCountCategories(blockchains);
|
|
34
|
-
|
|
35
|
-
const showCategory = countActiveCategories !== 1;
|
|
30
|
+
const routeKey = type === 'source' ? 'fromBlockchain' : 'toBlockchain';
|
|
36
31
|
|
|
37
32
|
return (
|
|
38
33
|
<Layout
|
|
39
34
|
header={{
|
|
40
|
-
|
|
35
|
+
onBack: () => {
|
|
36
|
+
navigateBackFrom(navigationRoutes[routeKey]);
|
|
37
|
+
},
|
|
38
|
+
title: i18n.t(`Select Blockchain`),
|
|
41
39
|
}}>
|
|
42
40
|
<Divider size={12} />
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
isLoading={fetchStatus === 'loading'}
|
|
51
|
-
/>
|
|
52
|
-
<Divider size={24} />
|
|
53
|
-
</>
|
|
54
|
-
)}
|
|
55
|
-
|
|
41
|
+
<SelectableCategoryList
|
|
42
|
+
setCategory={setBlockchainCategory}
|
|
43
|
+
category={blockchainCategory}
|
|
44
|
+
blockchains={blockchains}
|
|
45
|
+
isLoading={loadingStatus === 'loading'}
|
|
46
|
+
/>
|
|
47
|
+
<Divider size={24} />
|
|
56
48
|
<SearchInput
|
|
57
49
|
value={searchedFor}
|
|
58
50
|
autoFocus
|
|
@@ -75,7 +67,8 @@ export function SelectBlockchainPage(props: PropTypes) {
|
|
|
75
67
|
} else {
|
|
76
68
|
setToBlockchain(blockchain);
|
|
77
69
|
}
|
|
78
|
-
|
|
70
|
+
|
|
71
|
+
navigateBackFrom(navigationRoutes[routeKey]);
|
|
79
72
|
}}
|
|
80
73
|
/>
|
|
81
74
|
</Layout>
|
|
@@ -11,10 +11,10 @@ import { SearchInput } from '../components/SearchInput';
|
|
|
11
11
|
import { TokenList } from '../components/TokenList/TokenList';
|
|
12
12
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
13
13
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
14
|
-
import { useAppStore } from '../store/
|
|
15
|
-
import {
|
|
14
|
+
import { useAppStore } from '../store/app';
|
|
15
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
16
16
|
import { useWalletsStore } from '../store/wallets';
|
|
17
|
-
import {
|
|
17
|
+
import { getTokensBalanceFromWalletAndSort } from '../utils/wallets';
|
|
18
18
|
|
|
19
19
|
interface PropTypes {
|
|
20
20
|
type: 'source' | 'destination';
|
|
@@ -23,7 +23,7 @@ interface PropTypes {
|
|
|
23
23
|
export function SelectSwapItemsPage(props: PropTypes) {
|
|
24
24
|
const { type } = props;
|
|
25
25
|
const navigate = useNavigate();
|
|
26
|
-
const
|
|
26
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
27
27
|
const {
|
|
28
28
|
fromBlockchain,
|
|
29
29
|
toBlockchain,
|
|
@@ -31,28 +31,28 @@ export function SelectSwapItemsPage(props: PropTypes) {
|
|
|
31
31
|
setToToken,
|
|
32
32
|
setFromBlockchain,
|
|
33
33
|
setToBlockchain,
|
|
34
|
-
} =
|
|
35
|
-
const
|
|
34
|
+
} = useBestRouteStore();
|
|
35
|
+
const { connectedWallets } = useWalletsStore();
|
|
36
36
|
const [searchedFor, setSearchedFor] = useState<string>('');
|
|
37
|
-
const { isTokenPinned } = useAppStore();
|
|
38
37
|
|
|
39
38
|
const selectedBlockchain = type === 'source' ? fromBlockchain : toBlockchain;
|
|
40
39
|
const selectedBlockchainName = selectedBlockchain?.name ?? '';
|
|
41
40
|
|
|
42
41
|
// Tokens & Blockchains list
|
|
43
42
|
const blockchains = useAppStore().blockchains({
|
|
44
|
-
type,
|
|
43
|
+
type: type,
|
|
45
44
|
});
|
|
46
45
|
const tokens = useAppStore().tokens({
|
|
47
46
|
type,
|
|
48
47
|
blockchain: selectedBlockchainName,
|
|
49
48
|
searchFor: searchedFor,
|
|
50
49
|
});
|
|
50
|
+
const tokensList = getTokensBalanceFromWalletAndSort(
|
|
51
|
+
tokens,
|
|
52
|
+
connectedWallets
|
|
53
|
+
);
|
|
51
54
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
const tokensList = sortTokens(tokens, getBalanceFor, checkIsTokenPinned);
|
|
55
|
-
|
|
55
|
+
// Actions
|
|
56
56
|
const updateBlockchain = (blockchain: BlockchainMeta) => {
|
|
57
57
|
if (type === 'source') {
|
|
58
58
|
setFromBlockchain(blockchain);
|
|
@@ -63,22 +63,36 @@ export function SelectSwapItemsPage(props: PropTypes) {
|
|
|
63
63
|
|
|
64
64
|
const updateToken = (token: Token) => {
|
|
65
65
|
if (type === 'source') {
|
|
66
|
-
setFromToken(
|
|
66
|
+
setFromToken(token);
|
|
67
67
|
} else {
|
|
68
|
-
setToToken(
|
|
68
|
+
setToToken(token);
|
|
69
69
|
}
|
|
70
70
|
};
|
|
71
71
|
|
|
72
72
|
return (
|
|
73
73
|
<Layout
|
|
74
74
|
header={{
|
|
75
|
-
|
|
75
|
+
onBack: () =>
|
|
76
|
+
navigateBackFrom(
|
|
77
|
+
type === 'source'
|
|
78
|
+
? navigationRoutes.fromSwap
|
|
79
|
+
: navigationRoutes.toSwap
|
|
80
|
+
),
|
|
81
|
+
title: i18n.t('Swap {type}', {
|
|
82
|
+
type: type === 'source' ? 'from' : 'to',
|
|
83
|
+
}),
|
|
76
84
|
}}>
|
|
77
85
|
<BlockchainsSection
|
|
78
86
|
blockchains={blockchains}
|
|
79
87
|
type={type == 'source' ? 'from' : 'to'}
|
|
80
88
|
blockchain={type === 'source' ? fromBlockchain : toBlockchain}
|
|
81
|
-
onMoreClick={() =>
|
|
89
|
+
onMoreClick={() =>
|
|
90
|
+
navigate(
|
|
91
|
+
type === 'source'
|
|
92
|
+
? navigationRoutes.fromBlockchain
|
|
93
|
+
: navigationRoutes.toBlockchain
|
|
94
|
+
)
|
|
95
|
+
}
|
|
82
96
|
onChange={(blockchain) => {
|
|
83
97
|
updateBlockchain(blockchain);
|
|
84
98
|
}}
|
|
@@ -99,7 +113,6 @@ export function SelectSwapItemsPage(props: PropTypes) {
|
|
|
99
113
|
list={tokensList}
|
|
100
114
|
selectedBlockchain={selectedBlockchainName}
|
|
101
115
|
searchedFor={searchedFor}
|
|
102
|
-
type={type}
|
|
103
116
|
onChange={(token) => {
|
|
104
117
|
updateToken(token);
|
|
105
118
|
|
|
@@ -110,7 +123,7 @@ export function SelectSwapItemsPage(props: PropTypes) {
|
|
|
110
123
|
updateBlockchain(tokenBlockchain);
|
|
111
124
|
}
|
|
112
125
|
|
|
113
|
-
|
|
126
|
+
navigateBackFrom(navigationRoutes.fromSwap);
|
|
114
127
|
}}
|
|
115
128
|
/>
|
|
116
129
|
</Layout>
|
|
@@ -18,32 +18,27 @@ import { SettingsContainer } from '../components/SettingsContainer';
|
|
|
18
18
|
import { Slippage } from '../components/Slippage';
|
|
19
19
|
import { SlippageTooltipContainer as TooltipContainer } from '../components/Slippage/Slippage.styles';
|
|
20
20
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
21
|
-
import {
|
|
21
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
22
|
+
import { useMetaStore } from '../store/meta';
|
|
23
|
+
import { useSettingsStore } from '../store/settings';
|
|
22
24
|
import { getContainer } from '../utils/common';
|
|
23
|
-
import { getUniqueSwappersGroups
|
|
25
|
+
import { getUniqueSwappersGroups } from '../utils/settings';
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
const swappers = useAppStore().swappers();
|
|
30
|
-
const disabledLiquiditySources = useAppStore().disabledLiquiditySources;
|
|
31
|
-
const {
|
|
32
|
-
config: { features },
|
|
33
|
-
} = useAppStore();
|
|
34
|
-
const isThemeHidden = isFeatureHidden('theme', features);
|
|
27
|
+
interface PropTypes {
|
|
28
|
+
supportedSwappers?: string[];
|
|
29
|
+
singleTheme?: boolean;
|
|
30
|
+
}
|
|
35
31
|
|
|
36
|
-
|
|
32
|
+
export function SettingsPage({ supportedSwappers, singleTheme }: PropTypes) {
|
|
33
|
+
const navigate = useNavigate();
|
|
34
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
37
35
|
|
|
38
|
-
const
|
|
36
|
+
const infiniteApprove = useSettingsStore.use.infiniteApprove();
|
|
37
|
+
const toggleInfiniteApprove = useSettingsStore.use.toggleInfiniteApprove();
|
|
38
|
+
const loadingMetaStatus = useMetaStore.use.loadingStatus();
|
|
39
39
|
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const supportedUniqueSwappersGroups = getUniqueSwappersGroups(
|
|
44
|
-
swappers,
|
|
45
|
-
disabledLiquiditySources
|
|
46
|
-
);
|
|
40
|
+
const supportedUniqueSwappersGroups =
|
|
41
|
+
getUniqueSwappersGroups(supportedSwappers);
|
|
47
42
|
|
|
48
43
|
const bridgeSources = supportedUniqueSwappersGroups.filter(
|
|
49
44
|
(uniqueItem) =>
|
|
@@ -63,7 +58,7 @@ export function SettingsPage() {
|
|
|
63
58
|
).length;
|
|
64
59
|
|
|
65
60
|
const handleEndItem = (totalSelected: number, total: number) => {
|
|
66
|
-
switch (
|
|
61
|
+
switch (loadingMetaStatus) {
|
|
67
62
|
case 'loading':
|
|
68
63
|
return <Skeleton variant="text" size="medium" width={50} />;
|
|
69
64
|
case 'failed':
|
|
@@ -144,18 +139,17 @@ export function SettingsPage() {
|
|
|
144
139
|
title: (
|
|
145
140
|
<>
|
|
146
141
|
<Typography variant="title" size="xmedium">
|
|
147
|
-
{i18n.t('Infinite
|
|
142
|
+
{i18n.t('Infinite Approval')}
|
|
148
143
|
</Typography>
|
|
149
144
|
<Divider direction="horizontal" size={4} />
|
|
150
145
|
<Tooltip
|
|
151
146
|
side="top"
|
|
152
|
-
sideOffset={4}
|
|
153
147
|
container={getContainer()}
|
|
154
148
|
content={
|
|
155
149
|
<TooltipContainer>
|
|
156
150
|
<Typography variant="label" size="medium" color="neutral700">
|
|
157
151
|
{i18n.t(
|
|
158
|
-
"Enabling the 'Infinite
|
|
152
|
+
"Enabling the 'Infinite Approval' mode grants unrestricted access to smart contracts of DEXes/Bridges, allowing them to utilize the approved token amount without limitations."
|
|
159
153
|
)}
|
|
160
154
|
</Typography>
|
|
161
155
|
</TooltipContainer>
|
|
@@ -168,12 +162,12 @@ export function SettingsPage() {
|
|
|
168
162
|
onClick: toggleInfiniteApprove,
|
|
169
163
|
};
|
|
170
164
|
|
|
171
|
-
const settingItems =
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
//
|
|
175
|
-
|
|
176
|
-
if (!
|
|
165
|
+
const settingItems = [
|
|
166
|
+
bridgeItem,
|
|
167
|
+
exchangeItem,
|
|
168
|
+
// languageItem
|
|
169
|
+
];
|
|
170
|
+
if (!singleTheme) {
|
|
177
171
|
settingItems.push(themeItem);
|
|
178
172
|
}
|
|
179
173
|
settingItems.push(infiniteApprovalItem);
|
|
@@ -181,7 +175,8 @@ export function SettingsPage() {
|
|
|
181
175
|
return (
|
|
182
176
|
<Layout
|
|
183
177
|
header={{
|
|
184
|
-
|
|
178
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
|
|
179
|
+
title: i18n.t('Setting'),
|
|
185
180
|
}}>
|
|
186
181
|
<SettingsContainer>
|
|
187
182
|
<Slippage />
|
|
@@ -4,8 +4,9 @@ import React from 'react';
|
|
|
4
4
|
|
|
5
5
|
import { SwapDetails } from '../components/SwapDetails';
|
|
6
6
|
import { SwapDetailsPlaceholder } from '../components/SwapDetails/SwapDetails.Placeholder';
|
|
7
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
7
8
|
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
8
|
-
import {
|
|
9
|
+
import { useMetaStore } from '../store/meta';
|
|
9
10
|
import { useUiStore } from '../store/ui';
|
|
10
11
|
import { getPendingSwaps } from '../utils/queue';
|
|
11
12
|
|
|
@@ -14,10 +15,10 @@ export function SwapDetailsPage() {
|
|
|
14
15
|
const loading = !state.loadedFromPersistor;
|
|
15
16
|
const pendingSwaps = getPendingSwaps(manager);
|
|
16
17
|
const requestId = useUiStore.use.selectedSwapRequestId();
|
|
17
|
-
const
|
|
18
|
-
const {
|
|
18
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
19
|
+
const { loadingStatus } = useMetaStore();
|
|
19
20
|
|
|
20
|
-
const showSkeleton = loading ||
|
|
21
|
+
const showSkeleton = loading || loadingStatus === 'loading';
|
|
21
22
|
|
|
22
23
|
const selectedSwap = pendingSwaps.find(
|
|
23
24
|
({ swap }) => swap.requestId === requestId
|
|
@@ -35,8 +36,8 @@ export function SwapDetailsPage() {
|
|
|
35
36
|
const onDelete = async () => {
|
|
36
37
|
if (selectedSwap?.id) {
|
|
37
38
|
try {
|
|
38
|
-
manager?.deleteQueue(selectedSwap.id);
|
|
39
|
-
|
|
39
|
+
await manager?.deleteQueue(selectedSwap.id);
|
|
40
|
+
navigateBackFrom(navigationRoutes.swapDetails);
|
|
40
41
|
} catch (e) {
|
|
41
42
|
console.log(e);
|
|
42
43
|
}
|
package/src/pages/ThemePage.tsx
CHANGED
|
@@ -13,7 +13,9 @@ import React from 'react';
|
|
|
13
13
|
|
|
14
14
|
import { Layout } from '../components/Layout';
|
|
15
15
|
import { SettingsContainer } from '../components/SettingsContainer';
|
|
16
|
-
import {
|
|
16
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
17
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
18
|
+
import { useSettingsStore } from '../store/settings';
|
|
17
19
|
|
|
18
20
|
type Theme = 'dark' | 'light' | 'auto';
|
|
19
21
|
|
|
@@ -24,7 +26,9 @@ enum Mode {
|
|
|
24
26
|
}
|
|
25
27
|
|
|
26
28
|
export function ThemePage() {
|
|
27
|
-
const {
|
|
29
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
30
|
+
const theme = useSettingsStore.use.theme();
|
|
31
|
+
const setTheme = useSettingsStore.use.setTheme();
|
|
28
32
|
|
|
29
33
|
const themesList = [
|
|
30
34
|
{
|
|
@@ -68,6 +72,7 @@ export function ThemePage() {
|
|
|
68
72
|
return (
|
|
69
73
|
<Layout
|
|
70
74
|
header={{
|
|
75
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
|
|
71
76
|
title: i18n.t('Theme'),
|
|
72
77
|
}}>
|
|
73
78
|
<SettingsContainer>
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
1
2
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
2
3
|
|
|
3
4
|
import { i18n } from '@lingui/core';
|
|
@@ -6,17 +7,24 @@ import React, { Fragment, useState } from 'react';
|
|
|
6
7
|
|
|
7
8
|
import { Layout } from '../components/Layout';
|
|
8
9
|
import { WalletModal } from '../components/WalletModal';
|
|
10
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
11
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
9
12
|
import { useWalletList } from '../hooks/useWalletList';
|
|
10
|
-
import {
|
|
13
|
+
import { useMetaStore } from '../store/meta';
|
|
11
14
|
import { getContainer } from '../utils/common';
|
|
12
15
|
|
|
16
|
+
interface PropTypes {
|
|
17
|
+
supportedWallets: WidgetConfig['wallets'];
|
|
18
|
+
multiWallets: boolean;
|
|
19
|
+
config?: WidgetConfig;
|
|
20
|
+
}
|
|
21
|
+
|
|
13
22
|
const ListContainer = styled('div', {
|
|
14
|
-
display: '
|
|
15
|
-
justifyContent: 'space-evenly',
|
|
16
|
-
alignItems: 'center',
|
|
23
|
+
display: 'grid',
|
|
17
24
|
gap: '$10',
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
gridTemplateColumns: ' repeat(3, minmax(0, 1fr))',
|
|
26
|
+
alignContent: 'baseline',
|
|
27
|
+
paddingTop: '$15',
|
|
20
28
|
height: '100%',
|
|
21
29
|
});
|
|
22
30
|
|
|
@@ -27,8 +35,8 @@ const Container = styled('div', {
|
|
|
27
35
|
export const TIME_TO_CLOSE_MODAL = 3_000;
|
|
28
36
|
export const TIME_TO_IGNORE_MODAL = 300;
|
|
29
37
|
|
|
30
|
-
export function WalletsPage() {
|
|
31
|
-
const {
|
|
38
|
+
export function WalletsPage({ config }: PropTypes) {
|
|
39
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
32
40
|
const [openModal, setOpenModal] = useState(false);
|
|
33
41
|
const [selectedWalletType, setSelectedWalletType] = useState<WalletType>('');
|
|
34
42
|
let modalTimerId: ReturnType<typeof setTimeout> | null = null;
|
|
@@ -51,6 +59,7 @@ export function WalletsPage() {
|
|
|
51
59
|
},
|
|
52
60
|
});
|
|
53
61
|
|
|
62
|
+
const loadingMetaStatus = useMetaStore.use.loadingStatus();
|
|
54
63
|
const selectedWallet = list.find(
|
|
55
64
|
(wallet) => wallet.type === selectedWalletType
|
|
56
65
|
);
|
|
@@ -62,6 +71,7 @@ export function WalletsPage() {
|
|
|
62
71
|
<Layout
|
|
63
72
|
header={{
|
|
64
73
|
title: i18n.t('Connect Wallets'),
|
|
74
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.wallets),
|
|
65
75
|
}}>
|
|
66
76
|
<Container>
|
|
67
77
|
<Typography variant="title" size="xmedium" align="center">
|
|
@@ -78,7 +88,7 @@ export function WalletsPage() {
|
|
|
78
88
|
onClick={(type) => {
|
|
79
89
|
void handleClick(type);
|
|
80
90
|
}}
|
|
81
|
-
isLoading={
|
|
91
|
+
isLoading={loadingMetaStatus === 'loading'}
|
|
82
92
|
/>
|
|
83
93
|
</Fragment>
|
|
84
94
|
);
|
package/src/store/app.ts
CHANGED
|
@@ -1,53 +1,15 @@
|
|
|
1
1
|
import type { ConfigSlice } from './slices/config';
|
|
2
2
|
import type { DataSlice } from './slices/data';
|
|
3
|
-
import type { SettingsSlice } from './slices/settings';
|
|
4
|
-
import type { WidgetConfig } from '../types';
|
|
5
|
-
import type { StateCreator } from 'zustand';
|
|
6
3
|
|
|
7
4
|
import { create } from 'zustand';
|
|
8
|
-
import { persist } from 'zustand/middleware';
|
|
9
5
|
|
|
6
|
+
import createSelectors from './selectors';
|
|
10
7
|
import { createConfigSlice } from './slices/config';
|
|
11
8
|
import { createDataSlice } from './slices/data';
|
|
12
|
-
import { createSettingsSlice } from './slices/settings';
|
|
13
9
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
> = (
|
|
19
|
-
initialData: T | undefined,
|
|
20
|
-
...rest: Parameters<StateCreator<R, [], [], V>>
|
|
21
|
-
) => ReturnType<StateCreator<R, [], [], V>>;
|
|
10
|
+
const store = create<DataSlice & ConfigSlice>()((...a) => ({
|
|
11
|
+
...createDataSlice(...a),
|
|
12
|
+
...createConfigSlice(...a),
|
|
13
|
+
}));
|
|
22
14
|
|
|
23
|
-
export
|
|
24
|
-
|
|
25
|
-
export function createAppStore(initialData?: WidgetConfig) {
|
|
26
|
-
return create<AppStoreState>()(
|
|
27
|
-
persist(
|
|
28
|
-
(...a) => ({
|
|
29
|
-
...createDataSlice(...a),
|
|
30
|
-
...createSettingsSlice(...a),
|
|
31
|
-
...createConfigSlice(initialData, ...a),
|
|
32
|
-
}),
|
|
33
|
-
{
|
|
34
|
-
name: 'user-settings',
|
|
35
|
-
skipHydration: true,
|
|
36
|
-
partialize: (state) => {
|
|
37
|
-
return {
|
|
38
|
-
theme: state.theme,
|
|
39
|
-
language: state.language,
|
|
40
|
-
affiliatePercent: state.affiliatePercent,
|
|
41
|
-
affiliateRef: state.affiliateRef,
|
|
42
|
-
affiliateWallets: state.affiliateWallets,
|
|
43
|
-
slippage: state.slippage,
|
|
44
|
-
customSlippage: state.customSlippage,
|
|
45
|
-
infiniteApprove: state.infiniteApprove,
|
|
46
|
-
preferredBlockchains: state.preferredBlockchains,
|
|
47
|
-
disabledLiquiditySources: state.disabledLiquiditySources,
|
|
48
|
-
};
|
|
49
|
-
},
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
);
|
|
53
|
-
}
|
|
15
|
+
export const useAppStore = createSelectors(store);
|