@rango-dev/widget-embedded 0.12.1-next.2 → 0.12.1-next.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Wallets.d.ts +4 -3
- package/dist/Wallets.d.ts.map +1 -1
- package/dist/Widget.d.ts +3 -2
- package/dist/Widget.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +3 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainList/BlockchainList.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts +4 -0
- package/dist/components/BlockchainList/BlockchainList.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts +307 -0
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts +8 -0
- package/dist/components/BlockchainList/BlockchainList.types.d.ts.map +1 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts +3 -0
- package/dist/components/BlockchainList/LoadingBlockchainList.d.ts.map +1 -0
- package/dist/components/BlockchainList/index.d.ts +2 -0
- package/dist/components/BlockchainList/index.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts +5 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts +156 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts +6 -0
- package/dist/components/BlockchainsChip/BlockchainsChip.types.d.ts.map +1 -0
- package/dist/components/BlockchainsChip/index.d.ts +2 -0
- package/dist/components/BlockchainsChip/index.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts +3 -0
- package/dist/components/BlockchainsSection/BlockchainSection.helpers.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts +4 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +154 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts +9 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.types.d.ts.map +1 -0
- package/dist/components/BlockchainsSection/index.d.ts +2 -0
- package/dist/components/BlockchainsSection/index.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts +6 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.helpers.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +2597 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +11 -0
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts +4 -0
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +460 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +12 -0
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts.map +1 -0
- package/dist/components/HeaderButtons/BackButton.d.ts +5 -0
- package/dist/components/HeaderButtons/BackButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts +5 -0
- package/dist/components/HeaderButtons/CancelButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +895 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +12 -0
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts +4 -0
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts +3 -0
- package/dist/components/HeaderButtons/UnreadNotificationsBadge.d.ts.map +1 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts +5 -0
- package/dist/components/HeaderButtons/WalletButton.d.ts.map +1 -0
- package/dist/components/HeaderButtons/index.d.ts +5 -0
- package/dist/components/HeaderButtons/index.d.ts.map +1 -0
- package/dist/components/Layout/Layout.d.ts +7 -0
- package/dist/components/Layout/Layout.d.ts.map +1 -0
- package/dist/components/Layout/Layout.styles.d.ts +464 -0
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -0
- package/dist/components/Layout/Layout.types.d.ts +17 -0
- package/dist/components/Layout/Layout.types.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts +3 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +155 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts +2 -0
- package/dist/components/LoadingLiquiditySourceList/index.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts +3 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +460 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +4 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +1 -0
- package/dist/components/LoadingSwapDetails/index.d.ts +2 -0
- package/dist/components/LoadingSwapDetails/index.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts +4 -0
- package/dist/components/NoRoutes/NoRoutes.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts +3 -0
- package/dist/components/NoRoutes/NoRoutes.helper.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts +460 -0
- package/dist/components/NoRoutes/NoRoutes.styles.d.ts.map +1 -0
- package/dist/components/NoRoutes/NoRoutes.types.d.ts +20 -0
- package/dist/components/NoRoutes/NoRoutes.types.d.ts.map +1 -0
- package/dist/components/NoRoutes/index.d.ts +2 -0
- package/dist/components/NoRoutes/index.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts +3 -0
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +613 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts +3 -0
- package/dist/components/NotificationContent/NotificationNotFound.d.ts.map +1 -0
- package/dist/components/NotificationContent/index.d.ts +2 -0
- package/dist/components/NotificationContent/index.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrors.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts +613 -0
- package/dist/components/RouteErrors/RouteErrors.styles.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts +24 -0
- package/dist/components/RouteErrors/RouteErrors.types.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModal.d.ts.map +1 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts +4 -0
- package/dist/components/RouteErrors/RouteErrorsModalItem.d.ts.map +1 -0
- package/dist/components/RouteErrors/index.d.ts +2 -0
- package/dist/components/RouteErrors/index.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.d.ts +4 -0
- package/dist/components/SearchInput/SearchInput.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts +154 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts +10 -0
- package/dist/components/SearchInput/SearchInput.types.d.ts.map +1 -0
- package/dist/components/SearchInput/index.d.ts +2 -0
- package/dist/components/SearchInput/index.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts +4 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.helpers.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts +460 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.styles.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts +12 -0
- package/dist/components/SelectableCategoryList/SelectableCategoryList.types.d.ts.map +1 -0
- package/dist/components/SelectableCategoryList/index.d.ts +2 -0
- package/dist/components/SelectableCategoryList/index.d.ts.map +1 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +766 -0
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -0
- package/dist/components/SettingsContainer/index.d.ts +2 -0
- package/dist/components/SettingsContainer/index.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.d.ts +3 -0
- package/dist/components/Slippage/Slippage.d.ts.map +1 -0
- package/dist/components/Slippage/Slippage.styles.d.ts +613 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts +3 -0
- package/dist/components/Slippage/SlippageTooltipContent.d.ts.map +1 -0
- package/dist/components/Slippage/index.d.ts +2 -0
- package/dist/components/Slippage/index.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts +4 -0
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +8 -0
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +919 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts +12 -0
- package/dist/components/SwapDetails/SwapDetails.types.d.ts.map +1 -0
- package/dist/components/SwapDetails/index.d.ts +2 -0
- package/dist/components/SwapDetails/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +154 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +20 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts +3 -0
- package/dist/components/SwapDetailsAlerts/index.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Cancel.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.Delete.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +154 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +46 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -0
- package/dist/components/SwapDetailsModal/index.d.ts +4 -0
- package/dist/components/SwapDetailsModal/index.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts +4 -0
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +613 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts +12 -0
- package/dist/components/SwapsGroup/SwapsGroup.types.d.ts.map +1 -0
- package/dist/components/SwapsGroup/index.d.ts +2 -0
- package/dist/components/SwapsGroup/index.d.ts.map +1 -0
- package/dist/components/SwitchFromAndTo.d.ts +1 -1
- package/dist/components/SwitchFromAndTo.d.ts.map +1 -1
- package/dist/components/TokenList/LoadingTokenList.d.ts +4 -0
- package/dist/components/TokenList/LoadingTokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.d.ts +4 -0
- package/dist/components/TokenList/TokenList.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts +3 -0
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.styles.d.ts +1532 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -0
- package/dist/components/TokenList/TokenList.types.d.ts +41 -0
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -0
- package/dist/components/TokenList/index.d.ts +3 -0
- package/dist/components/TokenList/index.d.ts.map +1 -0
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModal.d.ts +4 -0
- package/dist/components/WalletModal/WalletModal.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts +10 -0
- package/dist/components/WalletModal/WalletModal.types.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts +4 -0
- package/dist/components/WalletModal/WalletModalContent.d.ts.map +1 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +613 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -0
- package/dist/components/WalletModal/index.d.ts +2 -0
- package/dist/components/WalletModal/index.d.ts.map +1 -0
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/constants/errors.d.ts +29 -0
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/messages.d.ts +7 -0
- package/dist/constants/messages.d.ts.map +1 -0
- package/dist/constants/navigationRoutes.d.ts +8 -4
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/routing.d.ts +13 -0
- package/dist/constants/routing.d.ts.map +1 -0
- package/dist/constants/searchParams.d.ts +2 -2
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/constants/swapSettings.d.ts.map +1 -1
- package/dist/constants/wallets.d.ts +3 -0
- package/dist/constants/wallets.d.ts.map +1 -0
- package/dist/constants/warnings.d.ts +3 -0
- package/dist/constants/warnings.d.ts.map +1 -0
- package/dist/globalStyles.d.ts +1 -1
- package/dist/globalStyles.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap.d.ts +14 -6
- package/dist/hooks/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useFetchBestRoute.d.ts +9 -0
- package/dist/hooks/useFetchBestRoute.d.ts.map +1 -0
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts +12 -0
- package/dist/hooks/useSwapInput.d.ts.map +1 -0
- package/dist/hooks/useTheme.d.ts +3 -29
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/hooks/useWalletList.d.ts +20 -0
- package/dist/hooks/useWalletList.d.ts.map +1 -0
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- package/dist/pages/ConfirmSwapPage.d.ts +6 -3
- package/dist/pages/ConfirmSwapPage.d.ts.map +1 -1
- package/dist/pages/HistoryPage.d.ts.map +1 -1
- package/dist/pages/Home.d.ts.map +1 -1
- package/dist/pages/LanguagePage.d.ts +3 -0
- package/dist/pages/LanguagePage.d.ts.map +1 -0
- package/dist/pages/LiquiditySourcePage.d.ts +8 -0
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -0
- package/dist/pages/SelectBlockchainPage.d.ts +8 -0
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -0
- package/dist/pages/SelectSwapItemsPage.d.ts +11 -0
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -0
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts +3 -0
- package/dist/pages/ThemePage.d.ts.map +1 -0
- package/dist/pages/WalletsPage.d.ts +4 -2
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/bestRoute.d.ts +32 -19
- package/dist/store/bestRoute.d.ts.map +1 -1
- package/dist/store/meta.d.ts +10 -3
- package/dist/store/meta.d.ts.map +1 -1
- package/dist/store/notification.d.ts +38 -0
- package/dist/store/notification.d.ts.map +1 -0
- package/dist/store/settings.d.ts +2 -2
- package/dist/store/settings.d.ts.map +1 -1
- package/dist/store/ui.d.ts +0 -2
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +14 -12
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +11 -6
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/notification.d.ts +22 -0
- package/dist/types/notification.d.ts.map +1 -0
- package/dist/types/routing.d.ts +30 -23
- package/dist/types/routing.d.ts.map +1 -1
- package/dist/types/swap.d.ts +8 -1
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/utils/common.d.ts +5 -0
- package/dist/utils/common.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +2 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/date.d.ts +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +3 -0
- package/dist/utils/meta.d.ts.map +1 -0
- package/dist/utils/numbers.d.ts +2 -1
- package/dist/utils/numbers.d.ts.map +1 -1
- package/dist/utils/routing.d.ts +10 -7
- package/dist/utils/routing.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +10 -0
- package/dist/utils/settings.d.ts.map +1 -0
- package/dist/utils/swap.d.ts +29 -14
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +20 -14
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/Wallets.tsx +23 -17
- package/src/Widget.tsx +88 -28
- package/src/components/AppRouter.tsx +36 -6
- package/src/components/AppRoutes.tsx +54 -19
- package/src/components/BlockchainList/BlockchainList.helpers.ts +37 -0
- package/src/components/BlockchainList/BlockchainList.styles.ts +19 -0
- package/src/components/BlockchainList/BlockchainList.tsx +73 -0
- package/src/components/BlockchainList/BlockchainList.types.ts +8 -0
- package/src/components/BlockchainList/LoadingBlockchainList.tsx +20 -0
- package/src/components/BlockchainList/index.ts +1 -0
- package/src/components/BlockchainsChip/BlockchainsChip.styles.ts +30 -0
- package/src/components/BlockchainsChip/BlockchainsChip.tsx +15 -0
- package/src/components/BlockchainsChip/BlockchainsChip.types.ts +4 -0
- package/src/components/BlockchainsChip/index.ts +1 -0
- package/src/components/BlockchainsSection/BlockchainSection.helpers.ts +20 -0
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +7 -0
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +100 -0
- package/src/components/BlockchainsSection/BlockchainsSection.types.ts +9 -0
- package/src/components/BlockchainsSection/index.ts +1 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.helpers.ts +86 -0
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +169 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +460 -0
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +11 -0
- package/src/components/ConfirmWalletsModal/WalletList.styles.ts +34 -0
- package/src/components/ConfirmWalletsModal/WalletList.tsx +250 -0
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +12 -0
- package/src/components/HeaderButtons/BackButton.tsx +16 -0
- package/src/components/HeaderButtons/CancelButton.tsx +21 -0
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +40 -0
- package/src/components/HeaderButtons/HeaderButtons.types.ts +11 -0
- package/src/components/HeaderButtons/HomeButtons.tsx +68 -0
- package/src/components/HeaderButtons/UnreadNotificationsBadge.tsx +20 -0
- package/src/components/HeaderButtons/WalletButton.tsx +20 -0
- package/src/components/HeaderButtons/index.ts +4 -0
- package/src/components/Layout/Layout.styles.ts +50 -0
- package/src/components/Layout/Layout.tsx +72 -0
- package/src/components/Layout/Layout.types.ts +20 -0
- package/src/components/Layout/index.ts +1 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.ts +5 -0
- package/src/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.tsx +23 -0
- package/src/components/LoadingLiquiditySourceList/index.ts +1 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +41 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +78 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +53 -0
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +3 -0
- package/src/components/LoadingSwapDetails/index.ts +1 -0
- package/src/components/NoRoutes/NoRoutes.helper.ts +50 -0
- package/src/components/NoRoutes/NoRoutes.styles.ts +15 -0
- package/src/components/NoRoutes/NoRoutes.tsx +81 -0
- package/src/components/NoRoutes/NoRoutes.types.ts +21 -0
- package/src/components/NoRoutes/index.ts +1 -0
- package/src/components/NotificationContent/NotificationContent.styles.ts +34 -0
- package/src/components/NotificationContent/NotificationContent.tsx +107 -0
- package/src/components/NotificationContent/NotificationNotFound.tsx +17 -0
- package/src/components/NotificationContent/index.ts +1 -0
- package/src/components/RouteErrors/RouteErrors.styles.ts +28 -0
- package/src/components/RouteErrors/RouteErrors.tsx +79 -0
- package/src/components/RouteErrors/RouteErrors.types.ts +29 -0
- package/src/components/RouteErrors/RouteErrorsModal.tsx +128 -0
- package/src/components/RouteErrors/RouteErrorsModalItem.tsx +24 -0
- package/src/components/RouteErrors/index.ts +1 -0
- package/src/components/SearchInput/SearchInput.styles.ts +9 -0
- package/src/components/SearchInput/SearchInput.tsx +51 -0
- package/src/components/SearchInput/SearchInput.types.ts +10 -0
- package/src/components/SearchInput/index.ts +1 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.helpers.ts +20 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.styles.ts +21 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.tsx +79 -0
- package/src/components/SelectableCategoryList/SelectableCategoryList.types.ts +12 -0
- package/src/components/SelectableCategoryList/index.ts +1 -0
- package/src/components/SettingsContainer/SettingsContainer.style.ts +33 -0
- package/src/components/SettingsContainer/index.ts +7 -0
- package/src/components/Slippage/Slippage.styles.ts +24 -0
- package/src/components/Slippage/Slippage.tsx +90 -0
- package/src/components/Slippage/SlippageTooltipContent.tsx +23 -0
- package/src/components/Slippage/index.ts +1 -0
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +79 -0
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +85 -0
- package/src/components/SwapDetails/SwapDetails.styles.ts +68 -0
- package/src/components/SwapDetails/SwapDetails.tsx +419 -0
- package/src/components/SwapDetails/SwapDetails.types.ts +12 -0
- package/src/components/SwapDetails/index.ts +1 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Failed.tsx +36 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +55 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.ts +7 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +74 -0
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +28 -0
- package/src/components/SwapDetailsAlerts/index.ts +2 -0
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +101 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.Delete.tsx +34 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +31 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +22 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.styles.ts +6 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +45 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +54 -0
- package/src/components/SwapDetailsModal/index.ts +3 -0
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +26 -0
- package/src/components/SwapsGroup/SwapsGroup.tsx +125 -0
- package/src/components/SwapsGroup/SwapsGroup.types.ts +13 -0
- package/src/components/SwapsGroup/index.ts +1 -0
- package/src/components/SwitchFromAndTo.tsx +23 -41
- package/src/components/TokenList/LoadingTokenList.tsx +34 -0
- package/src/components/TokenList/TokenList.helpers.ts +13 -0
- package/src/components/TokenList/TokenList.styles.ts +121 -0
- package/src/components/TokenList/TokenList.tsx +271 -0
- package/src/components/TokenList/TokenList.types.ts +48 -0
- package/src/components/TokenList/index.ts +2 -0
- package/src/components/UpdateUrl.tsx +40 -22
- package/src/components/WalletModal/WalletModal.tsx +20 -0
- package/src/components/WalletModal/WalletModal.types.ts +11 -0
- package/src/components/WalletModal/WalletModalContent.styles.ts +44 -0
- package/src/components/WalletModal/WalletModalContent.tsx +54 -0
- package/src/components/WalletModal/index.ts +1 -0
- package/src/components/WidgetEvents.tsx +37 -5
- package/src/constants/errors.ts +56 -1
- package/src/constants/messages.ts +8 -0
- package/src/constants/navigationRoutes.ts +8 -4
- package/src/constants/routing.ts +17 -0
- package/src/constants/searchParams.ts +2 -2
- package/src/constants/swapSettings.ts +5 -1
- package/src/constants/wallets.ts +3 -0
- package/src/constants/warnings.ts +26 -0
- package/src/globalStyles.ts +1 -4
- package/src/hooks/useConfirmSwap.ts +251 -220
- package/src/hooks/useFetchBestRoute.ts +38 -0
- package/src/hooks/useNavigateBack.ts +25 -9
- package/src/hooks/useSwapInput.ts +116 -0
- package/src/hooks/useTheme.ts +35 -74
- package/src/hooks/useWalletList.ts +125 -0
- package/src/pages/ConfirmSwapPage.tsx +492 -228
- package/src/pages/HistoryPage.tsx +104 -15
- package/src/pages/Home.tsx +392 -110
- package/src/pages/LanguagePage.tsx +83 -0
- package/src/pages/LiquiditySourcePage.tsx +160 -0
- package/src/pages/SelectBlockchainPage.tsx +77 -0
- package/src/pages/SelectSwapItemsPage.tsx +169 -0
- package/src/pages/SettingsPage.tsx +144 -72
- package/src/pages/SwapDetailsPage.tsx +40 -141
- package/src/pages/ThemePage.tsx +96 -0
- package/src/pages/WalletsPage.tsx +73 -124
- package/src/store/bestRoute.ts +85 -180
- package/src/store/meta.ts +23 -3
- package/src/store/notification.ts +77 -0
- package/src/store/settings.ts +20 -13
- package/src/store/ui.ts +1 -5
- package/src/store/wallets.ts +92 -76
- package/src/types/config.ts +12 -7
- package/src/types/notification.ts +33 -0
- package/src/types/routing.ts +29 -28
- package/src/types/swap.ts +9 -1
- package/src/utils/common.ts +53 -3
- package/src/utils/configs.ts +3 -0
- package/src/utils/date.ts +15 -18
- package/src/utils/meta.ts +9 -0
- package/src/utils/numbers.ts +63 -18
- package/src/utils/routing.ts +105 -27
- package/src/utils/settings.ts +57 -0
- package/src/utils/swap.ts +200 -113
- package/src/utils/wallets.ts +165 -116
- package/dist/components/ConfirmSwapErrors.d.ts +0 -4
- package/dist/components/ConfirmSwapErrors.d.ts.map +0 -1
- package/dist/components/ConfirmSwapWarnings.d.ts +0 -3
- package/dist/components/ConfirmSwapWarnings.d.ts.map +0 -1
- package/dist/components/Layout.d.ts +0 -7
- package/dist/components/Layout.d.ts.map +0 -1
- package/dist/pages/LiquiditySourcesPage.d.ts +0 -7
- package/dist/pages/LiquiditySourcesPage.d.ts.map +0 -1
- package/dist/pages/SelectChainPage.d.ts +0 -8
- package/dist/pages/SelectChainPage.d.ts.map +0 -1
- package/dist/pages/SelectTokenPage.d.ts +0 -15
- package/dist/pages/SelectTokenPage.d.ts.map +0 -1
- package/src/components/ConfirmSwapErrors.tsx +0 -34
- package/src/components/ConfirmSwapWarnings.tsx +0 -22
- package/src/components/Layout.tsx +0 -105
- package/src/pages/LiquiditySourcesPage.tsx +0 -63
- package/src/pages/SelectChainPage.tsx +0 -42
- package/src/pages/SelectTokenPage.tsx +0 -64
package/src/store/wallets.ts
CHANGED
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { WalletType } from '@rango-dev/wallets-shared';
|
|
1
|
+
import type { Wallet } from '../types';
|
|
2
|
+
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
3
|
+
|
|
3
4
|
import { create } from 'zustand';
|
|
4
5
|
import { subscribeWithSelector } from 'zustand/middleware';
|
|
5
6
|
import { shallow } from 'zustand/shallow';
|
|
7
|
+
|
|
6
8
|
import { httpService } from '../services/httpService';
|
|
7
9
|
import {
|
|
8
|
-
getRequiredChains,
|
|
9
10
|
getTokensWithBalance,
|
|
10
11
|
isAccountAndWalletMatched,
|
|
11
12
|
makeBalanceFor,
|
|
12
13
|
resetConnectedWalletState,
|
|
13
14
|
sortTokens,
|
|
14
15
|
} from '../utils/wallets';
|
|
16
|
+
|
|
15
17
|
import { useBestRouteStore } from './bestRoute';
|
|
16
18
|
import { useMetaStore } from './meta';
|
|
17
19
|
import createSelectors from './selectors';
|
|
18
|
-
import { Wallet } from '../types';
|
|
19
20
|
|
|
20
21
|
export type TokenBalance = {
|
|
21
22
|
chain: string;
|
|
@@ -31,100 +32,107 @@ export type TokenBalance = {
|
|
|
31
32
|
|
|
32
33
|
export interface ConnectedWallet extends Wallet {
|
|
33
34
|
balances: TokenBalance[] | null;
|
|
35
|
+
explorerUrl: string | null;
|
|
36
|
+
selected: boolean;
|
|
34
37
|
loading: boolean;
|
|
35
38
|
error: boolean;
|
|
36
|
-
explorerUrl: string | null;
|
|
37
39
|
}
|
|
38
40
|
|
|
39
41
|
interface WalletsStore {
|
|
40
42
|
connectedWallets: ConnectedWallet[];
|
|
41
|
-
selectedWallets: Wallet[];
|
|
42
43
|
customDestination: string;
|
|
44
|
+
loading: boolean;
|
|
43
45
|
connectWallet: (accounts: Wallet[]) => void;
|
|
44
46
|
disconnectWallet: (walletType: WalletType) => void;
|
|
45
|
-
|
|
46
|
-
setSelectedWallet: (wallet: SelectableWallet) => void;
|
|
47
|
+
selectWallets: (wallets: { walletType: string; chain: string }[]) => void;
|
|
47
48
|
clearConnectedWallet: () => void;
|
|
48
49
|
getWalletsDetails: (accounts: Wallet[], shouldRetry?: boolean) => void;
|
|
49
|
-
setCustomDestination: (customDestination: string) => void;
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
export const useWalletsStore = createSelectors(
|
|
53
53
|
create<WalletsStore>()(
|
|
54
54
|
subscribeWithSelector((set, get) => ({
|
|
55
55
|
connectedWallets: [],
|
|
56
|
-
selectedWallets: [],
|
|
57
56
|
customDestination: '',
|
|
57
|
+
loading: false,
|
|
58
58
|
connectWallet: (accounts) => {
|
|
59
59
|
const getWalletsDetails = get().getWalletsDetails;
|
|
60
60
|
set((state) => ({
|
|
61
|
+
loading: true,
|
|
61
62
|
connectedWallets: state.connectedWallets
|
|
62
63
|
.filter((wallet) => wallet.walletType !== accounts[0].walletType)
|
|
63
64
|
.concat(
|
|
64
|
-
accounts.map((account) =>
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
65
|
+
accounts.map((account) => {
|
|
66
|
+
const shouldMarkWalletAsSelected = !state.connectedWallets.find(
|
|
67
|
+
(connectedWallet) =>
|
|
68
|
+
connectedWallet.chain === account.chain &&
|
|
69
|
+
connectedWallet.selected
|
|
70
|
+
);
|
|
71
|
+
return {
|
|
72
|
+
balances: [],
|
|
73
|
+
address: account.address,
|
|
74
|
+
chain: account.chain,
|
|
75
|
+
explorerUrl: null,
|
|
76
|
+
walletType: account.walletType,
|
|
77
|
+
selected: shouldMarkWalletAsSelected,
|
|
78
|
+
loading: true,
|
|
79
|
+
error: false,
|
|
80
|
+
};
|
|
81
|
+
})
|
|
73
82
|
),
|
|
74
83
|
}));
|
|
75
84
|
getWalletsDetails(accounts);
|
|
76
85
|
},
|
|
77
86
|
disconnectWallet: (walletType) => {
|
|
78
|
-
set((state) => ({
|
|
79
|
-
connectedWallets: state.connectedWallets.filter(
|
|
80
|
-
(balance) => balance.walletType !== walletType
|
|
81
|
-
),
|
|
82
|
-
selectedWallets: state.selectedWallets.filter(
|
|
83
|
-
(wallet) => wallet.walletType != walletType
|
|
84
|
-
),
|
|
85
|
-
}));
|
|
86
|
-
},
|
|
87
|
-
initSelectedWallets: () =>
|
|
88
87
|
set((state) => {
|
|
89
|
-
const
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
(wallet) => wallet.chain === chain
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
if (!anyWalletSelected) {
|
|
100
|
-
const firstWalletWithMatchedChain = connectedWallets.find(
|
|
101
|
-
(wallet) => wallet.chain === chain
|
|
102
|
-
);
|
|
103
|
-
if (!!firstWalletWithMatchedChain)
|
|
104
|
-
selectedWallets.push({
|
|
105
|
-
address: firstWalletWithMatchedChain.address,
|
|
106
|
-
chain: firstWalletWithMatchedChain.chain,
|
|
107
|
-
walletType: firstWalletWithMatchedChain.walletType,
|
|
108
|
-
});
|
|
109
|
-
}
|
|
110
|
-
});
|
|
88
|
+
const selectedWallets = state.connectedWallets
|
|
89
|
+
.filter(
|
|
90
|
+
(connectedWallet) =>
|
|
91
|
+
connectedWallet.selected &&
|
|
92
|
+
connectedWallet.walletType !== walletType
|
|
93
|
+
)
|
|
94
|
+
.map((selectedWallet) => selectedWallet.chain);
|
|
111
95
|
return {
|
|
112
|
-
|
|
96
|
+
connectedWallets: state.connectedWallets
|
|
97
|
+
.filter(
|
|
98
|
+
(connectedWallet) => connectedWallet.walletType !== walletType
|
|
99
|
+
)
|
|
100
|
+
.map((connectedWallet) => {
|
|
101
|
+
const anyWalletSelectedForBlockchain = selectedWallets.includes(
|
|
102
|
+
connectedWallet.chain
|
|
103
|
+
);
|
|
104
|
+
if (anyWalletSelectedForBlockchain) {
|
|
105
|
+
return connectedWallet;
|
|
106
|
+
}
|
|
107
|
+
selectedWallets.push(connectedWallet.chain);
|
|
108
|
+
return { ...connectedWallet, selected: true };
|
|
109
|
+
}),
|
|
113
110
|
};
|
|
114
|
-
})
|
|
115
|
-
|
|
111
|
+
});
|
|
112
|
+
},
|
|
113
|
+
selectWallets: (wallets) =>
|
|
116
114
|
set((state) => ({
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
115
|
+
connectedWallets: state.connectedWallets.map((connectedWallet) => {
|
|
116
|
+
const walletSelected = !!wallets.find(
|
|
117
|
+
(wallet) =>
|
|
118
|
+
wallet.chain === connectedWallet.chain &&
|
|
119
|
+
wallet.walletType !== connectedWallet.walletType &&
|
|
120
|
+
connectedWallet.selected
|
|
121
|
+
);
|
|
122
|
+
const walletNotSelected = !!wallets.find(
|
|
123
|
+
(wallet) =>
|
|
124
|
+
wallet.chain === connectedWallet.chain &&
|
|
125
|
+
wallet.walletType === connectedWallet.walletType &&
|
|
126
|
+
!connectedWallet.selected
|
|
127
|
+
);
|
|
128
|
+
if (walletSelected) {
|
|
129
|
+
return { ...connectedWallet, selected: false };
|
|
130
|
+
} else if (walletNotSelected) {
|
|
131
|
+
return { ...connectedWallet, selected: true };
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
return connectedWallet;
|
|
135
|
+
}),
|
|
128
136
|
})),
|
|
129
137
|
clearConnectedWallet: () =>
|
|
130
138
|
set(() => ({
|
|
@@ -135,6 +143,7 @@ export const useWalletsStore = createSelectors(
|
|
|
135
143
|
const getWalletsDetails = get().getWalletsDetails;
|
|
136
144
|
const { tokens } = useMetaStore.getState().meta;
|
|
137
145
|
set((state) => ({
|
|
146
|
+
loading: true,
|
|
138
147
|
connectedWallets: state.connectedWallets.map((wallet) => {
|
|
139
148
|
return accounts.find((account) =>
|
|
140
149
|
isAccountAndWalletMatched(account, wallet)
|
|
@@ -149,39 +158,46 @@ export const useWalletsStore = createSelectors(
|
|
|
149
158
|
blockchain: chain,
|
|
150
159
|
}));
|
|
151
160
|
const response = await httpService().getWalletsDetails(data);
|
|
152
|
-
const
|
|
153
|
-
if (
|
|
161
|
+
const retrievedBalance = response.wallets;
|
|
162
|
+
if (retrievedBalance) {
|
|
154
163
|
set((state) => ({
|
|
164
|
+
loading: false,
|
|
155
165
|
connectedWallets: state.connectedWallets.map(
|
|
156
166
|
(connectedWallet) => {
|
|
157
167
|
const matchedAccount = accounts.find((account) =>
|
|
158
168
|
isAccountAndWalletMatched(account, connectedWallet)
|
|
159
169
|
);
|
|
160
|
-
const
|
|
170
|
+
const retrievedBalanceAccount = retrievedBalance.find(
|
|
161
171
|
(balance) =>
|
|
162
172
|
balance.address === connectedWallet.address &&
|
|
163
173
|
balance.blockChain === connectedWallet.chain
|
|
164
174
|
);
|
|
165
175
|
if (
|
|
166
|
-
|
|
176
|
+
retrievedBalanceAccount?.failed &&
|
|
167
177
|
matchedAccount &&
|
|
168
178
|
shouldRetry
|
|
169
179
|
) {
|
|
170
180
|
getWalletsDetails([matchedAccount], false);
|
|
171
181
|
}
|
|
172
|
-
return matchedAccount &&
|
|
173
|
-
?
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
182
|
+
return matchedAccount && retrievedBalanceAccount
|
|
183
|
+
? {
|
|
184
|
+
...connectedWallet,
|
|
185
|
+
explorerUrl: retrievedBalanceAccount.explorerUrl,
|
|
186
|
+
balances: makeBalanceFor(
|
|
187
|
+
retrievedBalanceAccount,
|
|
188
|
+
tokens
|
|
189
|
+
),
|
|
190
|
+
}
|
|
178
191
|
: connectedWallet;
|
|
179
192
|
}
|
|
180
193
|
),
|
|
181
194
|
}));
|
|
182
|
-
} else
|
|
195
|
+
} else {
|
|
196
|
+
throw new Error('Wallet not found');
|
|
197
|
+
}
|
|
183
198
|
} catch (error) {
|
|
184
199
|
set((state) => ({
|
|
200
|
+
loading: false,
|
|
185
201
|
connectedWallets: state.connectedWallets.map((balance) => {
|
|
186
202
|
return accounts.find((account) =>
|
|
187
203
|
isAccountAndWalletMatched(account, balance)
|
package/src/types/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import type { Language } from '@rango-dev/ui';
|
|
2
|
+
import type { ProviderInterface } from '@rango-dev/wallets-react';
|
|
3
|
+
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
4
|
+
import type { Asset } from 'rango-sdk';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The above type defines a set of optional color properties for a widget.
|
|
@@ -13,7 +13,7 @@ import { Language } from '@rango-dev/ui';
|
|
|
13
13
|
* @property {string} warning
|
|
14
14
|
* @property {string} surface
|
|
15
15
|
* @property {string} neutral
|
|
16
|
-
|
|
16
|
+
*
|
|
17
17
|
*/
|
|
18
18
|
export type WidgetColors = {
|
|
19
19
|
background?: string;
|
|
@@ -38,6 +38,8 @@ export type WidgetColors = {
|
|
|
38
38
|
* border color
|
|
39
39
|
* @property {number} borderRadius - `borderRadius` is a property of the `WidgetTheme` type that
|
|
40
40
|
* specifies the radius of the corners of a widget.
|
|
41
|
+
* @property {number} secondaryBorderRadius - `secondaryBorderRadius` is a property of the `WidgetTheme` type that
|
|
42
|
+
* specifies the radius of the buttons of a widget.
|
|
41
43
|
* @property {number} width - The `width` property is a number that represents the width of the widget.
|
|
42
44
|
* @property {number} height - The `height` property is a number that specifies the height of the widget.
|
|
43
45
|
* @property {boolean} singleTheme - The `singleTheme` property is a boolean that specifies the theme is support dark and light or only light.
|
|
@@ -47,6 +49,7 @@ export type WidgetTheme = {
|
|
|
47
49
|
fontFamily?: string;
|
|
48
50
|
colors?: { light: WidgetColors; dark: WidgetColors };
|
|
49
51
|
borderRadius?: number;
|
|
52
|
+
secondaryBorderRadius?: number;
|
|
50
53
|
width?: number;
|
|
51
54
|
height?: number;
|
|
52
55
|
singleTheme?: boolean;
|
|
@@ -93,7 +96,7 @@ export type BlockchainAndTokenConfig = {
|
|
|
93
96
|
* and theme.
|
|
94
97
|
*
|
|
95
98
|
* @property {string} apiKey - The API key used to communicate with Rango API
|
|
96
|
-
* @property {WidgeAffiliate} affiliate - If you want to charge users fee per transaction, you should
|
|
99
|
+
* @property {WidgeAffiliate} affiliate - If you want to charge users fee per transaction, you should
|
|
97
100
|
* pass `WidgetAffiliate` including affiliateRef, affiliatePercent, and affiliateWallets.
|
|
98
101
|
* @property {number} amount - The default input amount.
|
|
99
102
|
* @property {BlockchainAndTokenConfig} from - The `from` property is an optional property of type
|
|
@@ -121,7 +124,8 @@ export type BlockchainAndTokenConfig = {
|
|
|
121
124
|
* that defines the various properties of the theme, such as colors, fonts, and others.
|
|
122
125
|
* @property {boolean} externalWallets
|
|
123
126
|
* If `externalWallets` is `true`, you should add `WidgetWallets` to your app.
|
|
124
|
-
|
|
127
|
+
* @property {Asset} pinnedTokens - The `pinnedTokens` property is an optional array of `Asset` objects that
|
|
128
|
+
* you could use to pin tokens of your choice to the top of the token list.
|
|
125
129
|
*/
|
|
126
130
|
export type WidgetConfig = {
|
|
127
131
|
apiKey: string;
|
|
@@ -137,4 +141,5 @@ export type WidgetConfig = {
|
|
|
137
141
|
language?: Language;
|
|
138
142
|
theme?: WidgetTheme;
|
|
139
143
|
externalWallets?: boolean;
|
|
144
|
+
pinnedTokens?: Asset[];
|
|
140
145
|
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import {
|
|
2
|
+
type Route,
|
|
3
|
+
type RouteEvent,
|
|
4
|
+
type Step,
|
|
5
|
+
type StepEvent,
|
|
6
|
+
StepExecutionBlockedEventStatus,
|
|
7
|
+
} from '@rango-dev/queue-manager-rango-preset';
|
|
8
|
+
|
|
9
|
+
type NotificationRoute = {
|
|
10
|
+
from: {
|
|
11
|
+
blockchain: Step['fromBlockchain'];
|
|
12
|
+
tokenSymbol: Step['fromSymbol'];
|
|
13
|
+
tokenAddress: Step['fromSymbolAddress'];
|
|
14
|
+
};
|
|
15
|
+
to: {
|
|
16
|
+
blockchain: Step['toBlockchain'];
|
|
17
|
+
tokenSymbol: Step['toSymbol'];
|
|
18
|
+
tokenAddress: Step['toSymbolAddress'];
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export type Notification = Pick<Route, 'requestId'> & {
|
|
23
|
+
event: RouteEvent | StepEvent;
|
|
24
|
+
creationTime: number;
|
|
25
|
+
read: boolean;
|
|
26
|
+
route: NotificationRoute;
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export const validBlockedStatuses: StepExecutionBlockedEventStatus[] = [
|
|
30
|
+
StepExecutionBlockedEventStatus.WAITING_FOR_CHANGE_WALLET_ACCOUNT,
|
|
31
|
+
StepExecutionBlockedEventStatus.WAITING_FOR_NETWORK_CHANGE,
|
|
32
|
+
StepExecutionBlockedEventStatus.WAITING_FOR_WALLET_CONNECT,
|
|
33
|
+
];
|
package/src/types/routing.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
/* eslint-disable @typescript-eslint/prefer-enum-initializers */
|
|
2
|
+
import type { RouteState } from '../store/bestRoute';
|
|
3
|
+
import type { SettingsState } from '../store/settings';
|
|
3
4
|
|
|
4
5
|
interface BestRouteStoreParams {
|
|
5
|
-
|
|
6
|
-
|
|
6
|
+
fromBlockchain?: RouteState['fromBlockchain'];
|
|
7
|
+
toBlockchain?: RouteState['toBlockchain'];
|
|
7
8
|
fromToken?: RouteState['fromToken'];
|
|
8
9
|
toToken?: RouteState['toToken'];
|
|
9
10
|
inputAmount?: RouteState['inputAmount'];
|
|
@@ -32,45 +33,45 @@ export enum ConfirmSwapErrorTypes {
|
|
|
32
33
|
NO_ROUTE,
|
|
33
34
|
ROUTE_UPDATED_WITH_HIGH_VALUE_LOSS,
|
|
34
35
|
REQUEST_FAILED,
|
|
35
|
-
|
|
36
|
-
INSUFFICIENT_BALANCE,
|
|
36
|
+
REQUEST_CANCELED,
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
export type ConfirmSwapError =
|
|
40
40
|
| {
|
|
41
|
-
type: ConfirmSwapErrorTypes.
|
|
42
|
-
|
|
43
|
-
}
|
|
44
|
-
| {
|
|
45
|
-
type: ConfirmSwapErrorTypes.INSUFFICIENT_SLIPPAGE;
|
|
46
|
-
minRequiredSlippage: string | null;
|
|
41
|
+
type: ConfirmSwapErrorTypes.NO_ROUTE;
|
|
42
|
+
diagnosisMessage?: string;
|
|
47
43
|
}
|
|
48
|
-
| { type: ConfirmSwapErrorTypes.INSUFFICIENT_BALANCE; messages: string[] }
|
|
49
44
|
| {
|
|
50
|
-
type: Exclude<
|
|
51
|
-
ConfirmSwapErrorTypes,
|
|
52
|
-
| ConfirmSwapErrorTypes.REQUEST_FAILED
|
|
53
|
-
| ConfirmSwapErrorTypes.INSUFFICIENT_SLIPPAGE
|
|
54
|
-
| ConfirmSwapErrorTypes.INSUFFICIENT_BALANCE
|
|
55
|
-
>;
|
|
45
|
+
type: Exclude<ConfirmSwapErrorTypes, ConfirmSwapErrorTypes.NO_ROUTE>;
|
|
56
46
|
};
|
|
57
47
|
|
|
58
|
-
export
|
|
48
|
+
export enum RouteWarningType {
|
|
49
|
+
ROUTE_UPDATED,
|
|
50
|
+
ROUTE_SWAPPERS_UPDATED,
|
|
51
|
+
ROUTE_COINS_UPDATED,
|
|
52
|
+
ROUTE_AND_OUTPUT_AMOUNT_UPDATED,
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
export type RouteWarning =
|
|
59
56
|
| {
|
|
60
|
-
type:
|
|
57
|
+
type: RouteWarningType.ROUTE_AND_OUTPUT_AMOUNT_UPDATED;
|
|
61
58
|
newOutputAmount: string;
|
|
62
59
|
percentageChange: string;
|
|
63
60
|
}
|
|
64
61
|
| {
|
|
65
62
|
type: Exclude<
|
|
66
|
-
|
|
67
|
-
|
|
63
|
+
RouteWarningType,
|
|
64
|
+
RouteWarningType.ROUTE_AND_OUTPUT_AMOUNT_UPDATED
|
|
68
65
|
>;
|
|
69
66
|
};
|
|
70
67
|
|
|
71
|
-
export enum
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
ROUTE_COINS_UPDATED,
|
|
75
|
-
ROUTE_AND_OUTPUT_AMOUNT_UPDATED,
|
|
68
|
+
export enum SlippageWarningType {
|
|
69
|
+
INSUFFICIENT_SLIPPAGE,
|
|
70
|
+
HIGH_SLIPPAGE,
|
|
76
71
|
}
|
|
72
|
+
|
|
73
|
+
export type ConfirmSwapWarnings = {
|
|
74
|
+
route: RouteWarning | null;
|
|
75
|
+
balance: { messages: string[] } | null;
|
|
76
|
+
slippage: { type: SlippageWarningType; slippage: string | null } | null;
|
|
77
|
+
};
|
package/src/types/swap.ts
CHANGED
|
@@ -1,15 +1,23 @@
|
|
|
1
|
-
import { SwapSavedSettings } from 'rango-types/lib';
|
|
1
|
+
import type { SwapSavedSettings } from 'rango-types/lib';
|
|
2
2
|
|
|
3
3
|
export type PendingSwapSettings = Omit<
|
|
4
4
|
SwapSavedSettings,
|
|
5
5
|
'disabledSwappersIds'
|
|
6
6
|
>;
|
|
7
7
|
|
|
8
|
+
export enum ButtonState {
|
|
9
|
+
WAITFORCONNECTING = 'waitForConnecting',
|
|
10
|
+
SWAP = 'swap',
|
|
11
|
+
NEEDTOCONFIRM = 'needToConfirm',
|
|
12
|
+
WARNING = 'warning',
|
|
13
|
+
}
|
|
14
|
+
|
|
8
15
|
export type SwapButtonState = (
|
|
9
16
|
| { disabled: true }
|
|
10
17
|
| { disabled: false; hasWarning?: boolean }
|
|
11
18
|
) & {
|
|
12
19
|
title: string;
|
|
20
|
+
state: ButtonState;
|
|
13
21
|
};
|
|
14
22
|
|
|
15
23
|
export type ConvertedToken = {
|
package/src/utils/common.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable @typescript-eslint/no-magic-numbers */
|
|
1
2
|
export function removeDuplicateFrom<T>(array: T[]): T[] {
|
|
2
3
|
return Array.from(new Set(array));
|
|
3
4
|
}
|
|
@@ -10,9 +11,7 @@ export function areEqual(
|
|
|
10
11
|
array1.length === array2.length && array1.every((v, i) => v === array2[i])
|
|
11
12
|
);
|
|
12
13
|
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
16
15
|
export function debounce(fn: Function, time: number) {
|
|
17
16
|
let timeoutId: ReturnType<typeof setTimeout> | null;
|
|
18
17
|
return wrapper;
|
|
@@ -27,4 +26,55 @@ export function debounce(fn: Function, time: number) {
|
|
|
27
26
|
}
|
|
28
27
|
}
|
|
29
28
|
|
|
29
|
+
export function containsText(text: string, searchText: string): boolean {
|
|
30
|
+
// eslint-disable-next-line @typescript-eslint/no-magic-numbers
|
|
31
|
+
return text.toLowerCase().indexOf(searchText.toLowerCase()) > -1;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const colorShade = (col: string, amt: number) => {
|
|
35
|
+
col = col.replace(/^#/, '');
|
|
36
|
+
if (col.length === 3) {
|
|
37
|
+
col = col[0] + col[0] + col[1] + col[1] + col[2] + col[2];
|
|
38
|
+
}
|
|
39
|
+
let [r, g, b]: any = col.match(/.{2}/g);
|
|
40
|
+
[r, g, b] = [
|
|
41
|
+
parseInt(r, 16) + amt,
|
|
42
|
+
parseInt(g, 16) + amt,
|
|
43
|
+
parseInt(b, 16) + amt,
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
r = Math.max(Math.min(255, r), 0).toString(16);
|
|
47
|
+
g = Math.max(Math.min(255, g), 0).toString(16);
|
|
48
|
+
b = Math.max(Math.min(255, b), 0).toString(16);
|
|
30
49
|
|
|
50
|
+
const rr = (r.length < 2 ? '0' : '') + r;
|
|
51
|
+
const gg = (g.length < 2 ? '0' : '') + g;
|
|
52
|
+
const bb = (b.length < 2 ? '0' : '') + b;
|
|
53
|
+
|
|
54
|
+
return `#${rr}${gg}${bb}`;
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
export const generateRangeColors = (name: string, color: string) => {
|
|
58
|
+
let colors = { [name]: color };
|
|
59
|
+
for (let i = 1; i < 10; i++) {
|
|
60
|
+
if (i < 5) {
|
|
61
|
+
colors = {
|
|
62
|
+
...colors,
|
|
63
|
+
[name + i * 100]: colorShade(color, (5 - i) * 32),
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
if (i === 5) {
|
|
67
|
+
colors = {
|
|
68
|
+
...colors,
|
|
69
|
+
[name + i * 100]: color,
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
if (i > 5) {
|
|
73
|
+
colors = {
|
|
74
|
+
...colors,
|
|
75
|
+
[name + i * 100]: colorShade(color, -((i - 5) * 32)),
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
return colors;
|
|
80
|
+
};
|
package/src/utils/configs.ts
CHANGED
package/src/utils/date.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { GroupBy } from '../components/SwapsGroup/SwapsGroup.types';
|
|
2
|
+
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
3
|
+
|
|
2
4
|
import dayjs from 'dayjs';
|
|
3
|
-
import { GroupBy } from '@rango-dev/ui';
|
|
4
5
|
|
|
5
|
-
export const groupSwapsByDate: GroupBy = swaps => {
|
|
6
|
+
export const groupSwapsByDate: GroupBy = (swaps) => {
|
|
6
7
|
const output: Map<
|
|
7
8
|
string,
|
|
8
9
|
{
|
|
@@ -17,24 +18,17 @@ export const groupSwapsByDate: GroupBy = swaps => {
|
|
|
17
18
|
swaps: [],
|
|
18
19
|
},
|
|
19
20
|
],
|
|
20
|
-
[
|
|
21
|
-
'week',
|
|
22
|
-
{
|
|
23
|
-
title: 'This week',
|
|
24
|
-
swaps: [],
|
|
25
|
-
},
|
|
26
|
-
],
|
|
27
21
|
[
|
|
28
22
|
'month',
|
|
29
23
|
{
|
|
30
|
-
title: '
|
|
24
|
+
title: 'Last month',
|
|
31
25
|
swaps: [],
|
|
32
26
|
},
|
|
33
27
|
],
|
|
34
28
|
[
|
|
35
29
|
'year',
|
|
36
30
|
{
|
|
37
|
-
title: '
|
|
31
|
+
title: 'Last year',
|
|
38
32
|
swaps: [],
|
|
39
33
|
},
|
|
40
34
|
],
|
|
@@ -48,14 +42,17 @@ export const groupSwapsByDate: GroupBy = swaps => {
|
|
|
48
42
|
]);
|
|
49
43
|
|
|
50
44
|
const now = dayjs();
|
|
51
|
-
swaps.forEach(swap => {
|
|
45
|
+
swaps.forEach((swap) => {
|
|
52
46
|
const swapDate = dayjs(Number(swap.creationTime));
|
|
53
|
-
if (now.isSame(swapDate, 'day'))
|
|
54
|
-
|
|
55
|
-
else if (now.isSame(swapDate, 'month'))
|
|
47
|
+
if (now.isSame(swapDate, 'day')) {
|
|
48
|
+
output.get('today')?.swaps.push(swap);
|
|
49
|
+
} else if (now.isSame(swapDate, 'month')) {
|
|
56
50
|
output.get('month')?.swaps.push(swap);
|
|
57
|
-
else if (now.isSame(swapDate, 'year'))
|
|
58
|
-
|
|
51
|
+
} else if (now.isSame(swapDate, 'year')) {
|
|
52
|
+
output.get('year')?.swaps.push(swap);
|
|
53
|
+
} else {
|
|
54
|
+
output.get('history')?.swaps.push(swap);
|
|
55
|
+
}
|
|
59
56
|
});
|
|
60
57
|
|
|
61
58
|
return Array.from(output.values());
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { BlockchainMeta } from 'rango-sdk';
|
|
2
|
+
|
|
3
|
+
export function getBlockchainDisplayNameFor(
|
|
4
|
+
blockchainName: string,
|
|
5
|
+
blockchains: BlockchainMeta[]
|
|
6
|
+
): string | undefined {
|
|
7
|
+
return blockchains.find((blockchain) => blockchain.name === blockchainName)
|
|
8
|
+
?.displayName;
|
|
9
|
+
}
|