@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
package/src/pages/Home.tsx
CHANGED
|
@@ -1,76 +1,150 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { SwapResult } from 'rango-sdk';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import {
|
|
5
|
+
Alert,
|
|
6
|
+
BestRoute,
|
|
7
|
+
BestRouteSkeleton,
|
|
8
|
+
Button,
|
|
9
|
+
Divider,
|
|
10
|
+
styled,
|
|
11
|
+
SwapInput,
|
|
12
|
+
Typography,
|
|
13
|
+
WarningIcon,
|
|
14
|
+
} from '@rango-dev/ui';
|
|
15
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
2
16
|
import { useNavigate } from 'react-router-dom';
|
|
3
|
-
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
17
|
+
|
|
18
|
+
import { HomeButtons } from '../components/HeaderButtons';
|
|
19
|
+
import { Layout } from '../components/Layout';
|
|
20
|
+
import { NoRoutes } from '../components/NoRoutes';
|
|
21
|
+
import { RouteErrors } from '../components/RouteErrors';
|
|
22
|
+
import { SwitchFromAndToButton } from '../components/SwitchFromAndTo';
|
|
9
23
|
import { errorMessages } from '../constants/errors';
|
|
24
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
10
25
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
26
|
+
BALANCE_MAX_DECIMALS,
|
|
27
|
+
BALANCE_MIN_DECIMALS,
|
|
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 { useSwapInput } from '../hooks/useSwapInput';
|
|
38
|
+
import { useBestRouteStore } from '../store/bestRoute';
|
|
39
|
+
import { useMetaStore } from '../store/meta';
|
|
21
40
|
import { useUiStore } from '../store/ui';
|
|
41
|
+
import { useWalletsStore } from '../store/wallets';
|
|
42
|
+
import { ButtonState } from '../types';
|
|
22
43
|
import {
|
|
23
44
|
numberToString,
|
|
24
45
|
secondsToString,
|
|
25
46
|
totalArrivalTime,
|
|
26
47
|
} from '../utils/numbers';
|
|
48
|
+
import { getFormattedBestRoute, getPriceImpactLevel } from '../utils/routing';
|
|
49
|
+
import {
|
|
50
|
+
canComputePriceImpact,
|
|
51
|
+
getOutputRatio,
|
|
52
|
+
getPercentageChange,
|
|
53
|
+
getSwapButtonState,
|
|
54
|
+
getTotalFeeInUsd,
|
|
55
|
+
hasLimitError,
|
|
56
|
+
LimitErrorMessage,
|
|
57
|
+
outputRatioHasWarning,
|
|
58
|
+
} from '../utils/swap';
|
|
27
59
|
import { getBalanceFromWallet } from '../utils/wallets';
|
|
28
|
-
|
|
29
|
-
|
|
60
|
+
|
|
61
|
+
const Container = styled('div', {
|
|
62
|
+
display: 'flex',
|
|
63
|
+
flexDirection: 'column',
|
|
64
|
+
overflowY: 'visible',
|
|
65
|
+
});
|
|
66
|
+
|
|
67
|
+
const FromContainer = styled('div', {
|
|
68
|
+
position: 'relative',
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
const InputsContainer = styled('div', {
|
|
72
|
+
display: 'flex',
|
|
73
|
+
flexDirection: 'column',
|
|
74
|
+
gap: 5,
|
|
75
|
+
alignSelf: 'stretch',
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
const BestRouteContainer = styled('div', {
|
|
79
|
+
width: '100%',
|
|
80
|
+
paddingTop: '$2',
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
const FooterStepAlarm = styled('div', {
|
|
84
|
+
paddingBottom: '$15',
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
const FooterAlert = styled('div', {
|
|
88
|
+
width: '100%',
|
|
89
|
+
display: 'flex',
|
|
90
|
+
});
|
|
30
91
|
|
|
31
92
|
export function Home() {
|
|
32
93
|
const navigate = useNavigate();
|
|
33
|
-
const
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
const
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
94
|
+
const {
|
|
95
|
+
fetch: refetchBestRoute,
|
|
96
|
+
loading: fetchingBestRoute,
|
|
97
|
+
error: bestRouteError,
|
|
98
|
+
} = useSwapInput();
|
|
99
|
+
const {
|
|
100
|
+
fromToken,
|
|
101
|
+
fromBlockchain,
|
|
102
|
+
toToken,
|
|
103
|
+
toBlockchain,
|
|
104
|
+
setInputAmount,
|
|
105
|
+
inputAmount,
|
|
106
|
+
inputUsdValue,
|
|
107
|
+
outputAmount,
|
|
108
|
+
outputUsdValue,
|
|
109
|
+
bestRoute,
|
|
110
|
+
resetRouteWallets,
|
|
111
|
+
} = useBestRouteStore();
|
|
112
|
+
|
|
113
|
+
const {
|
|
114
|
+
meta: { tokens },
|
|
115
|
+
loadingStatus: loadingMetaStatus,
|
|
116
|
+
} = useMetaStore();
|
|
117
|
+
|
|
47
118
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
48
119
|
const setCurrentPage = useUiStore.use.setCurrentPage();
|
|
120
|
+
const [openWarningModal, setOpenWarningModal] = useState(false);
|
|
121
|
+
const {
|
|
122
|
+
fromAmountRangeError,
|
|
123
|
+
swap: swapHasError,
|
|
124
|
+
recommendation,
|
|
125
|
+
} = LimitErrorMessage(bestRoute);
|
|
126
|
+
const layoutRef = useRef<HTMLDivElement>(null);
|
|
49
127
|
|
|
50
|
-
const
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
: bestRouteError;
|
|
128
|
+
const showBestRoute =
|
|
129
|
+
!!Number(inputAmount) &&
|
|
130
|
+
(!!bestRoute || fetchingBestRoute || !!bestRouteError);
|
|
54
131
|
|
|
55
132
|
const needsToWarnEthOnPath = false;
|
|
56
133
|
|
|
57
|
-
const showBestRoute =
|
|
58
|
-
!!inputAmount && (!!bestRoute || fetchingBestRoute || !!bestRouteError);
|
|
59
|
-
|
|
60
134
|
const outToInRatio = getOutputRatio(inputUsdValue, outputUsdValue);
|
|
61
|
-
|
|
62
135
|
const highValueLoss = outputRatioHasWarning(inputUsdValue, outToInRatio);
|
|
63
136
|
|
|
64
|
-
const
|
|
65
|
-
|
|
137
|
+
const priceImpactInputCanNotBeComputed = !canComputePriceImpact(
|
|
138
|
+
bestRoute,
|
|
139
|
+
inputAmount,
|
|
140
|
+
inputUsdValue
|
|
141
|
+
);
|
|
66
142
|
|
|
67
|
-
const
|
|
143
|
+
const priceImpactOutputCanNotBeComputed = !canComputePriceImpact(
|
|
68
144
|
bestRoute,
|
|
69
145
|
inputAmount,
|
|
70
|
-
inputUsdValue,
|
|
71
146
|
outputUsdValue
|
|
72
147
|
);
|
|
73
|
-
|
|
74
148
|
const swapButtonState = getSwapButtonState(
|
|
75
149
|
loadingMetaStatus,
|
|
76
150
|
connectedWallets,
|
|
@@ -78,40 +152,37 @@ export function Home() {
|
|
|
78
152
|
bestRoute,
|
|
79
153
|
hasLimitError(bestRoute),
|
|
80
154
|
highValueLoss,
|
|
81
|
-
|
|
155
|
+
priceImpactInputCanNotBeComputed || priceImpactOutputCanNotBeComputed,
|
|
82
156
|
needsToWarnEthOnPath,
|
|
83
157
|
inputAmount
|
|
84
158
|
);
|
|
85
159
|
|
|
86
|
-
const totalFeeInUsd = getTotalFeeInUsd(bestRoute, tokens);
|
|
87
|
-
|
|
88
|
-
const highFee = hasHighFee(totalFeeInUsd);
|
|
89
|
-
|
|
90
160
|
const tokenBalance =
|
|
91
|
-
!!
|
|
161
|
+
!!fromBlockchain && !!fromToken
|
|
92
162
|
? numberToString(
|
|
93
163
|
getBalanceFromWallet(
|
|
94
164
|
connectedWallets,
|
|
95
|
-
|
|
165
|
+
fromBlockchain?.name,
|
|
96
166
|
fromToken?.symbol,
|
|
97
167
|
fromToken?.address
|
|
98
168
|
)?.amount || '0',
|
|
99
|
-
|
|
169
|
+
BALANCE_MIN_DECIMALS,
|
|
170
|
+
BALANCE_MAX_DECIMALS
|
|
100
171
|
)
|
|
101
172
|
: '0';
|
|
102
173
|
|
|
103
174
|
const tokenBalanceReal =
|
|
104
|
-
!!
|
|
175
|
+
!!fromBlockchain && !!fromToken
|
|
105
176
|
? numberToString(
|
|
106
177
|
getBalanceFromWallet(
|
|
107
178
|
connectedWallets,
|
|
108
|
-
|
|
179
|
+
fromBlockchain?.name,
|
|
109
180
|
fromToken?.symbol,
|
|
110
181
|
fromToken?.address
|
|
111
182
|
)?.amount || '0',
|
|
112
183
|
getBalanceFromWallet(
|
|
113
184
|
connectedWallets,
|
|
114
|
-
|
|
185
|
+
fromBlockchain?.name,
|
|
115
186
|
fromToken?.symbol,
|
|
116
187
|
fromToken?.address
|
|
117
188
|
)?.decimal
|
|
@@ -120,7 +191,7 @@ export function Home() {
|
|
|
120
191
|
|
|
121
192
|
useEffect(() => {
|
|
122
193
|
setCurrentPage(navigationRoutes.home);
|
|
123
|
-
|
|
194
|
+
resetRouteWallets();
|
|
124
195
|
return setCurrentPage.bind(null, '');
|
|
125
196
|
}, []);
|
|
126
197
|
|
|
@@ -132,60 +203,271 @@ export function Home() {
|
|
|
132
203
|
outputUsdValue.toNumber()
|
|
133
204
|
);
|
|
134
205
|
|
|
206
|
+
const getBestRouteSteps = (swaps: SwapResult[]) => {
|
|
207
|
+
return swaps.map((swap, index) => ({
|
|
208
|
+
swapper: { displayName: swap.swapperId, image: swap.swapperLogo },
|
|
209
|
+
from: {
|
|
210
|
+
token: { displayName: swap.from.symbol, image: swap.from.logo },
|
|
211
|
+
chain: {
|
|
212
|
+
displayName: swap.from.blockchain,
|
|
213
|
+
image: swap.from.blockchainLogo,
|
|
214
|
+
},
|
|
215
|
+
price: {
|
|
216
|
+
value:
|
|
217
|
+
index === 0
|
|
218
|
+
? numberToString(
|
|
219
|
+
inputAmount,
|
|
220
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
221
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
222
|
+
)
|
|
223
|
+
: swap.fromAmount,
|
|
224
|
+
},
|
|
225
|
+
},
|
|
226
|
+
to: {
|
|
227
|
+
token: { displayName: swap.to.symbol, image: swap.to.logo },
|
|
228
|
+
chain: {
|
|
229
|
+
displayName: swap.to.blockchain,
|
|
230
|
+
image: swap.to.blockchainLogo,
|
|
231
|
+
},
|
|
232
|
+
price: {
|
|
233
|
+
value: swap.toAmount,
|
|
234
|
+
},
|
|
235
|
+
},
|
|
236
|
+
alerts:
|
|
237
|
+
swap.swapperId === swapHasError?.swapperId ? (
|
|
238
|
+
<FooterStepAlarm>
|
|
239
|
+
<Alert
|
|
240
|
+
type="error"
|
|
241
|
+
title={recommendation}
|
|
242
|
+
footer={
|
|
243
|
+
<FooterAlert>
|
|
244
|
+
<Typography size="xsmall" variant="body" color="neutral900">
|
|
245
|
+
{fromAmountRangeError}
|
|
246
|
+
</Typography>
|
|
247
|
+
<Divider direction="horizontal" size={8} />
|
|
248
|
+
<Typography size="xsmall" variant="body" color="neutral900">
|
|
249
|
+
|
|
|
250
|
+
</Typography>
|
|
251
|
+
<Divider direction="horizontal" size={8} />
|
|
252
|
+
<Typography size="xsmall" variant="body" color="neutral900">
|
|
253
|
+
{`Yours: ${numberToString(
|
|
254
|
+
swapHasError?.fromAmount || null,
|
|
255
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
256
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
257
|
+
)} ${swap?.from.symbol}`}
|
|
258
|
+
</Typography>
|
|
259
|
+
</FooterAlert>
|
|
260
|
+
}
|
|
261
|
+
/>
|
|
262
|
+
</FooterStepAlarm>
|
|
263
|
+
) : undefined,
|
|
264
|
+
}));
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
const totalFeeInUsd = getTotalFeeInUsd(bestRoute, tokens);
|
|
268
|
+
|
|
269
|
+
const bestRouteData = getFormattedBestRoute(bestRoute);
|
|
270
|
+
|
|
135
271
|
return (
|
|
136
|
-
<
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
272
|
+
<Layout
|
|
273
|
+
ref={layoutRef}
|
|
274
|
+
fixedHeight={false}
|
|
275
|
+
hasLogo
|
|
276
|
+
footer={
|
|
277
|
+
<Button
|
|
278
|
+
type="primary"
|
|
279
|
+
size="large"
|
|
280
|
+
disabled={swapButtonState.disabled}
|
|
281
|
+
prefix={
|
|
282
|
+
!swapButtonState.disabled &&
|
|
283
|
+
swapButtonState.hasWarning && <WarningIcon />
|
|
284
|
+
}
|
|
285
|
+
fullWidth
|
|
286
|
+
onClick={() => {
|
|
287
|
+
if (swapButtonState.state === ButtonState.WAITFORCONNECTING) {
|
|
288
|
+
navigate(navigationRoutes.wallets);
|
|
289
|
+
} else if (swapButtonState.state === ButtonState.NEEDTOCONFIRM) {
|
|
290
|
+
setOpenWarningModal(true);
|
|
291
|
+
} else {
|
|
292
|
+
navigate(navigationRoutes.confirmSwap);
|
|
293
|
+
}
|
|
294
|
+
}}>
|
|
295
|
+
{swapButtonState.title}
|
|
296
|
+
</Button>
|
|
151
297
|
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
298
|
+
header={{
|
|
299
|
+
hasConnectWallet: true,
|
|
300
|
+
title: i18n.t('Swap'),
|
|
301
|
+
suffix: (
|
|
302
|
+
<HomeButtons
|
|
303
|
+
layoutRef={layoutRef.current}
|
|
304
|
+
onClickRefresh={
|
|
305
|
+
!!bestRoute || bestRouteError ? refetchBestRoute : undefined
|
|
306
|
+
}
|
|
307
|
+
onClickHistory={() => navigate(navigationRoutes.swaps)}
|
|
308
|
+
onClickSettings={() => navigate(navigationRoutes.settings)}
|
|
309
|
+
/>
|
|
310
|
+
),
|
|
311
|
+
}}>
|
|
312
|
+
<Container>
|
|
313
|
+
<InputsContainer>
|
|
314
|
+
<FromContainer>
|
|
315
|
+
<SwapInput
|
|
316
|
+
label="From"
|
|
317
|
+
onInputChange={setInputAmount}
|
|
318
|
+
balance={tokenBalance}
|
|
319
|
+
chain={{
|
|
320
|
+
displayName: fromBlockchain?.displayName || '',
|
|
321
|
+
image: fromBlockchain?.logo || '',
|
|
322
|
+
}}
|
|
323
|
+
token={{
|
|
324
|
+
displayName: fromToken?.symbol || '',
|
|
325
|
+
image: fromToken?.image || '',
|
|
326
|
+
}}
|
|
327
|
+
onClickToken={() => navigate('from-swap')}
|
|
328
|
+
price={{
|
|
329
|
+
value: inputAmount,
|
|
330
|
+
usdValue: priceImpactInputCanNotBeComputed
|
|
331
|
+
? undefined
|
|
332
|
+
: numberToString(
|
|
333
|
+
inputUsdValue,
|
|
334
|
+
USD_VALUE_MIN_DECIMALS,
|
|
335
|
+
USD_VALUE_MAX_DECIMALS
|
|
336
|
+
),
|
|
337
|
+
error: priceImpactInputCanNotBeComputed
|
|
338
|
+
? errorMessages.unknownPriceError.impactTitle
|
|
339
|
+
: undefined,
|
|
340
|
+
}}
|
|
341
|
+
disabled={loadingMetaStatus === 'failed'}
|
|
342
|
+
loading={loadingMetaStatus === 'loading'}
|
|
343
|
+
onSelectMaxBalance={() => {
|
|
344
|
+
if (tokenBalance !== '0') {
|
|
345
|
+
setInputAmount(tokenBalanceReal.split(',').join(''));
|
|
346
|
+
}
|
|
347
|
+
}}
|
|
348
|
+
/>
|
|
349
|
+
<SwitchFromAndToButton />
|
|
350
|
+
</FromContainer>
|
|
351
|
+
<SwapInput
|
|
352
|
+
sharpBottomStyle={!!bestRoute?.result || fetchingBestRoute}
|
|
353
|
+
label="To"
|
|
354
|
+
chain={{
|
|
355
|
+
displayName: toBlockchain?.displayName || '',
|
|
356
|
+
image: toBlockchain?.logo || '',
|
|
357
|
+
}}
|
|
358
|
+
token={{
|
|
359
|
+
displayName: toToken?.symbol || '',
|
|
360
|
+
image: toToken?.image || '',
|
|
361
|
+
}}
|
|
362
|
+
percentageChange={
|
|
363
|
+
!!percentageChange?.lt(0)
|
|
364
|
+
? numberToString(
|
|
365
|
+
percentageChange,
|
|
366
|
+
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
367
|
+
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
368
|
+
)
|
|
369
|
+
: null
|
|
370
|
+
}
|
|
371
|
+
warningLevel={getPriceImpactLevel(
|
|
372
|
+
percentageChange?.toNumber() ?? 0
|
|
373
|
+
)}
|
|
374
|
+
price={{
|
|
375
|
+
value: numberToString(
|
|
376
|
+
outputAmount,
|
|
377
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
378
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
379
|
+
),
|
|
380
|
+
usdValue: priceImpactOutputCanNotBeComputed
|
|
381
|
+
? undefined
|
|
382
|
+
: numberToString(
|
|
383
|
+
outputUsdValue,
|
|
384
|
+
USD_VALUE_MIN_DECIMALS,
|
|
385
|
+
USD_VALUE_MAX_DECIMALS
|
|
386
|
+
),
|
|
387
|
+
error: priceImpactOutputCanNotBeComputed
|
|
388
|
+
? errorMessages.unknownPriceError.impactTitle
|
|
389
|
+
: undefined,
|
|
390
|
+
}}
|
|
391
|
+
onClickToken={() => navigate('to-swap')}
|
|
392
|
+
disabled={loadingMetaStatus === 'failed'}
|
|
393
|
+
loading={loadingMetaStatus === 'loading'}
|
|
394
|
+
/>
|
|
395
|
+
</InputsContainer>
|
|
396
|
+
{fetchingBestRoute && (
|
|
397
|
+
<BestRouteContainer>
|
|
398
|
+
<BestRouteSkeleton type="basic" />
|
|
399
|
+
</BestRouteContainer>
|
|
400
|
+
)}
|
|
401
|
+
{showBestRoute &&
|
|
402
|
+
!fetchingBestRoute &&
|
|
403
|
+
bestRouteData?.result?.swaps?.length ? (
|
|
404
|
+
<BestRouteContainer>
|
|
405
|
+
<BestRoute
|
|
406
|
+
type="basic"
|
|
407
|
+
recommended={true}
|
|
408
|
+
input={{
|
|
409
|
+
value: numberToString(
|
|
410
|
+
inputAmount,
|
|
411
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
412
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
413
|
+
),
|
|
414
|
+
usdValue: numberToString(
|
|
415
|
+
inputUsdValue,
|
|
416
|
+
USD_VALUE_MIN_DECIMALS,
|
|
417
|
+
USD_VALUE_MAX_DECIMALS
|
|
418
|
+
),
|
|
419
|
+
}}
|
|
420
|
+
output={{
|
|
421
|
+
value: numberToString(
|
|
422
|
+
outputAmount,
|
|
423
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
424
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
425
|
+
),
|
|
426
|
+
usdValue: numberToString(
|
|
427
|
+
outputUsdValue,
|
|
428
|
+
USD_VALUE_MIN_DECIMALS,
|
|
429
|
+
USD_VALUE_MAX_DECIMALS
|
|
430
|
+
),
|
|
431
|
+
}}
|
|
432
|
+
steps={getBestRouteSteps(bestRouteData.result.swaps)}
|
|
433
|
+
percentageChange={numberToString(
|
|
434
|
+
percentageChange,
|
|
435
|
+
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
436
|
+
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
437
|
+
)}
|
|
438
|
+
totalFee={numberToString(
|
|
439
|
+
totalFeeInUsd,
|
|
440
|
+
GAS_FEE_MIN_DECIMALS,
|
|
441
|
+
GAS_FEE_MAX_DECIMALS
|
|
442
|
+
)}
|
|
443
|
+
totalTime={secondsToString(totalArrivalTime(bestRoute))}
|
|
444
|
+
/>
|
|
445
|
+
</BestRouteContainer>
|
|
446
|
+
) : showBestRoute && !fetchingBestRoute ? (
|
|
447
|
+
<>
|
|
448
|
+
<Divider size={20} />
|
|
449
|
+
<NoRoutes
|
|
450
|
+
diagnosisMessage={bestRouteData?.diagnosisMessages?.[0]}
|
|
451
|
+
fetch={refetchBestRoute}
|
|
452
|
+
error={!!bestRouteError}
|
|
453
|
+
/>
|
|
454
|
+
</>
|
|
455
|
+
) : null}
|
|
456
|
+
</Container>
|
|
457
|
+
<RouteErrors
|
|
458
|
+
openModal={openWarningModal}
|
|
459
|
+
onToggle={setOpenWarningModal}
|
|
460
|
+
totalFeeInUsd={totalFeeInUsd}
|
|
461
|
+
outputUsdValue={outputUsdValue}
|
|
462
|
+
inputUsdValue={inputUsdValue}
|
|
463
|
+
percentageChange={percentageChange}
|
|
464
|
+
highValueLoss={highValueLoss}
|
|
465
|
+
priceImpactCanNotBeComputed={
|
|
466
|
+
priceImpactInputCanNotBeComputed || priceImpactOutputCanNotBeComputed
|
|
165
467
|
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
onTokenClick={(route) => {
|
|
171
|
-
navigate(route);
|
|
172
|
-
}}
|
|
173
|
-
highFee={highFee}
|
|
174
|
-
errorMessage={errorMessage}
|
|
175
|
-
hasLimitError={hasLimitError}
|
|
176
|
-
swap={swap}
|
|
177
|
-
fromAmountRangeError={fromAmountRangeError}
|
|
178
|
-
recommendation={recommendation}
|
|
179
|
-
totalFeeInUsd={numberToString(totalFeeInUsd, 0, 2)}
|
|
180
|
-
swithFromAndToComponent={<SwithFromAndToButton />}
|
|
181
|
-
connectedWallets={connectedWallets}
|
|
182
|
-
percentageChange={numberToString(percentageChange, 0, 2)}
|
|
183
|
-
showPercentageChange={!!percentageChange?.lt(0)}
|
|
184
|
-
tokenBalanceReal={tokenBalanceReal}
|
|
185
|
-
tokenBalance={tokenBalance}
|
|
186
|
-
totalTime={secondsToString(totalArrivalTime(bestRoute))}
|
|
187
|
-
bestRouteData={getFormatedBestRoute(bestRoute)}
|
|
188
|
-
swapFromAmount={numberToString(swap?.fromAmount || null)}
|
|
189
|
-
/>
|
|
468
|
+
loading={fetchingBestRoute || loadingMetaStatus === 'loading'}
|
|
469
|
+
extraSpace={!!bestRoute?.result || !bestRoute}
|
|
470
|
+
/>
|
|
471
|
+
</Layout>
|
|
190
472
|
);
|
|
191
473
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core';
|
|
2
|
+
import {
|
|
3
|
+
List,
|
|
4
|
+
ListItemButton,
|
|
5
|
+
Radio,
|
|
6
|
+
RadioRoot,
|
|
7
|
+
Typography,
|
|
8
|
+
} from '@rango-dev/ui';
|
|
9
|
+
import React, { useState } from 'react';
|
|
10
|
+
|
|
11
|
+
import { Layout } from '../components/Layout';
|
|
12
|
+
import { SettingsContainer } from '../components/SettingsContainer';
|
|
13
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
14
|
+
import { useNavigateBack } from '../hooks/useNavigateBack';
|
|
15
|
+
|
|
16
|
+
enum Languages {
|
|
17
|
+
ENGLISH = 'english',
|
|
18
|
+
FRENCH = 'french',
|
|
19
|
+
SPANISH = 'spanish',
|
|
20
|
+
}
|
|
21
|
+
export function LanguagePage() {
|
|
22
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
23
|
+
const [language, setLanguage] = useState(Languages.ENGLISH);
|
|
24
|
+
|
|
25
|
+
const languageList = [
|
|
26
|
+
{
|
|
27
|
+
id: Languages.ENGLISH,
|
|
28
|
+
value: Languages.ENGLISH,
|
|
29
|
+
title: (
|
|
30
|
+
<Typography variant="title" size="xmedium">
|
|
31
|
+
{i18n.t('English')}
|
|
32
|
+
</Typography>
|
|
33
|
+
),
|
|
34
|
+
onClick: () => setLanguage(Languages.ENGLISH),
|
|
35
|
+
end: <Radio value={Languages.ENGLISH} />,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
id: Languages.FRENCH,
|
|
39
|
+
value: Languages.FRENCH,
|
|
40
|
+
title: (
|
|
41
|
+
<Typography variant="title" size="xmedium">
|
|
42
|
+
{i18n.t('French')}
|
|
43
|
+
</Typography>
|
|
44
|
+
),
|
|
45
|
+
onClick: () => setLanguage(Languages.FRENCH),
|
|
46
|
+
end: <Radio value={Languages.FRENCH} />,
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
id: Languages.SPANISH,
|
|
50
|
+
value: Languages.SPANISH,
|
|
51
|
+
title: (
|
|
52
|
+
<Typography variant="title" size="xmedium">
|
|
53
|
+
{i18n.t('Spanish')}
|
|
54
|
+
</Typography>
|
|
55
|
+
),
|
|
56
|
+
onClick: () => setLanguage(Languages.SPANISH),
|
|
57
|
+
end: <Radio value={Languages.SPANISH} />,
|
|
58
|
+
},
|
|
59
|
+
];
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<Layout
|
|
63
|
+
header={{
|
|
64
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.settings),
|
|
65
|
+
title: i18n.t('Language'),
|
|
66
|
+
}}>
|
|
67
|
+
<SettingsContainer>
|
|
68
|
+
<RadioRoot value={language}>
|
|
69
|
+
<List
|
|
70
|
+
type={
|
|
71
|
+
<ListItemButton
|
|
72
|
+
title="language"
|
|
73
|
+
id="_"
|
|
74
|
+
onClick={() => console.log()}
|
|
75
|
+
/>
|
|
76
|
+
}
|
|
77
|
+
items={languageList}
|
|
78
|
+
/>
|
|
79
|
+
</RadioRoot>
|
|
80
|
+
</SettingsContainer>
|
|
81
|
+
</Layout>
|
|
82
|
+
);
|
|
83
|
+
}
|