@rango-dev/widget-embedded 0.12.1-next.2 → 0.12.1-next.21
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/dist/Wallets.d.ts +4 -3
- package/dist/Wallets.d.ts.map +1 -1
- package/dist/Widget.d.ts +3 -2
- package/dist/Widget.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +3 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +307 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts +8 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts.map +1 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts +3 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/index.d.ts +2 -0
- package/dist/components/BlockchainList/index.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts +5 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts +156 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts +6 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/index.d.ts +2 -0
- package/dist/components/BlockchainsChip/index.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts +3 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts +4 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +154 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts +9 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/index.d.ts +2 -0
- package/dist/components/BlockchainsSection/index.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +6 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +2597 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +11 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +460 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +12 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -0
- package/dist/components/HeaderButtons/BackButton.d.ts +5 -0
- package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts +5 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +895 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +12 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts +4 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts +3 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts +5 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/index.d.ts +5 -0
- package/dist/components/HeaderButtons/index.d.ts.map +1 -0
- package/dist/components/Layout/Layout.d.ts +7 -0
- package/dist/components/Layout/Layout.d.ts.map +1 -0
- package/dist/components/Layout/Layout.styles.d.ts +464 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -0
- package/dist/components/Layout/Layout.types.d.ts +17 -0
- package/dist/components/Layout/Layout.types.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts +3 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +155 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts +2 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts.map +1 -0
- 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 +3 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +460 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/index.d.ts +2 -0
- package/dist/components/LoadingSwapDetails/index.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/NoRoutes/NoRoutes.styles.d.ts +460 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.types.d.ts +20 -0
- 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 +3 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +613 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts +3 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts.map +1 -0
- package/dist/components/NotificationContent/index.d.ts +2 -0
- package/dist/components/NotificationContent/index.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts +613 -0
- 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/SearchInput/SearchInput.d.ts +4 -0
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts +154 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +10 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -0
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/SearchInput/index.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +460 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts +12 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/index.d.ts +2 -0
- package/dist/components/SelectableCategoryList/index.d.ts.map +1 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +766 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -0
- package/dist/components/SettingsContainer/index.d.ts +2 -0
- package/dist/components/SettingsContainer/index.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.d.ts +3 -0
- package/dist/components/Slippage/Slippage.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.styles.d.ts +613 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts +3 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts.map +1 -0
- package/dist/components/Slippage/index.d.ts +2 -0
- package/dist/components/Slippage/index.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +8 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +919 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts +12 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts.map +1 -0
- package/dist/components/SwapDetails/index.d.ts +2 -0
- package/dist/components/SwapDetails/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +154 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +20 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts +3 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +154 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +46 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/index.d.ts +4 -0
- package/dist/components/SwapDetailsModal/index.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts +4 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +613 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts +12 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +1 -0
- package/dist/components/SwapsGroup/index.d.ts +2 -0
- package/dist/components/SwapsGroup/index.d.ts.map +1 -0
- package/dist/components/SwitchFromAndTo.d.ts +1 -1
- package/dist/components/SwitchFromAndTo.d.ts.map +1 -1
- package/dist/components/TokenList/LoadingTokenList.d.ts +4 -0
- package/dist/components/TokenList/LoadingTokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.d.ts +4 -0
- package/dist/components/TokenList/TokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts +3 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.styles.d.ts +1532 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.types.d.ts +41 -0
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -0
- package/dist/components/TokenList/index.d.ts +3 -0
- package/dist/components/TokenList/index.d.ts.map +1 -0
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModal.d.ts +4 -0
- package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +613 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -0
- package/dist/components/WalletModal/index.d.ts +2 -0
- package/dist/components/WalletModal/index.d.ts.map +1 -0
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +29 -0
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +7 -0
- package/dist/constants/messages.d.ts.map +1 -0
- package/dist/constants/navigationRoutes.d.ts +8 -4
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/routing.d.ts +13 -0
- package/dist/constants/routing.d.ts.map +1 -0
- package/dist/constants/searchParams.d.ts +2 -2
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/constants/swapSettings.d.ts.map +1 -1
- package/dist/constants/wallets.d.ts +3 -0
- package/dist/constants/wallets.d.ts.map +1 -0
- package/dist/constants/warnings.d.ts +3 -0
- package/dist/constants/warnings.d.ts.map +1 -0
- package/dist/globalStyles.d.ts +1 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap.d.ts +14 -6
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useFetchBestRoute.d.ts +9 -0
- package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts +12 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts +3 -29
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts +20 -0
- package/dist/hooks/useWalletList.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +6 -3
- 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 +3 -0
- package/dist/pages/LanguagePage.d.ts.map +1 -0
- package/dist/pages/LiquiditySourcePage.d.ts +8 -0
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -0
- package/dist/pages/SelectBlockchainPage.d.ts +8 -0
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -0
- package/dist/pages/SelectSwapItemsPage.d.ts +11 -0
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts +3 -0
- package/dist/pages/ThemePage.d.ts.map +1 -0
- package/dist/pages/WalletsPage.d.ts +4 -2
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +32 -19
- package/dist/store/bestRoute.d.ts.map +1 -1
- package/dist/store/meta.d.ts +10 -3
- package/dist/store/meta.d.ts.map +1 -1
- package/dist/store/notification.d.ts +38 -0
- package/dist/store/notification.d.ts.map +1 -0
- package/dist/store/settings.d.ts +2 -2
- package/dist/store/settings.d.ts.map +1 -1
- package/dist/store/ui.d.ts +0 -2
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -12
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +11 -6
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/notification.d.ts +22 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/routing.d.ts +30 -23
- package/dist/types/routing.d.ts.map +1 -1
- package/dist/types/swap.d.ts +8 -1
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/utils/common.d.ts +5 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +3 -0
- package/dist/utils/meta.d.ts.map +1 -0
- package/dist/utils/numbers.d.ts +2 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +10 -7
- package/dist/utils/routing.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +10 -0
- package/dist/utils/settings.d.ts.map +1 -0
- package/dist/utils/swap.d.ts +29 -14
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +20 -14
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Wallets.tsx +23 -17
- package/src/Widget.tsx +88 -28
- package/src/components/AppRouter.tsx +36 -6
- package/src/components/AppRoutes.tsx +54 -19
- package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
- package/src/components/BlockchainList/BlockchainList.styles.ts +19 -0
- package/src/components/BlockchainList/BlockchainList.tsx +73 -0
- package/src/components/BlockchainList/BlockchainList.types.ts +8 -0
- package/src/components/BlockchainList/LoadingBlockchainList.tsx +20 -0
- package/src/components/BlockchainList/index.ts +1 -0
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +30 -0
- package/src/components/BlockchainsChip/BlockchainsChip.tsx +15 -0
- package/src/components/BlockchainsChip/BlockchainsChip.types.ts +4 -0
- package/src/components/BlockchainsChip/index.ts +1 -0
- package/src/components/BlockchainsSection/BlockchainSection.helpers.ts +20 -0
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +100 -0
- package/src/components/BlockchainsSection/BlockchainsSection.types.ts +9 -0
- package/src/components/BlockchainsSection/index.ts +1 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +86 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +169 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +460 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +11 -0
- package/src/components/ConfirmWalletsModal/WalletList.styles.ts +34 -0
- package/src/components/ConfirmWalletsModal/WalletList.tsx +250 -0
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +12 -0
- package/src/components/HeaderButtons/BackButton.tsx +16 -0
- package/src/components/HeaderButtons/CancelButton.tsx +21 -0
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +40 -0
- package/src/components/HeaderButtons/HeaderButtons.types.ts +11 -0
- package/src/components/HeaderButtons/HomeButtons.tsx +68 -0
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +20 -0
- package/src/components/HeaderButtons/WalletButton.tsx +20 -0
- package/src/components/HeaderButtons/index.ts +4 -0
- package/src/components/Layout/Layout.styles.ts +50 -0
- package/src/components/Layout/Layout.tsx +72 -0
- package/src/components/Layout/Layout.types.ts +20 -0
- package/src/components/Layout/index.ts +1 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +5 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +23 -0
- package/src/components/LoadingLiquiditySourceList/index.ts +1 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +78 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +53 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
- package/src/components/LoadingSwapDetails/index.ts +1 -0
- package/src/components/NoRoutes/NoRoutes.helper.ts +50 -0
- package/src/components/NoRoutes/NoRoutes.styles.ts +15 -0
- package/src/components/NoRoutes/NoRoutes.tsx +81 -0
- package/src/components/NoRoutes/NoRoutes.types.ts +21 -0
- package/src/components/NoRoutes/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.styles.ts +34 -0
- package/src/components/NotificationContent/NotificationContent.tsx +107 -0
- package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
- package/src/components/NotificationContent/index.ts +1 -0
- package/src/components/RouteErrors/RouteErrors.styles.ts +28 -0
- package/src/components/RouteErrors/RouteErrors.tsx +79 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +128 -0
- package/src/components/RouteErrors/RouteErrorsModalItem.tsx +24 -0
- package/src/components/RouteErrors/index.ts +1 -0
- package/src/components/SearchInput/SearchInput.styles.ts +9 -0
- package/src/components/SearchInput/SearchInput.tsx +51 -0
- package/src/components/SearchInput/SearchInput.types.ts +10 -0
- package/src/components/SearchInput/index.ts +1 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +20 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.styles.ts +21 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +79 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.types.ts +12 -0
- package/src/components/SelectableCategoryList/index.ts +1 -0
- package/src/components/SettingsContainer/SettingsContainer.style.ts +33 -0
- package/src/components/SettingsContainer/index.ts +7 -0
- package/src/components/Slippage/Slippage.styles.ts +24 -0
- package/src/components/Slippage/Slippage.tsx +90 -0
- package/src/components/Slippage/SlippageTooltipContent.tsx +23 -0
- package/src/components/Slippage/index.ts +1 -0
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +79 -0
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +85 -0
- package/src/components/SwapDetails/SwapDetails.styles.ts +68 -0
- package/src/components/SwapDetails/SwapDetails.tsx +419 -0
- package/src/components/SwapDetails/SwapDetails.types.ts +12 -0
- package/src/components/SwapDetails/index.ts +1 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +36 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +55 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +7 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +74 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +28 -0
- package/src/components/SwapDetailsAlerts/index.ts +2 -0
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +101 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +31 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +22 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +6 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +45 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +54 -0
- package/src/components/SwapDetailsModal/index.ts +3 -0
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +26 -0
- package/src/components/SwapsGroup/SwapsGroup.tsx +125 -0
- package/src/components/SwapsGroup/SwapsGroup.types.ts +13 -0
- package/src/components/SwapsGroup/index.ts +1 -0
- package/src/components/SwitchFromAndTo.tsx +23 -41
- package/src/components/TokenList/LoadingTokenList.tsx +34 -0
- package/src/components/TokenList/TokenList.helpers.ts +13 -0
- package/src/components/TokenList/TokenList.styles.ts +121 -0
- package/src/components/TokenList/TokenList.tsx +271 -0
- package/src/components/TokenList/TokenList.types.ts +48 -0
- package/src/components/TokenList/index.ts +2 -0
- package/src/components/UpdateUrl.tsx +40 -22
- package/src/components/WalletModal/WalletModal.tsx +20 -0
- package/src/components/WalletModal/WalletModal.types.ts +11 -0
- package/src/components/WalletModal/WalletModalContent.styles.ts +44 -0
- package/src/components/WalletModal/WalletModalContent.tsx +54 -0
- package/src/components/WalletModal/index.ts +1 -0
- package/src/components/WidgetEvents.tsx +37 -5
- package/src/constants/errors.ts +56 -1
- package/src/constants/messages.ts +8 -0
- package/src/constants/navigationRoutes.ts +8 -4
- package/src/constants/routing.ts +17 -0
- package/src/constants/searchParams.ts +2 -2
- package/src/constants/swapSettings.ts +5 -1
- package/src/constants/wallets.ts +3 -0
- package/src/constants/warnings.ts +26 -0
- package/src/globalStyles.ts +1 -4
- package/src/hooks/useConfirmSwap.ts +251 -220
- package/src/hooks/useFetchBestRoute.ts +38 -0
- package/src/hooks/useNavigateBack.ts +25 -9
- package/src/hooks/useSwapInput.ts +116 -0
- package/src/hooks/useTheme.ts +35 -74
- package/src/hooks/useWalletList.ts +125 -0
- package/src/pages/ConfirmSwapPage.tsx +492 -228
- package/src/pages/HistoryPage.tsx +104 -15
- package/src/pages/Home.tsx +392 -110
- package/src/pages/LanguagePage.tsx +83 -0
- package/src/pages/LiquiditySourcePage.tsx +160 -0
- package/src/pages/SelectBlockchainPage.tsx +77 -0
- package/src/pages/SelectSwapItemsPage.tsx +169 -0
- package/src/pages/SettingsPage.tsx +144 -72
- package/src/pages/SwapDetailsPage.tsx +40 -141
- package/src/pages/ThemePage.tsx +96 -0
- package/src/pages/WalletsPage.tsx +73 -124
- package/src/store/bestRoute.ts +85 -180
- package/src/store/meta.ts +23 -3
- package/src/store/notification.ts +77 -0
- package/src/store/settings.ts +20 -13
- package/src/store/ui.ts +1 -5
- package/src/store/wallets.ts +92 -76
- package/src/types/config.ts +12 -7
- package/src/types/notification.ts +33 -0
- package/src/types/routing.ts +29 -28
- package/src/types/swap.ts +9 -1
- package/src/utils/common.ts +53 -3
- package/src/utils/configs.ts +3 -0
- package/src/utils/date.ts +15 -18
- package/src/utils/meta.ts +9 -0
- package/src/utils/numbers.ts +63 -18
- package/src/utils/routing.ts +105 -27
- package/src/utils/settings.ts +57 -0
- package/src/utils/swap.ts +200 -113
- package/src/utils/wallets.ts +165 -116
- package/dist/components/ConfirmSwapErrors.d.ts +0 -4
- package/dist/components/ConfirmSwapErrors.d.ts.map +0 -1
- package/dist/components/ConfirmSwapWarnings.d.ts +0 -3
- package/dist/components/ConfirmSwapWarnings.d.ts.map +0 -1
- package/dist/components/Layout.d.ts +0 -7
- package/dist/components/Layout.d.ts.map +0 -1
- package/dist/pages/LiquiditySourcesPage.d.ts +0 -7
- package/dist/pages/LiquiditySourcesPage.d.ts.map +0 -1
- package/dist/pages/SelectChainPage.d.ts +0 -8
- package/dist/pages/SelectChainPage.d.ts.map +0 -1
- package/dist/pages/SelectTokenPage.d.ts +0 -15
- package/dist/pages/SelectTokenPage.d.ts.map +0 -1
- package/src/components/ConfirmSwapErrors.tsx +0 -34
- package/src/components/ConfirmSwapWarnings.tsx +0 -22
- package/src/components/Layout.tsx +0 -105
- package/src/pages/LiquiditySourcesPage.tsx +0 -63
- package/src/pages/SelectChainPage.tsx +0 -42
- package/src/pages/SelectTokenPage.tsx +0 -64
|
@@ -1,60 +1,42 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { styled, Button, VerticalSwapIcon } from '@rango-dev/ui';
|
|
4
|
-
import { SearchParams } from '../constants/searchParams';
|
|
5
|
-
import { useBestRouteStore } from '../store/bestRoute';
|
|
6
|
-
|
|
7
|
-
function SwithFromAndTo({ count }: { count: number }) {
|
|
8
|
-
const firstRender = useRef(true);
|
|
9
|
-
const [searchParams, setSearchParams] = useSearchParams();
|
|
10
|
-
const outputAmount = useBestRouteStore.use.outputAmount();
|
|
1
|
+
import { ReverseIcon, styled } from '@rango-dev/ui';
|
|
2
|
+
import React from 'react';
|
|
11
3
|
|
|
12
|
-
|
|
13
|
-
if (!firstRender.current) {
|
|
14
|
-
const fromChainString = searchParams.get(SearchParams.FROM_CHAIN);
|
|
15
|
-
const fromTokenString = searchParams.get(SearchParams.FROM_TOKEN);
|
|
16
|
-
const toChainString = searchParams.get(SearchParams.TO_CHAIN);
|
|
17
|
-
const toTokenString = searchParams.get(SearchParams.TO_TOKEN);
|
|
18
|
-
setSearchParams({
|
|
19
|
-
...(toChainString && { [SearchParams.FROM_CHAIN]: toChainString }),
|
|
20
|
-
...(toTokenString && { [SearchParams.FROM_TOKEN]: toTokenString }),
|
|
21
|
-
...(fromChainString && { [SearchParams.TO_CHAIN]: fromChainString }),
|
|
22
|
-
...(fromTokenString && { [SearchParams.TO_TOKEN]: fromTokenString }),
|
|
23
|
-
...(outputAmount && {
|
|
24
|
-
[SearchParams.FROM_AMOUNT]: outputAmount.toString(),
|
|
25
|
-
}),
|
|
26
|
-
});
|
|
27
|
-
} else {
|
|
28
|
-
firstRender.current = false;
|
|
29
|
-
}
|
|
30
|
-
}, [count]);
|
|
31
|
-
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
4
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
34
5
|
|
|
35
6
|
const SwitchButtonContainer = styled('div', {
|
|
36
7
|
position: 'absolute',
|
|
37
8
|
bottom: '-12px',
|
|
38
9
|
left: '50%',
|
|
39
10
|
transform: 'translate(-50%, 10%)',
|
|
11
|
+
cursor: 'pointer',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
const StyledButton = styled('div', {
|
|
15
|
+
borderRadius: '$md',
|
|
16
|
+
border: '3px solid $background',
|
|
17
|
+
background: '$neutral100',
|
|
18
|
+
width: '$24',
|
|
19
|
+
height: '$24',
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
color: '$foreground',
|
|
24
|
+
'&:hover': {
|
|
25
|
+
color: '$secondary500',
|
|
26
|
+
},
|
|
40
27
|
});
|
|
41
28
|
|
|
42
|
-
export function
|
|
29
|
+
export function SwitchFromAndToButton() {
|
|
43
30
|
const switchFromAndTo = useBestRouteStore.use.switchFromAndTo();
|
|
44
|
-
const isRouterInContext = useInRouterContext();
|
|
45
|
-
const [count, setCount] = useState(0);
|
|
46
31
|
|
|
47
32
|
return (
|
|
48
33
|
<SwitchButtonContainer>
|
|
49
|
-
<
|
|
50
|
-
variant="ghost"
|
|
34
|
+
<StyledButton
|
|
51
35
|
onClick={() => {
|
|
52
36
|
switchFromAndTo();
|
|
53
|
-
setCount((prev) => prev + 1);
|
|
54
37
|
}}>
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
</Button>
|
|
38
|
+
<ReverseIcon size={12} />
|
|
39
|
+
</StyledButton>
|
|
58
40
|
</SwitchButtonContainer>
|
|
59
41
|
);
|
|
60
42
|
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LoadingTokenListProps } from './TokenList.types';
|
|
2
|
+
|
|
3
|
+
import { Divider, ListItem, Skeleton } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { End, List } from './TokenList.styles';
|
|
7
|
+
|
|
8
|
+
export function LoadingTokenList(props: LoadingTokenListProps) {
|
|
9
|
+
return (
|
|
10
|
+
<List>
|
|
11
|
+
{Array.from(Array(props.size), (e) => (
|
|
12
|
+
<ListItem
|
|
13
|
+
key={e}
|
|
14
|
+
hasDivider
|
|
15
|
+
start={<Skeleton variant="circular" width={35} height={35} />}
|
|
16
|
+
end={
|
|
17
|
+
<End>
|
|
18
|
+
<Skeleton variant="text" size="large" width={70} />
|
|
19
|
+
<Divider size={4} />
|
|
20
|
+
<Skeleton variant="text" size="medium" width={50} />
|
|
21
|
+
</End>
|
|
22
|
+
}
|
|
23
|
+
title={
|
|
24
|
+
<div>
|
|
25
|
+
<Skeleton variant="text" size="large" width={90} />
|
|
26
|
+
<Divider size={4} />
|
|
27
|
+
<Skeleton variant="text" size="medium" width={90} />
|
|
28
|
+
</div>
|
|
29
|
+
}
|
|
30
|
+
/>
|
|
31
|
+
))}
|
|
32
|
+
</List>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { TokenWithBalance } from './TokenList.types';
|
|
2
|
+
|
|
3
|
+
import { containsText } from '../../utils/common';
|
|
4
|
+
|
|
5
|
+
export const filterTokens = (list: TokenWithBalance[], searchedFor: string) =>
|
|
6
|
+
list
|
|
7
|
+
.filter(
|
|
8
|
+
(token) =>
|
|
9
|
+
containsText(token.symbol, searchedFor) ||
|
|
10
|
+
containsText(token.address || '', searchedFor) ||
|
|
11
|
+
containsText(token.name || '', searchedFor)
|
|
12
|
+
)
|
|
13
|
+
.sort((a, b) => (b.pin as any) - (a.pin as any));
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { styled, Typography } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
flexDirection: 'column',
|
|
6
|
+
flexGrow: 1,
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const Title = styled('div', {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
alignItems: 'center',
|
|
12
|
+
'._typography': {
|
|
13
|
+
textOverflow: 'ellipsis',
|
|
14
|
+
whiteSpace: 'nowrap',
|
|
15
|
+
maxWidth: 100,
|
|
16
|
+
overflow: 'hidden',
|
|
17
|
+
},
|
|
18
|
+
});
|
|
19
|
+
export const List = styled('ul', {
|
|
20
|
+
flexGrow: 1,
|
|
21
|
+
padding: 0,
|
|
22
|
+
margin: 0,
|
|
23
|
+
listStyle: 'none',
|
|
24
|
+
'& li': {
|
|
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
|
+
},
|
|
36
|
+
|
|
37
|
+
'.token-address': {
|
|
38
|
+
transform: 'translateY(12px)',
|
|
39
|
+
visibility: 'hidden',
|
|
40
|
+
'& a': {
|
|
41
|
+
fontSize: '$12',
|
|
42
|
+
lineHeight: '$16',
|
|
43
|
+
color: '$neutral800',
|
|
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
|
+
},
|
|
57
|
+
'&:hover': {
|
|
58
|
+
'.description': {
|
|
59
|
+
'.token-address': {
|
|
60
|
+
position: 'absolute',
|
|
61
|
+
transform: 'none',
|
|
62
|
+
transition: 'transform 225ms cubic-bezier(0, 0, 0.2, 1) 0ms',
|
|
63
|
+
visibility: 'visible',
|
|
64
|
+
},
|
|
65
|
+
'.token-address-without-name': {
|
|
66
|
+
bottom: '-15px',
|
|
67
|
+
},
|
|
68
|
+
'.token-name': {
|
|
69
|
+
position: 'absolute',
|
|
70
|
+
transform: 'translateY(-12px)',
|
|
71
|
+
visibility: 'hidden',
|
|
72
|
+
},
|
|
73
|
+
'.token-title': {
|
|
74
|
+
position: 'absolute',
|
|
75
|
+
transform: 'translateY(-12px)',
|
|
76
|
+
bottom: '-10px',
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
},
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
export const Tag = styled('div', {
|
|
84
|
+
paddingLeft: '$5',
|
|
85
|
+
paddingRight: '$5',
|
|
86
|
+
borderRadius: '$md',
|
|
87
|
+
display: 'flex',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
export const TagTitle = styled(Typography, {});
|
|
92
|
+
|
|
93
|
+
export const BalanceContainer = styled('div', {
|
|
94
|
+
textAlign: 'right',
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
export const End = styled('ul', {
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'end',
|
|
100
|
+
flexDirection: 'column',
|
|
101
|
+
});
|
|
102
|
+
|
|
103
|
+
export const Description = styled('div', {
|
|
104
|
+
display: 'flex',
|
|
105
|
+
alignItems: 'center',
|
|
106
|
+
});
|
|
107
|
+
export const ImageSection = styled('div', {
|
|
108
|
+
position: 'relative',
|
|
109
|
+
'.image-container': {
|
|
110
|
+
borderRadius: '$xm',
|
|
111
|
+
overflow: 'hidden',
|
|
112
|
+
},
|
|
113
|
+
});
|
|
114
|
+
export const Pin = styled('div', {
|
|
115
|
+
position: 'absolute',
|
|
116
|
+
backgroundColor: '$neutral100',
|
|
117
|
+
padding: '$4',
|
|
118
|
+
borderRadius: '50%',
|
|
119
|
+
bottom: -6,
|
|
120
|
+
right: -6,
|
|
121
|
+
});
|
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
import type {
|
|
3
|
+
PropTypes,
|
|
4
|
+
RenderDescProps,
|
|
5
|
+
TokenWithBalance,
|
|
6
|
+
} from './TokenList.types';
|
|
7
|
+
import type { CommonProps } from 'react-window';
|
|
8
|
+
|
|
9
|
+
import { i18n } from '@lingui/core';
|
|
10
|
+
import {
|
|
11
|
+
darkTheme,
|
|
12
|
+
Divider,
|
|
13
|
+
ExternalLinkIcon,
|
|
14
|
+
Image,
|
|
15
|
+
ListItemButton,
|
|
16
|
+
NotFound,
|
|
17
|
+
PinIcon,
|
|
18
|
+
Skeleton,
|
|
19
|
+
Typography,
|
|
20
|
+
VirtualizedList,
|
|
21
|
+
} from '@rango-dev/ui';
|
|
22
|
+
import React, { forwardRef, useEffect, useState } from 'react';
|
|
23
|
+
|
|
24
|
+
import { useMetaStore } from '../../store/meta';
|
|
25
|
+
import { useWalletsStore } from '../../store/wallets';
|
|
26
|
+
import { generateRangeColors } from '../../utils/common';
|
|
27
|
+
|
|
28
|
+
import { LoadingTokenList } from './LoadingTokenList';
|
|
29
|
+
import {
|
|
30
|
+
BalanceContainer,
|
|
31
|
+
Container,
|
|
32
|
+
End,
|
|
33
|
+
ImageSection,
|
|
34
|
+
List,
|
|
35
|
+
Pin,
|
|
36
|
+
Tag,
|
|
37
|
+
TagTitle,
|
|
38
|
+
Title,
|
|
39
|
+
} from './TokenList.styles';
|
|
40
|
+
|
|
41
|
+
const PAGE_SIZE = 20;
|
|
42
|
+
|
|
43
|
+
const renderDesc = (props: RenderDescProps) => {
|
|
44
|
+
const { address, name, url, token, customCssForTag, customCssForTagTitle } =
|
|
45
|
+
props;
|
|
46
|
+
const length = address.length;
|
|
47
|
+
|
|
48
|
+
return (
|
|
49
|
+
<div className="description">
|
|
50
|
+
{name ? (
|
|
51
|
+
<div className="token-name">{name}</div>
|
|
52
|
+
) : (
|
|
53
|
+
<Title className="token-title">
|
|
54
|
+
<Typography variant="title" size="xmedium">
|
|
55
|
+
{token.symbol}
|
|
56
|
+
</Typography>
|
|
57
|
+
<Divider direction="horizontal" size={4} />
|
|
58
|
+
<Tag css={customCssForTag}>
|
|
59
|
+
<TagTitle variant="body" size="xsmall" css={customCssForTagTitle}>
|
|
60
|
+
{token.blockchain}
|
|
61
|
+
</TagTitle>
|
|
62
|
+
</Tag>
|
|
63
|
+
</Title>
|
|
64
|
+
)}
|
|
65
|
+
|
|
66
|
+
{!!address && (
|
|
67
|
+
<div
|
|
68
|
+
className={`token-address ${!name && 'token-address-without-name'}`}>
|
|
69
|
+
<a
|
|
70
|
+
href={url}
|
|
71
|
+
target="_blank"
|
|
72
|
+
rel="nofollow noreferrer"
|
|
73
|
+
onClick={(e) => e.stopPropagation()}>
|
|
74
|
+
{length > 10
|
|
75
|
+
? `${address.slice(0, 5)}...${address.slice(length - 6, length)}`
|
|
76
|
+
: address}{' '}
|
|
77
|
+
<ExternalLinkIcon color="gray" size={12} />
|
|
78
|
+
</a>
|
|
79
|
+
</div>
|
|
80
|
+
)}
|
|
81
|
+
</div>
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
|
|
85
|
+
export function TokenList(props: PropTypes) {
|
|
86
|
+
const { list, searchedFor = '', onChange, selectedBlockchain } = props;
|
|
87
|
+
|
|
88
|
+
const [tokens, setTokens] = useState<TokenWithBalance[]>(list);
|
|
89
|
+
const loadingStatus = useMetaStore.use.loadingStatus();
|
|
90
|
+
const [hasNextPage, setHasNextPage] = useState<boolean>(true);
|
|
91
|
+
const loadingWallet = useWalletsStore.use.loading();
|
|
92
|
+
const { blockchains } = useMetaStore.use.meta();
|
|
93
|
+
|
|
94
|
+
// eslint-disable-next-line react/display-name
|
|
95
|
+
const innerElementType: React.FC<CommonProps> = forwardRef((render, ref) => {
|
|
96
|
+
return (
|
|
97
|
+
<div
|
|
98
|
+
{...render}
|
|
99
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
100
|
+
ref={ref as any}
|
|
101
|
+
style={{
|
|
102
|
+
...render.style,
|
|
103
|
+
height: `${parseFloat(render.style?.height as string) + 8 * 2}px`,
|
|
104
|
+
}}
|
|
105
|
+
/>
|
|
106
|
+
);
|
|
107
|
+
});
|
|
108
|
+
const loadNextPage = () => {
|
|
109
|
+
setTokens(list.slice(0, tokens.length + PAGE_SIZE));
|
|
110
|
+
};
|
|
111
|
+
|
|
112
|
+
useEffect(() => {
|
|
113
|
+
setHasNextPage(list.length > tokens.length);
|
|
114
|
+
}, [tokens.length]);
|
|
115
|
+
|
|
116
|
+
useEffect(() => {
|
|
117
|
+
setTokens(list.slice(0, PAGE_SIZE));
|
|
118
|
+
}, [list]);
|
|
119
|
+
|
|
120
|
+
const renderList = () => {
|
|
121
|
+
if (!tokens.length && !!searchedFor) {
|
|
122
|
+
return (
|
|
123
|
+
<>
|
|
124
|
+
<Divider size={32} />
|
|
125
|
+
<NotFound
|
|
126
|
+
title={i18n.t('No results found')}
|
|
127
|
+
description={i18n.t('Try using different keywords')}
|
|
128
|
+
/>
|
|
129
|
+
</>
|
|
130
|
+
);
|
|
131
|
+
}
|
|
132
|
+
return (
|
|
133
|
+
<VirtualizedList
|
|
134
|
+
Item={({ index, style }) => {
|
|
135
|
+
const address = tokens[index].address || '';
|
|
136
|
+
const blockchain = blockchains.find(
|
|
137
|
+
(blockchain) => blockchain.name === tokens[index].blockchain
|
|
138
|
+
);
|
|
139
|
+
const color = generateRangeColors(
|
|
140
|
+
tokens[index].symbol,
|
|
141
|
+
blockchain?.color || ''
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
const customCssForTag = {
|
|
145
|
+
$$color: color[`${tokens[index].symbol}100`],
|
|
146
|
+
[`.${darkTheme} &`]: {
|
|
147
|
+
$$color: color[`${tokens[index].symbol}900`],
|
|
148
|
+
},
|
|
149
|
+
backgroundColor: '$$color',
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
const customCssForTagTitle = {
|
|
153
|
+
$$color: color[`${tokens[index].symbol}700`],
|
|
154
|
+
[`.${darkTheme} &`]: {
|
|
155
|
+
$$color: color[`${tokens[index].symbol}100`],
|
|
156
|
+
},
|
|
157
|
+
color: '$$color',
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
return (
|
|
161
|
+
<div
|
|
162
|
+
style={{
|
|
163
|
+
...style,
|
|
164
|
+
paddingRight: 5,
|
|
165
|
+
}}>
|
|
166
|
+
<ListItemButton
|
|
167
|
+
style={{
|
|
168
|
+
height: style?.height,
|
|
169
|
+
}}
|
|
170
|
+
tab-index={index}
|
|
171
|
+
key={`${tokens[index].symbol}${tokens[index].address}`}
|
|
172
|
+
id={`${tokens[index].symbol}${tokens[index].address}`}
|
|
173
|
+
hasDivider
|
|
174
|
+
onClick={() => onChange(tokens[index])}
|
|
175
|
+
start={
|
|
176
|
+
<ImageSection>
|
|
177
|
+
<Image src={tokens[index].image} size={30} />
|
|
178
|
+
{tokens[index].pin && (
|
|
179
|
+
<Pin>
|
|
180
|
+
<PinIcon size={12} color="gray" />
|
|
181
|
+
</Pin>
|
|
182
|
+
)}
|
|
183
|
+
</ImageSection>
|
|
184
|
+
}
|
|
185
|
+
title={
|
|
186
|
+
blockchain?.type === 'COSMOS' ||
|
|
187
|
+
!!tokens[index].name ||
|
|
188
|
+
(!tokens[index].name && !address) ? (
|
|
189
|
+
<Title>
|
|
190
|
+
<Typography variant="title" size="xmedium">
|
|
191
|
+
{tokens[index].symbol}
|
|
192
|
+
</Typography>
|
|
193
|
+
<Divider direction="horizontal" size={4} />
|
|
194
|
+
<Tag css={customCssForTag}>
|
|
195
|
+
<TagTitle
|
|
196
|
+
variant="body"
|
|
197
|
+
size="xsmall"
|
|
198
|
+
css={customCssForTagTitle}>
|
|
199
|
+
{tokens[index].blockchain}
|
|
200
|
+
</TagTitle>
|
|
201
|
+
</Tag>
|
|
202
|
+
</Title>
|
|
203
|
+
) : undefined
|
|
204
|
+
}
|
|
205
|
+
description={
|
|
206
|
+
!!blockchain?.info &&
|
|
207
|
+
!!address &&
|
|
208
|
+
blockchain.type !== 'COSMOS'
|
|
209
|
+
? renderDesc({
|
|
210
|
+
address,
|
|
211
|
+
token: tokens[index],
|
|
212
|
+
customCssForTag,
|
|
213
|
+
customCssForTagTitle,
|
|
214
|
+
name: tokens[index].name,
|
|
215
|
+
url: blockchain.info.addressUrl
|
|
216
|
+
.split('{wallet}')
|
|
217
|
+
.join(address),
|
|
218
|
+
})
|
|
219
|
+
: tokens[index].name || undefined
|
|
220
|
+
}
|
|
221
|
+
end={
|
|
222
|
+
loadingWallet ? (
|
|
223
|
+
<End>
|
|
224
|
+
<Skeleton variant="text" size="large" width={70} />
|
|
225
|
+
<Divider size={4} />
|
|
226
|
+
<Skeleton variant="text" size="medium" width={50} />
|
|
227
|
+
</End>
|
|
228
|
+
) : (
|
|
229
|
+
tokens[index]?.balance && (
|
|
230
|
+
<BalanceContainer>
|
|
231
|
+
<Typography variant="title" size="small">
|
|
232
|
+
{tokens[index].balance?.amount}
|
|
233
|
+
</Typography>
|
|
234
|
+
<div />
|
|
235
|
+
{tokens[index].balance?.usdValue && (
|
|
236
|
+
<Typography
|
|
237
|
+
variant="body"
|
|
238
|
+
color="neutral800"
|
|
239
|
+
size="xsmall">
|
|
240
|
+
{`$${tokens[index].balance?.usdValue}`}
|
|
241
|
+
</Typography>
|
|
242
|
+
)}
|
|
243
|
+
</BalanceContainer>
|
|
244
|
+
)
|
|
245
|
+
)
|
|
246
|
+
}
|
|
247
|
+
/>
|
|
248
|
+
</div>
|
|
249
|
+
);
|
|
250
|
+
}}
|
|
251
|
+
hasNextPage={hasNextPage}
|
|
252
|
+
itemCount={tokens.length}
|
|
253
|
+
loadNextPage={loadNextPage}
|
|
254
|
+
innerElementType={innerElementType}
|
|
255
|
+
size={60}
|
|
256
|
+
key={`${selectedBlockchain}-${searchedFor}`}
|
|
257
|
+
/>
|
|
258
|
+
);
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
return (
|
|
262
|
+
<Container>
|
|
263
|
+
<Typography variant="label" size="large">
|
|
264
|
+
{i18n.t('Select Token')}
|
|
265
|
+
</Typography>
|
|
266
|
+
<Divider size={4} />
|
|
267
|
+
{loadingStatus === 'loading' && <LoadingTokenList size={PAGE_SIZE} />}
|
|
268
|
+
{loadingStatus === 'success' && <List>{renderList()}</List>}
|
|
269
|
+
</Container>
|
|
270
|
+
);
|
|
271
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Token } from 'rango-sdk';
|
|
2
|
+
|
|
3
|
+
export interface TokenWithBalance extends Token {
|
|
4
|
+
balance?: {
|
|
5
|
+
amount: string;
|
|
6
|
+
usdValue: string;
|
|
7
|
+
};
|
|
8
|
+
pin?: boolean;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export interface PropTypes {
|
|
12
|
+
list: TokenWithBalance[];
|
|
13
|
+
searchedFor?: string;
|
|
14
|
+
onChange: (token: TokenWithBalance) => void;
|
|
15
|
+
selectedBlockchain?: string;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface LoadingTokenListProps {
|
|
19
|
+
size: number;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface RenderDescProps {
|
|
23
|
+
name?: string | null;
|
|
24
|
+
address: string;
|
|
25
|
+
url: string;
|
|
26
|
+
token: TokenWithBalance;
|
|
27
|
+
customCssForTag: TagCSS;
|
|
28
|
+
customCssForTagTitle: TitleCSS;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
type TagCSS = {
|
|
32
|
+
[x: string]:
|
|
33
|
+
| string
|
|
34
|
+
| {
|
|
35
|
+
$$color: string;
|
|
36
|
+
};
|
|
37
|
+
$$color: string;
|
|
38
|
+
backgroundColor: string;
|
|
39
|
+
};
|
|
40
|
+
type TitleCSS = {
|
|
41
|
+
[x: string]:
|
|
42
|
+
| string
|
|
43
|
+
| {
|
|
44
|
+
$$color: string;
|
|
45
|
+
};
|
|
46
|
+
$$color: string;
|
|
47
|
+
color: string;
|
|
48
|
+
};
|