@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
|
@@ -0,0 +1,250 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
2
|
+
import type { PropTypes } from './WalletList.type';
|
|
3
|
+
import type { Wallet } from '../../types';
|
|
4
|
+
import type { WalletInfo } from '@rango-dev/ui';
|
|
5
|
+
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
Button,
|
|
9
|
+
Divider,
|
|
10
|
+
Image,
|
|
11
|
+
MessageBox,
|
|
12
|
+
Modal,
|
|
13
|
+
SelectableWallet,
|
|
14
|
+
Typography,
|
|
15
|
+
WalletState,
|
|
16
|
+
} from '@rango-dev/ui';
|
|
17
|
+
import React, { useEffect, useState } from 'react';
|
|
18
|
+
|
|
19
|
+
import { useWallets } from '../..';
|
|
20
|
+
import { useWalletList } from '../../hooks/useWalletList';
|
|
21
|
+
import { TIME_TO_CLOSE_MODAL } from '../../pages/WalletsPage';
|
|
22
|
+
import { useMetaStore } from '../../store/meta';
|
|
23
|
+
import { useWalletsStore } from '../../store/wallets';
|
|
24
|
+
import { getBlockchainDisplayNameFor } from '../../utils/meta';
|
|
25
|
+
import {
|
|
26
|
+
getAddress,
|
|
27
|
+
getConciseAddress,
|
|
28
|
+
isExperimentalChain,
|
|
29
|
+
} from '../../utils/wallets';
|
|
30
|
+
import { WalletModal } from '../WalletModal';
|
|
31
|
+
|
|
32
|
+
import { WalletButton } from './ConfirmWallets.styles';
|
|
33
|
+
import {
|
|
34
|
+
LogoContainer,
|
|
35
|
+
Spinner,
|
|
36
|
+
WalletImageContainer,
|
|
37
|
+
} from './WalletList.styles';
|
|
38
|
+
|
|
39
|
+
export function WalletList(props: PropTypes) {
|
|
40
|
+
const { config, chain, isSelected, selectWallet, limit, onShowMore } = props;
|
|
41
|
+
|
|
42
|
+
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
43
|
+
const { blockchains } = useMetaStore.use.meta();
|
|
44
|
+
const [openWalletStateModal, setOpenWalletStateModal] =
|
|
45
|
+
useState<WalletType>('');
|
|
46
|
+
const [experimentalChainWallet, setExperimentalChainWallet] =
|
|
47
|
+
useState<Wallet | null>(null);
|
|
48
|
+
const [showExperimentalChainModal, setShowExperimentalChainModal] =
|
|
49
|
+
useState(false);
|
|
50
|
+
const [addingExperimentalChainStatus, setAddingExperimentalChainStatus] =
|
|
51
|
+
useState<'in-progress' | 'completed' | null>(null);
|
|
52
|
+
const { connect } = useWallets();
|
|
53
|
+
const { list, error, handleClick } = useWalletList({
|
|
54
|
+
config,
|
|
55
|
+
chain,
|
|
56
|
+
onBeforeConnect: setOpenWalletStateModal,
|
|
57
|
+
onConnect: () =>
|
|
58
|
+
setTimeout(() => setOpenWalletStateModal(''), TIME_TO_CLOSE_MODAL),
|
|
59
|
+
});
|
|
60
|
+
const [sortedList, setSortedList] = useState<WalletInfo[]>(list);
|
|
61
|
+
const numberOfSupportedWallets = list.length;
|
|
62
|
+
const shouldShowMoreWallets = limit && numberOfSupportedWallets - limit > 0;
|
|
63
|
+
|
|
64
|
+
const addExperimentalChain = async (wallet: Wallet) => {
|
|
65
|
+
setShowExperimentalChainModal(false);
|
|
66
|
+
setAddingExperimentalChainStatus('in-progress');
|
|
67
|
+
await connect(wallet.walletType, wallet.chain);
|
|
68
|
+
setAddingExperimentalChainStatus('completed');
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
useEffect(() => {
|
|
72
|
+
setSortedList((sortedList) => {
|
|
73
|
+
const selectedWalletIndex = list.findIndex((wallet) =>
|
|
74
|
+
isSelected(wallet.type, chain)
|
|
75
|
+
);
|
|
76
|
+
|
|
77
|
+
if (shouldShowMoreWallets && selectedWalletIndex > 1) {
|
|
78
|
+
return [list[selectedWalletIndex]].concat(
|
|
79
|
+
list.filter((_, index) => index !== selectedWalletIndex)
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
return sortedList.map(
|
|
83
|
+
(sortedItem) =>
|
|
84
|
+
list.find((listItem) => listItem.type === sortedItem.type) ??
|
|
85
|
+
sortedItem
|
|
86
|
+
);
|
|
87
|
+
});
|
|
88
|
+
}, [JSON.stringify(list)]);
|
|
89
|
+
|
|
90
|
+
const modalContainer = document.querySelector('#swap-box') as HTMLDivElement;
|
|
91
|
+
|
|
92
|
+
useEffect(() => {
|
|
93
|
+
let timeout: ReturnType<typeof setTimeout> | null = null;
|
|
94
|
+
if (addingExperimentalChainStatus === 'completed') {
|
|
95
|
+
timeout = setTimeout(
|
|
96
|
+
() => setAddingExperimentalChainStatus(null),
|
|
97
|
+
TIME_TO_CLOSE_MODAL
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
return () => {
|
|
102
|
+
if (timeout) {
|
|
103
|
+
clearTimeout(timeout);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
}, [addingExperimentalChainStatus]);
|
|
107
|
+
|
|
108
|
+
return (
|
|
109
|
+
<>
|
|
110
|
+
{sortedList.slice(0, limit).map((wallet) => {
|
|
111
|
+
const address = getAddress({
|
|
112
|
+
connectedWallets,
|
|
113
|
+
walletType: wallet.type,
|
|
114
|
+
chain,
|
|
115
|
+
});
|
|
116
|
+
const conciseAddress = address ? getConciseAddress(address) : '';
|
|
117
|
+
|
|
118
|
+
const experimentalChain = isExperimentalChain(blockchains, chain);
|
|
119
|
+
|
|
120
|
+
const experimentalChainNotAdded = !connectedWallets.find(
|
|
121
|
+
(connectedWallet) =>
|
|
122
|
+
connectedWallet.walletType === wallet.type &&
|
|
123
|
+
connectedWallet.chain === chain
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
const couldAddExperimentalChain =
|
|
127
|
+
experimentalChain &&
|
|
128
|
+
experimentalChainNotAdded &&
|
|
129
|
+
wallet.state === WalletState.CONNECTED;
|
|
130
|
+
|
|
131
|
+
const connectedWalletDescription = couldAddExperimentalChain
|
|
132
|
+
? `Add ${chain} chain`
|
|
133
|
+
: conciseAddress;
|
|
134
|
+
|
|
135
|
+
const onClick = () => {
|
|
136
|
+
if (wallet.state === WalletState.DISCONNECTED) {
|
|
137
|
+
void handleClick(wallet.type);
|
|
138
|
+
} else if (couldAddExperimentalChain) {
|
|
139
|
+
setExperimentalChainWallet({
|
|
140
|
+
walletType: wallet.type,
|
|
141
|
+
chain,
|
|
142
|
+
address: address ?? '',
|
|
143
|
+
});
|
|
144
|
+
setShowExperimentalChainModal(true);
|
|
145
|
+
} else {
|
|
146
|
+
selectWallet({
|
|
147
|
+
walletType: wallet.type,
|
|
148
|
+
chain,
|
|
149
|
+
address: address ?? '',
|
|
150
|
+
});
|
|
151
|
+
}
|
|
152
|
+
};
|
|
153
|
+
|
|
154
|
+
const blockchainDisplayName: string | undefined =
|
|
155
|
+
experimentalChainWallet?.chain
|
|
156
|
+
? getBlockchainDisplayNameFor(
|
|
157
|
+
experimentalChainWallet.chain,
|
|
158
|
+
blockchains
|
|
159
|
+
)
|
|
160
|
+
: undefined;
|
|
161
|
+
return (
|
|
162
|
+
<>
|
|
163
|
+
{openWalletStateModal === wallet.type && (
|
|
164
|
+
<WalletModal
|
|
165
|
+
open={openWalletStateModal === wallet.type}
|
|
166
|
+
onClose={() => setOpenWalletStateModal('')}
|
|
167
|
+
image={wallet.image}
|
|
168
|
+
state={wallet.state}
|
|
169
|
+
error={error}
|
|
170
|
+
/>
|
|
171
|
+
)}
|
|
172
|
+
{!!experimentalChainWallet && (
|
|
173
|
+
<Modal
|
|
174
|
+
open={!!experimentalChainWallet && showExperimentalChainModal}
|
|
175
|
+
container={modalContainer}
|
|
176
|
+
onClose={() => {
|
|
177
|
+
setExperimentalChainWallet(null);
|
|
178
|
+
}}>
|
|
179
|
+
<MessageBox
|
|
180
|
+
title={`Add ${blockchainDisplayName} Chain`}
|
|
181
|
+
type="warning"
|
|
182
|
+
description={`You should connect a ${blockchainDisplayName} supported wallet or choose a different ${blockchainDisplayName} address`}>
|
|
183
|
+
<Divider size={18} />
|
|
184
|
+
<Divider size={32} />
|
|
185
|
+
<Button
|
|
186
|
+
onClick={addExperimentalChain.bind(
|
|
187
|
+
null,
|
|
188
|
+
experimentalChainWallet
|
|
189
|
+
)}
|
|
190
|
+
variant="outlined"
|
|
191
|
+
type="primary"
|
|
192
|
+
fullWidth
|
|
193
|
+
size="large">
|
|
194
|
+
Confirm
|
|
195
|
+
</Button>
|
|
196
|
+
</MessageBox>
|
|
197
|
+
</Modal>
|
|
198
|
+
)}
|
|
199
|
+
{addingExperimentalChainStatus && (
|
|
200
|
+
<Modal
|
|
201
|
+
open={!!addingExperimentalChainStatus}
|
|
202
|
+
onClose={setAddingExperimentalChainStatus.bind(null, null)}
|
|
203
|
+
container={modalContainer}>
|
|
204
|
+
{addingExperimentalChainStatus === 'in-progress' ? (
|
|
205
|
+
<MessageBox
|
|
206
|
+
type="loading"
|
|
207
|
+
title={`Add ${blockchainDisplayName} Chain`}
|
|
208
|
+
description={`You should connect a ${blockchainDisplayName} supported wallet or choose a different ${blockchainDisplayName} address.`}
|
|
209
|
+
icon={
|
|
210
|
+
<LogoContainer>
|
|
211
|
+
<WalletImageContainer>
|
|
212
|
+
<Image src={wallet.image} size={45} />
|
|
213
|
+
</WalletImageContainer>
|
|
214
|
+
<Spinner />
|
|
215
|
+
</LogoContainer>
|
|
216
|
+
}
|
|
217
|
+
/>
|
|
218
|
+
) : (
|
|
219
|
+
<MessageBox
|
|
220
|
+
type="success"
|
|
221
|
+
title={`${blockchainDisplayName} Chain Added`}
|
|
222
|
+
description={`${blockchainDisplayName} is added to your wallet, you can use it to swap.`}
|
|
223
|
+
/>
|
|
224
|
+
)}
|
|
225
|
+
<Divider direction="vertical" size={32} />
|
|
226
|
+
</Modal>
|
|
227
|
+
)}
|
|
228
|
+
<SelectableWallet
|
|
229
|
+
key={wallet.type}
|
|
230
|
+
description={connectedWalletDescription}
|
|
231
|
+
onClick={onClick}
|
|
232
|
+
selected={isSelected(wallet.type, chain)}
|
|
233
|
+
{...wallet}
|
|
234
|
+
/>
|
|
235
|
+
</>
|
|
236
|
+
);
|
|
237
|
+
})}
|
|
238
|
+
{shouldShowMoreWallets && (
|
|
239
|
+
<WalletButton selected={false} onClick={onShowMore.bind(null)}>
|
|
240
|
+
<Typography variant="label" size="medium">
|
|
241
|
+
Show more wallets
|
|
242
|
+
<Typography variant="label" size="medium" color="$primary">
|
|
243
|
+
+{numberOfSupportedWallets - (limit ?? 0)}
|
|
244
|
+
</Typography>
|
|
245
|
+
</Typography>
|
|
246
|
+
</WalletButton>
|
|
247
|
+
)}
|
|
248
|
+
</>
|
|
249
|
+
);
|
|
250
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Wallet, WidgetConfig } from '../../types';
|
|
2
|
+
|
|
3
|
+
export type PropTypes = {
|
|
4
|
+
chain: string;
|
|
5
|
+
supportedWallets: WidgetConfig['wallets'];
|
|
6
|
+
isSelected: (walletType: string, chain: string) => boolean;
|
|
7
|
+
selectWallet: (wallet: Wallet) => void;
|
|
8
|
+
multiWallets: boolean;
|
|
9
|
+
config?: WidgetConfig;
|
|
10
|
+
limit?: number;
|
|
11
|
+
onShowMore: () => void;
|
|
12
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { PropTypes } from './HeaderButtons.types';
|
|
2
|
+
|
|
3
|
+
import { ChevronLeftIcon } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { HeaderButton } from './HeaderButtons.styles';
|
|
7
|
+
|
|
8
|
+
function BackButton(props: PropTypes) {
|
|
9
|
+
return (
|
|
10
|
+
<HeaderButton variant="ghost" size="small" onClick={props.onClick}>
|
|
11
|
+
<ChevronLeftIcon color="black" size={16} />
|
|
12
|
+
</HeaderButton>
|
|
13
|
+
);
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export { BackButton };
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PropTypes } from './HeaderButtons.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Button, Typography } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { SuffixContainer } from './HeaderButtons.styles';
|
|
8
|
+
|
|
9
|
+
function CancelButton(props: PropTypes) {
|
|
10
|
+
return (
|
|
11
|
+
<SuffixContainer>
|
|
12
|
+
<Button variant="ghost" onClick={props.onClick} size="xsmall">
|
|
13
|
+
<Typography variant="label" size="medium" color="error500">
|
|
14
|
+
{i18n.t('Cancel')}
|
|
15
|
+
</Typography>
|
|
16
|
+
</Button>
|
|
17
|
+
</SuffixContainer>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export { CancelButton };
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Button, darkTheme, styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const HeaderButton = styled(Button, {
|
|
4
|
+
width: '$24',
|
|
5
|
+
position: 'relative',
|
|
6
|
+
padding: '0',
|
|
7
|
+
overflow: 'unset',
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
export const ConnectedIcon = styled('div', {
|
|
11
|
+
position: 'absolute',
|
|
12
|
+
background: '$secondary500',
|
|
13
|
+
[`.${darkTheme} &`]: {
|
|
14
|
+
$$color: '$colors$secondary400',
|
|
15
|
+
},
|
|
16
|
+
width: '$6',
|
|
17
|
+
height: '$6',
|
|
18
|
+
borderRadius: '$lg',
|
|
19
|
+
right: '$4',
|
|
20
|
+
border: '1px solid $surface100',
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
export const SuffixContainer = styled('div', {
|
|
24
|
+
display: 'flex',
|
|
25
|
+
justifyContent: 'flex-end',
|
|
26
|
+
width: '$40',
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
export const NotificationsBadgeContainer = styled('div', {
|
|
30
|
+
position: 'absolute',
|
|
31
|
+
backgroundColor: '$secondary500',
|
|
32
|
+
width: '14px',
|
|
33
|
+
height: '14px',
|
|
34
|
+
display: 'flex',
|
|
35
|
+
justifyContent: 'center',
|
|
36
|
+
alignItems: 'center',
|
|
37
|
+
borderRadius: '7px',
|
|
38
|
+
top: '$0',
|
|
39
|
+
right: '$0',
|
|
40
|
+
});
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface PropTypes {
|
|
2
|
+
onClick: () => void;
|
|
3
|
+
isConnected?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface HomeButtonsPropTypes {
|
|
6
|
+
layoutRef: HTMLDivElement | null;
|
|
7
|
+
onClickRefresh?: () => void;
|
|
8
|
+
onClickHistory?: () => void;
|
|
9
|
+
onClickSettings?: () => void;
|
|
10
|
+
onClickNotifications?: () => void;
|
|
11
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import type { HomeButtonsPropTypes } from './HeaderButtons.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import {
|
|
5
|
+
NotificationsIcon,
|
|
6
|
+
Popover,
|
|
7
|
+
RefreshIcon,
|
|
8
|
+
SettingsIcon,
|
|
9
|
+
Tooltip,
|
|
10
|
+
TransactionIcon,
|
|
11
|
+
} from '@rango-dev/ui';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
|
|
14
|
+
import { NotificationContent } from '../NotificationContent';
|
|
15
|
+
|
|
16
|
+
import { HeaderButton } from './HeaderButtons.styles';
|
|
17
|
+
import { UnreadNotificationsBadge } from './UnreadNotificationsBadge';
|
|
18
|
+
|
|
19
|
+
export function HomeButtons(props: HomeButtonsPropTypes) {
|
|
20
|
+
const {
|
|
21
|
+
layoutRef,
|
|
22
|
+
onClickRefresh,
|
|
23
|
+
onClickHistory,
|
|
24
|
+
onClickSettings,
|
|
25
|
+
onClickNotifications,
|
|
26
|
+
} = props;
|
|
27
|
+
|
|
28
|
+
return (
|
|
29
|
+
<>
|
|
30
|
+
<Tooltip side="top" content={i18n.t('Refresh')}>
|
|
31
|
+
<HeaderButton
|
|
32
|
+
variant="ghost"
|
|
33
|
+
size="small"
|
|
34
|
+
onClick={onClickRefresh}
|
|
35
|
+
disabled={!onClickRefresh}>
|
|
36
|
+
<RefreshIcon size={16} color={!onClickRefresh ? 'gray' : 'black'} />
|
|
37
|
+
</HeaderButton>
|
|
38
|
+
</Tooltip>
|
|
39
|
+
|
|
40
|
+
<Tooltip side="top" content={i18n.t('Notifications')}>
|
|
41
|
+
<Popover
|
|
42
|
+
align="center"
|
|
43
|
+
collisionBoundary={layoutRef}
|
|
44
|
+
collisionPadding={{ right: 20, left: 20 }}
|
|
45
|
+
container={document.getElementById('swap-box') as HTMLElement}
|
|
46
|
+
content={<NotificationContent />}>
|
|
47
|
+
<HeaderButton
|
|
48
|
+
size="small"
|
|
49
|
+
variant="ghost"
|
|
50
|
+
onClick={onClickNotifications}>
|
|
51
|
+
<NotificationsIcon size={18} color="black" />
|
|
52
|
+
<UnreadNotificationsBadge />
|
|
53
|
+
</HeaderButton>
|
|
54
|
+
</Popover>
|
|
55
|
+
</Tooltip>
|
|
56
|
+
<Tooltip side="top" content={i18n.t('Settings')}>
|
|
57
|
+
<HeaderButton size="small" variant="ghost" onClick={onClickSettings}>
|
|
58
|
+
<SettingsIcon size={18} color="black" />
|
|
59
|
+
</HeaderButton>
|
|
60
|
+
</Tooltip>
|
|
61
|
+
<Tooltip side="top" content={i18n.t('Transactions History')}>
|
|
62
|
+
<HeaderButton size="small" variant="ghost" onClick={onClickHistory}>
|
|
63
|
+
<TransactionIcon size={18} color="black" />
|
|
64
|
+
</HeaderButton>
|
|
65
|
+
</Tooltip>
|
|
66
|
+
</>
|
|
67
|
+
);
|
|
68
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Typography } from '@rango-dev/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { useNotificationStore } from '../../store/notification';
|
|
5
|
+
|
|
6
|
+
import { NotificationsBadgeContainer } from './HeaderButtons.styles';
|
|
7
|
+
|
|
8
|
+
export function UnreadNotificationsBadge() {
|
|
9
|
+
const { getUnreadNotifications } = useNotificationStore();
|
|
10
|
+
|
|
11
|
+
const notificationsCount = getUnreadNotifications().length;
|
|
12
|
+
|
|
13
|
+
return notificationsCount ? (
|
|
14
|
+
<NotificationsBadgeContainer>
|
|
15
|
+
<Typography variant="body" size="xsmall" color="$background">
|
|
16
|
+
{notificationsCount}
|
|
17
|
+
</Typography>
|
|
18
|
+
</NotificationsBadgeContainer>
|
|
19
|
+
) : null;
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PropTypes } from './HeaderButtons.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Tooltip, WalletIcon } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { ConnectedIcon, HeaderButton } from './HeaderButtons.styles';
|
|
8
|
+
|
|
9
|
+
function WalletButton(props: PropTypes) {
|
|
10
|
+
return (
|
|
11
|
+
<Tooltip side="top" content={i18n.t('Connect Wallet')}>
|
|
12
|
+
<HeaderButton variant="ghost" size="small" onClick={props.onClick}>
|
|
13
|
+
{props.isConnected && <ConnectedIcon />}
|
|
14
|
+
<WalletIcon size={18} color="black" />
|
|
15
|
+
</HeaderButton>
|
|
16
|
+
</Tooltip>
|
|
17
|
+
);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export { WalletButton };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
position: 'relative',
|
|
5
|
+
display: 'flex',
|
|
6
|
+
flexDirection: 'column',
|
|
7
|
+
borderRadius: '$primary',
|
|
8
|
+
overflow: 'hidden !important',
|
|
9
|
+
boxShadow: '15px 15px 15px 0px rgba(0, 0, 0, 0.05)',
|
|
10
|
+
width: '95vw',
|
|
11
|
+
maxWidth: '390px',
|
|
12
|
+
maxHeight: '700px',
|
|
13
|
+
variants: {
|
|
14
|
+
fixedHeight: {
|
|
15
|
+
true: {
|
|
16
|
+
height: '95vh',
|
|
17
|
+
},
|
|
18
|
+
false: {
|
|
19
|
+
height: 'auto',
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
});
|
|
24
|
+
export const Content = styled('div', {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
flexDirection: 'column',
|
|
27
|
+
flex: 1,
|
|
28
|
+
padding: '$20 $20 $10 $20',
|
|
29
|
+
backgroundColor: '$background',
|
|
30
|
+
position: 'relative',
|
|
31
|
+
overflowY: 'auto',
|
|
32
|
+
overflowX: 'hidden',
|
|
33
|
+
variants: {
|
|
34
|
+
noPadding: {
|
|
35
|
+
true: {
|
|
36
|
+
padding: '0',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const Footer = styled('div', {
|
|
43
|
+
backgroundColor: '$background',
|
|
44
|
+
'& .footer__content': {
|
|
45
|
+
padding: '$0 $20',
|
|
46
|
+
},
|
|
47
|
+
'& .footer__logo': {
|
|
48
|
+
padding: '$0 $20 $10 $20',
|
|
49
|
+
},
|
|
50
|
+
});
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import type { PropTypes, Ref } from './Layout.types';
|
|
2
|
+
import type { PropsWithChildren } from 'react';
|
|
3
|
+
|
|
4
|
+
import { BottomLogo, Divider, Header } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { useNavigate } from 'react-router-dom';
|
|
7
|
+
|
|
8
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
9
|
+
import { useUiStore } from '../../store/ui';
|
|
10
|
+
import { useWalletsStore } from '../../store/wallets';
|
|
11
|
+
import { BackButton, CancelButton, WalletButton } from '../HeaderButtons';
|
|
12
|
+
|
|
13
|
+
import { Container, Content, Footer } from './Layout.styles';
|
|
14
|
+
|
|
15
|
+
function LayoutComponent(props: PropsWithChildren<PropTypes>, ref: Ref) {
|
|
16
|
+
const {
|
|
17
|
+
children,
|
|
18
|
+
header,
|
|
19
|
+
footer,
|
|
20
|
+
noPadding,
|
|
21
|
+
hasLogo = true,
|
|
22
|
+
fixedHeight = true,
|
|
23
|
+
} = props;
|
|
24
|
+
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
25
|
+
|
|
26
|
+
const connectWalletsButtonDisabled =
|
|
27
|
+
useUiStore.use.connectWalletsButtonDisabled();
|
|
28
|
+
const navigate = useNavigate();
|
|
29
|
+
|
|
30
|
+
const onConnectWallet = () => {
|
|
31
|
+
if (!connectWalletsButtonDisabled) {
|
|
32
|
+
navigate('/' + navigationRoutes.wallets);
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
return (
|
|
36
|
+
<Container ref={ref} fixedHeight={fixedHeight} id="swap-box">
|
|
37
|
+
<Header
|
|
38
|
+
prefix={<>{header.onBack && <BackButton onClick={header.onBack} />}</>}
|
|
39
|
+
title={header.title}
|
|
40
|
+
suffix={
|
|
41
|
+
<>
|
|
42
|
+
{header.suffix}
|
|
43
|
+
{header.hasConnectWallet && (
|
|
44
|
+
<WalletButton
|
|
45
|
+
onClick={onConnectWallet}
|
|
46
|
+
isConnected={!!connectedWallets?.length}
|
|
47
|
+
/>
|
|
48
|
+
)}
|
|
49
|
+
{header.onCancel && <CancelButton onClick={header.onCancel} />}
|
|
50
|
+
</>
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
<Content noPadding={noPadding}>{children}</Content>
|
|
54
|
+
{(hasLogo || footer) && (
|
|
55
|
+
<Footer>
|
|
56
|
+
<div className="footer__content">{footer}</div>
|
|
57
|
+
{hasLogo && (
|
|
58
|
+
<div className="footer__logo">
|
|
59
|
+
<Divider size={12} />
|
|
60
|
+
<BottomLogo />
|
|
61
|
+
</div>
|
|
62
|
+
)}
|
|
63
|
+
</Footer>
|
|
64
|
+
)}
|
|
65
|
+
</Container>
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const Layout = React.forwardRef(LayoutComponent);
|
|
70
|
+
Layout.displayName = 'Layout';
|
|
71
|
+
|
|
72
|
+
export { Layout };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export interface PropTypes {
|
|
2
|
+
header: {
|
|
3
|
+
title: string;
|
|
4
|
+
hasConnectWallet?: boolean;
|
|
5
|
+
hasSettings?: boolean;
|
|
6
|
+
suffix?: React.ReactNode;
|
|
7
|
+
onBack?: () => void;
|
|
8
|
+
onCancel?: () => void;
|
|
9
|
+
};
|
|
10
|
+
hasLogo?: boolean;
|
|
11
|
+
footer?: React.ReactNode;
|
|
12
|
+
noPadding?: boolean;
|
|
13
|
+
fixedHeight?: boolean;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export type Ref =
|
|
17
|
+
| ((instance: HTMLDivElement | null) => void)
|
|
18
|
+
| React.RefObject<HTMLDivElement>
|
|
19
|
+
| null
|
|
20
|
+
| undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Layout } from './Layout';
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Checkbox, Skeleton } from '@rango-dev/ui';
|
|
2
|
+
import React from 'react';
|
|
3
|
+
|
|
4
|
+
import { LiquiditySourceList } from '../SettingsContainer';
|
|
5
|
+
|
|
6
|
+
import { CustomeListItem } from './LoadingLiquiditySourceList.styles';
|
|
7
|
+
|
|
8
|
+
const ITEM_SKELETON_COUNT = 30;
|
|
9
|
+
export function LoadingLiquiditySourceList() {
|
|
10
|
+
return (
|
|
11
|
+
<LiquiditySourceList>
|
|
12
|
+
{Array.from(Array(ITEM_SKELETON_COUNT), (e) => (
|
|
13
|
+
<CustomeListItem
|
|
14
|
+
hasDivider
|
|
15
|
+
key={e}
|
|
16
|
+
start={<Skeleton variant="circular" width={35} height={35} />}
|
|
17
|
+
title={<Skeleton variant="text" size="large" width={90} />}
|
|
18
|
+
end={<Checkbox checked={false} />}
|
|
19
|
+
/>
|
|
20
|
+
))}
|
|
21
|
+
</LiquiditySourceList>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { LoadingLiquiditySourceList } from './LoadingLiquiditySourceList';
|