@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
|
@@ -1,36 +1,30 @@
|
|
|
1
1
|
import type { WalletStateContentProps } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
-
import { MessageBox, Wallet } from '@rango-dev/ui';
|
|
3
|
+
import { MessageBox, Wallet, WalletState } from '@rango-dev/ui';
|
|
4
4
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { getContainer } from '../../utils/common';
|
|
8
|
-
import { mapStatusToWalletState } from '../../utils/wallets';
|
|
9
8
|
|
|
10
9
|
import { WalletContainer } from './SwapDetailsModal.styles';
|
|
11
10
|
|
|
12
11
|
export const WalletStateContent = (props: WalletStateContentProps) => {
|
|
13
12
|
const { type, title, currentStepWallet, message, showWalletButton } = props;
|
|
14
|
-
const { connect, getWalletInfo, state } = useWallets();
|
|
13
|
+
const { connect, getWalletInfo, state: walletState } = useWallets();
|
|
15
14
|
const walletType = currentStepWallet?.walletType;
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
: null;
|
|
19
|
-
const walletInfo = walletType ? getWalletInfo(walletType) : null;
|
|
20
|
-
const shouldShowWallet =
|
|
21
|
-
showWalletButton && !!walletType && !!walletState && !!walletInfo;
|
|
15
|
+
const isConnected = walletType && walletState(walletType).connected;
|
|
16
|
+
const state = isConnected ? WalletState.CONNECTED : WalletState.DISCONNECTED;
|
|
22
17
|
return (
|
|
23
18
|
<>
|
|
24
19
|
<MessageBox type={type} title={title} description={message} />
|
|
25
|
-
{
|
|
20
|
+
{showWalletButton && walletType && (
|
|
26
21
|
<WalletContainer>
|
|
27
22
|
<Wallet
|
|
28
23
|
container={getContainer()}
|
|
29
|
-
title={
|
|
30
|
-
image={
|
|
24
|
+
title={getWalletInfo(walletType).name}
|
|
25
|
+
image={getWalletInfo(walletType).img}
|
|
31
26
|
type={walletType}
|
|
32
|
-
state={
|
|
33
|
-
link={walletInfo.installLink}
|
|
27
|
+
state={state}
|
|
34
28
|
onClick={async () => connect(walletType)}
|
|
35
29
|
/>
|
|
36
30
|
</WalletContainer>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalNetworkValueTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
3
|
import { i18n } from '@lingui/core';
|
|
4
|
-
import { PendingSwapNetworkStatus } from 'rango-
|
|
4
|
+
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
5
5
|
|
|
6
6
|
export const modalNetworkValues: Record<
|
|
7
7
|
Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ModalPropTypes } from './SwapDetailsModal.types';
|
|
2
2
|
|
|
3
|
+
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
3
4
|
import { Modal } from '@rango-dev/ui';
|
|
4
|
-
import { PendingSwapNetworkStatus } from 'rango-types';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { CancelContent } from './SwapDetailsModal.Cancel';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import type { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
1
2
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
2
|
-
import type { PendingSwapNetworkStatus } from 'rango-types';
|
|
3
3
|
|
|
4
4
|
export type ModalState =
|
|
5
5
|
| Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>
|
|
@@ -1,18 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
export const groupStyles = css();
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
4
2
|
|
|
5
3
|
export const Group = styled('div', {
|
|
6
4
|
width: '100%',
|
|
7
5
|
display: 'flex',
|
|
8
6
|
flexDirection: 'column',
|
|
9
|
-
[`& .${groupStyles}`]: {
|
|
10
|
-
$$color: '$colors$neutral600',
|
|
11
|
-
[`.${darkTheme} &`]: {
|
|
12
|
-
$$color: '$colors$neutral700',
|
|
13
|
-
},
|
|
14
|
-
color: '$$color',
|
|
15
|
-
},
|
|
16
7
|
});
|
|
17
8
|
|
|
18
9
|
export const Time = styled('div', {
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { limitDecimalPlaces } from '../../utils/numbers';
|
|
8
8
|
|
|
9
|
-
import { Group,
|
|
9
|
+
import { Group, SwapList, Time } from './SwapsGroup.styles';
|
|
10
10
|
|
|
11
11
|
export function SwapsGroup(props: PropTypes) {
|
|
12
12
|
const { list, onSwapClick, groupBy, isLoading } = props;
|
|
@@ -34,7 +34,8 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
34
34
|
<Typography
|
|
35
35
|
variant="label"
|
|
36
36
|
size="medium"
|
|
37
|
-
|
|
37
|
+
color="neutral600"
|
|
38
|
+
className="group-title">
|
|
38
39
|
{i18n.t(group.title)}
|
|
39
40
|
</Typography>
|
|
40
41
|
</Time>
|
|
@@ -67,7 +68,8 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
67
68
|
<Typography
|
|
68
69
|
variant="label"
|
|
69
70
|
size="medium"
|
|
70
|
-
|
|
71
|
+
color="neutral600"
|
|
72
|
+
className="group-title">
|
|
71
73
|
{i18n.t(group.title)}
|
|
72
74
|
</Typography>
|
|
73
75
|
</Time>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { ReverseIcon, styled } from '@rango-dev/ui';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
5
5
|
|
|
6
6
|
const SwitchButtonContainer = styled('div', {
|
|
7
7
|
position: 'absolute',
|
|
@@ -27,7 +27,7 @@ const StyledButton = styled('div', {
|
|
|
27
27
|
});
|
|
28
28
|
|
|
29
29
|
export function SwitchFromAndToButton() {
|
|
30
|
-
const switchFromAndTo =
|
|
30
|
+
const switchFromAndTo = useBestRouteStore.use.switchFromAndTo();
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<SwitchButtonContainer>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { TokenWithBalance } from './TokenList.types';
|
|
2
2
|
|
|
3
3
|
import { containsText } from '../../utils/common';
|
|
4
4
|
|
|
5
|
-
export const filterTokens = (list:
|
|
5
|
+
export const filterTokens = (list: TokenWithBalance[], searchedFor: string) =>
|
|
6
6
|
list.filter(
|
|
7
7
|
(token) =>
|
|
8
8
|
containsText(token.symbol, searchedFor) ||
|
|
@@ -1,51 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
css,
|
|
3
|
-
darkTheme,
|
|
4
|
-
ImageContainer,
|
|
5
|
-
styled,
|
|
6
|
-
Typography,
|
|
7
|
-
} from '@rango-dev/ui';
|
|
8
|
-
|
|
9
|
-
export const tokenNameStyles = css({
|
|
10
|
-
position: 'absolute',
|
|
11
|
-
transform: 'none',
|
|
12
|
-
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
13
|
-
textOverflow: 'ellipsis',
|
|
14
|
-
whiteSpace: 'nowrap',
|
|
15
|
-
maxWidth: 100,
|
|
16
|
-
overflow: 'hidden',
|
|
17
|
-
});
|
|
18
|
-
export const descriptionStyles = css({
|
|
19
|
-
position: 'relative',
|
|
20
|
-
height: 12,
|
|
21
|
-
width: '30%',
|
|
22
|
-
maxWidth: '150px',
|
|
23
|
-
});
|
|
24
|
-
export const tokenTitleStyles = css({
|
|
25
|
-
position: 'absolute',
|
|
26
|
-
transform: 'none',
|
|
27
|
-
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
28
|
-
bottom: '-8px',
|
|
29
|
-
});
|
|
30
|
-
export const tokenAddressStyles = css({
|
|
31
|
-
transform: 'translateY(12px)',
|
|
32
|
-
visibility: 'hidden',
|
|
33
|
-
'& a': {
|
|
34
|
-
display: 'flex',
|
|
35
|
-
justifyContent: 'center',
|
|
36
|
-
alignItems: 'center',
|
|
37
|
-
fontSize: '$12',
|
|
38
|
-
lineHeight: '$16',
|
|
39
|
-
$$color: '$colors$neutral600',
|
|
40
|
-
[`.${darkTheme} &`]: {
|
|
41
|
-
$$color: '$colors$neutral700',
|
|
42
|
-
},
|
|
43
|
-
color: '$$color',
|
|
44
|
-
textDecoration: 'none',
|
|
45
|
-
},
|
|
46
|
-
});
|
|
47
|
-
export const tokenWithoutNameStyles = css({});
|
|
48
|
-
export const usdValueStyles = css();
|
|
1
|
+
import { styled, Typography } from '@rango-dev/ui';
|
|
49
2
|
|
|
50
3
|
export const Container = styled('div', {
|
|
51
4
|
display: 'flex',
|
|
@@ -70,25 +23,54 @@ export const List = styled('ul', {
|
|
|
70
23
|
listStyle: 'none',
|
|
71
24
|
'& li': {
|
|
72
25
|
alignItems: 'none',
|
|
26
|
+
'.description': {
|
|
27
|
+
position: 'relative',
|
|
28
|
+
height: 12,
|
|
29
|
+
width: 150,
|
|
30
|
+
'.token-title': {
|
|
31
|
+
position: 'absolute',
|
|
32
|
+
transform: 'none',
|
|
33
|
+
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
34
|
+
bottom: '-8px',
|
|
35
|
+
},
|
|
73
36
|
|
|
37
|
+
'.token-address': {
|
|
38
|
+
transform: 'translateY(12px)',
|
|
39
|
+
visibility: 'hidden',
|
|
40
|
+
'& a': {
|
|
41
|
+
fontSize: '$12',
|
|
42
|
+
lineHeight: '$16',
|
|
43
|
+
color: '$neutral600',
|
|
44
|
+
textDecoration: 'none',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
'.token-name': {
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
transform: 'none',
|
|
50
|
+
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
51
|
+
textOverflow: 'ellipsis',
|
|
52
|
+
whiteSpace: 'nowrap',
|
|
53
|
+
maxWidth: 100,
|
|
54
|
+
overflow: 'hidden',
|
|
55
|
+
},
|
|
56
|
+
},
|
|
74
57
|
'&:hover': {
|
|
75
|
-
|
|
76
|
-
|
|
58
|
+
'.description': {
|
|
59
|
+
'.token-address': {
|
|
77
60
|
position: 'absolute',
|
|
78
61
|
transform: 'none',
|
|
79
62
|
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
80
63
|
visibility: 'visible',
|
|
81
64
|
},
|
|
82
|
-
|
|
83
|
-
[`& .${tokenWithoutNameStyles}`]: {
|
|
65
|
+
'.token-address-without-name': {
|
|
84
66
|
bottom: '-15px',
|
|
85
67
|
},
|
|
86
|
-
|
|
68
|
+
'.token-name': {
|
|
87
69
|
position: 'absolute',
|
|
88
70
|
transform: 'translateY(-12px)',
|
|
89
71
|
visibility: 'hidden',
|
|
90
72
|
},
|
|
91
|
-
|
|
73
|
+
'.token-title': {
|
|
92
74
|
position: 'absolute',
|
|
93
75
|
transform: 'translateY(-12px)',
|
|
94
76
|
bottom: '-10px',
|
|
@@ -110,20 +92,9 @@ export const TagTitle = styled(Typography, {});
|
|
|
110
92
|
|
|
111
93
|
export const BalanceContainer = styled('div', {
|
|
112
94
|
textAlign: 'right',
|
|
113
|
-
width: '100%',
|
|
114
|
-
overflow: 'hidden',
|
|
115
|
-
textOverflow: 'ellipsis',
|
|
116
|
-
whiteSpace: 'nowrap',
|
|
117
|
-
[`& .${usdValueStyles}`]: {
|
|
118
|
-
$$color: '$colors$neutral600',
|
|
119
|
-
[`.${darkTheme} &`]: {
|
|
120
|
-
$$color: '$colors$neutral700',
|
|
121
|
-
},
|
|
122
|
-
color: '$$color',
|
|
123
|
-
},
|
|
124
95
|
});
|
|
125
96
|
|
|
126
|
-
export const End = styled('
|
|
97
|
+
export const End = styled('ul', {
|
|
127
98
|
display: 'flex',
|
|
128
99
|
alignItems: 'end',
|
|
129
100
|
flexDirection: 'column',
|
|
@@ -135,7 +106,7 @@ export const Description = styled('div', {
|
|
|
135
106
|
});
|
|
136
107
|
export const ImageSection = styled('div', {
|
|
137
108
|
position: 'relative',
|
|
138
|
-
|
|
109
|
+
'.image-container': {
|
|
139
110
|
borderRadius: '$xm',
|
|
140
111
|
overflow: 'hidden',
|
|
141
112
|
},
|
|
@@ -148,10 +119,3 @@ export const Pin = styled('div', {
|
|
|
148
119
|
bottom: -6,
|
|
149
120
|
right: -6,
|
|
150
121
|
});
|
|
151
|
-
|
|
152
|
-
export const TokenBalance = styled(Typography, {
|
|
153
|
-
width: '100%',
|
|
154
|
-
overflow: 'hidden',
|
|
155
|
-
textOverflow: 'ellipsis',
|
|
156
|
-
whiteSpace: 'nowrap',
|
|
157
|
-
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
-
import type {
|
|
3
|
-
|
|
2
|
+
import type {
|
|
3
|
+
PropTypes,
|
|
4
|
+
RenderDescProps,
|
|
5
|
+
TokenWithBalance,
|
|
6
|
+
} from './TokenList.types';
|
|
4
7
|
import type { CommonProps } from 'react-window';
|
|
5
8
|
|
|
6
9
|
import { i18n } from '@lingui/core';
|
|
@@ -18,16 +21,15 @@ import {
|
|
|
18
21
|
} from '@rango-dev/ui';
|
|
19
22
|
import React, { forwardRef, useEffect, useState } from 'react';
|
|
20
23
|
|
|
21
|
-
import { useAppStore } from '../../store/
|
|
24
|
+
import { useAppStore } from '../../store/app';
|
|
25
|
+
import { useMetaStore } from '../../store/meta';
|
|
22
26
|
import { useWalletsStore } from '../../store/wallets';
|
|
23
27
|
import { generateRangeColors } from '../../utils/colors';
|
|
24
|
-
import { formatBalance } from '../../utils/wallets';
|
|
25
28
|
|
|
26
29
|
import { LoadingTokenList } from './LoadingTokenList';
|
|
27
30
|
import {
|
|
28
31
|
BalanceContainer,
|
|
29
32
|
Container,
|
|
30
|
-
descriptionStyles,
|
|
31
33
|
End,
|
|
32
34
|
ImageSection,
|
|
33
35
|
List,
|
|
@@ -35,12 +37,6 @@ import {
|
|
|
35
37
|
Tag,
|
|
36
38
|
TagTitle,
|
|
37
39
|
Title,
|
|
38
|
-
tokenAddressStyles,
|
|
39
|
-
TokenBalance,
|
|
40
|
-
tokenNameStyles,
|
|
41
|
-
tokenTitleStyles,
|
|
42
|
-
tokenWithoutNameStyles,
|
|
43
|
-
usdValueStyles,
|
|
44
40
|
} from './TokenList.styles';
|
|
45
41
|
|
|
46
42
|
const PAGE_SIZE = 20;
|
|
@@ -51,11 +47,11 @@ const renderDesc = (props: RenderDescProps) => {
|
|
|
51
47
|
const length = address.length;
|
|
52
48
|
|
|
53
49
|
return (
|
|
54
|
-
<div className=
|
|
50
|
+
<div className="description">
|
|
55
51
|
{name ? (
|
|
56
|
-
<div className=
|
|
52
|
+
<div className="token-name">{name}</div>
|
|
57
53
|
) : (
|
|
58
|
-
<Title className=
|
|
54
|
+
<Title className="token-title">
|
|
59
55
|
<Typography variant="title" size="xmedium">
|
|
60
56
|
{token.symbol}
|
|
61
57
|
</Typography>
|
|
@@ -70,9 +66,7 @@ const renderDesc = (props: RenderDescProps) => {
|
|
|
70
66
|
|
|
71
67
|
{!!address && (
|
|
72
68
|
<div
|
|
73
|
-
className={
|
|
74
|
-
!name && tokenWithoutNameStyles()
|
|
75
|
-
}`}>
|
|
69
|
+
className={`token-address ${!name && 'token-address-without-name'}`}>
|
|
76
70
|
<a
|
|
77
71
|
href={url}
|
|
78
72
|
target="_blank"
|
|
@@ -81,7 +75,6 @@ const renderDesc = (props: RenderDescProps) => {
|
|
|
81
75
|
{length > 10
|
|
82
76
|
? `${address.slice(0, 5)}...${address.slice(length - 6, length)}`
|
|
83
77
|
: address}{' '}
|
|
84
|
-
<Divider size={4} direction="horizontal" />
|
|
85
78
|
<ExternalLinkIcon color="gray" size={12} />
|
|
86
79
|
</a>
|
|
87
80
|
</div>
|
|
@@ -93,11 +86,11 @@ const renderDesc = (props: RenderDescProps) => {
|
|
|
93
86
|
export function TokenList(props: PropTypes) {
|
|
94
87
|
const { list, searchedFor = '', onChange, selectedBlockchain } = props;
|
|
95
88
|
|
|
96
|
-
const [tokens, setTokens] = useState<
|
|
97
|
-
const
|
|
98
|
-
const blockchains = useAppStore().blockchains();
|
|
89
|
+
const [tokens, setTokens] = useState<TokenWithBalance[]>(list);
|
|
90
|
+
const loadingStatus = useMetaStore.use.loadingStatus();
|
|
99
91
|
const [hasNextPage, setHasNextPage] = useState<boolean>(true);
|
|
100
|
-
const
|
|
92
|
+
const loadingWallet = useWalletsStore.use.loading();
|
|
93
|
+
const { blockchains } = useMetaStore.use.meta();
|
|
101
94
|
const { isTokenPinned } = useAppStore();
|
|
102
95
|
|
|
103
96
|
// eslint-disable-next-line react/display-name
|
|
@@ -142,7 +135,7 @@ export function TokenList(props: PropTypes) {
|
|
|
142
135
|
<VirtualizedList
|
|
143
136
|
Item={({ index, style }) => {
|
|
144
137
|
const token = tokens[index];
|
|
145
|
-
|
|
138
|
+
|
|
146
139
|
const address = token.address || '';
|
|
147
140
|
const blockchain = blockchains.find(
|
|
148
141
|
(blockchain) => blockchain.name === token.blockchain
|
|
@@ -177,8 +170,6 @@ export function TokenList(props: PropTypes) {
|
|
|
177
170
|
<ListItemButton
|
|
178
171
|
style={{
|
|
179
172
|
height: style?.height,
|
|
180
|
-
width: '100%',
|
|
181
|
-
overflow: 'hidden',
|
|
182
173
|
}}
|
|
183
174
|
tab-index={index}
|
|
184
175
|
key={`${token.symbol}${token.address}`}
|
|
@@ -188,7 +179,7 @@ export function TokenList(props: PropTypes) {
|
|
|
188
179
|
start={
|
|
189
180
|
<ImageSection>
|
|
190
181
|
<Image src={token.image} size={30} />
|
|
191
|
-
{isTokenPinned(token
|
|
182
|
+
{isTokenPinned(token) && (
|
|
192
183
|
<Pin>
|
|
193
184
|
<PinIcon size={12} color="gray" />
|
|
194
185
|
</Pin>
|
|
@@ -239,18 +230,18 @@ export function TokenList(props: PropTypes) {
|
|
|
239
230
|
<Skeleton variant="text" size="medium" width={50} />
|
|
240
231
|
</End>
|
|
241
232
|
) : (
|
|
242
|
-
|
|
233
|
+
tokens[index]?.balance && (
|
|
243
234
|
<BalanceContainer>
|
|
244
|
-
<
|
|
245
|
-
{
|
|
246
|
-
</
|
|
235
|
+
<Typography variant="title" size="small">
|
|
236
|
+
{token.balance?.amount}
|
|
237
|
+
</Typography>
|
|
247
238
|
<div />
|
|
248
|
-
{
|
|
239
|
+
{token.balance?.usdValue && (
|
|
249
240
|
<Typography
|
|
250
241
|
variant="body"
|
|
251
|
-
|
|
242
|
+
color="neutral600"
|
|
252
243
|
size="xsmall">
|
|
253
|
-
{`$${
|
|
244
|
+
{`$${token.balance?.usdValue}`}
|
|
254
245
|
</Typography>
|
|
255
246
|
)}
|
|
256
247
|
</BalanceContainer>
|
|
@@ -277,8 +268,8 @@ export function TokenList(props: PropTypes) {
|
|
|
277
268
|
{i18n.t('Select Token')}
|
|
278
269
|
</Typography>
|
|
279
270
|
<Divider size={4} />
|
|
280
|
-
{
|
|
281
|
-
{
|
|
271
|
+
{loadingStatus === 'loading' && <LoadingTokenList size={PAGE_SIZE} />}
|
|
272
|
+
{loadingStatus === 'success' && <List>{renderList()}</List>}
|
|
282
273
|
</Container>
|
|
283
274
|
);
|
|
284
275
|
}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import type { Token } from 'rango-sdk';
|
|
2
2
|
|
|
3
|
+
export interface TokenWithBalance extends Token {
|
|
4
|
+
balance?: {
|
|
5
|
+
amount: string;
|
|
6
|
+
usdValue: string;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
|
|
3
10
|
export interface PropTypes {
|
|
4
|
-
list:
|
|
11
|
+
list: TokenWithBalance[];
|
|
5
12
|
searchedFor?: string;
|
|
6
|
-
onChange: (token:
|
|
13
|
+
onChange: (token: TokenWithBalance) => void;
|
|
7
14
|
selectedBlockchain?: string;
|
|
8
|
-
type: 'source' | 'destination';
|
|
9
15
|
}
|
|
10
16
|
|
|
11
17
|
export interface LoadingTokenListProps {
|
|
@@ -16,7 +22,7 @@ export interface RenderDescProps {
|
|
|
16
22
|
name?: string | null;
|
|
17
23
|
address: string;
|
|
18
24
|
url: string;
|
|
19
|
-
token:
|
|
25
|
+
token: TokenWithBalance;
|
|
20
26
|
customCssForTag: TagCSS;
|
|
21
27
|
customCssForTagTitle: TitleCSS;
|
|
22
28
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
2
|
+
|
|
1
3
|
import { useEffect, useRef } from 'react';
|
|
2
4
|
import {
|
|
3
5
|
createSearchParams,
|
|
@@ -7,31 +9,34 @@ import {
|
|
|
7
9
|
|
|
8
10
|
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
9
11
|
import { SearchParams } from '../constants/searchParams';
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
+
import { useSyncStoresWithConfig } from '../hooks/useSyncStoresWithConfig';
|
|
13
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
14
|
+
import { useMetaStore } from '../store/meta';
|
|
12
15
|
import { useUiStore } from '../store/ui';
|
|
13
|
-
import { searchParamsToToken } from '../utils/
|
|
16
|
+
import { searchParamsToToken } from '../utils/routing';
|
|
17
|
+
|
|
18
|
+
type Props = { config: WidgetConfig | undefined };
|
|
14
19
|
|
|
15
|
-
export function UpdateUrl() {
|
|
20
|
+
export function UpdateUrl(props: Props) {
|
|
16
21
|
const firstRender = useRef(true);
|
|
17
22
|
const [searchParams, setSearchParams] = useSearchParams();
|
|
18
23
|
const location = useLocation();
|
|
19
24
|
const firstRenderSearchParams = useRef(location.search);
|
|
20
25
|
const searchParamsRef = useRef<Record<string, string>>({});
|
|
21
|
-
const fromBlockchain =
|
|
22
|
-
const toBlockchain =
|
|
23
|
-
const fromToken =
|
|
24
|
-
const toToken =
|
|
25
|
-
const setFromBlockchain =
|
|
26
|
-
const setFromToken =
|
|
27
|
-
const setToBlockchain =
|
|
28
|
-
const setToToken =
|
|
29
|
-
const inputAmount =
|
|
30
|
-
const setInputAmount =
|
|
31
|
-
const
|
|
32
|
-
const blockchains =
|
|
33
|
-
const tokens = useAppStore().tokens();
|
|
26
|
+
const fromBlockchain = useBestRouteStore.use.fromBlockchain();
|
|
27
|
+
const toBlockchain = useBestRouteStore.use.toBlockchain();
|
|
28
|
+
const fromToken = useBestRouteStore.use.fromToken();
|
|
29
|
+
const toToken = useBestRouteStore.use.toToken();
|
|
30
|
+
const setFromBlockchain = useBestRouteStore.use.setFromBlockchain();
|
|
31
|
+
const setFromToken = useBestRouteStore.use.setFromToken();
|
|
32
|
+
const setToBlockchain = useBestRouteStore.use.setToBlockchain();
|
|
33
|
+
const setToToken = useBestRouteStore.use.setToToken();
|
|
34
|
+
const inputAmount = useBestRouteStore.use.inputAmount();
|
|
35
|
+
const setInputAmount = useBestRouteStore.use.setInputAmount();
|
|
36
|
+
const loadingStatus = useMetaStore.use.loadingStatus();
|
|
37
|
+
const { blockchains, tokens } = useMetaStore.use.meta();
|
|
34
38
|
const setSelectedSwap = useUiStore.use.setSelectedSwap();
|
|
39
|
+
useSyncStoresWithConfig(props.config);
|
|
35
40
|
|
|
36
41
|
useEffect(() => {
|
|
37
42
|
const params: Record<string, string> = {};
|
|
@@ -55,8 +60,7 @@ export function UpdateUrl() {
|
|
|
55
60
|
toChainString = '',
|
|
56
61
|
toTokenString = '',
|
|
57
62
|
fromAmount = '';
|
|
58
|
-
|
|
59
|
-
if (fetchMetaStatus !== 'success') {
|
|
63
|
+
if (loadingStatus !== 'success') {
|
|
60
64
|
fromChainString = searchParamsRef.current[SearchParams.FROM_CHAIN];
|
|
61
65
|
fromTokenString = searchParamsRef.current[SearchParams.FROM_TOKEN];
|
|
62
66
|
toChainString = searchParamsRef.current[SearchParams.TO_CHAIN];
|
|
@@ -64,6 +68,9 @@ export function UpdateUrl() {
|
|
|
64
68
|
fromAmount =
|
|
65
69
|
searchParamsRef.current[SearchParams.FROM_AMOUNT] || inputAmount;
|
|
66
70
|
} else {
|
|
71
|
+
if (location.state === 'redirect') {
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
67
74
|
fromChainString = fromBlockchain?.name || '';
|
|
68
75
|
fromTokenString =
|
|
69
76
|
(fromToken?.symbol || '') +
|
|
@@ -87,9 +94,6 @@ export function UpdateUrl() {
|
|
|
87
94
|
...(fromAmount && {
|
|
88
95
|
[SearchParams.FROM_AMOUNT]: fromAmount.toString(),
|
|
89
96
|
}),
|
|
90
|
-
...(autoConnect && {
|
|
91
|
-
[SearchParams.AUTO_CONNECT]: autoConnect,
|
|
92
|
-
}),
|
|
93
97
|
},
|
|
94
98
|
{ replace: true }
|
|
95
99
|
);
|
|
@@ -105,7 +109,7 @@ export function UpdateUrl() {
|
|
|
105
109
|
]);
|
|
106
110
|
|
|
107
111
|
useEffect(() => {
|
|
108
|
-
if (
|
|
112
|
+
if (loadingStatus === 'success') {
|
|
109
113
|
const fromChainString = searchParams.get(SearchParams.FROM_CHAIN);
|
|
110
114
|
const fromTokenString = searchParams.get(SearchParams.FROM_TOKEN);
|
|
111
115
|
const toChainString = searchParams.get(SearchParams.TO_CHAIN);
|
|
@@ -130,29 +134,20 @@ export function UpdateUrl() {
|
|
|
130
134
|
if (!!fromBlockchain) {
|
|
131
135
|
setFromBlockchain(fromBlockchain);
|
|
132
136
|
if (!!fromToken) {
|
|
133
|
-
setFromToken(
|
|
134
|
-
token: fromToken,
|
|
135
|
-
meta: {
|
|
136
|
-
blockchains: blockchains,
|
|
137
|
-
tokens: tokens,
|
|
138
|
-
},
|
|
139
|
-
});
|
|
137
|
+
setFromToken(fromToken);
|
|
140
138
|
}
|
|
141
139
|
}
|
|
142
140
|
if (!!toBlockchain) {
|
|
143
141
|
setToBlockchain(toBlockchain);
|
|
144
142
|
if (!!toToken) {
|
|
145
|
-
setToToken(
|
|
146
|
-
token: toToken,
|
|
147
|
-
meta: { blockchains: blockchains, tokens: tokens },
|
|
148
|
-
});
|
|
143
|
+
setToToken(toToken);
|
|
149
144
|
}
|
|
150
145
|
}
|
|
151
146
|
if (fromAmount) {
|
|
152
147
|
setInputAmount(fromAmount);
|
|
153
148
|
}
|
|
154
149
|
}
|
|
155
|
-
}, [
|
|
150
|
+
}, [loadingStatus]);
|
|
156
151
|
|
|
157
152
|
return null;
|
|
158
153
|
}
|
|
@@ -8,13 +8,11 @@ import {
|
|
|
8
8
|
} from '@rango-dev/queue-manager-rango-preset';
|
|
9
9
|
import { useEffect } from 'react';
|
|
10
10
|
|
|
11
|
-
import { useAppStore } from '../store/AppStore';
|
|
12
11
|
import { useNotificationStore } from '../store/notification';
|
|
13
12
|
import { useWalletsStore } from '../store/wallets';
|
|
14
13
|
import { validBlockedStatuses } from '../types/notification';
|
|
15
14
|
|
|
16
15
|
export function WidgetEvents() {
|
|
17
|
-
const tokens = useAppStore().tokens();
|
|
18
16
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
19
17
|
const getWalletsDetails = useWalletsStore.use.getWalletsDetails();
|
|
20
18
|
const setNotification = useNotificationStore.use.setNotification();
|
|
@@ -40,8 +38,8 @@ export function WidgetEvents() {
|
|
|
40
38
|
(wallet) => wallet.chain === step?.toBlockchain
|
|
41
39
|
);
|
|
42
40
|
|
|
43
|
-
fromAccount && getWalletsDetails([fromAccount]
|
|
44
|
-
toAccount && getWalletsDetails([toAccount]
|
|
41
|
+
fromAccount && getWalletsDetails([fromAccount]);
|
|
42
|
+
toAccount && getWalletsDetails([toAccount]);
|
|
45
43
|
}
|
|
46
44
|
if (
|
|
47
45
|
(event.type === StepEventType.TX_EXECUTION_BLOCKED &&
|