@rango-dev/widget-embedded 0.20.1-next.8 → 0.21.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/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/BlockchainList/BlockchainList.styles.d.ts +169 -1
- package/dist/components/BlockchainList/BlockchainList.styles.d.ts.map +1 -1
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts +4 -0
- package/dist/components/BlockchainsSection/BlockchainsSection.styles.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/ConfirmWallets.styles.d.ts +514 -1089
- 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/WalletList.d.ts.map +1 -1
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts +12 -0
- package/dist/components/ConfirmWalletsModal/WalletList.styles.d.ts.map +1 -1
- package/dist/components/CustomCollapsible/CustomCollapsible.d.ts +5 -0
- package/dist/components/CustomCollapsible/CustomCollapsible.d.ts.map +1 -0
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts +654 -0
- package/dist/components/CustomCollapsible/CustomCollapsible.styles.d.ts.map +1 -0
- package/dist/components/CustomCollapsible/CustomCollapsible.types.d.ts +10 -0
- package/dist/components/CustomCollapsible/CustomCollapsible.types.d.ts.map +1 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts +20 -0
- package/dist/components/HeaderButtons/HeaderButtons.styles.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts +0 -1
- package/dist/components/HeaderButtons/HeaderButtons.types.d.ts.map +1 -1
- package/dist/components/HeaderButtons/HomeButtons.d.ts.map +1 -1
- package/dist/components/Layout/Layout.d.ts +2 -3
- package/dist/components/Layout/Layout.d.ts.map +1 -1
- package/dist/components/Layout/Layout.helpers.d.ts +2 -0
- package/dist/components/Layout/Layout.helpers.d.ts.map +1 -0
- package/dist/components/Layout/Layout.styles.d.ts +14 -4
- package/dist/components/Layout/Layout.styles.d.ts.map +1 -1
- package/dist/components/Layout/Layout.types.d.ts +6 -3
- package/dist/components/Layout/Layout.types.d.ts.map +1 -1
- package/dist/components/Layout/PageContainer.d.ts +166 -0
- package/dist/components/Layout/PageContainer.d.ts.map +1 -0
- package/dist/components/Layout/ScrollableArea.d.ts +164 -0
- package/dist/components/Layout/ScrollableArea.d.ts.map +1 -0
- package/dist/components/Layout/index.d.ts +2 -0
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts +4 -0
- package/dist/components/LoadingLiquiditySourceList/LoadingLiquiditySourceList.styles.d.ts.map +1 -1
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts +56 -0
- package/dist/components/LoadingSwapDetails/LoadingSwapDetails.styles.d.ts.map +1 -1
- package/dist/components/NoResult/NoResult.styles.d.ts +12 -0
- package/dist/components/NoResult/NoResult.styles.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.d.ts.map +1 -1
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts +16 -0
- package/dist/components/NotificationContent/NotificationContent.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.d.ts.map +1 -1
- package/dist/components/Quote/Quote.styles.d.ts +387 -3
- package/dist/components/Quote/Quote.styles.d.ts.map +1 -1
- package/dist/components/Quote/Quote.types.d.ts +19 -0
- package/dist/components/Quote/Quote.types.d.ts.map +1 -1
- package/dist/components/Quote/QuoteCostDetails.d.ts +4 -0
- package/dist/components/Quote/QuoteCostDetails.d.ts.map +1 -0
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts +806 -0
- package/dist/components/Quote/QuoteCostDetails.styles.d.ts.map +1 -0
- package/dist/components/Quote/QuoteSummary.d.ts.map +1 -1
- package/dist/components/Quote/QuoteSummary.styles.d.ts +8 -0
- package/dist/components/Quote/QuoteSummary.styles.d.ts.map +1 -1
- package/dist/components/Quote/QuoteTrigger .d.ts +4 -0
- package/dist/components/Quote/QuoteTrigger .d.ts.map +1 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts +16 -0
- package/dist/components/QuoteSkeleton/QuoteSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts +40 -0
- package/dist/components/QuoteSkeleton/QuoteSummarySkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts +20 -0
- package/dist/components/QuoteSkeleton/StepSkeleton.styles.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts +1 -0
- package/dist/components/QuoteWarningsAndErrors/HighValueLossWarningModal.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.d.ts +16 -0
- 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/QuoteWarningsAndErrors/SlippageWariningModal.d.ts +1 -0
- package/dist/components/QuoteWarningsAndErrors/SlippageWariningModal.d.ts.map +1 -1
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts +1 -0
- package/dist/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.d.ts.map +1 -1
- package/dist/components/SearchInput/SearchInput.styles.d.ts +4 -0
- package/dist/components/SearchInput/SearchInput.styles.d.ts.map +1 -1
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts +11 -156
- package/dist/components/SettingsContainer/SettingsContainer.style.d.ts.map +1 -1
- package/dist/components/SettingsContainer/index.d.ts +1 -1
- package/dist/components/SettingsContainer/index.d.ts.map +1 -1
- package/dist/components/Slippage/Slippage.styles.d.ts +20 -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 +523 -1
- package/dist/components/SwapDetails/SwapDetails.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts +4 -0
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts +2 -1
- package/dist/components/SwapDetailsAlerts/SwapDetailsAlerts.types.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.WalletState.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts +4 -0
- package/dist/components/SwapDetailsModal/SwapDetailsModal.styles.d.ts.map +1 -1
- package/dist/components/SwapDetailsModal/SwapDetailsModal.types.d.ts +2 -0
- 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 +20 -0
- package/dist/components/SwapsGroup/SwapsGroup.styles.d.ts.map +1 -1
- package/dist/components/TokenList/TokenList.styles.d.ts +68 -0
- package/dist/components/TokenList/TokenList.styles.d.ts.map +1 -1
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts +16 -0
- package/dist/components/WalletModal/WalletModalContent.styles.d.ts.map +1 -1
- package/dist/components/WidgetEvents.d.ts.map +1 -1
- package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts +4 -0
- package/dist/components/common/ActivateTabAlert/ActivateTabAlert.d.ts.map +1 -0
- package/dist/components/common/ActivateTabAlert/ActivateTabAlert.types.d.ts +4 -0
- package/dist/components/common/ActivateTabAlert/ActivateTabAlert.types.d.ts.map +1 -0
- package/dist/components/common/ActivateTabAlert/index.d.ts +2 -0
- package/dist/components/common/ActivateTabAlert/index.d.ts.map +1 -0
- package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts +4 -0
- package/dist/components/common/ActivateTabModal/ActivateTabModal.d.ts.map +1 -0
- package/dist/components/common/ActivateTabModal/ActivateTabModal.types.d.ts +6 -0
- package/dist/components/common/ActivateTabModal/ActivateTabModal.types.d.ts.map +1 -0
- package/dist/components/common/ActivateTabModal/index.d.ts +2 -0
- package/dist/components/common/ActivateTabModal/index.d.ts.map +1 -0
- package/dist/constants/index.d.ts +1 -0
- package/dist/constants/index.d.ts.map +1 -1
- package/dist/constants/quote.d.ts +12 -0
- package/dist/constants/quote.d.ts.map +1 -0
- package/dist/constants/searchParams.d.ts +6 -6
- package/dist/constants/searchParams.d.ts.map +1 -1
- package/dist/containers/App/App.d.ts.map +1 -1
- package/dist/containers/App/App.styles.d.ts +4 -0
- package/dist/containers/App/App.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts +10 -314
- package/dist/containers/QuoteInfo/QuoteInfo.styles.d.ts.map +1 -1
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts +0 -7
- package/dist/containers/QuoteInfo/QuoteInfo.types.d.ts.map +1 -1
- package/dist/containers/Widget/Widget.d.ts.map +1 -1
- package/dist/containers/WidgetInfo/WidgetInfo.d.ts.map +1 -1
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts +7 -0
- package/dist/containers/WidgetInfo/WidgetInfo.types.d.ts.map +1 -1
- package/dist/containers/WidgetProvider/WidgetProvider.d.ts.map +1 -1
- package/dist/hooks/useLanguage.d.ts +2 -1
- package/dist/hooks/useLanguage.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/useSyncUrlAndStore/index.d.ts +2 -0
- package/dist/hooks/useSyncUrlAndStore/index.d.ts.map +1 -0
- package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts +2 -0
- package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.d.ts.map +1 -0
- package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.d.ts +4 -0
- package/dist/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.d.ts.map +1 -0
- package/dist/index.d.ts +4 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +4 -4
- package/dist/libs/tabManager/index.d.ts +3 -0
- package/dist/libs/tabManager/index.d.ts.map +1 -0
- package/dist/libs/tabManager/tabManager.constants.d.ts +4 -0
- package/dist/libs/tabManager/tabManager.constants.d.ts.map +1 -0
- package/dist/libs/tabManager/tabManager.d.ts +63 -0
- package/dist/libs/tabManager/tabManager.d.ts.map +1 -0
- package/dist/libs/tabManager/tabManager.types.d.ts +29 -0
- package/dist/libs/tabManager/tabManager.types.d.ts.map +1 -0
- 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/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 +2 -2
- package/dist/store/app.d.ts +2 -2
- package/dist/store/slices/settings.d.ts +2 -2
- package/dist/store/slices/settings.d.ts.map +1 -1
- package/dist/store/ui.d.ts +12 -10
- package/dist/store/ui.d.ts.map +1 -1
- package/dist/types/notification.d.ts +1 -2
- package/dist/types/notification.d.ts.map +1 -1
- package/dist/utils/date.d.ts.map +1 -1
- package/dist/utils/quote.d.ts +5 -2
- package/dist/utils/quote.d.ts.map +1 -1
- package/dist/utils/swap.d.ts +5 -1
- package/dist/utils/swap.d.ts.map +1 -1
- package/dist/utils/ui.d.ts +2 -0
- package/dist/utils/ui.d.ts.map +1 -1
- package/package.json +7 -7
- package/src/QueueManager.tsx +4 -1
- package/src/components/AppRouter.tsx +1 -8
- package/src/components/AppRoutes.tsx +11 -0
- package/src/components/BlockchainList/BlockchainList.styles.ts +4 -3
- package/src/components/BlockchainList/BlockchainList.tsx +1 -1
- package/src/components/ConfirmWalletsModal/ConfirmWallets.styles.ts +27 -96
- package/src/components/ConfirmWalletsModal/ConfirmWalletsModal.tsx +25 -40
- package/src/components/ConfirmWalletsModal/WalletList.tsx +3 -0
- package/src/components/CustomCollapsible/CustomCollapsible.styles.ts +75 -0
- package/src/components/CustomCollapsible/CustomCollapsible.tsx +55 -0
- package/src/components/CustomCollapsible/CustomCollapsible.types.ts +10 -0
- package/src/components/HeaderButtons/HeaderButtons.styles.ts +4 -1
- package/src/components/HeaderButtons/HeaderButtons.types.ts +0 -1
- package/src/components/HeaderButtons/HomeButtons.tsx +1 -2
- package/src/components/Layout/Layout.helpers.ts +16 -0
- package/src/components/Layout/Layout.styles.ts +17 -31
- package/src/components/Layout/Layout.tsx +60 -29
- package/src/components/Layout/Layout.types.ts +9 -8
- package/src/components/Layout/PageContainer.tsx +24 -0
- package/src/components/Layout/ScrollableArea.tsx +11 -0
- package/src/components/Layout/index.ts +2 -0
- package/src/components/NotificationContent/NotificationContent.tsx +10 -4
- package/src/components/Quote/Quote.styles.ts +44 -5
- package/src/components/Quote/Quote.tsx +10 -77
- package/src/components/Quote/Quote.types.ts +22 -0
- package/src/components/Quote/QuoteCostDetails.styles.ts +50 -0
- package/src/components/Quote/QuoteCostDetails.tsx +218 -0
- package/src/components/Quote/QuoteSummary.tsx +3 -2
- package/src/components/Quote/QuoteTrigger .tsx +215 -0
- package/src/components/QuoteWarningsAndErrors/HighValueLossWarningModal.tsx +3 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.styles.ts +0 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.tsx +3 -1
- package/src/components/QuoteWarningsAndErrors/QuoteWarningsAndErrors.types.ts +1 -0
- package/src/components/QuoteWarningsAndErrors/SlippageWariningModal.tsx +3 -1
- package/src/components/QuoteWarningsAndErrors/UnknownPriceWarningModal.tsx +3 -1
- package/src/components/SettingsContainer/SettingsContainer.style.ts +0 -5
- package/src/components/SettingsContainer/index.ts +0 -1
- package/src/components/Slippage/Slippage.tsx +5 -5
- package/src/components/Slippage/SlippageTooltipContent.tsx +1 -1
- package/src/components/SwapDetails/SwapDetails.Placeholder.tsx +12 -13
- package/src/components/SwapDetails/SwapDetails.helpers.tsx +43 -3
- package/src/components/SwapDetails/SwapDetails.styles.ts +18 -6
- package/src/components/SwapDetails/SwapDetails.tsx +16 -5
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.tsx +13 -7
- package/src/components/SwapDetailsAlerts/SwapDetailsAlerts.types.ts +2 -0
- package/src/components/SwapDetailsModal/SwapDetailsModal.WalletState.tsx +9 -1
- package/src/components/SwapDetailsModal/SwapDetailsModal.tsx +10 -2
- package/src/components/SwapDetailsModal/SwapDetailsModal.types.ts +2 -0
- package/src/components/SwapsGroup/SwapsGroup.tsx +18 -7
- package/src/components/TokenList/TokenList.styles.ts +2 -0
- package/src/components/TokenList/TokenList.tsx +1 -1
- package/src/components/WidgetEvents.tsx +2 -14
- package/src/components/common/ActivateTabAlert/ActivateTabAlert.tsx +26 -0
- package/src/components/common/ActivateTabAlert/ActivateTabAlert.types.ts +3 -0
- package/src/components/common/ActivateTabAlert/index.ts +1 -0
- package/src/components/common/ActivateTabModal/ActivateTabModal.tsx +31 -0
- package/src/components/common/ActivateTabModal/ActivateTabModal.types.ts +5 -0
- package/src/components/common/ActivateTabModal/index.ts +1 -0
- package/src/constants/index.ts +1 -0
- package/src/constants/quote.ts +23 -0
- package/src/constants/searchParams.ts +6 -6
- package/src/containers/App/App.styles.ts +2 -0
- package/src/containers/App/App.tsx +1 -4
- package/src/containers/QuoteInfo/QuoteInfo.styles.ts +0 -15
- package/src/containers/QuoteInfo/QuoteInfo.tsx +30 -77
- package/src/containers/QuoteInfo/QuoteInfo.types.ts +0 -7
- package/src/containers/Wallets/Wallets.tsx +3 -3
- package/src/containers/Widget/Widget.tsx +6 -1
- package/src/containers/WidgetInfo/WidgetInfo.tsx +13 -1
- package/src/containers/WidgetInfo/WidgetInfo.types.ts +7 -0
- package/src/containers/WidgetProvider/WidgetProvider.tsx +2 -1
- package/src/hooks/useLanguage.ts +6 -4
- package/src/hooks/useSwapInput.ts +6 -1
- package/src/hooks/useSyncStoresWithConfig.ts +3 -17
- package/src/hooks/useSyncUrlAndStore/index.ts +1 -0
- package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.helpers.ts +35 -0
- package/src/hooks/useSyncUrlAndStore/useSyncUrlAndStore.ts +135 -0
- package/src/index.ts +2 -2
- package/src/libs/tabManager/index.ts +2 -0
- package/src/libs/tabManager/tabManager.constants.ts +3 -0
- package/src/libs/tabManager/tabManager.ts +222 -0
- package/src/libs/tabManager/tabManager.types.ts +28 -0
- package/src/pages/ConfirmSwapPage.tsx +55 -47
- package/src/pages/HistoryPage.tsx +5 -17
- package/src/pages/Home.tsx +47 -43
- package/src/pages/LanguagePage.tsx +3 -4
- package/src/pages/LiquiditySourcePage.tsx +8 -6
- package/src/pages/SelectBlockchainPage.tsx +41 -41
- package/src/pages/SelectSwapItemsPage.tsx +45 -39
- package/src/pages/SettingsPage.tsx +3 -4
- package/src/pages/SwapDetailsPage.tsx +21 -7
- package/src/pages/ThemePage.tsx +3 -4
- package/src/pages/WalletsPage.tsx +15 -13
- package/src/store/slices/settings.ts +3 -3
- package/src/store/ui.ts +39 -11
- package/src/types/notification.ts +0 -7
- package/src/utils/date.ts +5 -4
- package/src/utils/quote.ts +18 -28
- package/src/utils/swap.ts +35 -0
- package/src/utils/ui.ts +20 -0
- package/dist/components/UpdateUrl.d.ts +0 -2
- package/dist/components/UpdateUrl.d.ts.map +0 -1
- package/src/components/UpdateUrl.tsx +0 -158
|
@@ -8,7 +8,10 @@ import {
|
|
|
8
8
|
TOKEN_AMOUNT_MAX_DECIMALS,
|
|
9
9
|
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
10
10
|
} from '../../constants/routing';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
getBlockchainShortNameFor,
|
|
13
|
+
getSwapperDisplayName,
|
|
14
|
+
} from '../../utils/meta';
|
|
12
15
|
import { numberToString } from '../../utils/numbers';
|
|
13
16
|
import { isNetworkStatusInWarningState } from '../../utils/swap';
|
|
14
17
|
import { SwapDetailsAlerts } from '../SwapDetailsAlerts';
|
|
@@ -16,7 +19,12 @@ import { SwapDetailsAlerts } from '../SwapDetailsAlerts';
|
|
|
16
19
|
export const RESET_INTERVAL = 2_000;
|
|
17
20
|
export const SECONDS = 60;
|
|
18
21
|
|
|
19
|
-
export const getSteps = ({
|
|
22
|
+
export const getSteps = ({
|
|
23
|
+
swap,
|
|
24
|
+
blockchains,
|
|
25
|
+
swappers,
|
|
26
|
+
...args
|
|
27
|
+
}: GetStep): Step[] => {
|
|
20
28
|
const hasAlreadyProceededToSign = swap.hasAlreadyProceededToSign !== false;
|
|
21
29
|
return swap.steps.map((step, index) => {
|
|
22
30
|
const amountToConvert =
|
|
@@ -58,7 +66,39 @@ export const getSteps = ({ swap, blockchains, ...args }: GetStep): Step[] => {
|
|
|
58
66
|
step.outputAmount || step.expectedOutputAmountHumanReadable,
|
|
59
67
|
},
|
|
60
68
|
},
|
|
61
|
-
swapper: {
|
|
69
|
+
swapper: {
|
|
70
|
+
displayName: getSwapperDisplayName(step.swapperId, swappers),
|
|
71
|
+
image: step.swapperLogo ?? '',
|
|
72
|
+
type: step.swapperType,
|
|
73
|
+
},
|
|
74
|
+
internalSwaps: step.internalSwaps
|
|
75
|
+
? step.internalSwaps.map((internalSwap) => {
|
|
76
|
+
return {
|
|
77
|
+
from: {
|
|
78
|
+
blockchain:
|
|
79
|
+
getBlockchainShortNameFor(
|
|
80
|
+
internalSwap.fromBlockchain,
|
|
81
|
+
blockchains
|
|
82
|
+
) ?? '',
|
|
83
|
+
},
|
|
84
|
+
to: {
|
|
85
|
+
blockchain:
|
|
86
|
+
getBlockchainShortNameFor(
|
|
87
|
+
internalSwap.toBlockchain,
|
|
88
|
+
blockchains
|
|
89
|
+
) ?? '',
|
|
90
|
+
},
|
|
91
|
+
swapper: {
|
|
92
|
+
displayName: getSwapperDisplayName(
|
|
93
|
+
internalSwap.swapperId,
|
|
94
|
+
swappers
|
|
95
|
+
),
|
|
96
|
+
image: internalSwap.swapperLogo ?? '',
|
|
97
|
+
type: internalSwap.swapperType,
|
|
98
|
+
},
|
|
99
|
+
};
|
|
100
|
+
})
|
|
101
|
+
: [],
|
|
62
102
|
alerts: (
|
|
63
103
|
<SwapDetailsAlerts
|
|
64
104
|
step={step}
|
|
@@ -1,23 +1,22 @@
|
|
|
1
1
|
import { css, darkTheme, styled } from '@rango-dev/ui';
|
|
2
2
|
|
|
3
|
+
import { ScrollableArea } from '../Layout';
|
|
4
|
+
|
|
3
5
|
export const Container = styled('div', {
|
|
4
6
|
display: 'flex',
|
|
5
|
-
width: '100%',
|
|
6
7
|
flexDirection: 'column',
|
|
7
|
-
alignItems: 'center',
|
|
8
|
-
height: '0',
|
|
9
8
|
flexGrow: 1,
|
|
9
|
+
overflow: 'hidden',
|
|
10
10
|
});
|
|
11
11
|
|
|
12
12
|
export const HeaderDetails = styled('div', {
|
|
13
13
|
width: '100%',
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export const StepsList = styled(
|
|
16
|
+
export const StepsList = styled(ScrollableArea, {
|
|
17
17
|
padding: '$0 $20 $20 $20',
|
|
18
|
-
width: '100%',
|
|
19
|
-
overflow: 'auto',
|
|
20
18
|
});
|
|
19
|
+
|
|
21
20
|
export const Alerts = styled('div', {
|
|
22
21
|
display: 'flex',
|
|
23
22
|
flexDirection: 'column',
|
|
@@ -54,6 +53,10 @@ export const rowStyles = css({
|
|
|
54
53
|
color: '$neutral500',
|
|
55
54
|
});
|
|
56
55
|
|
|
56
|
+
export const datePlaceholderStyles = css({
|
|
57
|
+
padding: '$5 0',
|
|
58
|
+
});
|
|
59
|
+
|
|
57
60
|
export const requestIdStyles = css({
|
|
58
61
|
display: 'flex',
|
|
59
62
|
justifyContent: 'center',
|
|
@@ -73,3 +76,12 @@ export const titleStepsStyles = css({
|
|
|
73
76
|
width: '100%',
|
|
74
77
|
padding: '0 $20 $10',
|
|
75
78
|
});
|
|
79
|
+
|
|
80
|
+
export const StyledLink = styled('a', {
|
|
81
|
+
fontSize: '$16',
|
|
82
|
+
fontWeight: '$400',
|
|
83
|
+
color: '$neutral700',
|
|
84
|
+
display: 'flex',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
justifyContent: 'center',
|
|
87
|
+
});
|
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
CopyIcon,
|
|
13
13
|
Divider,
|
|
14
14
|
IconButton,
|
|
15
|
+
LinkIcon,
|
|
15
16
|
QuoteCost,
|
|
16
17
|
StepDetails,
|
|
17
18
|
Typography,
|
|
@@ -23,6 +24,7 @@ import { PendingSwapNetworkStatus } from 'rango-types';
|
|
|
23
24
|
import React, { useEffect, useRef, useState } from 'react';
|
|
24
25
|
import { useNavigate } from 'react-router-dom';
|
|
25
26
|
|
|
27
|
+
import { SCANNER_BASE_URL } from '../../constants';
|
|
26
28
|
import {
|
|
27
29
|
GAS_FEE_MAX_DECIMALS,
|
|
28
30
|
GAS_FEE_MIN_DECIMALS,
|
|
@@ -36,6 +38,7 @@ import {
|
|
|
36
38
|
import { useAppStore } from '../../store/AppStore';
|
|
37
39
|
import { useNotificationStore } from '../../store/notification';
|
|
38
40
|
import { useQuoteStore } from '../../store/quote';
|
|
41
|
+
import { useUiStore } from '../../store/ui';
|
|
39
42
|
import { getContainer } from '../../utils/common';
|
|
40
43
|
import {
|
|
41
44
|
formatTooltipNumbers,
|
|
@@ -52,7 +55,7 @@ import {
|
|
|
52
55
|
import { getSwapDate } from '../../utils/time';
|
|
53
56
|
import { getConciseAddress } from '../../utils/wallets';
|
|
54
57
|
import { SuffixContainer } from '../HeaderButtons/HeaderButtons.styles';
|
|
55
|
-
import { Layout } from '../Layout';
|
|
58
|
+
import { Layout, PageContainer } from '../Layout';
|
|
56
59
|
import { QuoteSummary } from '../Quote';
|
|
57
60
|
import {
|
|
58
61
|
SwapDetailsCompleteModal,
|
|
@@ -61,12 +64,12 @@ import {
|
|
|
61
64
|
|
|
62
65
|
import { getSteps, getStepState, RESET_INTERVAL } from './SwapDetails.helpers';
|
|
63
66
|
import {
|
|
64
|
-
Container,
|
|
65
67
|
HeaderDetails,
|
|
66
68
|
outputStyles,
|
|
67
69
|
requestIdStyles,
|
|
68
70
|
rowStyles,
|
|
69
71
|
StepsList,
|
|
72
|
+
StyledLink,
|
|
70
73
|
titleStepsStyles,
|
|
71
74
|
} from './SwapDetails.styles';
|
|
72
75
|
|
|
@@ -74,8 +77,10 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
74
77
|
const { swap, requestId, onDelete, onCancel: onCancelProps } = props;
|
|
75
78
|
const { canSwitchNetworkTo, connect, getWalletInfo } = useWallets();
|
|
76
79
|
const blockchains = useAppStore().blockchains();
|
|
80
|
+
const swappers = useAppStore().swappers();
|
|
77
81
|
const tokens = useAppStore().tokens();
|
|
78
82
|
const retry = useQuoteStore.use.retry();
|
|
83
|
+
const isActiveTab = useUiStore.use.isActiveTab();
|
|
79
84
|
const navigate = useNavigate();
|
|
80
85
|
const [_, handleCopy] = useCopyToClipboard(RESET_INTERVAL);
|
|
81
86
|
const listRef = useRef<HTMLDivElement | null>(null);
|
|
@@ -158,6 +163,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
158
163
|
setNetworkModal: setModalState,
|
|
159
164
|
message: stepMessage,
|
|
160
165
|
blockchains: blockchains,
|
|
166
|
+
swappers: swappers,
|
|
161
167
|
});
|
|
162
168
|
const numberOfSteps = steps.length;
|
|
163
169
|
const [firstStep, lastStep] = [swap.steps[0], swap.steps[numberOfSteps - 1]];
|
|
@@ -236,7 +242,6 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
236
242
|
|
|
237
243
|
return (
|
|
238
244
|
<Layout
|
|
239
|
-
noPadding
|
|
240
245
|
header={{
|
|
241
246
|
title: i18n.t('Swap and Bridge'),
|
|
242
247
|
onCancel:
|
|
@@ -274,7 +279,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
274
279
|
</Button>
|
|
275
280
|
)
|
|
276
281
|
}>
|
|
277
|
-
<
|
|
282
|
+
<PageContainer compact view>
|
|
278
283
|
<HeaderDetails>
|
|
279
284
|
<div className={rowStyles()}>
|
|
280
285
|
<Typography variant="label" size="large" color="neutral700">
|
|
@@ -289,6 +294,11 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
289
294
|
onClick={handleCopy.bind(null, requestId || '')}>
|
|
290
295
|
<CopyIcon size={16} color="gray" />
|
|
291
296
|
</IconButton>
|
|
297
|
+
<StyledLink
|
|
298
|
+
target="_blank"
|
|
299
|
+
href={`${SCANNER_BASE_URL}/swap/${requestId}`}>
|
|
300
|
+
<LinkIcon size={16} />
|
|
301
|
+
</StyledLink>
|
|
292
302
|
</div>
|
|
293
303
|
</div>
|
|
294
304
|
<div className={rowStyles()}>
|
|
@@ -390,7 +400,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
390
400
|
);
|
|
391
401
|
})}
|
|
392
402
|
</StepsList>
|
|
393
|
-
</
|
|
403
|
+
</PageContainer>
|
|
394
404
|
|
|
395
405
|
<SwapDetailsModal
|
|
396
406
|
state={modalState}
|
|
@@ -399,6 +409,7 @@ export function SwapDetails(props: SwapDetailsProps) {
|
|
|
399
409
|
onDelete={onDelete}
|
|
400
410
|
message={stepMessage.detailedMessage.content}
|
|
401
411
|
currentStepWallet={currentStepWallet}
|
|
412
|
+
walletButtonDisabled={!isActiveTab}
|
|
402
413
|
/>
|
|
403
414
|
<SwapDetailsCompleteModal
|
|
404
415
|
open={!!showCompletedModal}
|
|
@@ -24,18 +24,27 @@ export function SwapDetailsAlerts(props: SwapAlertsProps) {
|
|
|
24
24
|
const waitingForApproval =
|
|
25
25
|
step.status === 'waitingForApproval' && !hasWarning;
|
|
26
26
|
const inProgress = step.status === 'running' && !hasWarning;
|
|
27
|
+
const waitingProgress =
|
|
28
|
+
(inProgress && !hasAlreadyProceededToSign) ||
|
|
29
|
+
(waitingForApproval && !step.explorerUrl?.length);
|
|
30
|
+
|
|
27
31
|
return (
|
|
28
32
|
<Alerts>
|
|
29
33
|
{step.explorerUrl?.map((explorerUrl, index, urls) => {
|
|
30
34
|
const key = index + explorerUrl.url;
|
|
31
35
|
const lastUrl = index === urls.length - 1;
|
|
32
|
-
const loading =
|
|
36
|
+
const loading =
|
|
37
|
+
((lastUrl && inProgress) || waitingForApproval) && !waitingProgress;
|
|
33
38
|
const error = lastUrl && step.status === 'failed';
|
|
34
39
|
|
|
35
40
|
return (
|
|
36
41
|
<Fragment key={key}>
|
|
37
42
|
<Alert
|
|
38
|
-
type={
|
|
43
|
+
type={
|
|
44
|
+
lastUrl
|
|
45
|
+
? (loading && 'loading') || (error && 'error') || 'success'
|
|
46
|
+
: 'success'
|
|
47
|
+
}
|
|
39
48
|
title={
|
|
40
49
|
!explorerUrl.description
|
|
41
50
|
? i18n.t('View transaction')
|
|
@@ -47,7 +56,7 @@ export function SwapDetailsAlerts(props: SwapAlertsProps) {
|
|
|
47
56
|
variant="ghost"
|
|
48
57
|
size="xsmall"
|
|
49
58
|
onClick={() => window.open(explorerUrl.url, '_blank')}>
|
|
50
|
-
<LinkIcon size={
|
|
59
|
+
<LinkIcon size={12} />
|
|
51
60
|
</IconButton>
|
|
52
61
|
)
|
|
53
62
|
}
|
|
@@ -55,10 +64,7 @@ export function SwapDetailsAlerts(props: SwapAlertsProps) {
|
|
|
55
64
|
</Fragment>
|
|
56
65
|
);
|
|
57
66
|
})}
|
|
58
|
-
{
|
|
59
|
-
(waitingForApproval && !step.explorerUrl?.length)) && (
|
|
60
|
-
<Alert type="loading" title={message.shortMessage} />
|
|
61
|
-
)}
|
|
67
|
+
{waitingProgress && <Alert type="loading" title={message.shortMessage} />}
|
|
62
68
|
{step.status !== 'failed' && hasWarning && (
|
|
63
69
|
<WarningAlert
|
|
64
70
|
switchNetwork={switchNetwork}
|
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
PendingSwap,
|
|
7
7
|
PendingSwapNetworkStatus,
|
|
8
8
|
PendingSwapStep,
|
|
9
|
+
SwapperMeta,
|
|
9
10
|
} from 'rango-types';
|
|
10
11
|
|
|
11
12
|
export interface SwapAlertsProps extends WaningAlertsProps {
|
|
@@ -26,4 +27,5 @@ export interface FailedAlertsProps {
|
|
|
26
27
|
export type GetStep = {
|
|
27
28
|
swap: PendingSwap;
|
|
28
29
|
blockchains: BlockchainMeta[];
|
|
30
|
+
swappers: SwapperMeta[];
|
|
29
31
|
} & Omit<SwapAlertsProps, 'step' | 'hasAlreadyProceededToSign'>;
|
|
@@ -10,7 +10,14 @@ import { mapStatusToWalletState } from '../../utils/wallets';
|
|
|
10
10
|
import { WalletContainer } from './SwapDetailsModal.styles';
|
|
11
11
|
|
|
12
12
|
export const WalletStateContent = (props: WalletStateContentProps) => {
|
|
13
|
-
const {
|
|
13
|
+
const {
|
|
14
|
+
type,
|
|
15
|
+
title,
|
|
16
|
+
currentStepWallet,
|
|
17
|
+
message,
|
|
18
|
+
showWalletButton,
|
|
19
|
+
walletButtonDisabled,
|
|
20
|
+
} = props;
|
|
14
21
|
const { connect, getWalletInfo, state } = useWallets();
|
|
15
22
|
const walletType = currentStepWallet?.walletType;
|
|
16
23
|
const walletState = walletType
|
|
@@ -31,6 +38,7 @@ export const WalletStateContent = (props: WalletStateContentProps) => {
|
|
|
31
38
|
type={walletType}
|
|
32
39
|
state={walletState}
|
|
33
40
|
link={walletInfo.installLink}
|
|
41
|
+
disabled={walletButtonDisabled}
|
|
34
42
|
onClick={async () => connect(walletType)}
|
|
35
43
|
/>
|
|
36
44
|
</WalletContainer>
|
|
@@ -12,8 +12,15 @@ import { modalNetworkValues } from './SwapDetailsModal.helpers';
|
|
|
12
12
|
import { WalletStateContent } from './SwapDetailsModal.WalletState';
|
|
13
13
|
|
|
14
14
|
export function SwapDetailsModal(props: ModalPropTypes) {
|
|
15
|
-
const {
|
|
16
|
-
|
|
15
|
+
const {
|
|
16
|
+
state,
|
|
17
|
+
onClose,
|
|
18
|
+
onDelete,
|
|
19
|
+
onCancel,
|
|
20
|
+
currentStepWallet,
|
|
21
|
+
message,
|
|
22
|
+
walletButtonDisabled,
|
|
23
|
+
} = props;
|
|
17
24
|
|
|
18
25
|
const showWalletStateContent =
|
|
19
26
|
state === PendingSwapNetworkStatus.WaitingForNetworkChange ||
|
|
@@ -31,6 +38,7 @@ export function SwapDetailsModal(props: ModalPropTypes) {
|
|
|
31
38
|
title={modalNetworkValues[state].title}
|
|
32
39
|
currentStepWallet={currentStepWallet}
|
|
33
40
|
message={message}
|
|
41
|
+
walletButtonDisabled={walletButtonDisabled}
|
|
34
42
|
showWalletButton={
|
|
35
43
|
state !== PendingSwapNetworkStatus.WaitingForNetworkChange
|
|
36
44
|
}
|
|
@@ -17,6 +17,7 @@ export interface ModalPropTypes {
|
|
|
17
17
|
state: ModalState;
|
|
18
18
|
currentStepWallet: WalletTypeAndAddress | null;
|
|
19
19
|
message: string;
|
|
20
|
+
walletButtonDisabled: boolean;
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
export interface CompleteModalPropTypes {
|
|
@@ -49,6 +50,7 @@ export interface WalletStateContentProps extends ModalNetworkValueTypes {
|
|
|
49
50
|
currentStepWallet: WalletTypeAndAddress | null;
|
|
50
51
|
message: string;
|
|
51
52
|
showWalletButton: boolean;
|
|
53
|
+
walletButtonDisabled: boolean;
|
|
52
54
|
}
|
|
53
55
|
|
|
54
56
|
export type CancelContentProps = Pick<ModalPropTypes, 'onClose' | 'onCancel'>;
|
|
@@ -4,6 +4,10 @@ import { i18n } from '@lingui/core';
|
|
|
4
4
|
import { Divider, SwapListItem, Typography } from '@rango-dev/ui';
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
+
import {
|
|
8
|
+
TOKEN_AMOUNT_MAX_DECIMALS,
|
|
9
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
10
|
+
} from '../../constants/routing';
|
|
7
11
|
import { getContainer } from '../../utils/common';
|
|
8
12
|
import { formatTooltipNumbers, numberToString } from '../../utils/numbers';
|
|
9
13
|
|
|
@@ -18,11 +22,11 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
18
22
|
|
|
19
23
|
const loadingGroups = [
|
|
20
24
|
{
|
|
21
|
-
title: 'Today',
|
|
25
|
+
title: i18n.t('Today'),
|
|
22
26
|
swaps,
|
|
23
27
|
},
|
|
24
28
|
{
|
|
25
|
-
title: 'This month',
|
|
29
|
+
title: i18n.t('This month'),
|
|
26
30
|
swaps,
|
|
27
31
|
},
|
|
28
32
|
];
|
|
@@ -36,7 +40,7 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
36
40
|
variant="label"
|
|
37
41
|
size="medium"
|
|
38
42
|
className={groupStyles()}>
|
|
39
|
-
{
|
|
43
|
+
{group.title}
|
|
40
44
|
</Typography>
|
|
41
45
|
</Time>
|
|
42
46
|
<Divider size={4} />
|
|
@@ -69,7 +73,7 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
69
73
|
variant="label"
|
|
70
74
|
size="medium"
|
|
71
75
|
className={groupStyles()}>
|
|
72
|
-
{
|
|
76
|
+
{group.title}
|
|
73
77
|
</Typography>
|
|
74
78
|
</Time>
|
|
75
79
|
<Divider size={4} />
|
|
@@ -85,8 +89,8 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
85
89
|
creationTime={swap.creationTime}
|
|
86
90
|
status={swap.status}
|
|
87
91
|
onClick={onSwapClick}
|
|
88
|
-
onlyShowTime={group.title === 'Today'}
|
|
89
92
|
tooltipContainer={getContainer()}
|
|
93
|
+
onlyShowTime={group.title === i18n.t('Today')}
|
|
90
94
|
swapTokenData={{
|
|
91
95
|
from: {
|
|
92
96
|
token: {
|
|
@@ -96,7 +100,12 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
96
100
|
blockchain: {
|
|
97
101
|
image: firstStep.fromBlockchainLogo || '',
|
|
98
102
|
},
|
|
99
|
-
amount:
|
|
103
|
+
amount: numberToString(
|
|
104
|
+
swap.inputAmount,
|
|
105
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
106
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
107
|
+
),
|
|
108
|
+
realAmount: formatTooltipNumbers(swap.inputAmount),
|
|
100
109
|
},
|
|
101
110
|
to: {
|
|
102
111
|
token: {
|
|
@@ -109,7 +118,9 @@ export function SwapsGroup(props: PropTypes) {
|
|
|
109
118
|
amount: numberToString(
|
|
110
119
|
lastStep.outputAmount ||
|
|
111
120
|
lastStep.expectedOutputAmountHumanReadable ||
|
|
112
|
-
''
|
|
121
|
+
'',
|
|
122
|
+
TOKEN_AMOUNT_MIN_DECIMALS,
|
|
123
|
+
TOKEN_AMOUNT_MAX_DECIMALS
|
|
113
124
|
),
|
|
114
125
|
realAmount: formatTooltipNumbers(
|
|
115
126
|
lastStep.outputAmount ||
|
|
@@ -51,6 +51,7 @@ export const Container = styled('div', {
|
|
|
51
51
|
display: 'flex',
|
|
52
52
|
flexDirection: 'column',
|
|
53
53
|
flexGrow: 1,
|
|
54
|
+
overflow: 'hidden',
|
|
54
55
|
});
|
|
55
56
|
|
|
56
57
|
export const Title = styled('div', {
|
|
@@ -68,6 +69,7 @@ export const List = styled('ul', {
|
|
|
68
69
|
padding: 0,
|
|
69
70
|
margin: 0,
|
|
70
71
|
listStyle: 'none',
|
|
72
|
+
|
|
71
73
|
'& li': {
|
|
72
74
|
alignItems: 'none',
|
|
73
75
|
|
|
@@ -278,7 +278,7 @@ export function TokenList(props: PropTypes) {
|
|
|
278
278
|
</Typography>
|
|
279
279
|
<Divider size={4} />
|
|
280
280
|
{fetchStatus === 'loading' && <LoadingTokenList size={PAGE_SIZE} />}
|
|
281
|
-
{fetchStatus === 'success' && <List>{renderList()}</List>}
|
|
281
|
+
{fetchStatus === 'success' && <List as="ul">{renderList()}</List>}
|
|
282
282
|
</Container>
|
|
283
283
|
);
|
|
284
284
|
}
|
|
@@ -11,14 +11,12 @@ import { useEffect } from 'react';
|
|
|
11
11
|
import { useAppStore } from '../store/AppStore';
|
|
12
12
|
import { useNotificationStore } from '../store/notification';
|
|
13
13
|
import { useWalletsStore } from '../store/wallets';
|
|
14
|
-
import { validBlockedStatuses } from '../types/notification';
|
|
15
14
|
|
|
16
15
|
export function WidgetEvents() {
|
|
17
16
|
const tokens = useAppStore().tokens();
|
|
18
17
|
const connectedWallets = useWalletsStore.use.connectedWallets();
|
|
19
18
|
const getWalletsDetails = useWalletsStore.use.getWalletsDetails();
|
|
20
19
|
const setNotification = useNotificationStore.use.setNotification();
|
|
21
|
-
const setAsRead = useNotificationStore.use.setAsRead();
|
|
22
20
|
const widgetEvents = useEvents();
|
|
23
21
|
|
|
24
22
|
useEffect(() => {
|
|
@@ -43,18 +41,8 @@ export function WidgetEvents() {
|
|
|
43
41
|
fromAccount && getWalletsDetails([fromAccount], tokens);
|
|
44
42
|
toAccount && getWalletsDetails([toAccount], tokens);
|
|
45
43
|
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
validBlockedStatuses.includes(event.status)) ||
|
|
49
|
-
event.type === StepEventType.FAILED
|
|
50
|
-
) {
|
|
51
|
-
setNotification(event, route);
|
|
52
|
-
} else if (
|
|
53
|
-
event.type === StepEventType.TX_EXECUTION ||
|
|
54
|
-
event.type === StepEventType.CHECK_STATUS
|
|
55
|
-
) {
|
|
56
|
-
setAsRead(route.requestId);
|
|
57
|
-
}
|
|
44
|
+
|
|
45
|
+
setNotification(event, route);
|
|
58
46
|
});
|
|
59
47
|
|
|
60
48
|
return () => widgetEvents.all.clear();
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import type { PropTypes } from './ActivateTabAlert.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Alert, Button } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
export function ActivateTabAlert(props: PropTypes) {
|
|
8
|
+
return (
|
|
9
|
+
<Alert
|
|
10
|
+
action={
|
|
11
|
+
<Button
|
|
12
|
+
onClick={props.onActivateTab}
|
|
13
|
+
variant="contained"
|
|
14
|
+
size="xxsmall"
|
|
15
|
+
type="warning">
|
|
16
|
+
{i18n.t('Activate')}
|
|
17
|
+
</Button>
|
|
18
|
+
}
|
|
19
|
+
type="warning"
|
|
20
|
+
variant="alarm"
|
|
21
|
+
title={i18n.t(
|
|
22
|
+
'Another tab is open and handles transactions. You can activate this tab.'
|
|
23
|
+
)}
|
|
24
|
+
/>
|
|
25
|
+
);
|
|
26
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ActivateTabAlert } from './ActivateTabAlert';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { PropTypes } from './ActivateTabModal.types';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
import { Button, Divider, MessageBox, Modal } from '@rango-dev/ui';
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { getContainer } from '../../../utils/common';
|
|
8
|
+
|
|
9
|
+
export function ActivateTabModal(props: PropTypes) {
|
|
10
|
+
const { open, onClose, onConfirm } = props;
|
|
11
|
+
return (
|
|
12
|
+
<Modal open={open} dismissible onClose={onClose} container={getContainer()}>
|
|
13
|
+
<MessageBox
|
|
14
|
+
title={i18n.t('Activate current tab')}
|
|
15
|
+
type="warning"
|
|
16
|
+
description={i18n.t(
|
|
17
|
+
'Currently, some transactions are running and being handled by other browser tab. If you activate this tab, all transactions that are already in the transaction sign step will expire.'
|
|
18
|
+
)}>
|
|
19
|
+
<Divider size={20} />
|
|
20
|
+
<Button
|
|
21
|
+
variant="contained"
|
|
22
|
+
size="large"
|
|
23
|
+
type="primary"
|
|
24
|
+
fullWidth
|
|
25
|
+
onClick={onConfirm}>
|
|
26
|
+
{i18n.t('Confirm')}
|
|
27
|
+
</Button>
|
|
28
|
+
</MessageBox>
|
|
29
|
+
</Modal>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ActivateTabModal } from './ActivateTabModal';
|
package/src/constants/index.ts
CHANGED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { SwapFee } from 'rango-sdk';
|
|
2
|
+
|
|
3
|
+
import { i18n } from '@lingui/core';
|
|
4
|
+
|
|
5
|
+
export type NameOfFees =
|
|
6
|
+
| 'Swapper Fee'
|
|
7
|
+
| 'Affiliate Fee'
|
|
8
|
+
| 'Outbound network fee'
|
|
9
|
+
| 'Rango Fee'
|
|
10
|
+
| 'Network Fee';
|
|
11
|
+
|
|
12
|
+
export const NAME_OF_FEES: Record<NameOfFees, string> = {
|
|
13
|
+
'Network Fee': i18n.t('Network Fee'),
|
|
14
|
+
'Swapper Fee': i18n.t('Protocol Fee'),
|
|
15
|
+
'Affiliate Fee': i18n.t('Affiliate Fee'),
|
|
16
|
+
'Outbound network fee': i18n.t('Outbound Fee'),
|
|
17
|
+
'Rango Fee': i18n.t('Rango Fee'),
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export type FeesGroup = {
|
|
21
|
+
payable: { [key in NameOfFees]?: SwapFee[] };
|
|
22
|
+
nonePayable: { [key in NameOfFees]?: SwapFee[] };
|
|
23
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export enum SearchParams {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
FROM_BLOCKCHAIN = 'fromBlockchain',
|
|
3
|
+
FROM_TOKEN = 'fromToken',
|
|
4
|
+
TO_BLOCKCHAIN = 'toBlockchain',
|
|
5
|
+
TO_TOKEN = 'toToken',
|
|
6
|
+
FROM_AMOUNT = 'fromAmount',
|
|
7
|
+
AUTO_CONNECT = 'autoConnect',
|
|
8
8
|
}
|
|
@@ -20,7 +20,7 @@ export function Main() {
|
|
|
20
20
|
|
|
21
21
|
const { config } = useAppStore();
|
|
22
22
|
const { activeTheme } = useTheme(config?.theme || {});
|
|
23
|
-
const { activeLanguage
|
|
23
|
+
const { activeLanguage } = useLanguage();
|
|
24
24
|
const [lastConnectedWalletWithNetwork, setLastConnectedWalletWithNetwork] =
|
|
25
25
|
useState<string>('');
|
|
26
26
|
const [disconnectedWallet, setDisconnectedWallet] = useState<WalletType>();
|
|
@@ -30,9 +30,6 @@ export function Main() {
|
|
|
30
30
|
void useNotificationStore.persist.rehydrate();
|
|
31
31
|
widgetContext.onConnectWallet(setLastConnectedWalletWithNetwork);
|
|
32
32
|
}, []);
|
|
33
|
-
useEffect(() => {
|
|
34
|
-
changeLanguage(config?.language);
|
|
35
|
-
}, [config?.language]);
|
|
36
33
|
|
|
37
34
|
return (
|
|
38
35
|
<I18nManager language={activeLanguage}>
|