@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,74 @@
|
|
|
1
|
+
import type { SwapAlertsProps } from './SwapDetailsAlerts.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Alert, IconButton, LinkIcon } from '@rango-dev/ui';
|
|
5
|
+
import React, { Fragment } from 'react';
|
|
6
|
+
|
|
7
|
+
import { isNetworkStatusInWarningState } from '../../utils/swap';
|
|
8
|
+
|
|
9
|
+
import { FailedAlert } from './SwapDetailsAlerts.Failed';
|
|
10
|
+
import { Alerts } from './SwapDetailsAlerts.styles';
|
|
11
|
+
import { WarningAlert } from './SwapDetailsAlerts.Warning';
|
|
12
|
+
|
|
13
|
+
export function SwapDetailsAlerts(props: SwapAlertsProps) {
|
|
14
|
+
const {
|
|
15
|
+
switchNetwork,
|
|
16
|
+
showNetworkModal,
|
|
17
|
+
setNetworkModal,
|
|
18
|
+
message,
|
|
19
|
+
step,
|
|
20
|
+
hasAlreadyProceededToSign,
|
|
21
|
+
} = props;
|
|
22
|
+
|
|
23
|
+
const hasWarning = isNetworkStatusInWarningState(step);
|
|
24
|
+
const waitingForApproval =
|
|
25
|
+
step.status === 'waitingForApproval' && !hasWarning;
|
|
26
|
+
const inProgress = step.status === 'running' && !hasWarning;
|
|
27
|
+
return (
|
|
28
|
+
<Alerts>
|
|
29
|
+
{step.explorerUrl?.map((explorerUrl, index, urls) => {
|
|
30
|
+
const key = index + explorerUrl.url;
|
|
31
|
+
const lastUrl = index === urls.length - 1;
|
|
32
|
+
const loading = (lastUrl && inProgress) || waitingForApproval;
|
|
33
|
+
const error = lastUrl && step.status === 'failed';
|
|
34
|
+
|
|
35
|
+
return (
|
|
36
|
+
<Fragment key={key}>
|
|
37
|
+
<Alert
|
|
38
|
+
type={(loading && 'loading') || (error && 'error') || 'success'}
|
|
39
|
+
title={
|
|
40
|
+
!explorerUrl.description
|
|
41
|
+
? i18n.t('View transaction')
|
|
42
|
+
: `${explorerUrl.description} Tx`
|
|
43
|
+
}
|
|
44
|
+
action={
|
|
45
|
+
explorerUrl.url && (
|
|
46
|
+
<IconButton
|
|
47
|
+
variant="ghost"
|
|
48
|
+
size="xsmall"
|
|
49
|
+
onClick={() => window.open(explorerUrl.url, '_blank')}>
|
|
50
|
+
<LinkIcon size={16} />
|
|
51
|
+
</IconButton>
|
|
52
|
+
)
|
|
53
|
+
}
|
|
54
|
+
/>
|
|
55
|
+
</Fragment>
|
|
56
|
+
);
|
|
57
|
+
})}
|
|
58
|
+
{((inProgress && !hasAlreadyProceededToSign) ||
|
|
59
|
+
(waitingForApproval && !step.explorerUrl?.length)) && (
|
|
60
|
+
<Alert type="loading" title={message.shortMessage} />
|
|
61
|
+
)}
|
|
62
|
+
{step.status !== 'failed' && hasWarning && (
|
|
63
|
+
<WarningAlert
|
|
64
|
+
switchNetwork={switchNetwork}
|
|
65
|
+
showNetworkModal={showNetworkModal}
|
|
66
|
+
setNetworkModal={setNetworkModal}
|
|
67
|
+
message={message}
|
|
68
|
+
/>
|
|
69
|
+
)}
|
|
70
|
+
|
|
71
|
+
{step.status === 'failed' && <FailedAlert message={message} />}
|
|
72
|
+
</Alerts>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { getSwapMessages } from '../../utils/swap';
|
|
2
|
+
import type { ModalState } from '../SwapDetailsModal';
|
|
3
|
+
import type { ConnectResult } from '@rango-dev/wallets-react';
|
|
4
|
+
import type {
|
|
5
|
+
PendingSwap,
|
|
6
|
+
PendingSwapNetworkStatus,
|
|
7
|
+
PendingSwapStep,
|
|
8
|
+
} from 'rango-types';
|
|
9
|
+
|
|
10
|
+
export interface SwapAlertsProps extends WaningAlertsProps {
|
|
11
|
+
step: PendingSwapStep;
|
|
12
|
+
hasAlreadyProceededToSign?: boolean;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface WaningAlertsProps extends FailedAlertsProps {
|
|
16
|
+
switchNetwork: (() => Promise<ConnectResult>) | undefined;
|
|
17
|
+
showNetworkModal: PendingSwapNetworkStatus | null | undefined;
|
|
18
|
+
setNetworkModal: (network: ModalState) => void;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export interface FailedAlertsProps {
|
|
22
|
+
message: ReturnType<typeof getSwapMessages>;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export type GetStep = { swap: PendingSwap } & Omit<
|
|
26
|
+
SwapAlertsProps,
|
|
27
|
+
'step' | 'hasAlreadyProceededToSign'
|
|
28
|
+
>;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { CompleteModalPropTypes } from './SwapDetailsModal.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Divider,
|
|
7
|
+
MessageBox,
|
|
8
|
+
Modal,
|
|
9
|
+
TokenAmount,
|
|
10
|
+
Typography,
|
|
11
|
+
} from '@rango-dev/ui';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { useNavigate } from 'react-router-dom';
|
|
14
|
+
|
|
15
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
16
|
+
|
|
17
|
+
export function SwapDetailsCompleteModal(props: CompleteModalPropTypes) {
|
|
18
|
+
const {
|
|
19
|
+
open,
|
|
20
|
+
onClose,
|
|
21
|
+
status,
|
|
22
|
+
priceValue,
|
|
23
|
+
usdValue,
|
|
24
|
+
token,
|
|
25
|
+
chain,
|
|
26
|
+
percentageChange,
|
|
27
|
+
description,
|
|
28
|
+
diagnosisUrl,
|
|
29
|
+
} = props;
|
|
30
|
+
const navigate = useNavigate();
|
|
31
|
+
|
|
32
|
+
return (
|
|
33
|
+
<Modal
|
|
34
|
+
open={open}
|
|
35
|
+
onClose={onClose}
|
|
36
|
+
container={document.getElementById('swap-box') || document.body}>
|
|
37
|
+
{status === 'success' ? (
|
|
38
|
+
<MessageBox type="success" title={i18n.t('Swap Successful')}>
|
|
39
|
+
<TokenAmount
|
|
40
|
+
direction="vertical"
|
|
41
|
+
type="output"
|
|
42
|
+
centerAlign={true}
|
|
43
|
+
price={{
|
|
44
|
+
value: priceValue,
|
|
45
|
+
usdValue,
|
|
46
|
+
}}
|
|
47
|
+
token={token}
|
|
48
|
+
chain={chain}
|
|
49
|
+
percentageChange={percentageChange}
|
|
50
|
+
/>
|
|
51
|
+
<Divider size={12} />
|
|
52
|
+
<Typography
|
|
53
|
+
variant="body"
|
|
54
|
+
size="medium"
|
|
55
|
+
color="neutral900"
|
|
56
|
+
align="center">
|
|
57
|
+
{description}
|
|
58
|
+
</Typography>
|
|
59
|
+
</MessageBox>
|
|
60
|
+
) : (
|
|
61
|
+
<MessageBox
|
|
62
|
+
type="error"
|
|
63
|
+
title={i18n.t('Transaction Failed')}
|
|
64
|
+
description={description}
|
|
65
|
+
/>
|
|
66
|
+
)}
|
|
67
|
+
<Divider size={32} />
|
|
68
|
+
{status === 'success' && (
|
|
69
|
+
<Button
|
|
70
|
+
variant="contained"
|
|
71
|
+
type="primary"
|
|
72
|
+
size="large"
|
|
73
|
+
onClick={() => navigate(navigationRoutes.home)}>
|
|
74
|
+
<Typography variant="title" size="medium" color="neutral100">
|
|
75
|
+
{i18n.t('Done')}
|
|
76
|
+
</Typography>
|
|
77
|
+
</Button>
|
|
78
|
+
)}
|
|
79
|
+
<Divider size={12} />
|
|
80
|
+
{diagnosisUrl && (
|
|
81
|
+
<>
|
|
82
|
+
<Button
|
|
83
|
+
variant="contained"
|
|
84
|
+
type="primary"
|
|
85
|
+
size="large"
|
|
86
|
+
onClick={() => window.open(diagnosisUrl, '_blank')}>
|
|
87
|
+
<Typography variant="title" size="medium" color="primary">
|
|
88
|
+
{i18n.t('Diagnosis')}
|
|
89
|
+
</Typography>
|
|
90
|
+
</Button>
|
|
91
|
+
<Divider size={12} />
|
|
92
|
+
</>
|
|
93
|
+
)}
|
|
94
|
+
<Button variant="outlined" type="primary" size="large" onClick={onClose}>
|
|
95
|
+
<Typography variant="title" size="medium" color="primary">
|
|
96
|
+
{i18n.t('See Details')}
|
|
97
|
+
</Typography>
|
|
98
|
+
</Button>
|
|
99
|
+
</Modal>
|
|
100
|
+
);
|
|
101
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { CancelContentProps } from './SwapDetailsModal.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Button, Divider, MessageBox, Typography } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
export const CancelContent = ({ onCancel, onClose }: CancelContentProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<Divider size={20} />
|
|
11
|
+
<MessageBox
|
|
12
|
+
type="error"
|
|
13
|
+
title={i18n.t('Transaction Cancel')}
|
|
14
|
+
description={i18n.t('Are you sure you want to Cancel this swap?')}
|
|
15
|
+
/>
|
|
16
|
+
<Divider size={32} />
|
|
17
|
+
<Button
|
|
18
|
+
variant="contained"
|
|
19
|
+
type="primary"
|
|
20
|
+
size="large"
|
|
21
|
+
onClick={onCancel}>
|
|
22
|
+
<Typography variant="title" size="medium" color="neutral100">
|
|
23
|
+
{i18n.t('Yes, Cancel it')}
|
|
24
|
+
</Typography>
|
|
25
|
+
</Button>
|
|
26
|
+
<Divider size={12} />
|
|
27
|
+
<Button variant="outlined" type="primary" size="large" onClick={onClose}>
|
|
28
|
+
<Typography variant="title" size="medium" color="primary">
|
|
29
|
+
{i18n.t('No, Continue')}
|
|
30
|
+
</Typography>
|
|
31
|
+
</Button>
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { DeleteContentProps } from './SwapDetailsModal.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Button, Divider, MessageBox, Typography } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
export const DeleteContent = ({ onDelete, onClose }: DeleteContentProps) => {
|
|
8
|
+
return (
|
|
9
|
+
<>
|
|
10
|
+
<Divider size={20} />
|
|
11
|
+
<MessageBox
|
|
12
|
+
type="error"
|
|
13
|
+
title={i18n.t('Delete Transaction')}
|
|
14
|
+
description={i18n.t('Are you sure you want to delete this swap?')}
|
|
15
|
+
/>
|
|
16
|
+
<Divider size={32} />
|
|
17
|
+
<Button
|
|
18
|
+
variant="contained"
|
|
19
|
+
type="primary"
|
|
20
|
+
size="large"
|
|
21
|
+
onClick={onDelete}>
|
|
22
|
+
<Typography variant="title" size="medium" color="neutral100">
|
|
23
|
+
{i18n.t('Yes, Delete it')}
|
|
24
|
+
</Typography>
|
|
25
|
+
</Button>
|
|
26
|
+
<Divider size={12} />
|
|
27
|
+
<Button variant="outlined" type="primary" size="large" onClick={onClose}>
|
|
28
|
+
<Typography variant="title" size="medium" color="primary">
|
|
29
|
+
{i18n.t('No, Cancel')}
|
|
30
|
+
</Typography>
|
|
31
|
+
</Button>
|
|
32
|
+
</>
|
|
33
|
+
);
|
|
34
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { WalletStateContentProps } from './SwapDetailsModal.types';
|
|
2
|
+
|
|
3
|
+
import { MessageBox, Wallet, WalletState } from '@rango-dev/ui';
|
|
4
|
+
import { useWallets } from '@rango-dev/wallets-react';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { WalletContainer } from './SwapDetailsModal.styles';
|
|
8
|
+
|
|
9
|
+
export const WalletStateContent = (props: WalletStateContentProps) => {
|
|
10
|
+
const { type, title, currentStepWallet, message, showWalletButton } = props;
|
|
11
|
+
const { connect, getWalletInfo, state: walletState } = useWallets();
|
|
12
|
+
const walletType = currentStepWallet?.walletType;
|
|
13
|
+
const isConnected = walletType && walletState(walletType).connected;
|
|
14
|
+
const state = isConnected ? WalletState.CONNECTED : WalletState.DISCONNECTED;
|
|
15
|
+
return (
|
|
16
|
+
<>
|
|
17
|
+
<MessageBox type={type} title={title} description={message} />
|
|
18
|
+
{showWalletButton && walletType && (
|
|
19
|
+
<WalletContainer>
|
|
20
|
+
<Wallet
|
|
21
|
+
title={getWalletInfo(walletType).name}
|
|
22
|
+
image={getWalletInfo(walletType).img}
|
|
23
|
+
type={walletType}
|
|
24
|
+
state={state}
|
|
25
|
+
onClick={async () => connect(walletType)}
|
|
26
|
+
/>
|
|
27
|
+
</WalletContainer>
|
|
28
|
+
)}
|
|
29
|
+
</>
|
|
30
|
+
);
|
|
31
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ModalNetworkValueTypes } from './SwapDetailsModal.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
5
|
+
|
|
6
|
+
export const modalNetworkValues: Record<
|
|
7
|
+
Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>,
|
|
8
|
+
ModalNetworkValueTypes
|
|
9
|
+
> = {
|
|
10
|
+
[PendingSwapNetworkStatus.WaitingForNetworkChange]: {
|
|
11
|
+
type: 'loading',
|
|
12
|
+
title: i18n.t('Change Network'),
|
|
13
|
+
},
|
|
14
|
+
[PendingSwapNetworkStatus.WaitingForConnectingWallet]: {
|
|
15
|
+
type: 'warning',
|
|
16
|
+
title: i18n.t('Connect Wallet'),
|
|
17
|
+
},
|
|
18
|
+
[PendingSwapNetworkStatus.NetworkChanged]: {
|
|
19
|
+
type: 'success',
|
|
20
|
+
title: i18n.t('Network Changed'),
|
|
21
|
+
},
|
|
22
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import type { ModalPropTypes } from './SwapDetailsModal.types';
|
|
2
|
+
|
|
3
|
+
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
4
|
+
import { Modal } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { CancelContent } from './SwapDetailsModal.Cancel';
|
|
8
|
+
import { DeleteContent } from './SwapDetailsModal.Delete';
|
|
9
|
+
import { modalNetworkValues } from './SwapDetailsModal.helpers';
|
|
10
|
+
import { WalletStateContent } from './SwapDetailsModal.WalletState';
|
|
11
|
+
|
|
12
|
+
export function SwapDetailsModal(props: ModalPropTypes) {
|
|
13
|
+
const { state, onClose, onDelete, onCancel, currentStepWallet, message } =
|
|
14
|
+
props;
|
|
15
|
+
|
|
16
|
+
const showWalletStateContent =
|
|
17
|
+
state === PendingSwapNetworkStatus.WaitingForNetworkChange ||
|
|
18
|
+
state === PendingSwapNetworkStatus.WaitingForConnectingWallet ||
|
|
19
|
+
state === PendingSwapNetworkStatus.NetworkChanged;
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<Modal
|
|
23
|
+
open={!!state}
|
|
24
|
+
onClose={onClose}
|
|
25
|
+
container={document.getElementById('swap-box') || document.body}>
|
|
26
|
+
{showWalletStateContent && (
|
|
27
|
+
<WalletStateContent
|
|
28
|
+
type={modalNetworkValues[state].type}
|
|
29
|
+
title={modalNetworkValues[state].title}
|
|
30
|
+
currentStepWallet={currentStepWallet}
|
|
31
|
+
message={message}
|
|
32
|
+
showWalletButton={
|
|
33
|
+
state !== PendingSwapNetworkStatus.WaitingForNetworkChange
|
|
34
|
+
}
|
|
35
|
+
/>
|
|
36
|
+
)}
|
|
37
|
+
{state === 'delete' && (
|
|
38
|
+
<DeleteContent onClose={onClose} onDelete={onDelete} />
|
|
39
|
+
)}
|
|
40
|
+
{state === 'cancel' && (
|
|
41
|
+
<CancelContent onClose={onClose} onCancel={onCancel} />
|
|
42
|
+
)}
|
|
43
|
+
</Modal>
|
|
44
|
+
);
|
|
45
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
2
|
+
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
+
|
|
4
|
+
export type ModalState =
|
|
5
|
+
| Exclude<PendingSwapNetworkStatus, PendingSwapNetworkStatus.WaitingForQueue>
|
|
6
|
+
| 'delete'
|
|
7
|
+
| 'cancel'
|
|
8
|
+
| null;
|
|
9
|
+
type WalletTypeAndAddress = {
|
|
10
|
+
walletType: WalletType;
|
|
11
|
+
address: string;
|
|
12
|
+
};
|
|
13
|
+
export interface ModalPropTypes {
|
|
14
|
+
onClose: () => void;
|
|
15
|
+
onCancel: () => void;
|
|
16
|
+
onDelete: () => void;
|
|
17
|
+
state: ModalState;
|
|
18
|
+
currentStepWallet: WalletTypeAndAddress | null;
|
|
19
|
+
message: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export interface CompleteModalPropTypes {
|
|
23
|
+
open: boolean;
|
|
24
|
+
onClose: () => void;
|
|
25
|
+
status: 'success' | 'failed';
|
|
26
|
+
priceValue: string;
|
|
27
|
+
usdValue: string;
|
|
28
|
+
percentageChange: string;
|
|
29
|
+
chain: {
|
|
30
|
+
displayName?: string;
|
|
31
|
+
image: string;
|
|
32
|
+
};
|
|
33
|
+
token: {
|
|
34
|
+
displayName: string;
|
|
35
|
+
image: string;
|
|
36
|
+
};
|
|
37
|
+
description?: string;
|
|
38
|
+
diagnosisUrl?: string | null;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export interface ModalNetworkValueTypes {
|
|
42
|
+
type: 'loading' | 'warning' | 'success';
|
|
43
|
+
title: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export interface WalletStateContentProps extends ModalNetworkValueTypes {
|
|
47
|
+
currentStepWallet: WalletTypeAndAddress | null;
|
|
48
|
+
message: string;
|
|
49
|
+
showWalletButton: boolean;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type CancelContentProps = Pick<ModalPropTypes, 'onClose' | 'onCancel'>;
|
|
53
|
+
|
|
54
|
+
export type DeleteContentProps = Pick<ModalPropTypes, 'onClose' | 'onDelete'>;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Group = styled('div', {
|
|
4
|
+
width: '100%',
|
|
5
|
+
display: 'flex',
|
|
6
|
+
flexDirection: 'column',
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const Time = styled('div', {
|
|
10
|
+
display: 'flex',
|
|
11
|
+
justifyContent: 'flex-start',
|
|
12
|
+
padding: '$2',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const SwapList = styled('div', {
|
|
16
|
+
gap: '$10',
|
|
17
|
+
display: 'flex',
|
|
18
|
+
flexDirection: 'column',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const NotFoundContainer = styled('div', {
|
|
22
|
+
height: '100%',
|
|
23
|
+
display: 'flex',
|
|
24
|
+
justifyContent: 'center',
|
|
25
|
+
alignItems: 'center',
|
|
26
|
+
});
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
import type { PropTypes } from './SwapsGroup.types';
|
|
2
|
+
|
|
3
|
+
import { Divider, SwapListItem, Typography } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { limitDecimalPlaces } from '../../utils/numbers';
|
|
7
|
+
|
|
8
|
+
import { Group, SwapList, Time } from './SwapsGroup.styles';
|
|
9
|
+
|
|
10
|
+
export function SwapsGroup(props: PropTypes) {
|
|
11
|
+
const { list, onSwapClick, groupBy, isLoading } = props;
|
|
12
|
+
const groups = groupBy ? groupBy(list) : [{ title: 'History', swaps: list }];
|
|
13
|
+
|
|
14
|
+
if (isLoading) {
|
|
15
|
+
const swaps = [{}, {}];
|
|
16
|
+
|
|
17
|
+
const loadingGroups = [
|
|
18
|
+
{
|
|
19
|
+
title: 'Today',
|
|
20
|
+
swaps,
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
title: 'Last month',
|
|
24
|
+
swaps,
|
|
25
|
+
},
|
|
26
|
+
];
|
|
27
|
+
return (
|
|
28
|
+
<>
|
|
29
|
+
{loadingGroups.map((group) => (
|
|
30
|
+
<React.Fragment key={group.title}>
|
|
31
|
+
<Group>
|
|
32
|
+
<Time>
|
|
33
|
+
<Typography
|
|
34
|
+
variant="label"
|
|
35
|
+
size="medium"
|
|
36
|
+
color="neutral800"
|
|
37
|
+
className="group-title">
|
|
38
|
+
{group.title}
|
|
39
|
+
</Typography>
|
|
40
|
+
</Time>
|
|
41
|
+
<Divider size={4} />
|
|
42
|
+
<SwapList>
|
|
43
|
+
{group.swaps.map((_, index) => {
|
|
44
|
+
const key = index + group.title;
|
|
45
|
+
return (
|
|
46
|
+
<React.Fragment key={key}>
|
|
47
|
+
<SwapListItem isLoading={true} />
|
|
48
|
+
</React.Fragment>
|
|
49
|
+
);
|
|
50
|
+
})}
|
|
51
|
+
</SwapList>
|
|
52
|
+
</Group>
|
|
53
|
+
</React.Fragment>
|
|
54
|
+
))}
|
|
55
|
+
</>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
return (
|
|
60
|
+
<>
|
|
61
|
+
{groups
|
|
62
|
+
.filter((group) => group.swaps.length > 0)
|
|
63
|
+
.map((group) => (
|
|
64
|
+
<React.Fragment key={group.title}>
|
|
65
|
+
<Group>
|
|
66
|
+
<Time>
|
|
67
|
+
<Typography
|
|
68
|
+
variant="label"
|
|
69
|
+
size="medium"
|
|
70
|
+
color="neutral800"
|
|
71
|
+
className="group-title">
|
|
72
|
+
{group.title}
|
|
73
|
+
</Typography>
|
|
74
|
+
</Time>
|
|
75
|
+
<Divider size={4} />
|
|
76
|
+
<SwapList>
|
|
77
|
+
{group.swaps.map((swap) => {
|
|
78
|
+
const firstStep = swap.steps[0];
|
|
79
|
+
const lastStep = swap.steps[swap.steps.length - 1];
|
|
80
|
+
return (
|
|
81
|
+
<React.Fragment key={swap.requestId}>
|
|
82
|
+
<SwapListItem
|
|
83
|
+
requestId={swap.requestId}
|
|
84
|
+
creationTime={swap.creationTime}
|
|
85
|
+
status={swap.status}
|
|
86
|
+
onClick={onSwapClick}
|
|
87
|
+
onlyShowTime={group.title === 'Today'}
|
|
88
|
+
swapTokenData={{
|
|
89
|
+
from: {
|
|
90
|
+
token: {
|
|
91
|
+
image: firstStep.fromLogo,
|
|
92
|
+
displayName: firstStep.fromSymbol,
|
|
93
|
+
},
|
|
94
|
+
blockchain: {
|
|
95
|
+
image: firstStep.fromBlockchainLogo || '',
|
|
96
|
+
},
|
|
97
|
+
amount: limitDecimalPlaces(swap.inputAmount),
|
|
98
|
+
},
|
|
99
|
+
to: {
|
|
100
|
+
token: {
|
|
101
|
+
image: lastStep.toLogo,
|
|
102
|
+
displayName: lastStep.toSymbol,
|
|
103
|
+
},
|
|
104
|
+
blockchain: {
|
|
105
|
+
image: lastStep.toBlockchainLogo || '',
|
|
106
|
+
},
|
|
107
|
+
amount: limitDecimalPlaces(
|
|
108
|
+
lastStep.outputAmount || ''
|
|
109
|
+
),
|
|
110
|
+
estimatedAmount: limitDecimalPlaces(
|
|
111
|
+
lastStep.expectedOutputAmountHumanReadable || ''
|
|
112
|
+
),
|
|
113
|
+
},
|
|
114
|
+
}}
|
|
115
|
+
/>
|
|
116
|
+
</React.Fragment>
|
|
117
|
+
);
|
|
118
|
+
})}
|
|
119
|
+
</SwapList>
|
|
120
|
+
</Group>
|
|
121
|
+
</React.Fragment>
|
|
122
|
+
))}
|
|
123
|
+
</>
|
|
124
|
+
);
|
|
125
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { PendingSwap } from 'rango-types';
|
|
2
|
+
|
|
3
|
+
export type GroupBy = (list: PendingSwap[]) => {
|
|
4
|
+
title: string;
|
|
5
|
+
swaps: PendingSwap[];
|
|
6
|
+
}[];
|
|
7
|
+
|
|
8
|
+
export interface PropTypes {
|
|
9
|
+
list: PendingSwap[];
|
|
10
|
+
onSwapClick: (requestId: string) => void;
|
|
11
|
+
groupBy?: GroupBy;
|
|
12
|
+
isLoading: boolean;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SwapsGroup } from './SwapsGroup';
|