@rango-dev/widget-embedded 0.12.1-next.3 → 0.12.1-next.30
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/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 +2599 -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 +616 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +13 -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/SettingsContainer/SettingsContainer.style.d.ts +613 -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 +6 -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 +5 -2
- 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/time.d.ts +2 -2
- package/dist/utils/time.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 +92 -28
- package/src/components/AppRouter.tsx +35 -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/BlockchainsSection/BlockchainSection.helpers.ts +20 -0
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +105 -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 +210 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +494 -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 +294 -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 +12 -0
- package/src/components/HeaderButtons/HomeButtons.tsx +81 -0
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +20 -0
- package/src/components/HeaderButtons/WalletButton.tsx +23 -0
- package/src/components/HeaderButtons/index.ts +4 -0
- package/src/components/Layout/Layout.styles.ts +53 -0
- package/src/components/Layout/Layout.tsx +74 -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 +52 -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 +108 -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 +129 -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/SettingsContainer/SettingsContainer.style.ts +27 -0
- package/src/components/SettingsContainer/index.ts +6 -0
- package/src/components/Slippage/Slippage.styles.ts +24 -0
- package/src/components/Slippage/Slippage.tsx +94 -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 +72 -0
- package/src/components/SwapDetails/SwapDetails.tsx +428 -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 +34 -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 +126 -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 +499 -228
- package/src/pages/HistoryPage.tsx +104 -15
- package/src/pages/Home.tsx +405 -110
- package/src/pages/LanguagePage.tsx +83 -0
- package/src/pages/LiquiditySourcePage.tsx +159 -0
- package/src/pages/SelectBlockchainPage.tsx +81 -0
- package/src/pages/SelectSwapItemsPage.tsx +169 -0
- package/src/pages/SettingsPage.tsx +165 -72
- package/src/pages/SwapDetailsPage.tsx +40 -141
- package/src/pages/ThemePage.tsx +96 -0
- package/src/pages/WalletsPage.tsx +79 -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 +56 -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 +66 -20
- package/src/utils/routing.ts +105 -27
- package/src/utils/settings.ts +57 -0
- package/src/utils/swap.ts +244 -117
- package/src/utils/time.ts +69 -36
- 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,129 @@
|
|
|
1
|
+
import type { ModalPropTypes } from './RouteErrors.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Divider,
|
|
7
|
+
MessageBox,
|
|
8
|
+
Modal,
|
|
9
|
+
Typography,
|
|
10
|
+
WarningIcon,
|
|
11
|
+
} from '@rango-dev/ui';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import { useNavigate } from 'react-router-dom';
|
|
14
|
+
|
|
15
|
+
import { errorMessages } from '../../constants/errors';
|
|
16
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
17
|
+
import {
|
|
18
|
+
GAS_FEE_MAX_DECIMALS,
|
|
19
|
+
GAS_FEE_MIN_DECIMALS,
|
|
20
|
+
HIGHT_PRICE_IMPACT,
|
|
21
|
+
PERCENTAGE_CHANGE_MAX_DECIMALS,
|
|
22
|
+
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
23
|
+
USD_VALUE_MAX_DECIMALS,
|
|
24
|
+
USD_VALUE_MIN_DECIMALS,
|
|
25
|
+
} from '../../constants/routing';
|
|
26
|
+
import { numberToString } from '../../utils/numbers';
|
|
27
|
+
|
|
28
|
+
import { Flex } from './RouteErrors.styles';
|
|
29
|
+
import { RouteErrorsModalItem } from './RouteErrorsModalItem';
|
|
30
|
+
|
|
31
|
+
export function RouteErrorsModal(props: ModalPropTypes) {
|
|
32
|
+
const {
|
|
33
|
+
highValueLoss,
|
|
34
|
+
open,
|
|
35
|
+
onToggle,
|
|
36
|
+
percentageChange,
|
|
37
|
+
inputUsdValue,
|
|
38
|
+
outputUsdValue,
|
|
39
|
+
totalFeeInUsd,
|
|
40
|
+
} = props;
|
|
41
|
+
const navigate = useNavigate();
|
|
42
|
+
const type =
|
|
43
|
+
highValueLoss && !!percentageChange?.lt(HIGHT_PRICE_IMPACT)
|
|
44
|
+
? 'error'
|
|
45
|
+
: 'warning';
|
|
46
|
+
const highValueLossData = [
|
|
47
|
+
{
|
|
48
|
+
title: i18n.t('Swapping'),
|
|
49
|
+
value: numberToString(
|
|
50
|
+
inputUsdValue,
|
|
51
|
+
USD_VALUE_MIN_DECIMALS,
|
|
52
|
+
USD_VALUE_MAX_DECIMALS
|
|
53
|
+
),
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
title: i18n.t('Gas cost'),
|
|
57
|
+
value: numberToString(
|
|
58
|
+
totalFeeInUsd,
|
|
59
|
+
GAS_FEE_MIN_DECIMALS,
|
|
60
|
+
GAS_FEE_MAX_DECIMALS
|
|
61
|
+
),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
title: i18n.t('Receiving'),
|
|
65
|
+
value: numberToString(
|
|
66
|
+
outputUsdValue,
|
|
67
|
+
USD_VALUE_MIN_DECIMALS,
|
|
68
|
+
USD_VALUE_MAX_DECIMALS
|
|
69
|
+
),
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
title: i18n.t('Price impact'),
|
|
73
|
+
value: numberToString(
|
|
74
|
+
percentageChange,
|
|
75
|
+
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
76
|
+
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
77
|
+
),
|
|
78
|
+
valueColor: `${type}500`,
|
|
79
|
+
},
|
|
80
|
+
];
|
|
81
|
+
|
|
82
|
+
return (
|
|
83
|
+
<Modal
|
|
84
|
+
open={open}
|
|
85
|
+
onClose={() => onToggle(false)}
|
|
86
|
+
container={document.getElementById('swap-box') || document.body}>
|
|
87
|
+
{highValueLoss ? (
|
|
88
|
+
<MessageBox
|
|
89
|
+
type={type}
|
|
90
|
+
title={errorMessages.highValueLossError.impactTitle}
|
|
91
|
+
description={errorMessages.highValueLossError.description}
|
|
92
|
+
/>
|
|
93
|
+
) : (
|
|
94
|
+
<MessageBox
|
|
95
|
+
type={type}
|
|
96
|
+
title={errorMessages.unknownPriceError.impactTitle}
|
|
97
|
+
description={errorMessages.unknownPriceError.description}
|
|
98
|
+
/>
|
|
99
|
+
)}
|
|
100
|
+
{highValueLoss && (
|
|
101
|
+
<Flex>
|
|
102
|
+
<Divider size={20} />
|
|
103
|
+
<Typography size="small" variant="title">
|
|
104
|
+
{i18n.t('Details')}
|
|
105
|
+
</Typography>
|
|
106
|
+
<Flex>
|
|
107
|
+
{highValueLossData.map((item, index) => {
|
|
108
|
+
const key = index;
|
|
109
|
+
return <RouteErrorsModalItem key={key} {...item} />;
|
|
110
|
+
})}
|
|
111
|
+
</Flex>
|
|
112
|
+
</Flex>
|
|
113
|
+
)}
|
|
114
|
+
<Divider size={32} />
|
|
115
|
+
<Button
|
|
116
|
+
type="primary"
|
|
117
|
+
size="large"
|
|
118
|
+
prefix={<WarningIcon />}
|
|
119
|
+
fullWidth
|
|
120
|
+
onClick={() => {
|
|
121
|
+
navigate(navigationRoutes.confirmSwap);
|
|
122
|
+
}}>
|
|
123
|
+
{highValueLoss
|
|
124
|
+
? errorMessages.highValueLossError.confirmMessage
|
|
125
|
+
: errorMessages.unknownPriceError.confirmMessage}
|
|
126
|
+
</Button>
|
|
127
|
+
</Modal>
|
|
128
|
+
);
|
|
129
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import type { ModalContentData } from './RouteErrors.types';
|
|
2
|
+
|
|
3
|
+
import { Typography } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { Item } from './RouteErrors.styles';
|
|
7
|
+
|
|
8
|
+
export function RouteErrorsModalItem(props: ModalContentData) {
|
|
9
|
+
const { title, value, valueColor } = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Item>
|
|
13
|
+
<Typography size="medium" variant="label" color="neutral800">
|
|
14
|
+
{title}
|
|
15
|
+
</Typography>
|
|
16
|
+
<Typography
|
|
17
|
+
size="large"
|
|
18
|
+
variant="label"
|
|
19
|
+
color={valueColor || 'foreground'}>
|
|
20
|
+
{`${valueColor ? '%' : '$'}${value}`}
|
|
21
|
+
</Typography>
|
|
22
|
+
</Item>
|
|
23
|
+
);
|
|
24
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { RouteErrors } from './RouteErrors';
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import type { PropTypes } from './SearchInput.types';
|
|
2
|
+
|
|
3
|
+
import { CloseIcon, IconButton, SearchIcon, TextField } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { IconWrapper } from './SearchInput.styles';
|
|
7
|
+
|
|
8
|
+
export function SearchInput(props: PropTypes) {
|
|
9
|
+
const {
|
|
10
|
+
variant,
|
|
11
|
+
fullWidth,
|
|
12
|
+
color,
|
|
13
|
+
size,
|
|
14
|
+
onChange,
|
|
15
|
+
value,
|
|
16
|
+
setValue,
|
|
17
|
+
...inputAttributes
|
|
18
|
+
} = props;
|
|
19
|
+
|
|
20
|
+
return (
|
|
21
|
+
<TextField
|
|
22
|
+
prefix={
|
|
23
|
+
<IconWrapper>
|
|
24
|
+
<SearchIcon color="black" />
|
|
25
|
+
</IconWrapper>
|
|
26
|
+
}
|
|
27
|
+
suffix={
|
|
28
|
+
!!value.length && (
|
|
29
|
+
<IconButton
|
|
30
|
+
variant="ghost"
|
|
31
|
+
onClick={() => setValue?.('')}
|
|
32
|
+
size="small">
|
|
33
|
+
<CloseIcon color="gray" size={10} />
|
|
34
|
+
</IconButton>
|
|
35
|
+
)
|
|
36
|
+
}
|
|
37
|
+
fullWidth={fullWidth}
|
|
38
|
+
color={color}
|
|
39
|
+
variant={variant}
|
|
40
|
+
style={{
|
|
41
|
+
padding: 10,
|
|
42
|
+
borderRadius: 25,
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
}}
|
|
45
|
+
size={size}
|
|
46
|
+
value={value}
|
|
47
|
+
onChange={onChange}
|
|
48
|
+
{...inputAttributes}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
|
|
3
|
+
export type PropTypes = {
|
|
4
|
+
variant?: 'contained' | 'outlined' | 'ghost';
|
|
5
|
+
fullWidth?: boolean;
|
|
6
|
+
color?: 'dark' | 'light';
|
|
7
|
+
size?: 'small' | 'large';
|
|
8
|
+
value: string;
|
|
9
|
+
setValue?: (value: string) => void;
|
|
10
|
+
} & Omit<React.InputHTMLAttributes<HTMLInputElement>, 'size' | 'value'>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { SearchInput } from './SearchInput';
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const SettingsContainer = styled('div', {
|
|
4
|
+
height: '100%',
|
|
5
|
+
});
|
|
6
|
+
|
|
7
|
+
export const LiquiditySourceList = styled('ul', {
|
|
8
|
+
padding: '$15 $5 0',
|
|
9
|
+
margin: 0,
|
|
10
|
+
listStyle: 'none',
|
|
11
|
+
height: '100%',
|
|
12
|
+
overflowY: 'visible',
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const LiquiditySourceSuffix = styled('div', {
|
|
16
|
+
width: 80,
|
|
17
|
+
display: 'flex',
|
|
18
|
+
justifyContent: 'flex-end',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const NotFoundContainer = styled('div', {
|
|
22
|
+
display: 'flex',
|
|
23
|
+
flexDirection: 'column',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
justifyContent: 'center',
|
|
26
|
+
height: '100%',
|
|
27
|
+
});
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const BaseContainer = styled('div', {
|
|
4
|
+
paddingTop: '$5',
|
|
5
|
+
paddingBottom: '30px',
|
|
6
|
+
});
|
|
7
|
+
|
|
8
|
+
export const SlippageChipsContainer = styled('div', {
|
|
9
|
+
display: 'flex',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
justifyContent: 'start',
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export const Head = styled('div', {
|
|
15
|
+
display: 'flex',
|
|
16
|
+
justifyContent: 'start',
|
|
17
|
+
alignItems: 'center',
|
|
18
|
+
paddingBottom: '$10',
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
export const SlippageTooltipContainer = styled('div', {
|
|
22
|
+
maxWidth: '300px',
|
|
23
|
+
padding: '$10',
|
|
24
|
+
});
|
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core';
|
|
2
|
+
import {
|
|
3
|
+
Chip,
|
|
4
|
+
Divider,
|
|
5
|
+
InfoIcon,
|
|
6
|
+
TextField,
|
|
7
|
+
Tooltip,
|
|
8
|
+
Typography,
|
|
9
|
+
} from '@rango-dev/ui';
|
|
10
|
+
import React from 'react';
|
|
11
|
+
|
|
12
|
+
import {
|
|
13
|
+
MAX_SLIPPAGE,
|
|
14
|
+
MIN_SLIPPGAE,
|
|
15
|
+
SLIPPAGES,
|
|
16
|
+
} from '../../constants/swapSettings';
|
|
17
|
+
import { useSettingsStore } from '../../store/settings';
|
|
18
|
+
import { getContainer } from '../../utils/common';
|
|
19
|
+
|
|
20
|
+
import { BaseContainer, Head, SlippageChipsContainer } from './Slippage.styles';
|
|
21
|
+
import { SlippageTooltipContent } from './SlippageTooltipContent';
|
|
22
|
+
|
|
23
|
+
export function Slippage() {
|
|
24
|
+
const slippage = useSettingsStore.use.slippage();
|
|
25
|
+
const setSlippage = useSettingsStore.use.setSlippage();
|
|
26
|
+
const customSlippage = useSettingsStore.use.customSlippage();
|
|
27
|
+
const setCustomSlippage = useSettingsStore.use.setCustomSlippage();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<BaseContainer>
|
|
31
|
+
<Head>
|
|
32
|
+
<Typography variant="title" size="xmedium">
|
|
33
|
+
{i18n.t('Slippage tolerance per swap')}
|
|
34
|
+
</Typography>
|
|
35
|
+
<Divider direction="horizontal" size={4} />
|
|
36
|
+
<Tooltip
|
|
37
|
+
container={getContainer()}
|
|
38
|
+
side="top"
|
|
39
|
+
content={<SlippageTooltipContent />}>
|
|
40
|
+
<InfoIcon color="gray" />
|
|
41
|
+
</Tooltip>
|
|
42
|
+
</Head>
|
|
43
|
+
<SlippageChipsContainer>
|
|
44
|
+
{SLIPPAGES.map((slippageItem, index) => {
|
|
45
|
+
const key = `slippage-${index}`;
|
|
46
|
+
return (
|
|
47
|
+
<>
|
|
48
|
+
<Chip
|
|
49
|
+
style={{ width: '64px', flexShrink: 0 }}
|
|
50
|
+
key={key}
|
|
51
|
+
onClick={() => {
|
|
52
|
+
if (customSlippage) {
|
|
53
|
+
setCustomSlippage(null);
|
|
54
|
+
}
|
|
55
|
+
setSlippage(slippageItem);
|
|
56
|
+
}}
|
|
57
|
+
selected={!customSlippage && slippageItem === slippage}
|
|
58
|
+
label={`${slippageItem.toString()}%`}
|
|
59
|
+
/>
|
|
60
|
+
<Divider direction="horizontal" size={8} />
|
|
61
|
+
</>
|
|
62
|
+
);
|
|
63
|
+
})}
|
|
64
|
+
<TextField
|
|
65
|
+
type="number"
|
|
66
|
+
min="0.01"
|
|
67
|
+
max="30"
|
|
68
|
+
step="0.01"
|
|
69
|
+
fullWidth
|
|
70
|
+
variant="contained"
|
|
71
|
+
value={customSlippage || ''}
|
|
72
|
+
color="dark"
|
|
73
|
+
onChange={(event) => {
|
|
74
|
+
const parsedValue = parseFloat(event.target.value);
|
|
75
|
+
if (
|
|
76
|
+
!parsedValue ||
|
|
77
|
+
(parsedValue >= MIN_SLIPPGAE && parsedValue <= MAX_SLIPPAGE)
|
|
78
|
+
) {
|
|
79
|
+
setCustomSlippage(parsedValue);
|
|
80
|
+
}
|
|
81
|
+
}}
|
|
82
|
+
suffix={
|
|
83
|
+
customSlippage && (
|
|
84
|
+
<Typography variant="body" size="small">
|
|
85
|
+
%
|
|
86
|
+
</Typography>
|
|
87
|
+
)
|
|
88
|
+
}
|
|
89
|
+
placeholder={i18n.t('Custom')}
|
|
90
|
+
/>
|
|
91
|
+
</SlippageChipsContainer>
|
|
92
|
+
</BaseContainer>
|
|
93
|
+
);
|
|
94
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { i18n } from '@lingui/core';
|
|
2
|
+
import { Typography } from '@rango-dev/ui';
|
|
3
|
+
import React from 'react';
|
|
4
|
+
|
|
5
|
+
import { SlippageTooltipContainer } from './Slippage.styles';
|
|
6
|
+
|
|
7
|
+
export function SlippageTooltipContent() {
|
|
8
|
+
return (
|
|
9
|
+
<SlippageTooltipContainer>
|
|
10
|
+
<Typography variant="label" size="medium" color="neutral900">
|
|
11
|
+
{i18n.t(
|
|
12
|
+
'Your transaction will be reverted if the price changes unfavorably by more than this percentage'
|
|
13
|
+
)}
|
|
14
|
+
<br />
|
|
15
|
+
<br />
|
|
16
|
+
<b>{i18n.t('Warning')}</b>:
|
|
17
|
+
{i18n.t(
|
|
18
|
+
'This setting is applied per step, e.g. 1Inch, Thorchain, etc. and only that step will be reverted, not the whole transaction'
|
|
19
|
+
)}
|
|
20
|
+
</Typography>
|
|
21
|
+
</SlippageTooltipContainer>
|
|
22
|
+
);
|
|
23
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { Slippage } from './Slippage';
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import type { SwapDetailsPlaceholderPropTypes } from './SwapDetails.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import {
|
|
5
|
+
CopyIcon,
|
|
6
|
+
IconButton,
|
|
7
|
+
NotFound,
|
|
8
|
+
Skeleton,
|
|
9
|
+
Typography,
|
|
10
|
+
} from '@rango-dev/ui';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
|
|
13
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
14
|
+
import { useNavigateBack } from '../../hooks/useNavigateBack';
|
|
15
|
+
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
16
|
+
import { Layout } from '../Layout';
|
|
17
|
+
import { LoadingSwapDetails } from '../LoadingSwapDetails';
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
Container,
|
|
21
|
+
HeaderDetails,
|
|
22
|
+
PlaceholderContainer,
|
|
23
|
+
} from './SwapDetails.styles';
|
|
24
|
+
|
|
25
|
+
export function SwapDetailsPlaceholder(props: SwapDetailsPlaceholderPropTypes) {
|
|
26
|
+
const { requestId, showSkeleton } = props;
|
|
27
|
+
const { navigateBackFrom } = useNavigateBack();
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<Layout
|
|
31
|
+
noPadding
|
|
32
|
+
header={{
|
|
33
|
+
title: i18n.t('Swap and Bridge'),
|
|
34
|
+
onBack: navigateBackFrom.bind(null, navigationRoutes.swapDetails),
|
|
35
|
+
suffix: <SuffixContainer />,
|
|
36
|
+
}}>
|
|
37
|
+
{showSkeleton && (
|
|
38
|
+
<Container>
|
|
39
|
+
<HeaderDetails>
|
|
40
|
+
<div className="row">
|
|
41
|
+
<Typography variant="label" size="large" color="neutral900">
|
|
42
|
+
{`${i18n.t('Request ID')}:`}
|
|
43
|
+
</Typography>
|
|
44
|
+
<div className="request-id">
|
|
45
|
+
<Typography variant="label" size="small" color="neutral900">
|
|
46
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
47
|
+
</Typography>
|
|
48
|
+
<IconButton variant="ghost">
|
|
49
|
+
<CopyIcon size={16} color="gray" />
|
|
50
|
+
</IconButton>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
<div className="row">
|
|
54
|
+
<Typography variant="label" size="large" color="neutral900">
|
|
55
|
+
{`${i18n.t('Created at')}:`}
|
|
56
|
+
</Typography>
|
|
57
|
+
<Typography variant="label" size="small" color="neutral900">
|
|
58
|
+
<Skeleton width={60} height={10} variant="rounded" />
|
|
59
|
+
</Typography>
|
|
60
|
+
</div>
|
|
61
|
+
</HeaderDetails>
|
|
62
|
+
<LoadingSwapDetails />
|
|
63
|
+
</Container>
|
|
64
|
+
)}
|
|
65
|
+
{!showSkeleton && (
|
|
66
|
+
<PlaceholderContainer>
|
|
67
|
+
<NotFound
|
|
68
|
+
title={i18n.t('Not found')}
|
|
69
|
+
description={i18n.t({
|
|
70
|
+
id: 'swapNotFound',
|
|
71
|
+
values: { requestId },
|
|
72
|
+
message: 'Swap with request ID = {requestId} not found.',
|
|
73
|
+
})}
|
|
74
|
+
/>
|
|
75
|
+
</PlaceholderContainer>
|
|
76
|
+
)}
|
|
77
|
+
</Layout>
|
|
78
|
+
);
|
|
79
|
+
}
|
|
@@ -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,72 @@
|
|
|
1
|
+
import { darkTheme, 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 $20',
|
|
16
|
+
borderBottom: '1px solid',
|
|
17
|
+
$$color: '$colors$neutral300',
|
|
18
|
+
[`.${darkTheme} &`]: {
|
|
19
|
+
$$color: '$colors$neutral400',
|
|
20
|
+
},
|
|
21
|
+
borderColor: '$$color',
|
|
22
|
+
color: '$neutral500',
|
|
23
|
+
},
|
|
24
|
+
'& .request-id': {
|
|
25
|
+
display: 'flex',
|
|
26
|
+
justifyContent: 'center',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
height: '$24',
|
|
29
|
+
},
|
|
30
|
+
'& .output': {
|
|
31
|
+
display: 'flex',
|
|
32
|
+
width: '100%',
|
|
33
|
+
padding: '$15 $20 $20',
|
|
34
|
+
flexDirection: 'column',
|
|
35
|
+
alignItems: 'start',
|
|
36
|
+
},
|
|
37
|
+
'& .title-steps': {
|
|
38
|
+
textAlign: 'left',
|
|
39
|
+
width: '100%',
|
|
40
|
+
padding: '0 $20 $10',
|
|
41
|
+
},
|
|
42
|
+
});
|
|
43
|
+
|
|
44
|
+
export const HeaderDetails = styled('div', {
|
|
45
|
+
width: '100%',
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
export const StepsList = styled('div', {
|
|
49
|
+
padding: '$0 $20 $20 $20',
|
|
50
|
+
width: '100%',
|
|
51
|
+
overflow: 'auto',
|
|
52
|
+
});
|
|
53
|
+
export const Alerts = styled('div', {
|
|
54
|
+
display: 'flex',
|
|
55
|
+
flexDirection: 'column',
|
|
56
|
+
gap: '$10',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const PlaceholderContainer = styled('div', {
|
|
60
|
+
height: '450px',
|
|
61
|
+
display: 'flex',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
justifyContent: 'center',
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
export const LoaderContainer = styled('div', {
|
|
67
|
+
display: 'flex',
|
|
68
|
+
justifyContent: 'center',
|
|
69
|
+
width: '100%',
|
|
70
|
+
paddingTop: '33%',
|
|
71
|
+
flex: 1,
|
|
72
|
+
});
|