@rango-dev/widget-embedded 0.17.1-next.8 → 0.18.0
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/CHANGELOG.md +116 -0
- package/dist/QueueManager.d.ts +3 -1
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +690 -61
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +2 -2
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +1727 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +793 -5
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +0 -1
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +157 -0
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
- package/dist/components/Quote/index.d.ts +0 -1
- package/dist/components/Quote/index.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSkeleton.d.ts.map +1 -0
- package/dist/components/{Quote → QuoteSkeleton}/QuoteSkeleton.styles.d.ts +314 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.types.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts +4 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +1571 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts +6 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.types.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts +4 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +786 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts +4 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.types.d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/index.d.ts +4 -0
- package/dist/components/QuoteSkeleton/index.d.ts.map +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts +1 -0
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +158 -0
- package/dist/components/Slippage/Slippage.styles.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.Placeholder.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts +1 -1
- package/dist/components/SwapDetails/SwapDetails.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts +628 -0
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsCompleteModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.helpers.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.d.ts.map +1 -1
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts +157 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.helpers.d.ts +2 -2
- package/dist/components/TokenList/TokenList.helpers.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +1100 -1
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +4 -9
- package/dist/components/TokenList/TokenList.types.d.ts.map +1 -1
- package/dist/components/TokenList/index.d.ts +0 -1
- package/dist/components/TokenList/index.d.ts.map +1 -1
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/constants/errors.d.ts.map +1 -1
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/navigationRoutes.d.ts +1 -2
- package/dist/constants/navigationRoutes.d.ts.map +1 -1
- package/dist/constants/searchParams.d.ts +2 -1
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/containers/App/App.d.ts +3 -0
- package/dist/containers/App/App.d.ts.map +1 -0
- package/dist/containers/App/App.styles.d.ts +158 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -0
- package/dist/containers/App/index.d.ts +2 -0
- package/dist/containers/App/index.d.ts.map +1 -0
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +316 -0
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +3 -0
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Wallets/Wallets.d.ts +6 -0
- package/dist/containers/Wallets/Wallets.d.ts.map +1 -0
- package/dist/containers/Wallets/Wallets.types.d.ts +11 -0
- package/dist/containers/Wallets/Wallets.types.d.ts.map +1 -0
- package/dist/containers/Wallets/index.d.ts +2 -0
- package/dist/containers/Wallets/index.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.d.ts +5 -0
- package/dist/containers/Widget/Widget.d.ts.map +1 -0
- package/dist/containers/Widget/Widget.types.d.ts +5 -0
- package/dist/containers/Widget/Widget.types.d.ts.map +1 -0
- package/dist/containers/Widget/index.d.ts +3 -0
- package/dist/containers/Widget/index.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts +6 -0
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts +20 -0
- package/dist/containers/WidgetInfo/WidgetInfo.helpers.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +21 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -0
- package/dist/containers/WidgetInfo/index.d.ts +2 -0
- package/dist/containers/WidgetInfo/index.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts +5 -0
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts +7 -0
- package/dist/containers/WidgetProvider/WidgetProvider.types.d.ts.map +1 -0
- package/dist/containers/WidgetProvider/index.d.ts +2 -0
- package/dist/containers/WidgetProvider/index.d.ts.map +1 -0
- package/dist/hooks/useConfirmSwap/useConfirmSwap.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts +6 -3
- package/dist/hooks/useConfirmSwap/useConfirmSwap.helpers.d.ts.map +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts +1 -1
- package/dist/hooks/useConfirmSwap/useConfirmSwap.types.d.ts.map +1 -1
- package/dist/hooks/useForceAutoConnect.d.ts +2 -0
- package/dist/hooks/useForceAutoConnect.d.ts.map +1 -0
- package/dist/hooks/useLanguage.d.ts +1 -1
- package/dist/hooks/useLanguage.d.ts.map +1 -1
- package/dist/hooks/useNavigateBack.d.ts +1 -3
- package/dist/hooks/useNavigateBack.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.d.ts +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts +2 -2
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts +3 -5
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts +1 -0
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.d.ts.map +1 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts +5 -1
- package/dist/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.d.ts.map +1 -1
- package/dist/hooks/useSwapInput.d.ts.map +1 -1
- package/dist/hooks/useSyncStoresWithConfig.d.ts.map +1 -1
- package/dist/hooks/useTheme.d.ts +1 -1
- package/dist/hooks/useTheme.d.ts.map +1 -1
- package/dist/index.d.ts +20 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +4 -4
- 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.map +1 -1
- package/dist/pages/LiquiditySourcePage.d.ts.map +1 -1
- package/dist/pages/SelectBlockchainPage.d.ts.map +1 -1
- package/dist/pages/SelectSwapItemsPage.d.ts.map +1 -1
- package/dist/pages/SettingsPage.d.ts.map +1 -1
- package/dist/pages/SwapDetailsPage.d.ts.map +1 -1
- package/dist/pages/ThemePage.d.ts.map +1 -1
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +37 -1
- package/dist/store/AppStore.d.ts.map +1 -1
- package/dist/store/app.d.ts +39 -2
- package/dist/store/app.d.ts.map +1 -1
- package/dist/store/notification.d.ts +4 -3
- package/dist/store/notification.d.ts.map +1 -1
- package/dist/store/quote.d.ts +9 -9
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +2 -2
- package/dist/store/slices/data.d.ts.map +1 -1
- package/dist/store/slices/settings.d.ts +39 -0
- package/dist/store/slices/settings.d.ts.map +1 -0
- package/dist/store/ui.d.ts +2 -1
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/store/wallets.d.ts +9 -5
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +36 -3
- package/dist/types/config.d.ts.map +1 -1
- package/dist/types/swap.d.ts +4 -14
- package/dist/types/swap.d.ts.map +1 -1
- package/dist/types/wallets.d.ts +15 -1
- package/dist/types/wallets.d.ts.map +1 -1
- package/dist/utils/colors.d.ts.map +1 -1
- package/dist/utils/configs.d.ts +1 -0
- package/dist/utils/configs.d.ts.map +1 -1
- package/dist/utils/meta.d.ts +2 -1
- package/dist/utils/meta.d.ts.map +1 -1
- package/dist/utils/providers.d.ts +2 -2
- package/dist/utils/providers.d.ts.map +1 -1
- package/dist/utils/queue.d.ts +2 -2
- package/dist/utils/queue.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +1 -1
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/settings.d.ts +4 -1
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +13 -5
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/time.d.ts +1 -1
- package/dist/utils/time.d.ts.map +1 -1
- package/dist/utils/wallets.d.ts +7 -8
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/QueueManager.tsx +4 -3
- package/src/components/AppRouter.tsx +5 -27
- package/src/components/AppRoutes.tsx +54 -33
- package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
- package/src/components/BlockchainsSection/BlockchainsSection.styles.ts +1 -1
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +19 -10
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +29 -10
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +15 -7
- package/src/components/ConfirmWalletsModal/WalletList.tsx +3 -3
- package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
- package/src/components/Layout/Layout.styles.ts +2 -0
- package/src/components/Layout/Layout.tsx +20 -7
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +65 -61
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +28 -34
- package/src/components/NoResult/NoResult.helpers.ts +12 -12
- package/src/components/NoResult/NoResult.tsx +2 -5
- package/src/components/NotificationContent/NotificationContent.tsx +2 -1
- package/src/components/Quote/Quote.styles.ts +49 -12
- package/src/components/Quote/Quote.tsx +107 -38
- package/src/components/Quote/Quote.types.ts +0 -1
- package/src/components/Quote/QuoteSummary.styles.ts +9 -8
- package/src/components/Quote/QuoteSummary.tsx +2 -2
- package/src/components/Quote/index.ts +0 -1
- package/src/components/QuoteSkeleton/QuoteSkeleton.styles.ts +42 -0
- package/src/components/QuoteSkeleton/QuoteSkeleton.tsx +30 -0
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.styles.ts +57 -0
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.tsx +76 -0
- package/src/components/QuoteSkeleton/QuoteSummarySkeleton.types.ts +6 -0
- package/src/components/QuoteSkeleton/StepSkeleton.styles.ts +33 -0
- package/src/components/QuoteSkeleton/StepSkeleton.tsx +44 -0
- package/src/components/QuoteSkeleton/StepSkeleton.types.ts +1 -0
- package/src/components/QuoteSkeleton/index.ts +3 -0
- package/src/components/QuoteWarningsAndErrors/QuoteErrorsModalItem.tsx +1 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.helpers.ts +11 -4
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +8 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +13 -13
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -3
- package/src/components/Slippage/Slippage.styles.ts +15 -5
- package/src/components/Slippage/Slippage.tsx +11 -10
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -8
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +36 -33
- package/src/components/SwapDetails/SwapDetails.tsx +28 -39
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.Warning.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsCompleteModal.tsx +4 -3
- package/src/components/SwapDetailsModal/SwapDetailsModal.Cancel.tsx +2 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +14 -8
- package/src/components/SwapDetailsModal/SwapDetailsModal.helpers.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +1 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +1 -1
- package/src/components/SwapsGroup/SwapsGroup.styles.ts +10 -1
- package/src/components/SwapsGroup/SwapsGroup.tsx +3 -5
- package/src/components/TokenList/TokenList.helpers.ts +2 -2
- package/src/components/TokenList/TokenList.styles.ts +74 -38
- package/src/components/TokenList/TokenList.tsx +30 -20
- package/src/components/TokenList/TokenList.types.ts +4 -10
- package/src/components/TokenList/index.ts +0 -1
- package/src/components/UpdateUrl.tsx +4 -5
- package/src/constants/errors.ts +9 -5
- package/src/constants/index.ts +1 -0
- package/src/constants/navigationRoutes.ts +7 -8
- package/src/constants/searchParams.ts +1 -0
- package/src/containers/App/App.styles.ts +18 -0
- package/src/containers/App/App.tsx +52 -0
- package/src/containers/App/index.ts +1 -0
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +17 -1
- package/src/containers/QuoteInfo/QuoteInfo.tsx +46 -44
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
- package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +25 -31
- package/src/containers/Wallets/Wallets.types.ts +12 -0
- package/src/containers/Wallets/index.ts +1 -0
- package/src/containers/Widget/Widget.tsx +19 -0
- package/src/containers/Widget/Widget.types.ts +5 -0
- package/src/containers/Widget/index.ts +2 -0
- package/src/containers/WidgetInfo/WidgetInfo.helpers.ts +64 -0
- package/src/containers/WidgetInfo/WidgetInfo.tsx +62 -0
- package/src/containers/WidgetInfo/WidgetInfo.types.ts +21 -0
- package/src/containers/WidgetInfo/index.ts +1 -0
- package/src/containers/WidgetProvider/WidgetProvider.tsx +28 -0
- package/src/containers/WidgetProvider/WidgetProvider.types.ts +7 -0
- package/src/containers/WidgetProvider/index.ts +1 -0
- package/src/hooks/useConfirmSwap/useConfirmSwap.helpers.ts +15 -11
- package/src/hooks/useConfirmSwap/useConfirmSwap.ts +21 -20
- package/src/hooks/useConfirmSwap/useConfirmSwap.types.ts +1 -1
- package/src/hooks/useForceAutoConnect.ts +27 -0
- package/src/hooks/useLanguage.ts +4 -5
- package/src/hooks/useNavigateBack.ts +3 -52
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.constants.ts +1 -1
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.helpers.ts +37 -7
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.mock.ts +60 -0
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.test.ts +78 -3
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.ts +15 -6
- package/src/hooks/usePrepareBlockchainList/usePrepareBlockchainList.types.ts +6 -1
- package/src/hooks/useSwapInput.ts +86 -28
- package/src/hooks/useSyncStoresWithConfig.ts +18 -5
- package/src/hooks/useTheme.ts +4 -5
- package/src/index.ts +53 -5
- package/src/pages/ConfirmSwapPage.tsx +61 -33
- package/src/pages/HistoryPage.tsx +2 -7
- package/src/pages/Home.tsx +55 -81
- package/src/pages/LanguagePage.tsx +0 -5
- package/src/pages/LiquiditySourcePage.tsx +3 -7
- package/src/pages/SelectBlockchainPage.tsx +26 -18
- package/src/pages/SelectSwapItemsPage.tsx +13 -26
- package/src/pages/SettingsPage.tsx +26 -17
- package/src/pages/SwapDetailsPage.tsx +3 -4
- package/src/pages/ThemePage.tsx +2 -7
- package/src/pages/WalletsPage.tsx +5 -8
- package/src/services/httpService.ts +1 -1
- package/src/store/AppStore.tsx +7 -1
- package/src/store/app.ts +31 -5
- package/src/store/quote.ts +3 -4
- package/src/store/slices/config.ts +1 -0
- package/src/store/slices/data.ts +10 -6
- package/src/store/slices/settings.ts +168 -0
- package/src/store/wallets.ts +57 -29
- package/src/types/config.ts +48 -3
- package/src/types/swap.ts +4 -13
- package/src/types/wallets.ts +18 -1
- package/src/utils/colors.ts +2 -1
- package/src/utils/configs.ts +2 -1
- package/src/utils/date.ts +1 -1
- package/src/utils/meta.ts +8 -1
- package/src/utils/providers.ts +8 -5
- package/src/utils/queue.ts +2 -2
- package/src/utils/quote.ts +7 -7
- package/src/utils/settings.ts +11 -5
- package/src/utils/swap.ts +46 -40
- package/src/utils/time.ts +1 -1
- package/src/utils/wallets.ts +127 -144
- package/dist/Wallets.d.ts +0 -18
- package/dist/Wallets.d.ts.map +0 -1
- package/dist/Widget.d.ts +0 -9
- package/dist/Widget.d.ts.map +0 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts +0 -4
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.d.ts.map +0 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts +0 -4
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.types.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSkeleton.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSkeleton.styles.d.ts.map +0 -1
- package/dist/components/Quote/QuoteSkeleton.types.d.ts.map +0 -1
- package/dist/store/settings.d.ts +0 -82
- package/dist/store/settings.d.ts.map +0 -1
- package/src/Widget.tsx +0 -106
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +0 -41
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.types.ts +0 -3
- package/src/components/Quote/QuoteSkeleton.styles.ts +0 -110
- package/src/components/Quote/QuoteSkeleton.tsx +0 -108
- package/src/store/settings.ts +0 -161
- /package/dist/components/{Quote → QuoteSkeleton}/QuoteSkeleton.d.ts +0 -0
- /package/dist/components/{Quote → QuoteSkeleton}/QuoteSkeleton.types.d.ts +0 -0
- /package/src/components/{Quote → QuoteSkeleton}/QuoteSkeleton.types.ts +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import type { WidgetConfig } from '../types';
|
|
2
|
+
import type { ProviderInterface } from '@rango-dev/wallets-react';
|
|
3
3
|
export interface ProvidersOptions {
|
|
4
4
|
walletConnectProjectId?: WidgetConfig['walletConnectProjectId'];
|
|
5
5
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"providers.d.ts","sourceRoot":"","sources":["../../src/utils/providers.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,0BAA0B,CAAC;AAIlE,MAAM,WAAW,gBAAgB;IAC/B,sBAAsB,CAAC,EAAE,YAAY,CAAC,wBAAwB,CAAC,CAAC;CACjE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CACvC,SAAS,EAAE,YAAY,CAAC,SAAS,CAAC,EAClC,OAAO,CAAC,EAAE,gBAAgB,GACzB,iBAAiB,EAAE,CAoCrB;AAED,wBAAgB,yBAAyB,CACvC,MAAM,EAAE,YAAY,CAAC,SAAS,CAAC,EAC/B,OAAO,CAAC,EAAE,gBAAgB,GACzB,MAAM,EAAE,CAMV"}
|
package/dist/utils/queue.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Manager } from '@rango-dev/queue-manager-core';
|
|
2
|
-
import { PendingSwapWithQueueID } from '@rango-dev/queue-manager-rango-preset';
|
|
1
|
+
import type { Manager } from '@rango-dev/queue-manager-core';
|
|
2
|
+
import type { PendingSwapWithQueueID } from '@rango-dev/queue-manager-rango-preset';
|
|
3
3
|
export declare const getPendingSwaps: (manager: Manager | undefined) => PendingSwapWithQueueID[];
|
|
4
4
|
//# sourceMappingURL=queue.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;
|
|
1
|
+
{"version":3,"file":"queue.d.ts","sourceRoot":"","sources":["../../src/utils/queue.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EACV,sBAAsB,EAEvB,MAAM,uCAAuC,CAAC;AAE/C,eAAO,MAAM,eAAe,YAAa,OAAO,GAAG,SAAS,6BAiB3D,CAAC"}
|
package/dist/utils/quote.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { QuoteError, QuoteWarning, Wallet } from '../types';
|
|
2
|
-
import type { PendingSwap } from '@rango-dev/queue-manager-rango-preset';
|
|
3
2
|
import type { PriceImpactWarningLevel } from '@rango-dev/ui';
|
|
4
3
|
import type { SimulationAssetAndAmount, SimulationValidationStatus } from '@rango-dev/ui/dist/widget/ui/src/types/swaps';
|
|
5
4
|
import type { Asset, BestRouteResponse, BlockchainMeta, Token } from 'rango-sdk';
|
|
5
|
+
import type { PendingSwap } from 'rango-types';
|
|
6
6
|
import BigNumber from 'bignumber.js';
|
|
7
7
|
export declare function searchParamsToToken(tokens: Token[], searchParams: string | null, chain: BlockchainMeta | null): Token | null;
|
|
8
8
|
export declare function getQuoteToTokenUsdPrice(quote: BestRouteResponse | null): number | null | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/utils/quote.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AACjE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"quote.d.ts","sourceRoot":"","sources":["../../src/utils/quote.ts"],"names":[],"mappings":"AACA,OAAO,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,CACjC,WAAW,EAAE,MAAM,GAClB,uBAAuB,CASzB;AAED,wBAAgB,gBAAgB,CAAC,CAAC,SAAS,KAAK,EAAE,EAAE,CAAC,SAAS,KAAK,EAAE,EACnE,KAAK,EAAE,CAAC,EACR,KAAK,EAAE,CAAC,KAUT;AAED,wBAAgB,gBAAgB,CAC9B,WAAW,EAAE,WAAW,EACxB,WAAW,EAAE,cAAc,EAAE,EAC7B,MAAM,EAAE,KAAK,EAAE,GACd;IACD,cAAc,EAAE,cAAc,GAAG,IAAI,CAAC;IACtC,SAAS,EAAE,KAAK,GAAG,IAAI,CAAC;IACxB,YAAY,EAAE,cAAc,GAAG,IAAI,CAAC;IACpC,OAAO,EAAE,KAAK,GAAG,IAAI,CAAC;IACtB,WAAW,EAAE,MAAM,CAAC;CACrB,CA4CA;AAED,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,iBAAiB,EACxB,MAAM,EAAE;IACN,SAAS,EAAE,KAAK,CAAC;IACjB,OAAO,EAAE,KAAK,CAAC;IACf,MAAM,EAAE,KAAK,EAAE,CAAC;IAChB,YAAY,EAAE,MAAM,CAAC;CACtB,GACA,YAAY,GAAG,IAAI,CAiDrB;AAED,wBAAgB,mBAAmB,CACjC,KAAK,EAAE,iBAAiB,GACvB,UAAU,GAAG,IAAI,CA+BnB;AAED,wBAAgB,cAAc,CAC5B,aAAa,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,EACxC,cAAc,EAAE,SAAS,GAAG,MAAM,GAAG,IAAI,GACxC,MAAM,GAAG,IAAI,CAcf"}
|
package/dist/utils/settings.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Features } from '../types';
|
|
1
2
|
import type { SwapperMeta } from 'rango-sdk';
|
|
2
3
|
export type LiquiditySourceType = 'BRIDGE' | 'AGGREGATOR' | 'DEX';
|
|
3
4
|
export type UniqueSwappersGroupType = {
|
|
@@ -7,6 +8,8 @@ export type UniqueSwappersGroupType = {
|
|
|
7
8
|
type: LiquiditySourceType;
|
|
8
9
|
selected: boolean;
|
|
9
10
|
};
|
|
10
|
-
export declare function getUniqueSwappersGroups(swappers: SwapperMeta[]): UniqueSwappersGroupType[];
|
|
11
|
+
export declare function getUniqueSwappersGroups(swappers: SwapperMeta[], disabledLiquiditySources: string[]): UniqueSwappersGroupType[];
|
|
11
12
|
export declare function sortLiquiditySourcesByGroupTitle(a: SwapperMeta, b: SwapperMeta): 1 | -1 | 0;
|
|
13
|
+
export declare function isFeatureHidden(feature: keyof Features, features?: Features): boolean;
|
|
14
|
+
export declare function isFeatureEnabled(feature: keyof Features, features?: Features): boolean;
|
|
12
15
|
//# sourceMappingURL=settings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/utils/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"settings.d.ts","sourceRoot":"","sources":["../../src/utils/settings.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAI7C,MAAM,MAAM,mBAAmB,GAAG,QAAQ,GAAG,YAAY,GAAG,KAAK,CAAC;AAElE,MAAM,MAAM,uBAAuB,GAAG;IACpC,EAAE,EAAE,MAAM,CAAC;IACX,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,mBAAmB,CAAC;IAC1B,QAAQ,EAAE,OAAO,CAAC;CACnB,CAAC;AAEF,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,WAAW,EAAE,EACvB,wBAAwB,EAAE,MAAM,EAAE,GACjC,uBAAuB,EAAE,CAqC3B;AAED,wBAAgB,gCAAgC,CAC9C,CAAC,EAAE,WAAW,EACd,CAAC,EAAE,WAAW,cAWf;AAED,wBAAgB,eAAe,CAAC,OAAO,EAAE,MAAM,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ,WAE3E;AAED,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,QAAQ,EAAE,QAAQ,CAAC,EAAE,QAAQ,WAE5E"}
|
package/dist/utils/swap.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
import type { FetchStatus } from '../store/slices/data';
|
|
2
|
-
import type {
|
|
3
|
-
import type { ConvertedToken, RecommendedSlippages, SwapButtonState, Wallet } from '../types';
|
|
4
|
-
import type { PendingSwap, PendingSwapStep } from '@rango-dev/queue-manager-rango-preset';
|
|
2
|
+
import type { ConvertedToken, QuoteError, QuoteWarning, RecommendedSlippages, SwapButtonState, Wallet } from '../types';
|
|
5
3
|
import type { WalletType } from '@rango-dev/wallets-shared';
|
|
6
4
|
import type { BestRouteRequest, BestRouteResponse, BlockchainMeta, RecommendedSlippage, SwapResult, Token } from 'rango-sdk';
|
|
5
|
+
import type { PendingSwap, PendingSwapStep } from 'rango-types';
|
|
7
6
|
import BigNumber from 'bignumber.js';
|
|
8
7
|
export declare function getOutputRatio(inputUsdValue: BigNumber | null, outputUsdValue: BigNumber | null): number;
|
|
9
8
|
export declare function hasHighValueLoss(inputUsdValue: BigNumber | null, priceImpact: number): boolean;
|
|
@@ -13,7 +12,16 @@ export declare function getLimitErrorMessage(quote: BestRouteResponse): {
|
|
|
13
12
|
fromAmountRangeError: string;
|
|
14
13
|
recommendation: string;
|
|
15
14
|
};
|
|
16
|
-
export declare function getSwapButtonState(
|
|
15
|
+
export declare function getSwapButtonState(params: {
|
|
16
|
+
fetchMetaStatus: FetchStatus;
|
|
17
|
+
anyWalletConnected: boolean;
|
|
18
|
+
fetchingQuote: boolean;
|
|
19
|
+
inputAmount: string;
|
|
20
|
+
quote: BestRouteResponse | null;
|
|
21
|
+
warning: QuoteWarning | null;
|
|
22
|
+
error: QuoteError | null;
|
|
23
|
+
needsToWarnEthOnPath: boolean;
|
|
24
|
+
}): SwapButtonState;
|
|
17
25
|
export declare function canComputePriceImpact(quote: BestRouteResponse | null, inputAmount: string, usdValue: BigNumber | null): boolean;
|
|
18
26
|
export declare function requiredWallets(quote: BestRouteResponse | null): string[];
|
|
19
27
|
export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
|
|
@@ -54,7 +62,7 @@ export declare function getWalletsForNewSwap(selectedWallets: Wallet[]): {
|
|
|
54
62
|
export declare function getQuoteOutputAmount(quote: BestRouteResponse): string | null;
|
|
55
63
|
export declare function getPercentageChange(input: string, output: string): number;
|
|
56
64
|
export declare function isOutputAmountChangedALot(oldQuote: BestRouteResponse, newQuote: BestRouteResponse): boolean;
|
|
57
|
-
export declare function
|
|
65
|
+
export declare function generateBalanceWarnings(quote: BestRouteResponse, selectedWallets: Wallet[], blockchains: BlockchainMeta[]): string[];
|
|
58
66
|
export declare function calcOutputUsdValue(outputAmount?: string, tokenPrice?: number | null): BigNumber;
|
|
59
67
|
export declare function isNetworkStatusInWarningState(pendingSwapStep: PendingSwapStep | null): boolean;
|
|
60
68
|
export declare function getSwapMessages(pendingSwap: PendingSwap, currentStep: PendingSwapStep | null): {
|
package/dist/utils/swap.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"swap.d.ts","sourceRoot":"","sources":["../../src/utils/swap.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,KAAK,EACV,cAAc,EACd,UAAU,EACV,YAAY,EACZ,oBAAoB,EACpB,eAAe,EACf,MAAM,EACP,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,UAAU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IACrB,eAAe,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,OAAO,CAAA;KAAE,CAAC;CACrD,CAyCA;AAED,wBAAgB,iCAAiC,CAC/C,WAAW,EAAE,WAAW,GACvB,cAAc,CAkBhB;AAED,wBAAgB,eAAe,CAAC,WAAW,EAAE,WAAW,WAMvD;AAED,wBAAgB,mBAAmB,CACjC,QAAQ,EAAE,OAAO,EACjB,qBAAqB,EAAE,OAAO,EAC9B,iBAAiB,EAAE,MAAM,EACzB,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAC/B,eAAe,EAAE;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,EACxD,oBAAoB,CAAC,EAAE,cAAc,uBActC"}
|
package/dist/utils/time.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { PendingSwap } from '
|
|
1
|
+
import type { PendingSwap } from 'rango-types';
|
|
2
2
|
export declare function timeSince(millisecond: number): string;
|
|
3
3
|
export declare function getSwapDate(pendingSwap: PendingSwap): string;
|
|
4
4
|
//# sourceMappingURL=time.d.ts.map
|
package/dist/utils/time.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"time.d.ts","sourceRoot":"","sources":["../../src/utils/time.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAW/C,wBAAgB,SAAS,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAqDrD;AAED,wBAAgB,WAAW,CAAC,WAAW,EAAE,WAAW,UAUnD"}
|
package/dist/utils/wallets.d.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import type { TokenWithBalance } from '../components/TokenList';
|
|
2
1
|
import type { ConnectedWallet, TokenBalance } from '../store/wallets';
|
|
3
|
-
import type { Wallet } from '../types';
|
|
2
|
+
import type { Balance, TokenHash, TokensBalance, Wallet } from '../types';
|
|
4
3
|
import type { WalletInfo as ModalWalletInfo } from '@rango-dev/ui';
|
|
5
|
-
import type { Network, WalletInfo, WalletState, WalletType } from '@rango-dev/wallets-shared';
|
|
4
|
+
import type { Asset, Network, WalletInfo, WalletState, WalletType } from '@rango-dev/wallets-shared';
|
|
6
5
|
import type { BestRouteResponse, BlockchainMeta, Token, WalletDetail } from 'rango-sdk';
|
|
7
6
|
import { WalletState as WalletStatus } from '@rango-dev/ui';
|
|
8
7
|
export declare function mapStatusToWalletState(state: WalletState): WalletStatus;
|
|
@@ -10,18 +9,15 @@ export declare function mapWalletTypesToWalletInfo(getState: (type: WalletType)
|
|
|
10
9
|
export declare function walletAndSupportedChainsNames(supportedBlockchains: BlockchainMeta[]): Network[] | null;
|
|
11
10
|
export declare function prepareAccountsForWalletStore(wallet: WalletType, accounts: string[], evmBasedChains: string[], supportedChainNames: Network[] | null, isContractWallet: boolean): Wallet[];
|
|
12
11
|
export declare function getRequiredChains(quote: BestRouteResponse | null): string[];
|
|
13
|
-
export declare function getBalanceFromWallet(connectedWallets: ConnectedWallet[], chain: string, symbol: string, address: string | null): TokenBalance | null;
|
|
14
12
|
export declare function isAccountAndWalletMatched(account: Wallet, connectedWallet: ConnectedWallet): boolean;
|
|
15
13
|
export declare function makeBalanceFor(retrievedBalance: WalletDetail, tokens: Token[]): TokenBalance[];
|
|
16
14
|
export declare function resetConnectedWalletState(connectedWallet: ConnectedWallet): ConnectedWallet;
|
|
17
15
|
export declare const calculateWalletUsdValue: (connectedWallet: ConnectedWallet[]) => string;
|
|
18
|
-
export declare const sortTokens: (tokens: TokenWithBalance[]) => TokenWithBalance[];
|
|
19
16
|
export declare const getUsdPrice: (blockchain: string, symbol: string, address: string | null, allTokens: Token[]) => number | null;
|
|
20
17
|
export declare const isExperimentalChain: (blockchains: BlockchainMeta[], wallet: string) => boolean;
|
|
21
18
|
export declare const getKeplrCompatibleConnectedWallets: (selectableWallets: Wallet[]) => WalletType[];
|
|
22
|
-
export declare function
|
|
23
|
-
export declare function
|
|
24
|
-
export declare function getSortedTokens(chain: BlockchainMeta | null, tokens: Token[], connectedWallets: ConnectedWallet[], otherChainTokens: TokenWithBalance[]): TokenWithBalance[];
|
|
19
|
+
export declare function formatBalance(balance: Balance | null): Balance | null;
|
|
20
|
+
export declare function sortTokens(tokens: Token[], getBalanceFor: (token: Token) => Balance | null, isTokenPinned: (token: Token) => boolean): Token[];
|
|
25
21
|
export declare function tokensAreEqual(tokenA: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null, tokenB: Pick<Token, 'blockchain' | 'symbol' | 'address'> | null): boolean;
|
|
26
22
|
export declare function sortWalletsBasedOnConnectionState(wallets: ModalWalletInfo[]): ModalWalletInfo[];
|
|
27
23
|
export declare function getConciseAddress(address: string, maxChars?: number, ellipsisLength?: number): string;
|
|
@@ -30,4 +26,7 @@ export declare function getAddress({ chain, connectedWallets, walletType, }: {
|
|
|
30
26
|
walletType: string;
|
|
31
27
|
chain: string;
|
|
32
28
|
}): string | undefined;
|
|
29
|
+
export declare function createTokenHash(token: Asset): TokenHash;
|
|
30
|
+
export declare function makeTokensBalance(connectedWallets: ConnectedWallet[]): TokensBalance;
|
|
31
|
+
export declare const isFetchingBalance: (connectedWallets: ConnectedWallet[], blockchain: string) => boolean;
|
|
33
32
|
//# sourceMappingURL=wallets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"wallets.d.ts","sourceRoot":"","sources":["../../src/utils/wallets.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,kBAAkB,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CACf,GAAG,MAAM,GAAG,SAAS,CAMrB;AAED,wBAAgB,eAAe,CAAC,KAAK,EAAE,KAAK,GAAG,SAAS,CAEvD;AAED,wBAAgB,iBAAiB,CAAC,gBAAgB,EAAE,eAAe,EAAE,iBAmCpE;AAED,eAAO,MAAM,iBAAiB,qBACV,eAAe,EAAE,cACvB,MAAM,YAIjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rango-dev/widget-embedded",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"type": "module",
|
|
6
|
+
"source": "./src/index.ts",
|
|
6
7
|
"main": "dist/index.js",
|
|
7
8
|
"typings": "dist/index.d.ts",
|
|
8
9
|
"files": [
|
|
@@ -12,6 +13,7 @@
|
|
|
12
13
|
"browserslist": "> 0.5%, last 2 versions, not dead",
|
|
13
14
|
"scripts": {
|
|
14
15
|
"build": "node ../../scripts/build/command.mjs --path widget/embedded",
|
|
16
|
+
"ts-check": "tsc --declaration --emitDeclarationOnly -p ./tsconfig.json",
|
|
15
17
|
"clean": "rimraf dist",
|
|
16
18
|
"format": "prettier --write '{.,src}/**/*.{ts,tsx}'",
|
|
17
19
|
"lint": "eslint \"**/*.{ts,tsx}\" --ignore-path ../../.eslintignore"
|
|
@@ -19,20 +21,20 @@
|
|
|
19
21
|
"dependencies": {
|
|
20
22
|
"@lingui/core": "4.2.1",
|
|
21
23
|
"@lingui/react": "4.2.1",
|
|
22
|
-
"@rango-dev/provider-all": "^0.
|
|
23
|
-
"@rango-dev/queue-manager-core": "^0.22.
|
|
24
|
-
"@rango-dev/queue-manager-rango-preset": "^0.
|
|
25
|
-
"@rango-dev/queue-manager-react": "^0.22.
|
|
26
|
-
"@rango-dev/ui": "^0.
|
|
27
|
-
"@rango-dev/wallets-react": "^0.
|
|
28
|
-
"@rango-dev/wallets-shared": "^0.
|
|
24
|
+
"@rango-dev/provider-all": "^0.23.0",
|
|
25
|
+
"@rango-dev/queue-manager-core": "^0.22.0",
|
|
26
|
+
"@rango-dev/queue-manager-rango-preset": "^0.23.0",
|
|
27
|
+
"@rango-dev/queue-manager-react": "^0.22.0",
|
|
28
|
+
"@rango-dev/ui": "^0.23.0",
|
|
29
|
+
"@rango-dev/wallets-react": "^0.9.0",
|
|
30
|
+
"@rango-dev/wallets-shared": "^0.22.0",
|
|
29
31
|
"bignumber.js": "^9.1.1",
|
|
30
32
|
"copy-to-clipboard": "^3.3.3",
|
|
31
33
|
"dayjs": "^1.11.7",
|
|
32
34
|
"immer": "^9.0.19",
|
|
33
35
|
"mitt": "^3.0.0",
|
|
34
|
-
"rango-sdk": "^0.1.
|
|
35
|
-
"rango-types": "^0.1.
|
|
36
|
+
"rango-sdk": "^0.1.44",
|
|
37
|
+
"rango-types": "^0.1.57",
|
|
36
38
|
"react-i18next": "^12.2.0",
|
|
37
39
|
"react-router-dom": "^6.8.0",
|
|
38
40
|
"values.js": "2.1.1",
|
package/src/QueueManager.tsx
CHANGED
|
@@ -17,7 +17,7 @@ import { useWalletsStore } from './store/wallets';
|
|
|
17
17
|
import { getConfig } from './utils/configs';
|
|
18
18
|
import { walletAndSupportedChainsNames } from './utils/wallets';
|
|
19
19
|
|
|
20
|
-
function QueueManager(props: PropsWithChildren) {
|
|
20
|
+
function QueueManager(props: PropsWithChildren<{ apiKey?: string }>) {
|
|
21
21
|
const {
|
|
22
22
|
providers,
|
|
23
23
|
getSigners,
|
|
@@ -29,9 +29,10 @@ function QueueManager(props: PropsWithChildren) {
|
|
|
29
29
|
|
|
30
30
|
const swapQueueDef = useMemo(() => {
|
|
31
31
|
return makeQueueDefinition({
|
|
32
|
-
API_KEY: getConfig('API_KEY'),
|
|
32
|
+
API_KEY: props.apiKey || getConfig('API_KEY'),
|
|
33
|
+
BASE_URL: getConfig('BASE_URL'),
|
|
33
34
|
});
|
|
34
|
-
}, []);
|
|
35
|
+
}, [props.apiKey]);
|
|
35
36
|
|
|
36
37
|
const blockchains = useAppStore().blockchains();
|
|
37
38
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
@@ -4,38 +4,14 @@ import type { PropsWithChildren } from 'react';
|
|
|
4
4
|
import { useQueueManager } from '@rango-dev/queue-manager-rango-preset';
|
|
5
5
|
import { useWallets } from '@rango-dev/wallets-react';
|
|
6
6
|
import { isEvmBlockchain } from 'rango-types';
|
|
7
|
-
import React, {
|
|
7
|
+
import React, { Fragment } from 'react';
|
|
8
8
|
import { MemoryRouter, useInRouterContext } from 'react-router';
|
|
9
|
-
import { useLocation, useNavigate } from 'react-router-dom';
|
|
10
9
|
|
|
11
|
-
import {
|
|
12
|
-
import { Home } from '../pages/Home';
|
|
10
|
+
import { useForceAutoConnect } from '../hooks/useForceAutoConnect';
|
|
13
11
|
import { useAppStore } from '../store/AppStore';
|
|
14
12
|
|
|
15
13
|
import { UpdateUrl } from './UpdateUrl';
|
|
16
14
|
|
|
17
|
-
function Route(props: PropsWithChildren) {
|
|
18
|
-
const location = useLocation();
|
|
19
|
-
const navigate = useNavigate();
|
|
20
|
-
const firstRender = useRef(true);
|
|
21
|
-
const paths = location.pathname.split('/');
|
|
22
|
-
const pathMatched = paths[paths.length - 1] === navigationRoutes.confirmSwap;
|
|
23
|
-
const shouldRedirectToMainPage = pathMatched && firstRender.current;
|
|
24
|
-
|
|
25
|
-
useEffect(() => {
|
|
26
|
-
if (shouldRedirectToMainPage) {
|
|
27
|
-
navigate('.');
|
|
28
|
-
}
|
|
29
|
-
firstRender.current = false;
|
|
30
|
-
}, []);
|
|
31
|
-
|
|
32
|
-
if (shouldRedirectToMainPage) {
|
|
33
|
-
return <Home />;
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
return <> {props.children}</>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
15
|
export function AppRouter({
|
|
40
16
|
children,
|
|
41
17
|
...props
|
|
@@ -45,10 +21,12 @@ export function AppRouter({
|
|
|
45
21
|
clearDisconnectedWallet: () => void;
|
|
46
22
|
}) {
|
|
47
23
|
const isRouterInContext = useInRouterContext();
|
|
48
|
-
const Router = isRouterInContext ?
|
|
24
|
+
const Router = isRouterInContext ? Fragment : MemoryRouter;
|
|
49
25
|
const blockchains = useAppStore().blockchains();
|
|
50
26
|
const { canSwitchNetworkTo } = useWallets();
|
|
51
27
|
|
|
28
|
+
useForceAutoConnect();
|
|
29
|
+
|
|
52
30
|
const evmChains = blockchains.filter(isEvmBlockchain);
|
|
53
31
|
|
|
54
32
|
useQueueManager({
|
|
@@ -14,8 +14,6 @@ import { SwapDetailsPage } from '../pages/SwapDetailsPage';
|
|
|
14
14
|
import { ThemePage } from '../pages/ThemePage';
|
|
15
15
|
import { WalletsPage } from '../pages/WalletsPage';
|
|
16
16
|
|
|
17
|
-
const getAbsolutePath = (path: string) => path.replace('/', '');
|
|
18
|
-
|
|
19
17
|
export function AppRoutes() {
|
|
20
18
|
return useRoutes([
|
|
21
19
|
{
|
|
@@ -24,51 +22,74 @@ export function AppRoutes() {
|
|
|
24
22
|
},
|
|
25
23
|
{
|
|
26
24
|
path: navigationRoutes.fromSwap,
|
|
27
|
-
|
|
25
|
+
children: [
|
|
26
|
+
{
|
|
27
|
+
index: true,
|
|
28
|
+
element: <SelectSwapItemsPage type="source" />,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
path: navigationRoutes.blockchains,
|
|
32
|
+
element: <SelectBlockchainPage type="source" />,
|
|
33
|
+
},
|
|
34
|
+
],
|
|
28
35
|
},
|
|
29
36
|
{
|
|
30
37
|
path: navigationRoutes.toSwap,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
38
|
+
children: [
|
|
39
|
+
{
|
|
40
|
+
index: true,
|
|
41
|
+
element: <SelectSwapItemsPage type="destination" />,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
path: navigationRoutes.blockchains,
|
|
45
|
+
element: <SelectBlockchainPage type="destination" />,
|
|
46
|
+
},
|
|
47
|
+
],
|
|
40
48
|
},
|
|
41
49
|
{
|
|
42
50
|
path: navigationRoutes.settings,
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
51
|
+
children: [
|
|
52
|
+
{
|
|
53
|
+
index: true,
|
|
54
|
+
element: <SettingsPage />,
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
path: navigationRoutes.themes,
|
|
58
|
+
element: <ThemePage />,
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
path: navigationRoutes.languages,
|
|
62
|
+
element: <LanguagePage />,
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
path: navigationRoutes.exchanges,
|
|
66
|
+
element: <LiquiditySourcePage sourceType="Exchanges" />,
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
path: navigationRoutes.bridges,
|
|
70
|
+
element: <LiquiditySourcePage sourceType="Bridges" />,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
60
73
|
},
|
|
61
|
-
{ path: navigationRoutes.swaps, element: <HistoryPage /> },
|
|
62
74
|
{
|
|
63
|
-
path: navigationRoutes.
|
|
64
|
-
|
|
75
|
+
path: navigationRoutes.swaps,
|
|
76
|
+
children: [
|
|
77
|
+
{
|
|
78
|
+
index: true,
|
|
79
|
+
element: <HistoryPage />,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
path: navigationRoutes.swapDetails,
|
|
83
|
+
element: <SwapDetailsPage />,
|
|
84
|
+
},
|
|
85
|
+
],
|
|
65
86
|
},
|
|
66
87
|
{
|
|
67
88
|
path: navigationRoutes.wallets,
|
|
68
89
|
element: <WalletsPage />,
|
|
69
90
|
},
|
|
70
91
|
{
|
|
71
|
-
path:
|
|
92
|
+
path: navigationRoutes.confirmSwap,
|
|
72
93
|
element: <ConfirmSwapPage />,
|
|
73
94
|
},
|
|
74
95
|
]);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { ImageContainer, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
display: 'flex',
|
|
@@ -12,7 +12,7 @@ export const List = styled('ul', {
|
|
|
12
12
|
listStyle: 'none',
|
|
13
13
|
overflowY: 'auto',
|
|
14
14
|
paddingRight: '$5',
|
|
15
|
-
|
|
15
|
+
[`& ${ImageContainer}`]: {
|
|
16
16
|
borderRadius: '$xm',
|
|
17
17
|
overflow: 'hidden',
|
|
18
18
|
},
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
Divider,
|
|
8
8
|
Image,
|
|
9
9
|
Skeleton,
|
|
10
|
+
Tooltip,
|
|
10
11
|
Typography,
|
|
11
12
|
} from '@rango-dev/ui';
|
|
12
13
|
import React from 'react';
|
|
@@ -15,8 +16,9 @@ import { BLOCKCHAIN_LIST_SIZE } from '../../constants/configs';
|
|
|
15
16
|
import { usePrepareBlockchainList } from '../../hooks/usePrepareBlockchainList';
|
|
16
17
|
import { useAppStore } from '../../store/AppStore';
|
|
17
18
|
import { useQuoteStore } from '../../store/quote';
|
|
19
|
+
import { getContainer } from '../../utils/common';
|
|
18
20
|
|
|
19
|
-
import {
|
|
21
|
+
import { Blockchains } from './BlockchainsSection.styles';
|
|
20
22
|
|
|
21
23
|
const NUMBER_OF_LOADING = 12;
|
|
22
24
|
|
|
@@ -38,13 +40,13 @@ export function BlockchainsSection(props: PropTypes) {
|
|
|
38
40
|
const showMoreButton = !onlyOneItemInList && hasMoreItemsInList;
|
|
39
41
|
|
|
40
42
|
return (
|
|
41
|
-
|
|
43
|
+
<>
|
|
42
44
|
<Divider size={12} />
|
|
43
45
|
<Typography variant="label" size="large">
|
|
44
46
|
{i18n.t('Select Blockchain')}
|
|
45
47
|
</Typography>
|
|
46
48
|
<Divider size={12} />
|
|
47
|
-
<
|
|
49
|
+
<Blockchains>
|
|
48
50
|
{fetchStatus === 'loading' &&
|
|
49
51
|
Array.from(Array(NUMBER_OF_LOADING), (e) => (
|
|
50
52
|
<Skeleton key={e} variant="rounded" height={50} />
|
|
@@ -65,12 +67,19 @@ export function BlockchainsSection(props: PropTypes) {
|
|
|
65
67
|
</Typography>
|
|
66
68
|
</BlockchainsChip>
|
|
67
69
|
{blockchainsList.list.map((item) => (
|
|
68
|
-
<
|
|
70
|
+
<Tooltip
|
|
69
71
|
key={item.name}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
content={item.shortName}
|
|
73
|
+
side="bottom"
|
|
74
|
+
sideOffset={2}
|
|
75
|
+
container={getContainer()}>
|
|
76
|
+
<BlockchainsChip
|
|
77
|
+
key={item.name}
|
|
78
|
+
selected={!!blockchain && blockchain.name === item.name}
|
|
79
|
+
onClick={() => onChange(item)}>
|
|
80
|
+
<Image src={item.logo} size={30} />
|
|
81
|
+
</BlockchainsChip>
|
|
82
|
+
</Tooltip>
|
|
74
83
|
))}
|
|
75
84
|
|
|
76
85
|
{onlyOneItemInList ? (
|
|
@@ -96,7 +105,7 @@ export function BlockchainsSection(props: PropTypes) {
|
|
|
96
105
|
) : null}
|
|
97
106
|
</>
|
|
98
107
|
)}
|
|
99
|
-
</
|
|
100
|
-
|
|
108
|
+
</Blockchains>
|
|
109
|
+
</>
|
|
101
110
|
);
|
|
102
111
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
2
|
import {
|
|
3
3
|
Button,
|
|
4
|
+
css,
|
|
4
5
|
darkTheme,
|
|
5
6
|
IconButton,
|
|
6
7
|
keyframes,
|
|
@@ -36,10 +37,13 @@ export const Title = styled('div', {
|
|
|
36
37
|
});
|
|
37
38
|
|
|
38
39
|
export const ListContainer = styled('div', {
|
|
39
|
-
display: '
|
|
40
|
+
display: 'flex',
|
|
41
|
+
justifyContent: 'space-evenly',
|
|
42
|
+
alignItems: 'center',
|
|
40
43
|
gap: '$10',
|
|
41
|
-
|
|
42
|
-
|
|
44
|
+
flexWrap: 'wrap',
|
|
45
|
+
paddingTop: '$5',
|
|
46
|
+
height: '100%',
|
|
43
47
|
});
|
|
44
48
|
|
|
45
49
|
export const WalletButton = styled('button', {
|
|
@@ -84,6 +88,12 @@ export const WalletButton = styled('button', {
|
|
|
84
88
|
},
|
|
85
89
|
},
|
|
86
90
|
});
|
|
91
|
+
|
|
92
|
+
export const ShowMoreWallets = styled(WalletButton, {
|
|
93
|
+
alignSelf: 'stretch',
|
|
94
|
+
minHeight: '93px',
|
|
95
|
+
});
|
|
96
|
+
|
|
87
97
|
export const Trigger = styled(Collapsible.Trigger, {
|
|
88
98
|
padding: '$0',
|
|
89
99
|
border: 'none',
|
|
@@ -110,12 +120,16 @@ export const NavigateBack = styled(IconButton, {
|
|
|
110
120
|
|
|
111
121
|
export const WalletsContainer = styled('div', {
|
|
112
122
|
paddingTop: '$20',
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
123
|
+
});
|
|
124
|
+
|
|
125
|
+
export const walletsListStyles = css({
|
|
126
|
+
display: 'flex',
|
|
127
|
+
justifyContent: 'space-evenly',
|
|
128
|
+
alignItems: 'center',
|
|
129
|
+
gap: '$10',
|
|
130
|
+
flexWrap: 'wrap',
|
|
131
|
+
paddingTop: '$5',
|
|
132
|
+
height: '100%',
|
|
119
133
|
});
|
|
120
134
|
|
|
121
135
|
export const CollapsibleRoot = styled(Collapsible.Root, {
|
|
@@ -165,12 +179,15 @@ export const CustomDestination = styled('div', {
|
|
|
165
179
|
padding: '$10 $0',
|
|
166
180
|
'& .button__content': {
|
|
167
181
|
display: 'flex',
|
|
168
|
-
justifyContent: 'center',
|
|
169
182
|
alignItems: 'center',
|
|
170
183
|
},
|
|
171
184
|
'& .alarms': { paddingTop: '5px' },
|
|
172
185
|
});
|
|
173
186
|
|
|
187
|
+
export const alarmsStyles = css({
|
|
188
|
+
paddingTop: '5px',
|
|
189
|
+
});
|
|
190
|
+
|
|
174
191
|
export const ExpandedIcon = styled('div', {
|
|
175
192
|
transition: `all ${EXPANDABLE_TRANSITION_DURATION}ms ease`,
|
|
176
193
|
variants: {
|
|
@@ -190,10 +207,12 @@ export const ConfirmButton = styled('div', {
|
|
|
190
207
|
});
|
|
191
208
|
|
|
192
209
|
export const StyledTextField = styled(TextField, {
|
|
210
|
+
backgroundColor: '$neutral100',
|
|
193
211
|
padding: '$0 $15 $15 $15',
|
|
194
212
|
});
|
|
195
213
|
|
|
196
214
|
export const CollapsibleContent = styled(Collapsible.Content, {
|
|
215
|
+
backgroundColor: '$neutral100',
|
|
197
216
|
overflow: 'hidden',
|
|
198
217
|
variants: {
|
|
199
218
|
open: {
|