@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
|
@@ -4,10 +4,11 @@ import {
|
|
|
4
4
|
useLocation,
|
|
5
5
|
useSearchParams,
|
|
6
6
|
} from 'react-router-dom';
|
|
7
|
+
|
|
8
|
+
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
9
|
+
import { SearchParams } from '../constants/searchParams';
|
|
7
10
|
import { useBestRouteStore } from '../store/bestRoute';
|
|
8
11
|
import { useMetaStore } from '../store/meta';
|
|
9
|
-
import { SearchParams } from '../constants/searchParams';
|
|
10
|
-
import { navigationRoutes } from '../constants/navigationRoutes';
|
|
11
12
|
import { useUiStore } from '../store/ui';
|
|
12
13
|
import { searchParamsToToken } from '../utils/routing';
|
|
13
14
|
|
|
@@ -17,13 +18,13 @@ export function UpdateUrl() {
|
|
|
17
18
|
const location = useLocation();
|
|
18
19
|
const firstRenderSearchParams = useRef(location.search);
|
|
19
20
|
const searchParamsRef = useRef<Record<string, string>>({});
|
|
20
|
-
const
|
|
21
|
-
const
|
|
21
|
+
const fromBlockchain = useBestRouteStore.use.fromBlockchain();
|
|
22
|
+
const toBlockchain = useBestRouteStore.use.toBlockchain();
|
|
22
23
|
const fromToken = useBestRouteStore.use.fromToken();
|
|
23
24
|
const toToken = useBestRouteStore.use.toToken();
|
|
24
|
-
const
|
|
25
|
+
const setFromBlockchain = useBestRouteStore.use.setFromBlockchain();
|
|
25
26
|
const setFromToken = useBestRouteStore.use.setFromToken();
|
|
26
|
-
const
|
|
27
|
+
const setToBlockchain = useBestRouteStore.use.setToBlockchain();
|
|
27
28
|
const setToToken = useBestRouteStore.use.setToToken();
|
|
28
29
|
const inputAmount = useBestRouteStore.use.inputAmount();
|
|
29
30
|
const setInputAmount = useBestRouteStore.use.setInputAmount();
|
|
@@ -41,7 +42,9 @@ export function UpdateUrl() {
|
|
|
41
42
|
searchParamsRef.current = params;
|
|
42
43
|
const requestId =
|
|
43
44
|
location.pathname.split(navigationRoutes.swaps + '/')[1] || null;
|
|
44
|
-
if (requestId)
|
|
45
|
+
if (requestId) {
|
|
46
|
+
setSelectedSwap(requestId);
|
|
47
|
+
}
|
|
45
48
|
}, []);
|
|
46
49
|
|
|
47
50
|
useEffect(() => {
|
|
@@ -59,12 +62,14 @@ export function UpdateUrl() {
|
|
|
59
62
|
fromAmount =
|
|
60
63
|
searchParamsRef.current[SearchParams.FROM_AMOUNT] || inputAmount;
|
|
61
64
|
} else {
|
|
62
|
-
if (location.state === 'redirect')
|
|
63
|
-
|
|
65
|
+
if (location.state === 'redirect') {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
fromChainString = fromBlockchain?.name || '';
|
|
64
69
|
fromTokenString =
|
|
65
70
|
(fromToken?.symbol || '') +
|
|
66
71
|
(fromToken?.address ? `--${fromToken?.address}` : '');
|
|
67
|
-
toChainString =
|
|
72
|
+
toChainString = toBlockchain?.name || '';
|
|
68
73
|
toTokenString =
|
|
69
74
|
(toToken?.symbol || '') +
|
|
70
75
|
(toToken?.address ? `--${toToken?.address}` : '');
|
|
@@ -88,7 +93,14 @@ export function UpdateUrl() {
|
|
|
88
93
|
);
|
|
89
94
|
}
|
|
90
95
|
firstRender.current = false;
|
|
91
|
-
}, [
|
|
96
|
+
}, [
|
|
97
|
+
location.pathname,
|
|
98
|
+
inputAmount,
|
|
99
|
+
fromBlockchain,
|
|
100
|
+
fromToken,
|
|
101
|
+
toBlockchain,
|
|
102
|
+
toToken,
|
|
103
|
+
]);
|
|
92
104
|
|
|
93
105
|
useEffect(() => {
|
|
94
106
|
if (loadingStatus === 'success') {
|
|
@@ -97,31 +109,37 @@ export function UpdateUrl() {
|
|
|
97
109
|
const toChainString = searchParams.get(SearchParams.TO_CHAIN);
|
|
98
110
|
const toTokenString = searchParams.get(SearchParams.TO_TOKEN);
|
|
99
111
|
const fromAmount = searchParams.get(SearchParams.FROM_AMOUNT);
|
|
100
|
-
const
|
|
112
|
+
const fromBlockchain = blockchains.find(
|
|
101
113
|
(blockchain) => blockchain.name === fromChainString
|
|
102
114
|
);
|
|
103
115
|
const fromToken = searchParamsToToken(
|
|
104
116
|
tokens,
|
|
105
117
|
fromTokenString,
|
|
106
|
-
|
|
118
|
+
fromBlockchain || null
|
|
107
119
|
);
|
|
108
|
-
const
|
|
120
|
+
const toBlockchain = blockchains.find(
|
|
109
121
|
(blockchain) => blockchain.name === toChainString
|
|
110
122
|
);
|
|
111
123
|
const toToken = searchParamsToToken(
|
|
112
124
|
tokens,
|
|
113
125
|
toTokenString,
|
|
114
|
-
|
|
126
|
+
toBlockchain || null
|
|
115
127
|
);
|
|
116
|
-
if (!!
|
|
117
|
-
|
|
118
|
-
if (!!fromToken)
|
|
128
|
+
if (!!fromBlockchain) {
|
|
129
|
+
setFromBlockchain(fromBlockchain);
|
|
130
|
+
if (!!fromToken) {
|
|
131
|
+
setFromToken(fromToken);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
if (!!toBlockchain) {
|
|
135
|
+
setToBlockchain(toBlockchain);
|
|
136
|
+
if (!!toToken) {
|
|
137
|
+
setToToken(toToken);
|
|
138
|
+
}
|
|
119
139
|
}
|
|
120
|
-
if (
|
|
121
|
-
|
|
122
|
-
if (!!toToken) setToToken(toToken);
|
|
140
|
+
if (fromAmount) {
|
|
141
|
+
setInputAmount(fromAmount);
|
|
123
142
|
}
|
|
124
|
-
if (fromAmount) setInputAmount(fromAmount);
|
|
125
143
|
}
|
|
126
144
|
}, [loadingStatus]);
|
|
127
145
|
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { PropTypes } from './WalletModal.types';
|
|
2
|
+
|
|
3
|
+
import { Divider, Modal } from '@rango-dev/ui';
|
|
4
|
+
import React from 'react';
|
|
5
|
+
|
|
6
|
+
import { ModalContent } from './WalletModalContent';
|
|
7
|
+
|
|
8
|
+
export function WalletModal(props: PropTypes) {
|
|
9
|
+
const { open, onClose, ...otherProps } = props;
|
|
10
|
+
|
|
11
|
+
return (
|
|
12
|
+
<Modal
|
|
13
|
+
open={open}
|
|
14
|
+
onClose={onClose}
|
|
15
|
+
container={document.getElementById('swap-box') || document.body}>
|
|
16
|
+
<ModalContent {...otherProps} />
|
|
17
|
+
<Divider direction="vertical" size={32} />
|
|
18
|
+
</Modal>
|
|
19
|
+
);
|
|
20
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { WalletState } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export interface PropTypes {
|
|
4
|
+
open: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
image: string;
|
|
7
|
+
state: WalletState;
|
|
8
|
+
error?: string;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export type ModalContentProps = Pick<PropTypes, 'state' | 'error' | 'image'>;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { keyframes, styled } from '@rango-dev/ui';
|
|
2
|
+
|
|
3
|
+
export const IconContainer = styled('div', {
|
|
4
|
+
borderRadius: '$lg',
|
|
5
|
+
width: '$45',
|
|
6
|
+
height: '$45',
|
|
7
|
+
backgroundColor: '$success300',
|
|
8
|
+
display: 'flex',
|
|
9
|
+
justifyContent: 'center',
|
|
10
|
+
alignItems: 'center',
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
export const LogoContainer = styled('div', {
|
|
14
|
+
position: 'relative',
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const spin = keyframes({
|
|
18
|
+
'0%': {
|
|
19
|
+
transform: 'rotate(0deg)',
|
|
20
|
+
},
|
|
21
|
+
'100%': {
|
|
22
|
+
transform: 'rotate(360deg)',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export const Spinner = styled('div', {
|
|
27
|
+
position: 'absolute',
|
|
28
|
+
border: '2px solid rgba(0, 0, 0, 0.1)',
|
|
29
|
+
borderTop: '2px solid $info500',
|
|
30
|
+
borderRadius: '$lg',
|
|
31
|
+
width: '$45',
|
|
32
|
+
height: '$45',
|
|
33
|
+
animation: `${spin} 1s linear infinite`,
|
|
34
|
+
top: 0,
|
|
35
|
+
bottom: 0,
|
|
36
|
+
right: 0,
|
|
37
|
+
left: 0,
|
|
38
|
+
});
|
|
39
|
+
|
|
40
|
+
export const WalletImageContainer = styled('div', {
|
|
41
|
+
'& img': {
|
|
42
|
+
borderRadius: '50%',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ModalContentProps } from './WalletModal.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Image, MessageBox, WalletState } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import {
|
|
8
|
+
LogoContainer,
|
|
9
|
+
Spinner,
|
|
10
|
+
WalletImageContainer,
|
|
11
|
+
} from './WalletModalContent.styles';
|
|
12
|
+
|
|
13
|
+
export function ModalContent(props: ModalContentProps) {
|
|
14
|
+
const { state, image, error } = props;
|
|
15
|
+
if (state === WalletState.CONNECTED) {
|
|
16
|
+
return (
|
|
17
|
+
<MessageBox
|
|
18
|
+
type="success"
|
|
19
|
+
title={i18n.t('Wallet Connected')}
|
|
20
|
+
description={i18n.t(
|
|
21
|
+
'Your wallet is connected, you can use it to swap.'
|
|
22
|
+
)}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
if (error) {
|
|
28
|
+
return (
|
|
29
|
+
<MessageBox
|
|
30
|
+
type="error"
|
|
31
|
+
title={i18n.t('Failed to Connect')}
|
|
32
|
+
description={
|
|
33
|
+
error || i18n.t('Your wallet is not connected. Please try again.')
|
|
34
|
+
}
|
|
35
|
+
/>
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
return (
|
|
40
|
+
<MessageBox
|
|
41
|
+
type="loading"
|
|
42
|
+
title={i18n.t('Connecting to your wallet')}
|
|
43
|
+
description={i18n.t('Click connect in your wallet popup.')}
|
|
44
|
+
icon={
|
|
45
|
+
<LogoContainer>
|
|
46
|
+
<WalletImageContainer>
|
|
47
|
+
<Image src={image} size={45} />
|
|
48
|
+
</WalletImageContainer>
|
|
49
|
+
<Spinner />
|
|
50
|
+
</LogoContainer>
|
|
51
|
+
}
|
|
52
|
+
/>
|
|
53
|
+
);
|
|
54
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { WalletModal } from './WalletModal';
|
|
@@ -1,22 +1,27 @@
|
|
|
1
|
-
import { useEffect } from 'react';
|
|
2
1
|
import {
|
|
3
|
-
|
|
2
|
+
isApprovalTX,
|
|
4
3
|
MainEvents,
|
|
4
|
+
RouteEventType,
|
|
5
5
|
StepEventType,
|
|
6
6
|
StepExecutionEventStatus,
|
|
7
|
-
|
|
7
|
+
useEvents,
|
|
8
8
|
} from '@rango-dev/queue-manager-rango-preset';
|
|
9
|
+
import { useEffect } from 'react';
|
|
10
|
+
|
|
11
|
+
import { useNotificationStore } from '../store/notification';
|
|
9
12
|
import { useWalletsStore } from '../store/wallets';
|
|
13
|
+
import { validBlockedStatuses } from '../types/notification';
|
|
10
14
|
|
|
11
15
|
export function WidgetEvents() {
|
|
12
16
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
13
17
|
const getWalletsDetails = useWalletsStore.use.getWalletsDetails();
|
|
14
|
-
|
|
18
|
+
const setNotification = useNotificationStore.use.setNotification();
|
|
19
|
+
const setAsRead = useNotificationStore.use.setAsRead();
|
|
15
20
|
const widgetEvents = useEvents();
|
|
16
21
|
|
|
17
22
|
useEffect(() => {
|
|
18
23
|
widgetEvents.on(MainEvents.StepEvent, (widgetEvent) => {
|
|
19
|
-
const { event, step } = widgetEvent;
|
|
24
|
+
const { event, step, route } = widgetEvent;
|
|
20
25
|
const shouldRefetchBalance =
|
|
21
26
|
(event.type === StepEventType.TX_EXECUTION &&
|
|
22
27
|
event.status === StepExecutionEventStatus.TX_SENT &&
|
|
@@ -36,6 +41,33 @@ export function WidgetEvents() {
|
|
|
36
41
|
fromAccount && getWalletsDetails([fromAccount]);
|
|
37
42
|
toAccount && getWalletsDetails([toAccount]);
|
|
38
43
|
}
|
|
44
|
+
if (
|
|
45
|
+
(event.type === StepEventType.TX_EXECUTION_BLOCKED &&
|
|
46
|
+
validBlockedStatuses.includes(event.status)) ||
|
|
47
|
+
event.type === StepEventType.FAILED
|
|
48
|
+
) {
|
|
49
|
+
setNotification(event, route);
|
|
50
|
+
} else if (
|
|
51
|
+
event.type === StepEventType.TX_EXECUTION ||
|
|
52
|
+
event.type === StepEventType.CHECK_STATUS
|
|
53
|
+
) {
|
|
54
|
+
setAsRead(route.requestId);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
return () => widgetEvents.all.clear();
|
|
59
|
+
}, [widgetEvents, connectedWallets.length]);
|
|
60
|
+
|
|
61
|
+
useEffect(() => {
|
|
62
|
+
widgetEvents.on(MainEvents.RouteEvent, (widgetEvent) => {
|
|
63
|
+
const { event, route } = widgetEvent;
|
|
64
|
+
|
|
65
|
+
if (
|
|
66
|
+
event.type === RouteEventType.FAILED ||
|
|
67
|
+
event.type === RouteEventType.SUCCEEDED
|
|
68
|
+
) {
|
|
69
|
+
setNotification(event, route);
|
|
70
|
+
}
|
|
39
71
|
});
|
|
40
72
|
|
|
41
73
|
return () => widgetEvents.all.clear();
|
package/src/constants/errors.ts
CHANGED
|
@@ -1,3 +1,58 @@
|
|
|
1
|
+
import type { ConfirmSwapError } from '../types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
|
|
5
|
+
import { ConfirmSwapErrorTypes } from '../types';
|
|
6
|
+
|
|
1
7
|
export const errorMessages = {
|
|
2
|
-
genericServerError: '
|
|
8
|
+
genericServerError: i18n.t('Failed Network, Please retry your swap.'),
|
|
9
|
+
liquiditySourcesError: {
|
|
10
|
+
title: i18n.t('Please reset your liquidity sources.'),
|
|
11
|
+
description: i18n.t(
|
|
12
|
+
'You have limited the liquidity sources and this might result in Rango finding no routes. Please consider resetting your liquidity sources'
|
|
13
|
+
),
|
|
14
|
+
},
|
|
15
|
+
noRoutesError: {
|
|
16
|
+
title: i18n.t('No Routes Found'),
|
|
17
|
+
description:
|
|
18
|
+
"Reasons why Rango couldn't find a route: low liquidity on token, very low input amount or no routes available for the selected input/output token combination.",
|
|
19
|
+
},
|
|
20
|
+
bridgeLimitErrors: {
|
|
21
|
+
increaseAmount: i18n.t('Bridge Limit Error: Please increase your amount'),
|
|
22
|
+
decreaseAmount: i18n.t('Bridge Limit Error: Please decrease your amount'),
|
|
23
|
+
},
|
|
24
|
+
highValueLossError: {
|
|
25
|
+
impactTitle: i18n.t('High Price Impact'),
|
|
26
|
+
title: i18n.t('Price impact is too high!'),
|
|
27
|
+
description: i18n.t(
|
|
28
|
+
'The price impact is significantly higher than the allowed amount. If you are sure, continue, otherwise, change the swap.'
|
|
29
|
+
),
|
|
30
|
+
confirmMessage: i18n.t('Confirm High price impact'),
|
|
31
|
+
},
|
|
32
|
+
routeUpdatedWithHighValueLoss: {
|
|
33
|
+
title: i18n.t(
|
|
34
|
+
'Route updated and price impact is too high, try again later!'
|
|
35
|
+
),
|
|
36
|
+
},
|
|
37
|
+
unknownPriceError: {
|
|
38
|
+
impactTitle: i18n.t('USD Price Unknown'),
|
|
39
|
+
title: i18n.t('USD Price Unknown, Cannot calculate Price Impact.'),
|
|
40
|
+
description: i18n.t(
|
|
41
|
+
'USD Price Unknown, Cannot calculate Price Impact. The price impact may be higher than usual. Are you sure to continue the Swap?'
|
|
42
|
+
),
|
|
43
|
+
confirmMessage: i18n.t('Confirm USD Price Unknown'),
|
|
44
|
+
},
|
|
3
45
|
};
|
|
46
|
+
|
|
47
|
+
export function getConfirmSwapErrorMessage(error: ConfirmSwapError) {
|
|
48
|
+
switch (error.type) {
|
|
49
|
+
case ConfirmSwapErrorTypes.NO_ROUTE:
|
|
50
|
+
return error.diagnosisMessage ?? errorMessages.noRoutesError.title;
|
|
51
|
+
case ConfirmSwapErrorTypes.REQUEST_FAILED:
|
|
52
|
+
return errorMessages.genericServerError;
|
|
53
|
+
case ConfirmSwapErrorTypes.ROUTE_UPDATED_WITH_HIGH_VALUE_LOSS:
|
|
54
|
+
return errorMessages.routeUpdatedWithHighValueLoss.title;
|
|
55
|
+
default:
|
|
56
|
+
return '';
|
|
57
|
+
}
|
|
58
|
+
}
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
export const navigationRoutes = {
|
|
2
2
|
home: '/',
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
fromSwap: 'from-swap',
|
|
4
|
+
fromBlockchain: '/from-swap/blockchains',
|
|
5
|
+
toBlockchain: '/to-swap/blockchains',
|
|
6
|
+
toSwap: 'to-swap',
|
|
7
7
|
settings: 'settings',
|
|
8
8
|
liquiditySources: '/settings/liquidity-sources',
|
|
9
|
+
themes: '/settings/themes',
|
|
10
|
+
bridges: '/settings/bridges',
|
|
11
|
+
exchanges: '/settings/exchanges',
|
|
12
|
+
languages: '/settings/languages',
|
|
9
13
|
swaps: 'swaps',
|
|
10
14
|
wallets: 'wallets',
|
|
11
15
|
confirmSwap: 'confirm-swap',
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const LOW_PRICE_IMPACT = -3;
|
|
2
|
+
export const HIGHT_PRICE_IMPACT = -10;
|
|
3
|
+
|
|
4
|
+
export const TOKEN_AMOUNT_MIN_DECIMALS = 6;
|
|
5
|
+
export const TOKEN_AMOUNT_MAX_DECIMALS = 6;
|
|
6
|
+
|
|
7
|
+
export const USD_VALUE_MIN_DECIMALS = 4;
|
|
8
|
+
export const USD_VALUE_MAX_DECIMALS = 4;
|
|
9
|
+
|
|
10
|
+
export const GAS_FEE_MIN_DECIMALS = 2;
|
|
11
|
+
export const GAS_FEE_MAX_DECIMALS = 2;
|
|
12
|
+
|
|
13
|
+
export const PERCENTAGE_CHANGE_MIN_DECIMALS = 2;
|
|
14
|
+
export const PERCENTAGE_CHANGE_MAX_DECIMALS = 2;
|
|
15
|
+
|
|
16
|
+
export const BALANCE_MIN_DECIMALS = 8;
|
|
17
|
+
export const BALANCE_MAX_DECIMALS = 8;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { RouteWarning } from '../types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
|
|
5
|
+
import { RouteWarningType } from '../types';
|
|
6
|
+
|
|
7
|
+
export function getRouteWarningMessage(warning: RouteWarning) {
|
|
8
|
+
switch (warning.type) {
|
|
9
|
+
case RouteWarningType.ROUTE_UPDATED:
|
|
10
|
+
return i18n.t('Route has been updated.');
|
|
11
|
+
case RouteWarningType.ROUTE_AND_OUTPUT_AMOUNT_UPDATED:
|
|
12
|
+
return i18n.t(
|
|
13
|
+
'Output amount changed to {newOutputAmount} ({percentageChange}% change).',
|
|
14
|
+
{
|
|
15
|
+
newOutputAmount: warning.newOutputAmount,
|
|
16
|
+
percentageChange: warning.percentageChange,
|
|
17
|
+
}
|
|
18
|
+
);
|
|
19
|
+
case RouteWarningType.ROUTE_SWAPPERS_UPDATED:
|
|
20
|
+
return i18n.t('Route swappers has been updated.');
|
|
21
|
+
case RouteWarningType.ROUTE_COINS_UPDATED:
|
|
22
|
+
return i18n.t('Route internal coins has been updated.');
|
|
23
|
+
default:
|
|
24
|
+
return '';
|
|
25
|
+
}
|
|
26
|
+
}
|
package/src/globalStyles.ts
CHANGED
|
@@ -1,12 +1,9 @@
|
|
|
1
1
|
import { globalCss } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
|
-
export const globalFont = (
|
|
3
|
+
export const globalFont = () =>
|
|
4
4
|
globalCss({
|
|
5
5
|
'@import': [
|
|
6
6
|
"url('https://fonts.googleapis.com/css2?family=Roboto:ital,wght@0,100;0,300;0,400;0,500;0,700;0,900;1,100;1,300;1,400;1,500;1,700;1,900&display=swap')",
|
|
7
7
|
"url('https://fonts.cdnfonts.com/css/times-new-roman')",
|
|
8
8
|
],
|
|
9
|
-
body: {
|
|
10
|
-
fontFamily,
|
|
11
|
-
},
|
|
12
9
|
})();
|