@rango-dev/widget-embedded 0.17.1-next.3 → 0.17.1-next.31
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/QueueManager.d.ts +5 -2
- package/dist/QueueManager.d.ts.map +1 -1
- package/dist/components/AppRouter.d.ts +0 -2
- package/dist/components/AppRouter.d.ts.map +1 -1
- package/dist/components/AppRoutes.d.ts +1 -6
- package/dist/components/AppRoutes.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +370 -56
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts +0 -2
- package/dist/components/ConfirmWalletsModal/ConfirmWalletsModal.types.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.type.d.ts +1 -4
- package/dist/components/ConfirmWalletsModal/WalletList.type.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.types.d.ts +2 -2
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetailStep.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/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 +633 -3
- 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/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/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.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 +942 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.types.d.ts +3 -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 +1 -6
- package/dist/components/UpdateUrl.d.ts.map +1 -1
- package/dist/components/WidgetEvents.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 +1 -2
- 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/hooks/useWalletList.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 +1 -6
- 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 +1 -2
- 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 +1 -6
- 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 +1 -8
- package/dist/pages/WalletsPage.d.ts.map +1 -1
- package/dist/store/AppStore.d.ts +47 -0
- package/dist/store/AppStore.d.ts.map +1 -0
- package/dist/store/app.d.ts +41 -22
- 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 +23 -16
- package/dist/store/quote.d.ts.map +1 -1
- package/dist/store/slices/config.d.ts +3 -2
- package/dist/store/slices/config.d.ts.map +1 -1
- package/dist/store/slices/data.d.ts +3 -0
- 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 +14 -9
- package/dist/store/wallets.d.ts.map +1 -1
- package/dist/types/config.d.ts +38 -5
- 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 +6 -2
- package/dist/utils/settings.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +16 -7
- 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 -9
- package/dist/utils/wallets.d.ts.map +1 -1
- package/package.json +12 -10
- package/src/QueueManager.tsx +18 -17
- package/src/components/AppRouter.tsx +8 -32
- package/src/components/AppRoutes.tsx +57 -69
- package/src/components/BlockchainList/BlockchainList.styles.ts +2 -2
- package/src/components/BlockchainList/BlockchainList.tsx +4 -4
- package/src/components/BlockchainsSection/BlockchainsSection.tsx +4 -4
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +12 -6
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +20 -21
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.types.ts +0 -2
- package/src/components/ConfirmWalletsModal/WalletList.tsx +6 -5
- package/src/components/ConfirmWalletsModal/WalletList.type.ts +1 -4
- package/src/components/HeaderButtons/HomeButtons.tsx +28 -18
- package/src/components/Layout/Layout.tsx +20 -7
- package/src/components/Layout/Layout.types.ts +2 -2
- package/src/components/LoadingSwapDetails/LoadingSwapDetailStep.tsx +14 -7
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.styles.ts +63 -60
- package/src/components/LoadingSwapDetails/LoadingSwapDetails.tsx +17 -8
- package/src/components/NoResult/NoResult.helpers.ts +12 -12
- package/src/components/NoResult/NoResult.tsx +6 -6
- package/src/components/NotificationContent/NotificationContent.tsx +5 -3
- package/src/components/Quote/Quote.styles.ts +42 -12
- package/src/components/Quote/Quote.tsx +106 -37
- package/src/components/Quote/Quote.types.ts +0 -1
- package/src/components/Quote/QuoteSkeleton.tsx +1 -1
- package/src/components/Quote/QuoteSummary.styles.ts +9 -8
- package/src/components/Quote/QuoteSummary.tsx +2 -2
- 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.tsx +3 -5
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +5 -7
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.styles.ts +37 -33
- package/src/components/SwapDetails/SwapDetails.tsx +33 -45
- 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.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 +58 -37
- package/src/components/TokenList/TokenList.tsx +28 -23
- package/src/components/TokenList/TokenList.types.ts +3 -10
- package/src/components/TokenList/index.ts +0 -1
- package/src/components/UpdateUrl.tsx +23 -18
- package/src/components/WidgetEvents.tsx +4 -2
- 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 +44 -43
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +3 -0
- package/src/{Wallets.tsx → containers/Wallets/Wallets.tsx} +48 -34
- 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 +25 -24
- 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 +89 -30
- package/src/hooks/useSyncStoresWithConfig.ts +38 -22
- package/src/hooks/useTheme.ts +4 -5
- package/src/hooks/useWalletList.ts +3 -5
- package/src/index.ts +53 -5
- package/src/pages/ConfirmSwapPage.tsx +61 -41
- package/src/pages/HistoryPage.tsx +2 -7
- package/src/pages/Home.tsx +58 -88
- package/src/pages/LanguagePage.tsx +0 -5
- package/src/pages/LiquiditySourcePage.tsx +24 -37
- package/src/pages/SelectBlockchainPage.tsx +28 -21
- package/src/pages/SelectSwapItemsPage.tsx +10 -27
- package/src/pages/SettingsPage.tsx +28 -24
- package/src/pages/SwapDetailsPage.tsx +6 -7
- package/src/pages/ThemePage.tsx +2 -7
- package/src/pages/WalletsPage.tsx +4 -15
- package/src/services/httpService.ts +1 -1
- package/src/store/AppStore.tsx +41 -0
- package/src/store/app.ts +44 -6
- package/src/store/quote.ts +29 -26
- package/src/store/slices/config.ts +25 -15
- package/src/store/slices/data.ts +64 -29
- package/src/store/slices/settings.ts +168 -0
- package/src/store/wallets.ts +68 -37
- package/src/types/config.ts +50 -5
- 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 +17 -10
- package/src/utils/swap.ts +59 -55
- package/src/utils/time.ts +1 -1
- package/src/utils/wallets.ts +107 -149
- package/dist/Wallets.d.ts +0 -17
- 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/store/meta.d.ts +0 -23
- package/dist/store/meta.d.ts.map +0 -1
- package/dist/store/settings.d.ts +0 -81
- package/dist/store/settings.d.ts.map +0 -1
- package/src/Widget.tsx +0 -119
- package/src/store/meta.ts +0 -39
- package/src/store/settings.ts +0 -158
|
@@ -1,74 +1,15 @@
|
|
|
1
|
-
import { styled } from '@rango-dev/ui';
|
|
1
|
+
import { css, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
3
|
export const Container = styled('div', {
|
|
4
4
|
width: '100%',
|
|
5
5
|
height: '100%',
|
|
6
6
|
padding: '$0 $20',
|
|
7
|
-
|
|
8
|
-
'.cost': {
|
|
9
|
-
paddingTop: '$15',
|
|
10
|
-
display: 'flex',
|
|
11
|
-
},
|
|
12
|
-
|
|
13
|
-
'.quote-summary': {
|
|
14
|
-
padding: '$15 $0',
|
|
15
|
-
},
|
|
16
|
-
|
|
17
|
-
'.quote-summary-item': {
|
|
18
|
-
display: 'flex',
|
|
19
|
-
justifyContent: 'space-between',
|
|
20
|
-
alignItems: 'center',
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
'.token-amount': {
|
|
24
|
-
display: 'flex',
|
|
25
|
-
justifyContent: 'space-between',
|
|
26
|
-
alignItems: 'center',
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
'.quote-summary-separator': {
|
|
30
|
-
width: '0px',
|
|
31
|
-
height: '$16',
|
|
32
|
-
borderLeft: '1px solid $neutral400',
|
|
33
|
-
marginLeft: '13px',
|
|
34
|
-
},
|
|
35
|
-
|
|
36
|
-
'.swaps-steps': {
|
|
37
|
-
paddingBottom: '$10',
|
|
38
|
-
},
|
|
39
7
|
});
|
|
40
8
|
|
|
41
9
|
export const StepContainer = styled('div', {
|
|
42
10
|
backgroundColor: '$neutral100',
|
|
43
11
|
borderRadius: '$xm',
|
|
44
12
|
padding: '$10 $15',
|
|
45
|
-
|
|
46
|
-
'.step-title': {
|
|
47
|
-
display: 'flex',
|
|
48
|
-
justifyContent: 'start',
|
|
49
|
-
alignItems: 'center',
|
|
50
|
-
},
|
|
51
|
-
'.step-tokens': {
|
|
52
|
-
paddingTop: '$5',
|
|
53
|
-
display: 'flex',
|
|
54
|
-
alignItems: 'center',
|
|
55
|
-
},
|
|
56
|
-
'.step-token-info': {
|
|
57
|
-
display: 'flex',
|
|
58
|
-
alignItems: 'center',
|
|
59
|
-
},
|
|
60
|
-
'.step-icon-container': {
|
|
61
|
-
padding: '$4 $6',
|
|
62
|
-
display: 'flex',
|
|
63
|
-
justifyContent: 'center',
|
|
64
|
-
alignItems: 'center',
|
|
65
|
-
},
|
|
66
|
-
|
|
67
|
-
'.extra-info': {
|
|
68
|
-
display: 'flex',
|
|
69
|
-
paddingTop: '$10',
|
|
70
|
-
paddingBottom: '$5',
|
|
71
|
-
},
|
|
72
13
|
});
|
|
73
14
|
export const StepSeparator = styled('div', {
|
|
74
15
|
width: '0px',
|
|
@@ -76,3 +17,65 @@ export const StepSeparator = styled('div', {
|
|
|
76
17
|
borderLeft: '1px dashed $neutral700',
|
|
77
18
|
marginLeft: '25px',
|
|
78
19
|
});
|
|
20
|
+
|
|
21
|
+
export const quoteSummaryItemStyles = css({
|
|
22
|
+
display: 'flex',
|
|
23
|
+
justifyContent: 'space-between',
|
|
24
|
+
alignItems: 'center',
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const tokenAmountStyles = css({
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
alignItems: 'center',
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export const costStyles = css({
|
|
34
|
+
paddingTop: '$15',
|
|
35
|
+
display: 'flex',
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
export const quoteSummaryStyles = css({
|
|
39
|
+
padding: '$15 $0',
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
export const quoteSummarySeparatorStyles = css({
|
|
43
|
+
width: '0px',
|
|
44
|
+
height: '$16',
|
|
45
|
+
borderLeft: '1px solid $neutral400',
|
|
46
|
+
marginLeft: '13px',
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
export const swapsStepsStyles = css({
|
|
50
|
+
paddingBottom: '$10',
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
export const stepTitleStyles = css({
|
|
54
|
+
display: 'flex',
|
|
55
|
+
justifyContent: 'start',
|
|
56
|
+
alignItems: 'center',
|
|
57
|
+
});
|
|
58
|
+
|
|
59
|
+
export const stepTokensStyles = css({
|
|
60
|
+
paddingTop: '$5',
|
|
61
|
+
display: 'flex',
|
|
62
|
+
alignItems: 'center',
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
export const stepInfoStyles = css({
|
|
66
|
+
display: 'flex',
|
|
67
|
+
alignItems: 'center',
|
|
68
|
+
});
|
|
69
|
+
|
|
70
|
+
export const stepIconStyles = css({
|
|
71
|
+
padding: '$4 $6',
|
|
72
|
+
display: 'flex',
|
|
73
|
+
justifyContent: 'center',
|
|
74
|
+
alignItems: 'center',
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
export const extraInfoStyles = css({
|
|
78
|
+
display: 'flex',
|
|
79
|
+
paddingTop: '$10',
|
|
80
|
+
paddingBottom: '$5',
|
|
81
|
+
});
|
|
@@ -2,13 +2,22 @@ import { i18n } from '@lingui/core';
|
|
|
2
2
|
import { ChainToken, Divider, Skeleton, Typography } from '@rango-dev/ui';
|
|
3
3
|
import React from 'react';
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import {
|
|
6
|
+
Container,
|
|
7
|
+
costStyles,
|
|
8
|
+
quoteSummaryItemStyles,
|
|
9
|
+
quoteSummarySeparatorStyles,
|
|
10
|
+
quoteSummaryStyles,
|
|
11
|
+
StepSeparator,
|
|
12
|
+
swapsStepsStyles,
|
|
13
|
+
tokenAmountStyles,
|
|
14
|
+
} from './LoadingSwapDetails.styles';
|
|
6
15
|
import { LoadingSwapDetailStep } from './LoadingSwapDetailStep';
|
|
7
16
|
|
|
8
17
|
export function LoadingSwapDetails() {
|
|
9
18
|
const quoteSummary = (
|
|
10
|
-
<div className=
|
|
11
|
-
<div className=
|
|
19
|
+
<div className={quoteSummaryItemStyles()}>
|
|
20
|
+
<div className={tokenAmountStyles()}>
|
|
12
21
|
<ChainToken loading size="medium" chainImage="" tokenImage="" />
|
|
13
22
|
<Divider size={8} direction="horizontal" />
|
|
14
23
|
<Skeleton height={15} width={148} variant="rounded" />
|
|
@@ -19,7 +28,7 @@ export function LoadingSwapDetails() {
|
|
|
19
28
|
|
|
20
29
|
return (
|
|
21
30
|
<Container>
|
|
22
|
-
<div className=
|
|
31
|
+
<div className={costStyles()}>
|
|
23
32
|
<Skeleton width={60} height={10} variant="rounded" />
|
|
24
33
|
<Divider size={4} direction="horizontal" />
|
|
25
34
|
<Skeleton width={60} height={10} variant="rounded" />
|
|
@@ -27,19 +36,19 @@ export function LoadingSwapDetails() {
|
|
|
27
36
|
<Skeleton width={60} height={10} variant="rounded" />
|
|
28
37
|
</div>
|
|
29
38
|
|
|
30
|
-
<div className=
|
|
39
|
+
<div className={quoteSummaryStyles()}>
|
|
31
40
|
{quoteSummary}
|
|
32
|
-
<div className=
|
|
41
|
+
<div className={quoteSummarySeparatorStyles()}></div>
|
|
33
42
|
{quoteSummary}
|
|
34
43
|
</div>
|
|
35
44
|
|
|
36
|
-
<div className=
|
|
45
|
+
<div className={swapsStepsStyles()}>
|
|
37
46
|
<Typography variant="title" size="small">
|
|
38
47
|
{i18n.t('Swaps steps')}
|
|
39
48
|
</Typography>
|
|
40
49
|
</div>
|
|
41
50
|
|
|
42
|
-
<div
|
|
51
|
+
<div>
|
|
43
52
|
<LoadingSwapDetailStep extraInfo />
|
|
44
53
|
<StepSeparator />
|
|
45
54
|
<LoadingSwapDetailStep />
|
|
@@ -27,18 +27,6 @@ export function makeInfo(
|
|
|
27
27
|
},
|
|
28
28
|
description: '',
|
|
29
29
|
};
|
|
30
|
-
} else if (
|
|
31
|
-
error?.type === QuoteErrorType.NO_RESULT &&
|
|
32
|
-
error.diagnosisMessage
|
|
33
|
-
) {
|
|
34
|
-
return {
|
|
35
|
-
alert: {
|
|
36
|
-
type: 'error',
|
|
37
|
-
text: error.diagnosisMessage,
|
|
38
|
-
action: null,
|
|
39
|
-
},
|
|
40
|
-
description: '',
|
|
41
|
-
};
|
|
42
30
|
} else if (disabledLiquiditySources.length) {
|
|
43
31
|
return {
|
|
44
32
|
alert: {
|
|
@@ -51,6 +39,18 @@ export function makeInfo(
|
|
|
51
39
|
},
|
|
52
40
|
description: errorMessages().liquiditySourcesError.description,
|
|
53
41
|
};
|
|
42
|
+
} else if (
|
|
43
|
+
error?.type === QuoteErrorType.NO_RESULT &&
|
|
44
|
+
error.diagnosisMessage
|
|
45
|
+
) {
|
|
46
|
+
return {
|
|
47
|
+
alert: {
|
|
48
|
+
type: 'error',
|
|
49
|
+
text: error.diagnosisMessage,
|
|
50
|
+
action: null,
|
|
51
|
+
},
|
|
52
|
+
description: '',
|
|
53
|
+
};
|
|
54
54
|
}
|
|
55
55
|
return {
|
|
56
56
|
alert: null,
|
|
@@ -11,22 +11,22 @@ import {
|
|
|
11
11
|
import React from 'react';
|
|
12
12
|
|
|
13
13
|
import { errorMessages } from '../../constants/errors';
|
|
14
|
-
import {
|
|
14
|
+
import { useAppStore } from '../../store/AppStore';
|
|
15
15
|
|
|
16
16
|
import { makeInfo } from './NoResult.helpers';
|
|
17
17
|
import { Container, Footer, PrefixIcon } from './NoResult.styles';
|
|
18
18
|
|
|
19
19
|
export function NoResult(props: PropTypes) {
|
|
20
20
|
const { fetch, error } = props;
|
|
21
|
-
const disabledLiquiditySources =
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
21
|
+
const disabledLiquiditySources = useAppStore().disabledLiquiditySources;
|
|
22
|
+
const toggleAllLiquiditySources = useAppStore().toggleAllLiquiditySources;
|
|
23
|
+
|
|
24
|
+
const swappers = useAppStore().swappers();
|
|
25
25
|
|
|
26
26
|
const info = makeInfo(
|
|
27
27
|
error,
|
|
28
28
|
disabledLiquiditySources,
|
|
29
|
-
toggleAllLiquiditySources,
|
|
29
|
+
() => toggleAllLiquiditySources(swappers, true),
|
|
30
30
|
fetch
|
|
31
31
|
);
|
|
32
32
|
|
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { useNavigate } from 'react-router-dom';
|
|
12
12
|
|
|
13
|
-
import {
|
|
13
|
+
import { navigationRoutes } from '../../constants/navigationRoutes';
|
|
14
|
+
import { useAppStore } from '../../store/AppStore';
|
|
14
15
|
import { useNotificationStore } from '../../store/notification';
|
|
15
16
|
import { useUiStore } from '../../store/ui';
|
|
16
17
|
|
|
@@ -26,14 +27,15 @@ export function NotificationContent() {
|
|
|
26
27
|
const { getUnreadNotifications } = useNotificationStore();
|
|
27
28
|
|
|
28
29
|
const notifications: Notification[] = getUnreadNotifications();
|
|
29
|
-
const
|
|
30
|
+
const blockchains = useAppStore().blockchains();
|
|
31
|
+
const tokens = useAppStore().tokens();
|
|
30
32
|
const sortedNotification = notifications
|
|
31
33
|
.sort((a, b) => b.creationTime - a.creationTime)
|
|
32
34
|
.slice(0, MAX_NOTIFICATIONS_DISPLAYED);
|
|
33
35
|
|
|
34
36
|
const handleOnClick = (requestId: Notification['requestId']) => {
|
|
35
37
|
setSelectedSwap(requestId);
|
|
36
|
-
navigate(
|
|
38
|
+
navigate(`${navigationRoutes.swaps}/${requestId}`);
|
|
37
39
|
};
|
|
38
40
|
|
|
39
41
|
return (
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as Collapsible from '@radix-ui/react-collapsible';
|
|
2
|
-
import { darkTheme, styled } from '@rango-dev/ui';
|
|
2
|
+
import { css, darkTheme, Image, styled } from '@rango-dev/ui';
|
|
3
3
|
|
|
4
4
|
import { CollapsibleContent } from '../ConfirmWalletsModal/ConfirmWallets.styles';
|
|
5
5
|
|
|
@@ -13,6 +13,7 @@ export const QuoteContainer = styled(Collapsible.Root, {
|
|
|
13
13
|
overflowY: 'hidden',
|
|
14
14
|
width: '100%',
|
|
15
15
|
borderRadius: '$xm',
|
|
16
|
+
cursor: 'default',
|
|
16
17
|
variants: {
|
|
17
18
|
recommended: {
|
|
18
19
|
true: {
|
|
@@ -31,9 +32,10 @@ export const QuoteContainer = styled(Collapsible.Root, {
|
|
|
31
32
|
},
|
|
32
33
|
},
|
|
33
34
|
},
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
});
|
|
36
|
+
|
|
37
|
+
export const stepsDetailsStyles = css({
|
|
38
|
+
padding: '$10 $15',
|
|
37
39
|
});
|
|
38
40
|
|
|
39
41
|
export const SummaryContainer = styled('div', {
|
|
@@ -104,14 +106,24 @@ export const SummaryContainer = styled('div', {
|
|
|
104
106
|
},
|
|
105
107
|
},
|
|
106
108
|
],
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
'
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
export const summaryStyles = css({
|
|
112
|
+
width: '100%',
|
|
113
|
+
padding: '$15 $15 $10 $15',
|
|
114
|
+
cursor: 'default',
|
|
115
|
+
});
|
|
116
|
+
|
|
117
|
+
export const basicInfoStyles = css({
|
|
118
|
+
paddingTop: '$10',
|
|
119
|
+
display: 'flex',
|
|
120
|
+
alignItems: 'center',
|
|
121
|
+
'.usd-value': {
|
|
122
|
+
$$color: '$colors$neutral600',
|
|
123
|
+
[`.${darkTheme} &`]: {
|
|
124
|
+
$$color: '$colors$neutral700',
|
|
125
|
+
},
|
|
126
|
+
color: '$$color',
|
|
115
127
|
},
|
|
116
128
|
});
|
|
117
129
|
|
|
@@ -162,6 +174,24 @@ export const Chains = styled(Collapsible.Trigger, {
|
|
|
162
174
|
'& div:nth-child(1)': { display: 'flex' },
|
|
163
175
|
});
|
|
164
176
|
|
|
177
|
+
export const ChainImageContainer = styled('div', {
|
|
178
|
+
width: '18px',
|
|
179
|
+
height: '18px',
|
|
180
|
+
borderRadius: '100%',
|
|
181
|
+
border: '1.5px transparent solid',
|
|
182
|
+
display: 'flex',
|
|
183
|
+
justifyContent: 'center',
|
|
184
|
+
alignItems: 'center',
|
|
185
|
+
variants: {
|
|
186
|
+
state: {
|
|
187
|
+
error: {
|
|
188
|
+
borderColor: '$error500',
|
|
189
|
+
},
|
|
190
|
+
warning: { borderColor: '$warning500' },
|
|
191
|
+
},
|
|
192
|
+
},
|
|
193
|
+
});
|
|
194
|
+
|
|
165
195
|
export const Content = styled(CollapsibleContent, {
|
|
166
196
|
width: '100%',
|
|
167
197
|
});
|
|
@@ -25,13 +25,20 @@ import {
|
|
|
25
25
|
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
26
26
|
TOKEN_AMOUNT_MAX_DECIMALS,
|
|
27
27
|
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
28
|
+
USD_VALUE_MAX_DECIMALS,
|
|
29
|
+
USD_VALUE_MIN_DECIMALS,
|
|
28
30
|
} from '../../constants/routing';
|
|
29
31
|
import {
|
|
30
32
|
FooterAlert,
|
|
31
33
|
FooterStepAlarm,
|
|
32
34
|
} from '../../containers/QuoteInfo/QuoteInfo.styles';
|
|
33
|
-
import {
|
|
35
|
+
import { useAppStore } from '../../store/AppStore';
|
|
34
36
|
import { QuoteErrorType, QuoteWarningType } from '../../types';
|
|
37
|
+
import { getContainer } from '../../utils/common';
|
|
38
|
+
import {
|
|
39
|
+
getBlockchainShortNameFor,
|
|
40
|
+
getSwapperDisplayName,
|
|
41
|
+
} from '../../utils/meta';
|
|
35
42
|
import {
|
|
36
43
|
numberToString,
|
|
37
44
|
secondsToString,
|
|
@@ -41,6 +48,8 @@ import { getPriceImpact, getPriceImpactLevel } from '../../utils/quote';
|
|
|
41
48
|
import { getTotalFeeInUsd } from '../../utils/swap';
|
|
42
49
|
|
|
43
50
|
import {
|
|
51
|
+
basicInfoStyles,
|
|
52
|
+
ChainImageContainer,
|
|
44
53
|
Chains,
|
|
45
54
|
Content,
|
|
46
55
|
EXPANDABLE_QUOTE_TRANSITION_DURATION,
|
|
@@ -48,14 +57,13 @@ import {
|
|
|
48
57
|
HorizontalSeparator,
|
|
49
58
|
IconContainer,
|
|
50
59
|
QuoteContainer,
|
|
60
|
+
stepsDetailsStyles,
|
|
51
61
|
SummaryContainer,
|
|
62
|
+
summaryStyles,
|
|
52
63
|
} from './Quote.styles';
|
|
53
64
|
import { QuoteSummary } from './QuoteSummary';
|
|
54
65
|
|
|
55
66
|
export function Quote(props: QuoteProps) {
|
|
56
|
-
const {
|
|
57
|
-
meta: { tokens },
|
|
58
|
-
} = useMetaStore();
|
|
59
67
|
const {
|
|
60
68
|
quote,
|
|
61
69
|
input,
|
|
@@ -65,19 +73,39 @@ export function Quote(props: QuoteProps) {
|
|
|
65
73
|
type,
|
|
66
74
|
recommended = true,
|
|
67
75
|
} = props;
|
|
76
|
+
const tokens = useAppStore().tokens();
|
|
77
|
+
const blockchains = useAppStore().blockchains();
|
|
78
|
+
const swappers = useAppStore().swappers();
|
|
68
79
|
|
|
69
80
|
const [expanded, setExpanded] = useState(props.expanded);
|
|
70
81
|
const quoteRef = useRef<HTMLButtonElement | null>(null);
|
|
82
|
+
const prevExpanded = useRef(expanded);
|
|
71
83
|
const totalFee = numberToString(
|
|
72
84
|
getTotalFeeInUsd(quote.result?.swaps ?? [], tokens),
|
|
73
85
|
GAS_FEE_MIN_DECIMALS,
|
|
74
86
|
GAS_FEE_MAX_DECIMALS
|
|
75
87
|
);
|
|
76
88
|
const totalTime = secondsToString(totalArrivalTime(quote.result?.swaps));
|
|
77
|
-
|
|
89
|
+
const roundedInput = numberToString(
|
|
90
|
+
input.value,
|
|
91
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
92
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
93
|
+
);
|
|
94
|
+
const roundedOutput = numberToString(
|
|
95
|
+
output.value,
|
|
96
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
97
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
98
|
+
);
|
|
99
|
+
const roundedOutputUsdValue = output.usdValue
|
|
100
|
+
? numberToString(
|
|
101
|
+
output.usdValue,
|
|
102
|
+
USD_VALUE_MIN_DECIMALS,
|
|
103
|
+
USD_VALUE_MAX_DECIMALS
|
|
104
|
+
)
|
|
105
|
+
: '';
|
|
78
106
|
const priceImpact = getPriceImpact(input.usdValue, output.usdValue ?? null);
|
|
79
107
|
const percentageChange = numberToString(
|
|
80
|
-
|
|
108
|
+
priceImpact,
|
|
81
109
|
PERCENTAGE_CHANGE_MIN_DECIMALS,
|
|
82
110
|
PERCENTAGE_CHANGE_MAX_DECIMALS
|
|
83
111
|
);
|
|
@@ -89,8 +117,8 @@ export function Quote(props: QuoteProps) {
|
|
|
89
117
|
const stepHasError =
|
|
90
118
|
(error?.type === QuoteErrorType.BRIDGE_LIMIT &&
|
|
91
119
|
error.swap.swapperId === swap.swapperId) ||
|
|
92
|
-
(
|
|
93
|
-
|
|
120
|
+
(error?.type === QuoteErrorType.INSUFFICIENT_SLIPPAGE &&
|
|
121
|
+
error.recommendedSlippages?.has(index));
|
|
94
122
|
const stepHasWarning =
|
|
95
123
|
warning?.type === QuoteWarningType.INSUFFICIENT_SLIPPAGE &&
|
|
96
124
|
warning.recommendedSlippages?.has(index);
|
|
@@ -102,11 +130,17 @@ export function Quote(props: QuoteProps) {
|
|
|
102
130
|
}
|
|
103
131
|
|
|
104
132
|
return {
|
|
105
|
-
swapper: {
|
|
133
|
+
swapper: {
|
|
134
|
+
displayName: getSwapperDisplayName(swap.swapperId, swappers),
|
|
135
|
+
image: swap.swapperLogo,
|
|
136
|
+
},
|
|
106
137
|
from: {
|
|
107
138
|
token: { displayName: swap.from.symbol, image: swap.from.logo },
|
|
108
139
|
chain: {
|
|
109
|
-
displayName:
|
|
140
|
+
displayName: getBlockchainShortNameFor(
|
|
141
|
+
swap.from.blockchain,
|
|
142
|
+
blockchains
|
|
143
|
+
),
|
|
110
144
|
image: swap.from.blockchainLogo,
|
|
111
145
|
},
|
|
112
146
|
price: {
|
|
@@ -117,17 +151,38 @@ export function Quote(props: QuoteProps) {
|
|
|
117
151
|
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
118
152
|
TOKEN_AMOUNT_MAX_DECIMALS
|
|
119
153
|
)
|
|
120
|
-
:
|
|
154
|
+
: numberToString(
|
|
155
|
+
swap.fromAmount,
|
|
156
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
157
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
158
|
+
),
|
|
159
|
+
usdValue: numberToString(
|
|
160
|
+
(swap.from.usdPrice ?? 0) * parseFloat(swap.fromAmount),
|
|
161
|
+
USD_VALUE_MIN_DECIMALS,
|
|
162
|
+
USD_VALUE_MAX_DECIMALS
|
|
163
|
+
),
|
|
121
164
|
},
|
|
122
165
|
},
|
|
123
166
|
to: {
|
|
124
167
|
token: { displayName: swap.to.symbol, image: swap.to.logo },
|
|
125
168
|
chain: {
|
|
126
|
-
displayName:
|
|
169
|
+
displayName: getBlockchainShortNameFor(
|
|
170
|
+
swap.to.blockchain,
|
|
171
|
+
blockchains
|
|
172
|
+
),
|
|
127
173
|
image: swap.to.blockchainLogo,
|
|
128
174
|
},
|
|
129
175
|
price: {
|
|
130
|
-
value:
|
|
176
|
+
value: numberToString(
|
|
177
|
+
swap.toAmount,
|
|
178
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
179
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
180
|
+
),
|
|
181
|
+
usdValue: numberToString(
|
|
182
|
+
(swap.to.usdPrice ?? 0) * parseFloat(swap.toAmount),
|
|
183
|
+
USD_VALUE_MIN_DECIMALS,
|
|
184
|
+
USD_VALUE_MAX_DECIMALS
|
|
185
|
+
),
|
|
131
186
|
},
|
|
132
187
|
},
|
|
133
188
|
state: stepState,
|
|
@@ -185,7 +240,7 @@ export function Quote(props: QuoteProps) {
|
|
|
185
240
|
variant="body"
|
|
186
241
|
color="neutral900">
|
|
187
242
|
{i18n.t({
|
|
188
|
-
id: '
|
|
243
|
+
id: 'Minimum required slippage is {minRequiredSlippage}',
|
|
189
244
|
values: {
|
|
190
245
|
...(error?.type ===
|
|
191
246
|
QuoteErrorType.INSUFFICIENT_SLIPPAGE && {
|
|
@@ -211,14 +266,16 @@ export function Quote(props: QuoteProps) {
|
|
|
211
266
|
};
|
|
212
267
|
const steps = getQuoteSteps(quote.result?.swaps ?? []);
|
|
213
268
|
const numberOfSteps = steps.length;
|
|
269
|
+
const tooltipContainer = getContainer();
|
|
214
270
|
|
|
215
271
|
useLayoutEffect(() => {
|
|
216
|
-
if (expanded && quoteRef.current) {
|
|
272
|
+
if (expanded && !prevExpanded.current && quoteRef.current) {
|
|
217
273
|
setTimeout(() => {
|
|
218
274
|
quoteRef?.current?.scrollIntoView({ behavior: 'smooth' });
|
|
219
275
|
}, EXPANDABLE_QUOTE_TRANSITION_DURATION);
|
|
220
276
|
}
|
|
221
|
-
|
|
277
|
+
prevExpanded.current = expanded;
|
|
278
|
+
}, [expanded, prevExpanded]);
|
|
222
279
|
|
|
223
280
|
return (
|
|
224
281
|
<>
|
|
@@ -226,10 +283,10 @@ export function Quote(props: QuoteProps) {
|
|
|
226
283
|
recommended={recommended}
|
|
227
284
|
listItem={type === 'list-item'}
|
|
228
285
|
basic={type === 'basic'}>
|
|
229
|
-
<div className=
|
|
286
|
+
<div className={summaryStyles()}>
|
|
230
287
|
<QuoteCost fee={totalFee} time={totalTime} steps={numberOfSteps} />
|
|
231
288
|
{type === 'basic' && (
|
|
232
|
-
<div className=
|
|
289
|
+
<div className={basicInfoStyles()}>
|
|
233
290
|
<FrameIcon>
|
|
234
291
|
<InfoIcon size={12} color="gray" />
|
|
235
292
|
</FrameIcon>
|
|
@@ -237,16 +294,18 @@ export function Quote(props: QuoteProps) {
|
|
|
237
294
|
size="small"
|
|
238
295
|
variant="body"
|
|
239
296
|
style={{ letterSpacing: 0.4 }}>
|
|
240
|
-
{`${
|
|
241
|
-
|
|
242
|
-
} ${
|
|
297
|
+
{`${roundedInput} ${
|
|
298
|
+
steps[0].from.token.displayName
|
|
299
|
+
} = ${roundedOutput} ${
|
|
300
|
+
steps[steps.length - 1].to.token.displayName
|
|
301
|
+
}`}
|
|
243
302
|
</Typography>
|
|
244
303
|
<Typography
|
|
245
304
|
color="$neutral600"
|
|
246
305
|
ml={2}
|
|
247
306
|
size="xsmall"
|
|
248
307
|
variant="body">
|
|
249
|
-
{`($${
|
|
308
|
+
{`($${roundedOutputUsdValue})`}
|
|
250
309
|
</Typography>
|
|
251
310
|
</div>
|
|
252
311
|
)}
|
|
@@ -254,7 +313,7 @@ export function Quote(props: QuoteProps) {
|
|
|
254
313
|
<TokenAmount
|
|
255
314
|
type="output"
|
|
256
315
|
direction="vertical"
|
|
257
|
-
price={{ value:
|
|
316
|
+
price={{ value: roundedOutput, usdValue: roundedOutputUsdValue }}
|
|
258
317
|
token={{
|
|
259
318
|
displayName: steps[numberOfSteps - 1].to.token.displayName,
|
|
260
319
|
image: steps[numberOfSteps - 1].to.token.image,
|
|
@@ -283,38 +342,48 @@ export function Quote(props: QuoteProps) {
|
|
|
283
342
|
<Chains
|
|
284
343
|
ref={(ref) => (quoteRef.current = ref)}
|
|
285
344
|
recommended={recommended}
|
|
286
|
-
onClick={
|
|
345
|
+
onClick={() => setExpanded((prevState) => !prevState)}>
|
|
287
346
|
<div>
|
|
288
347
|
{steps.map((step, index) => {
|
|
289
348
|
const key = `item-${index}`;
|
|
349
|
+
const arrow = (
|
|
350
|
+
<IconContainer>
|
|
351
|
+
<ChevronRightIcon
|
|
352
|
+
size={12}
|
|
353
|
+
color="black"
|
|
354
|
+
{...(step.state && {
|
|
355
|
+
color: step.state === 'error' ? 'error' : 'warning',
|
|
356
|
+
})}
|
|
357
|
+
/>
|
|
358
|
+
</IconContainer>
|
|
359
|
+
);
|
|
290
360
|
return (
|
|
291
361
|
<React.Fragment key={key}>
|
|
292
362
|
<Tooltip
|
|
293
|
-
container={
|
|
363
|
+
container={tooltipContainer}
|
|
294
364
|
side="bottom"
|
|
295
365
|
sideOffset={4}
|
|
296
366
|
content={step.from.chain.displayName}>
|
|
297
|
-
<
|
|
367
|
+
<ChainImageContainer
|
|
368
|
+
state={step.state || steps[index - 1]?.state}>
|
|
369
|
+
<Image src={step.from.chain.image} size={16} />
|
|
370
|
+
</ChainImageContainer>
|
|
298
371
|
</Tooltip>
|
|
299
372
|
{index === numberOfSteps - 1 && (
|
|
300
373
|
<>
|
|
301
|
-
|
|
302
|
-
<ChevronRightIcon size={12} color="black" />
|
|
303
|
-
</IconContainer>
|
|
374
|
+
{arrow}
|
|
304
375
|
<Tooltip
|
|
305
|
-
container={
|
|
376
|
+
container={tooltipContainer}
|
|
306
377
|
side="bottom"
|
|
307
378
|
sideOffset={4}
|
|
308
379
|
content={step.to.chain.displayName}>
|
|
309
|
-
<
|
|
380
|
+
<ChainImageContainer state={step.state}>
|
|
381
|
+
<Image src={step.to.chain.image} size={16} />
|
|
382
|
+
</ChainImageContainer>
|
|
310
383
|
</Tooltip>
|
|
311
384
|
</>
|
|
312
385
|
)}
|
|
313
|
-
{index !== numberOfSteps - 1 &&
|
|
314
|
-
<IconContainer>
|
|
315
|
-
<ChevronRightIcon size={12} color="black" />
|
|
316
|
-
</IconContainer>
|
|
317
|
-
)}
|
|
386
|
+
{index !== numberOfSteps - 1 && <>{arrow}</>}
|
|
318
387
|
</React.Fragment>
|
|
319
388
|
);
|
|
320
389
|
})}
|
|
@@ -325,7 +394,7 @@ export function Quote(props: QuoteProps) {
|
|
|
325
394
|
</Chains>
|
|
326
395
|
<Content open={expanded}>
|
|
327
396
|
<HorizontalSeparator />
|
|
328
|
-
<div className=
|
|
397
|
+
<div className={stepsDetailsStyles()}>
|
|
329
398
|
{steps.map((step, index) => {
|
|
330
399
|
const key = `item-${index}`;
|
|
331
400
|
return (
|