@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,85 @@
|
|
|
1
|
+
import type { GetStep } from '../SwapDetailsAlerts';
|
|
2
|
+
import type { PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
3
|
+
import type { Step, StepDetailsProps } from '@rango-dev/ui';
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
TOKEN_AMOUNT_MAX_DECIMALS,
|
|
9
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
10
|
+
} from '../../constants/routing';
|
|
11
|
+
import { numberToString } from '../../utils/numbers';
|
|
12
|
+
import { isNetworkStatusInWarningState } from '../../utils/swap';
|
|
13
|
+
import { SwapDetailsAlerts } from '../SwapDetailsAlerts';
|
|
14
|
+
|
|
15
|
+
export const RESET_INTERVAL = 2_000;
|
|
16
|
+
export const SECONDS = 60;
|
|
17
|
+
|
|
18
|
+
export const getSteps = ({ swap, ...args }: GetStep): Step[] => {
|
|
19
|
+
const hasAlreadyProceededToSign = swap.hasAlreadyProceededToSign !== false;
|
|
20
|
+
return swap.steps.map((step, index) => {
|
|
21
|
+
const amountToConvert =
|
|
22
|
+
index === 0 ? swap.inputAmount : swap.steps[index - 1].outputAmount;
|
|
23
|
+
return {
|
|
24
|
+
from: {
|
|
25
|
+
token: { displayName: step.fromSymbol, image: step.fromLogo || '' },
|
|
26
|
+
chain: {
|
|
27
|
+
displayName: step.fromBlockchain,
|
|
28
|
+
image: step.fromBlockchainLogo || '',
|
|
29
|
+
},
|
|
30
|
+
price: {
|
|
31
|
+
value: numberToString(
|
|
32
|
+
amountToConvert,
|
|
33
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
34
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
35
|
+
),
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
to: {
|
|
39
|
+
token: { displayName: step.toSymbol, image: step.toLogo },
|
|
40
|
+
chain: {
|
|
41
|
+
displayName: step.toBlockchain,
|
|
42
|
+
image: step.toBlockchainLogo || '',
|
|
43
|
+
},
|
|
44
|
+
price: {
|
|
45
|
+
value: numberToString(
|
|
46
|
+
step.outputAmount || step.expectedOutputAmountHumanReadable,
|
|
47
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
48
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
49
|
+
),
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
swapper: { displayName: step.swapperId, image: step.swapperLogo || '' },
|
|
53
|
+
alerts: (
|
|
54
|
+
<SwapDetailsAlerts
|
|
55
|
+
step={step}
|
|
56
|
+
hasAlreadyProceededToSign={hasAlreadyProceededToSign}
|
|
57
|
+
{...args}
|
|
58
|
+
/>
|
|
59
|
+
),
|
|
60
|
+
};
|
|
61
|
+
});
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export function getStepState(step: PendingSwapStep): StepDetailsProps['state'] {
|
|
65
|
+
if (
|
|
66
|
+
isNetworkStatusInWarningState(step) &&
|
|
67
|
+
step.status !== 'failed' &&
|
|
68
|
+
step.status !== 'success'
|
|
69
|
+
) {
|
|
70
|
+
return 'warning';
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
switch (step.status) {
|
|
74
|
+
case 'created':
|
|
75
|
+
return 'default';
|
|
76
|
+
case 'approved':
|
|
77
|
+
case 'waitingForApproval':
|
|
78
|
+
case 'running':
|
|
79
|
+
return 'in-progress';
|
|
80
|
+
case 'failed':
|
|
81
|
+
return 'error';
|
|
82
|
+
case 'success':
|
|
83
|
+
return 'completed';
|
|
84
|
+
}
|
|
85
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const Container = styled('div', {
|
|
4
|
+
display: 'flex',
|
|
5
|
+
width: '100%',
|
|
6
|
+
flexDirection: 'column',
|
|
7
|
+
alignItems: 'center',
|
|
8
|
+
height: '0',
|
|
9
|
+
flexGrow: 1,
|
|
10
|
+
'& .row': {
|
|
11
|
+
display: 'flex',
|
|
12
|
+
width: '100%',
|
|
13
|
+
justifyContent: 'space-between',
|
|
14
|
+
alignItems: 'center',
|
|
15
|
+
padding: '$10 $5',
|
|
16
|
+
borderBottom: '1px solid $neutral300',
|
|
17
|
+
color: '$neutral500',
|
|
18
|
+
},
|
|
19
|
+
'& .request-id': {
|
|
20
|
+
display: 'flex',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
height: '$24',
|
|
24
|
+
},
|
|
25
|
+
'& .output': {
|
|
26
|
+
display: 'flex',
|
|
27
|
+
width: '100%',
|
|
28
|
+
padding: '$15 $20 $20',
|
|
29
|
+
flexDirection: 'column',
|
|
30
|
+
alignItems: 'start',
|
|
31
|
+
},
|
|
32
|
+
'& .title-steps': {
|
|
33
|
+
textAlign: 'left',
|
|
34
|
+
width: '100%',
|
|
35
|
+
padding: '0 $20 $10',
|
|
36
|
+
},
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
export const HeaderDetails = styled('div', {
|
|
40
|
+
width: '100%',
|
|
41
|
+
padding: '0px 15px',
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const StepsList = styled('div', {
|
|
45
|
+
padding: '$0 $20 $20 $20',
|
|
46
|
+
width: '100%',
|
|
47
|
+
overflow: 'auto',
|
|
48
|
+
});
|
|
49
|
+
export const Alerts = styled('div', {
|
|
50
|
+
display: 'flex',
|
|
51
|
+
flexDirection: 'column',
|
|
52
|
+
gap: '$10',
|
|
53
|
+
});
|
|
54
|
+
|
|
55
|
+
export const PlaceholderContainer = styled('div', {
|
|
56
|
+
height: '450px',
|
|
57
|
+
display: 'flex',
|
|
58
|
+
alignItems: 'center',
|
|
59
|
+
textAlign: 'center',
|
|
60
|
+
});
|
|
61
|
+
|
|
62
|
+
export const LoaderContainer = styled('div', {
|
|
63
|
+
display: 'flex',
|
|
64
|
+
justifyContent: 'center',
|
|
65
|
+
width: '100%',
|
|
66
|
+
paddingTop: '33%',
|
|
67
|
+
flex: 1,
|
|
68
|
+
});
|
|
@@ -0,0 +1,419 @@
|
|
|
1
|
+
import type { SwapDetailsProps } from './SwapDetails.types';
|
|
2
|
+
import type { ModalState } from '../SwapDetailsModal';
|
|
3
|
+
|
|
4
|
+
import { i18n } from '@lingui/core';
|
|
5
|
+
import {
|
|
6
|
+
getCurrentBlockchainOfOrNull,
|
|
7
|
+
getCurrentStep,
|
|
8
|
+
getRelatedWalletOrNull,
|
|
9
|
+
PendingSwapNetworkStatus,
|
|
10
|
+
} from '@rango-dev/queue-manager-rango-preset';
|
|
11
|
+
import {
|
|
12
|
+
Button,
|
|
13
|
+
CopyIcon,
|
|
14
|
+
Divider,
|
|
15
|
+
IconButton,
|
|
16
|
+
RouteCost,
|
|
17
|
+
RouteSummary,
|
|
18
|
+
StepDetails,
|
|
19
|
+
Typography,
|
|
20
|
+
useCopyToClipboard,
|
|
21
|
+
} from '@rango-dev/ui';
|
|
22
|
+
import { useWallets } from '@rango-dev/wallets-react';
|
|
23
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
24
|
+
import { useNavigate } from 'react-router-dom';
|
|
25
|
+
|
|
26
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
27
|
+
import {
|
|
28
|
+
GAS_FEE_MAX_DECIMALS,
|
|
29
|
+
GAS_FEE_MIN_DECIMALS,
|
|
30
|
+
PERCENTAGE_CHANGE_MAX_DECIMALS,
|
|
31
|
+
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
32
|
+
TOKEN_AMOUNT_MAX_DECIMALS,
|
|
33
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
34
|
+
USD_VALUE_MAX_DECIMALS,
|
|
35
|
+
USD_VALUE_MIN_DECIMALS,
|
|
36
|
+
} from '../../constants/routing';
|
|
37
|
+
import { useNavigateBack } from '../../hooks/useNavigateBack';
|
|
38
|
+
import { useBestRouteStore } from '../../store/bestRoute';
|
|
39
|
+
import { useMetaStore } from '../../store/meta';
|
|
40
|
+
import { useNotificationStore } from '../../store/notification';
|
|
41
|
+
import { numberToString } from '../../utils/numbers';
|
|
42
|
+
import { getPriceImpactLevel } from '../../utils/routing';
|
|
43
|
+
import {
|
|
44
|
+
getLastConvertedTokenInFailedSwap,
|
|
45
|
+
getPercentageChange,
|
|
46
|
+
getSwapMessages,
|
|
47
|
+
shouldRetrySwap,
|
|
48
|
+
} from '../../utils/swap';
|
|
49
|
+
import { getSwapDate } from '../../utils/time';
|
|
50
|
+
import { getConciseAddress, getUsdPrice } from '../../utils/wallets';
|
|
51
|
+
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
52
|
+
import { Layout } from '../Layout';
|
|
53
|
+
import {
|
|
54
|
+
SwapDetailsCompleteModal,
|
|
55
|
+
SwapDetailsModal,
|
|
56
|
+
} from '../SwapDetailsModal';
|
|
57
|
+
|
|
58
|
+
import {
|
|
59
|
+
getSteps,
|
|
60
|
+
getStepState,
|
|
61
|
+
RESET_INTERVAL,
|
|
62
|
+
SECONDS,
|
|
63
|
+
} from './SwapDetails.helpers';
|
|
64
|
+
import { Container, HeaderDetails, StepsList } from './SwapDetails.styles';
|
|
65
|
+
|
|
66
|
+
export function SwapDetails(props: SwapDetailsProps) {
|
|
67
|
+
const { swap, requestId, onDelete, onCancel: onCancelProps } = props;
|
|
68
|
+
const { canSwitchNetworkTo, connect, getWalletInfo } = useWallets();
|
|
69
|
+
const retry = useBestRouteStore.use.retry();
|
|
70
|
+
const navigate = useNavigate();
|
|
71
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
72
|
+
const [_, handleCopy] = useCopyToClipboard(RESET_INTERVAL);
|
|
73
|
+
const listRef = useRef<HTMLDivElement | null>(null);
|
|
74
|
+
const [modalState, setModalState] = useState<ModalState>(null);
|
|
75
|
+
const [showCompletedModal, setShowCompletedModal] = useState<
|
|
76
|
+
'success' | 'failed' | null
|
|
77
|
+
>(null);
|
|
78
|
+
const {
|
|
79
|
+
meta: { tokens },
|
|
80
|
+
} = useMetaStore();
|
|
81
|
+
|
|
82
|
+
const onCancel = () => {
|
|
83
|
+
onCancelProps();
|
|
84
|
+
setModalState(null);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const getUnreadNotifications =
|
|
88
|
+
useNotificationStore.use.getUnreadNotifications();
|
|
89
|
+
const setAsRead = useNotificationStore.use.setAsRead();
|
|
90
|
+
const unreadNotifications = getUnreadNotifications();
|
|
91
|
+
const currentStep = getCurrentStep(swap);
|
|
92
|
+
const currentStepNetworkStatus = currentStep?.networkStatus;
|
|
93
|
+
|
|
94
|
+
useEffect(() => {
|
|
95
|
+
const existNotification = unreadNotifications.find(
|
|
96
|
+
(n) => n.requestId === swap.requestId
|
|
97
|
+
);
|
|
98
|
+
if (existNotification) {
|
|
99
|
+
if (swap.status === 'success' || swap.status === 'failed') {
|
|
100
|
+
setShowCompletedModal(swap.status);
|
|
101
|
+
setAsRead(swap.requestId);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
}, [swap.status]);
|
|
105
|
+
|
|
106
|
+
useEffect(() => {
|
|
107
|
+
if (showSwitchNetwork) {
|
|
108
|
+
setModalState(PendingSwapNetworkStatus.WaitingForNetworkChange);
|
|
109
|
+
} else if (
|
|
110
|
+
currentStepNetworkStatus ===
|
|
111
|
+
PendingSwapNetworkStatus.WaitingForConnectingWallet ||
|
|
112
|
+
currentStepNetworkStatus === PendingSwapNetworkStatus.NetworkChanged
|
|
113
|
+
) {
|
|
114
|
+
setModalState(currentStepNetworkStatus);
|
|
115
|
+
} else {
|
|
116
|
+
setModalState(null);
|
|
117
|
+
}
|
|
118
|
+
}, [currentStepNetworkStatus]);
|
|
119
|
+
|
|
120
|
+
const lastConvertedTokenInFailedSwap =
|
|
121
|
+
getLastConvertedTokenInFailedSwap(swap);
|
|
122
|
+
|
|
123
|
+
const currentStepBlockchain = currentStep
|
|
124
|
+
? getCurrentBlockchainOfOrNull(swap, currentStep)
|
|
125
|
+
: null;
|
|
126
|
+
const currentStepWallet = currentStep
|
|
127
|
+
? getRelatedWalletOrNull(swap, currentStep)
|
|
128
|
+
: null;
|
|
129
|
+
|
|
130
|
+
const swapDate = getSwapDate(swap);
|
|
131
|
+
const shouldRetry = shouldRetrySwap(swap);
|
|
132
|
+
|
|
133
|
+
const isMobileWallet = (walletType: string): boolean =>
|
|
134
|
+
!!getWalletInfo(walletType)?.mobileWallet;
|
|
135
|
+
|
|
136
|
+
const showSwitchNetwork =
|
|
137
|
+
currentStepNetworkStatus ===
|
|
138
|
+
PendingSwapNetworkStatus.WaitingForNetworkChange &&
|
|
139
|
+
!!currentStepBlockchain &&
|
|
140
|
+
!!currentStepWallet?.walletType &&
|
|
141
|
+
(isMobileWallet(currentStepWallet.walletType) ||
|
|
142
|
+
canSwitchNetworkTo(currentStepWallet.walletType, currentStepBlockchain));
|
|
143
|
+
|
|
144
|
+
const switchNetwork = showSwitchNetwork
|
|
145
|
+
? connect.bind(null, currentStepWallet.walletType, currentStepBlockchain)
|
|
146
|
+
: undefined;
|
|
147
|
+
|
|
148
|
+
const stepMessage = getSwapMessages(swap, currentStep);
|
|
149
|
+
const steps = getSteps({
|
|
150
|
+
swap,
|
|
151
|
+
switchNetwork,
|
|
152
|
+
showNetworkModal: currentStepNetworkStatus,
|
|
153
|
+
setNetworkModal: setModalState,
|
|
154
|
+
message: stepMessage,
|
|
155
|
+
});
|
|
156
|
+
const numberOfSteps = steps.length;
|
|
157
|
+
const [firstStep, lastStep] = [swap.steps[0], swap.steps[numberOfSteps - 1]];
|
|
158
|
+
const outputAmount =
|
|
159
|
+
lastStep.outputAmount || lastStep.expectedOutputAmountHumanReadable;
|
|
160
|
+
|
|
161
|
+
const totalFee = swap.steps.reduce(
|
|
162
|
+
(totalFee, steps) => totalFee + parseFloat(steps.feeInUsd || ''),
|
|
163
|
+
0
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
const totalTime = swap.steps.reduce(
|
|
167
|
+
(totalTime, step) => totalTime + (step.estimatedTimeInSeconds || 0),
|
|
168
|
+
0
|
|
169
|
+
);
|
|
170
|
+
|
|
171
|
+
const minutes = Math.floor(totalTime / SECONDS);
|
|
172
|
+
|
|
173
|
+
const diagnosisUrl = swap.steps.find(
|
|
174
|
+
(step) => step.diagnosisUrl
|
|
175
|
+
)?.diagnosisUrl;
|
|
176
|
+
|
|
177
|
+
const outputUsdValue = numberToString(
|
|
178
|
+
String(
|
|
179
|
+
parseFloat(
|
|
180
|
+
numberToString(
|
|
181
|
+
outputAmount,
|
|
182
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
183
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
184
|
+
)
|
|
185
|
+
) *
|
|
186
|
+
(getUsdPrice(
|
|
187
|
+
lastStep.toBlockchain,
|
|
188
|
+
lastStep.toSymbol,
|
|
189
|
+
lastStep.toSymbolAddress,
|
|
190
|
+
tokens
|
|
191
|
+
) || 0)
|
|
192
|
+
),
|
|
193
|
+
USD_VALUE_MIN_DECIMALS,
|
|
194
|
+
USD_VALUE_MAX_DECIMALS
|
|
195
|
+
);
|
|
196
|
+
|
|
197
|
+
const inputUsdValue = numberToString(
|
|
198
|
+
String(
|
|
199
|
+
parseFloat(swap.inputAmount) *
|
|
200
|
+
(getUsdPrice(
|
|
201
|
+
firstStep.fromBlockchain,
|
|
202
|
+
firstStep.fromSymbol,
|
|
203
|
+
firstStep.fromSymbolAddress,
|
|
204
|
+
tokens
|
|
205
|
+
) || 0)
|
|
206
|
+
),
|
|
207
|
+
USD_VALUE_MIN_DECIMALS,
|
|
208
|
+
USD_VALUE_MAX_DECIMALS
|
|
209
|
+
);
|
|
210
|
+
|
|
211
|
+
const percentageChange = getPercentageChange(inputUsdValue, outputUsdValue);
|
|
212
|
+
|
|
213
|
+
const completeModalDesc =
|
|
214
|
+
swap.status === 'success'
|
|
215
|
+
? `You have received ${numberToString(
|
|
216
|
+
outputAmount,
|
|
217
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
218
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
219
|
+
)} ${
|
|
220
|
+
steps[numberOfSteps - 1].to.token.displayName
|
|
221
|
+
} in ${getConciseAddress(
|
|
222
|
+
swap.wallets[steps[numberOfSteps - 1].to.chain.displayName]
|
|
223
|
+
?.address || ''
|
|
224
|
+
)} wallet on ${steps[numberOfSteps - 1].to.chain.displayName} chain.`
|
|
225
|
+
: `${i18n.t('Transaction was not sent.')} ${
|
|
226
|
+
lastConvertedTokenInFailedSwap
|
|
227
|
+
? `${lastConvertedTokenInFailedSwap.outputAmount} ${lastConvertedTokenInFailedSwap.symbol} on ${lastConvertedTokenInFailedSwap.blockchain} remain in your wallet`
|
|
228
|
+
: ''
|
|
229
|
+
}`;
|
|
230
|
+
|
|
231
|
+
return (
|
|
232
|
+
<Layout
|
|
233
|
+
noPadding
|
|
234
|
+
header={{
|
|
235
|
+
title: i18n.t('Swap and Bridge'),
|
|
236
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.swapDetails),
|
|
237
|
+
onCancel:
|
|
238
|
+
swap.status === 'running' ? () => setModalState('cancel') : undefined,
|
|
239
|
+
suffix: swap.status !== 'running' && (
|
|
240
|
+
<SuffixContainer>
|
|
241
|
+
<Button
|
|
242
|
+
variant="ghost"
|
|
243
|
+
type="error"
|
|
244
|
+
size="xsmall"
|
|
245
|
+
onClick={() => setModalState('delete')}>
|
|
246
|
+
<Typography size="medium" variant="label" color="error">
|
|
247
|
+
{i18n.t('Delete')}
|
|
248
|
+
</Typography>
|
|
249
|
+
</Button>
|
|
250
|
+
</SuffixContainer>
|
|
251
|
+
),
|
|
252
|
+
}}
|
|
253
|
+
footer={
|
|
254
|
+
shouldRetry &&
|
|
255
|
+
!showCompletedModal && (
|
|
256
|
+
<Button
|
|
257
|
+
fullWidth
|
|
258
|
+
variant="contained"
|
|
259
|
+
type="primary"
|
|
260
|
+
size="large"
|
|
261
|
+
onClick={() => {
|
|
262
|
+
retry(swap);
|
|
263
|
+
setTimeout(() => {
|
|
264
|
+
navigate(navigationRoutes.home);
|
|
265
|
+
}, 0);
|
|
266
|
+
}}>
|
|
267
|
+
{i18n.t('Try again')}
|
|
268
|
+
</Button>
|
|
269
|
+
)
|
|
270
|
+
}>
|
|
271
|
+
<Container>
|
|
272
|
+
<HeaderDetails>
|
|
273
|
+
<div className="row">
|
|
274
|
+
<Typography variant="label" size="large" color="neutral900">
|
|
275
|
+
{`${i18n.t('Request ID')}:`}
|
|
276
|
+
</Typography>
|
|
277
|
+
<div className="request-id">
|
|
278
|
+
<Typography variant="label" size="small" color="neutral900">
|
|
279
|
+
{requestId}
|
|
280
|
+
</Typography>
|
|
281
|
+
<IconButton
|
|
282
|
+
variant="ghost"
|
|
283
|
+
onClick={handleCopy.bind(null, requestId || '')}>
|
|
284
|
+
<CopyIcon size={16} color="gray" />
|
|
285
|
+
</IconButton>
|
|
286
|
+
</div>
|
|
287
|
+
</div>
|
|
288
|
+
<div className="row">
|
|
289
|
+
<Typography variant="label" size="large" color="neutral900">
|
|
290
|
+
{`${i18n.t('Created at')}:`}
|
|
291
|
+
</Typography>
|
|
292
|
+
<Typography variant="label" size="small" color="neutral900">
|
|
293
|
+
{swapDate}
|
|
294
|
+
</Typography>
|
|
295
|
+
</div>
|
|
296
|
+
</HeaderDetails>
|
|
297
|
+
|
|
298
|
+
<div className="output">
|
|
299
|
+
<RouteCost
|
|
300
|
+
fee={numberToString(
|
|
301
|
+
String(totalFee),
|
|
302
|
+
GAS_FEE_MIN_DECIMALS,
|
|
303
|
+
GAS_FEE_MAX_DECIMALS
|
|
304
|
+
)}
|
|
305
|
+
time={minutes}
|
|
306
|
+
steps={numberOfSteps}
|
|
307
|
+
/>
|
|
308
|
+
<RouteSummary
|
|
309
|
+
from={{
|
|
310
|
+
price: {
|
|
311
|
+
value: numberToString(
|
|
312
|
+
swap.inputAmount,
|
|
313
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
314
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
315
|
+
),
|
|
316
|
+
usdValue: inputUsdValue,
|
|
317
|
+
},
|
|
318
|
+
token: {
|
|
319
|
+
displayName: steps[0].from.token.displayName,
|
|
320
|
+
image: steps[0].from.token.image,
|
|
321
|
+
},
|
|
322
|
+
chain: {
|
|
323
|
+
image: steps[0].from.chain.image,
|
|
324
|
+
displayName: steps[0].from.chain.displayName,
|
|
325
|
+
},
|
|
326
|
+
}}
|
|
327
|
+
to={{
|
|
328
|
+
price: {
|
|
329
|
+
value: numberToString(
|
|
330
|
+
outputAmount,
|
|
331
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
332
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
333
|
+
),
|
|
334
|
+
usdValue: outputUsdValue,
|
|
335
|
+
},
|
|
336
|
+
token: {
|
|
337
|
+
displayName: steps[numberOfSteps - 1].to.token.displayName,
|
|
338
|
+
image: steps[numberOfSteps - 1].to.token.image,
|
|
339
|
+
},
|
|
340
|
+
chain: {
|
|
341
|
+
image: steps[numberOfSteps - 1].to.chain.image,
|
|
342
|
+
displayName: steps[numberOfSteps - 1].to.chain.displayName,
|
|
343
|
+
},
|
|
344
|
+
}}
|
|
345
|
+
percentageChange={numberToString(
|
|
346
|
+
percentageChange,
|
|
347
|
+
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
348
|
+
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
349
|
+
)}
|
|
350
|
+
warningLevel={getPriceImpactLevel(
|
|
351
|
+
percentageChange?.toNumber() ?? 0
|
|
352
|
+
)}
|
|
353
|
+
/>
|
|
354
|
+
</div>
|
|
355
|
+
<div className="title-steps">
|
|
356
|
+
<Typography variant="title" size="small">
|
|
357
|
+
{i18n.t('Swaps steps')}
|
|
358
|
+
</Typography>
|
|
359
|
+
</div>
|
|
360
|
+
<Divider size={8} />
|
|
361
|
+
<StepsList ref={listRef}>
|
|
362
|
+
{steps.map((step, index) => {
|
|
363
|
+
const key = index;
|
|
364
|
+
const state = getStepState(swap.steps[index]);
|
|
365
|
+
const isFocused =
|
|
366
|
+
state === 'error' ||
|
|
367
|
+
state === 'in-progress' ||
|
|
368
|
+
state === 'warning' ||
|
|
369
|
+
(state === 'completed' && index === steps.length - 1);
|
|
370
|
+
return (
|
|
371
|
+
<StepDetails
|
|
372
|
+
key={key}
|
|
373
|
+
step={step}
|
|
374
|
+
type="route-progress"
|
|
375
|
+
ref={listRef}
|
|
376
|
+
state={state}
|
|
377
|
+
hasSeparator={index !== 0}
|
|
378
|
+
tabIndex={key}
|
|
379
|
+
isFocused={isFocused}
|
|
380
|
+
/>
|
|
381
|
+
);
|
|
382
|
+
})}
|
|
383
|
+
</StepsList>
|
|
384
|
+
</Container>
|
|
385
|
+
|
|
386
|
+
<SwapDetailsModal
|
|
387
|
+
state={modalState}
|
|
388
|
+
onClose={() => setModalState(null)}
|
|
389
|
+
onCancel={onCancel}
|
|
390
|
+
onDelete={onDelete}
|
|
391
|
+
message={stepMessage.detailedMessage.content}
|
|
392
|
+
currentStepWallet={currentStepWallet}
|
|
393
|
+
/>
|
|
394
|
+
<SwapDetailsCompleteModal
|
|
395
|
+
open={!!showCompletedModal}
|
|
396
|
+
diagnosisUrl={diagnosisUrl}
|
|
397
|
+
onClose={() => setShowCompletedModal(null)}
|
|
398
|
+
status={swap.status === 'success' ? 'success' : 'failed'}
|
|
399
|
+
priceValue={numberToString(
|
|
400
|
+
outputAmount,
|
|
401
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
402
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
403
|
+
)}
|
|
404
|
+
usdValue={outputUsdValue}
|
|
405
|
+
percentageChange={numberToString(
|
|
406
|
+
percentageChange,
|
|
407
|
+
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
408
|
+
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
409
|
+
)}
|
|
410
|
+
token={{
|
|
411
|
+
displayName: steps[numberOfSteps - 1].to.token.displayName,
|
|
412
|
+
image: steps[numberOfSteps - 1].to.token.image,
|
|
413
|
+
}}
|
|
414
|
+
chain={{ image: steps[numberOfSteps - 1].to.chain.image }}
|
|
415
|
+
description={completeModalDesc}
|
|
416
|
+
/>
|
|
417
|
+
</Layout>
|
|
418
|
+
);
|
|
419
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { PendingSwap } from 'rango-types';
|
|
2
|
+
|
|
3
|
+
export interface SwapDetailsProps {
|
|
4
|
+
swap: PendingSwap;
|
|
5
|
+
requestId: string;
|
|
6
|
+
onDelete: () => void;
|
|
7
|
+
onCancel: () => void;
|
|
8
|
+
}
|
|
9
|
+
export interface SwapDetailsPlaceholderPropTypes {
|
|
10
|
+
requestId: string;
|
|
11
|
+
showSkeleton: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SwapDetails } from './SwapDetails';
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import type { FailedAlertsProps } from './SwapDetailsAlerts.types';
|
|
2
|
+
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
ChevronDownIcon,
|
|
6
|
+
ChevronUpIcon,
|
|
7
|
+
IconButton,
|
|
8
|
+
} from '@rango-dev/ui';
|
|
9
|
+
import React, { useState } from 'react';
|
|
10
|
+
|
|
11
|
+
export function FailedAlert(props: FailedAlertsProps) {
|
|
12
|
+
const { message } = props;
|
|
13
|
+
const [showContentError, setShowContentError] = useState(false);
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<Alert
|
|
17
|
+
type="error"
|
|
18
|
+
title={message.shortMessage}
|
|
19
|
+
action={
|
|
20
|
+
message.detailedMessage.content && (
|
|
21
|
+
<IconButton
|
|
22
|
+
onClick={() => setShowContentError((prev) => !prev)}
|
|
23
|
+
variant="ghost"
|
|
24
|
+
size="xsmall">
|
|
25
|
+
{showContentError ? (
|
|
26
|
+
<ChevronUpIcon size={12} color="gray" />
|
|
27
|
+
) : (
|
|
28
|
+
<ChevronDownIcon size={12} color="gray" />
|
|
29
|
+
)}
|
|
30
|
+
</IconButton>
|
|
31
|
+
)
|
|
32
|
+
}
|
|
33
|
+
footer={showContentError ? message.detailedMessage.content : undefined}
|
|
34
|
+
/>
|
|
35
|
+
);
|
|
36
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import type { WaningAlertsProps } from './SwapDetailsAlerts.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { PendingSwapNetworkStatus } from '@rango-dev/queue-manager-rango-preset';
|
|
5
|
+
import { Alert, Button } from '@rango-dev/ui';
|
|
6
|
+
import React from 'react';
|
|
7
|
+
|
|
8
|
+
export function WarningAlert(props: WaningAlertsProps) {
|
|
9
|
+
const { switchNetwork, setNetworkModal, message, showNetworkModal } = props;
|
|
10
|
+
if (!!switchNetwork) {
|
|
11
|
+
return (
|
|
12
|
+
<Alert
|
|
13
|
+
type="warning"
|
|
14
|
+
title={message.shortMessage}
|
|
15
|
+
action={
|
|
16
|
+
<Button
|
|
17
|
+
size="xxsmall"
|
|
18
|
+
type="warning"
|
|
19
|
+
onClick={() => {
|
|
20
|
+
setNetworkModal(PendingSwapNetworkStatus.WaitingForNetworkChange);
|
|
21
|
+
switchNetwork().catch((e) => {
|
|
22
|
+
console.log(e);
|
|
23
|
+
});
|
|
24
|
+
}}>
|
|
25
|
+
{i18n.t('Change')}
|
|
26
|
+
</Button>
|
|
27
|
+
}
|
|
28
|
+
/>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
if (
|
|
32
|
+
showNetworkModal === PendingSwapNetworkStatus.WaitingForConnectingWallet
|
|
33
|
+
) {
|
|
34
|
+
return (
|
|
35
|
+
<Alert
|
|
36
|
+
type="warning"
|
|
37
|
+
title={message.shortMessage}
|
|
38
|
+
action={
|
|
39
|
+
<Button
|
|
40
|
+
size="xxsmall"
|
|
41
|
+
type="warning"
|
|
42
|
+
onClick={() => {
|
|
43
|
+
setNetworkModal(
|
|
44
|
+
PendingSwapNetworkStatus.WaitingForConnectingWallet
|
|
45
|
+
);
|
|
46
|
+
}}>
|
|
47
|
+
{i18n.t('Connect')}
|
|
48
|
+
</Button>
|
|
49
|
+
}
|
|
50
|
+
/>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
return <Alert type="warning" title={message.shortMessage} />;
|
|
55
|
+
}
|