2021-02-04 19:15:23 +01:00
|
|
|
import EventEmitter from 'events';
|
2021-09-15 15:13:18 +02:00
|
|
|
import React, { useContext, useRef, useState, useEffect } from 'react';
|
2021-12-07 18:33:13 +01:00
|
|
|
import { shallowEqual, useDispatch, useSelector } from 'react-redux';
|
2021-02-04 19:15:23 +01:00
|
|
|
import PropTypes from 'prop-types';
|
|
|
|
import { useHistory } from 'react-router-dom';
|
2021-12-07 18:33:13 +01:00
|
|
|
import isEqual from 'lodash/isEqual';
|
2021-05-19 16:51:47 +02:00
|
|
|
import { getBlockExplorerLink } from '@metamask/etherscan-link';
|
2021-02-04 19:15:23 +01:00
|
|
|
import { I18nContext } from '../../../contexts/i18n';
|
2022-04-01 21:11:12 +02:00
|
|
|
import { MetaMetricsContext } from '../../../contexts/metametrics';
|
2022-08-11 19:33:33 +02:00
|
|
|
import {
|
|
|
|
EVENT,
|
|
|
|
EVENT_NAMES,
|
|
|
|
CONTEXT_PROPS,
|
|
|
|
} from '../../../../shared/constants/metametrics';
|
2021-03-18 11:20:06 +01:00
|
|
|
|
2021-03-09 22:37:19 +01:00
|
|
|
import {
|
|
|
|
getCurrentChainId,
|
|
|
|
getCurrentCurrency,
|
|
|
|
getRpcPrefsForCurrentProvider,
|
|
|
|
getUSDConversionRate,
|
2021-05-13 21:26:08 +02:00
|
|
|
isHardwareWallet,
|
|
|
|
getHardwareWalletType,
|
2022-11-04 17:14:43 +01:00
|
|
|
getFullTxData,
|
2021-03-09 22:37:19 +01:00
|
|
|
} from '../../../selectors';
|
2021-03-18 11:20:06 +01:00
|
|
|
|
2020-10-06 20:28:38 +02:00
|
|
|
import {
|
2020-11-03 00:41:28 +01:00
|
|
|
getUsedQuote,
|
|
|
|
getFetchParams,
|
|
|
|
getApproveTxParams,
|
2020-11-04 17:14:08 +01:00
|
|
|
getUsedSwapsGasPrice,
|
2020-10-06 20:28:38 +02:00
|
|
|
fetchQuotesAndSetQuoteState,
|
|
|
|
navigateBackToBuildQuote,
|
|
|
|
prepareForRetryGetQuotes,
|
|
|
|
prepareToLeaveSwaps,
|
2022-02-18 17:48:38 +01:00
|
|
|
getSmartTransactionsOptInStatus,
|
|
|
|
getSmartTransactionsEnabled,
|
2022-03-23 20:28:26 +01:00
|
|
|
getCurrentSmartTransactionsEnabled,
|
2021-12-01 17:25:09 +01:00
|
|
|
getFromTokenInputValue,
|
|
|
|
getMaxSlippage,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../../ducks/swaps/swaps';
|
|
|
|
import Mascot from '../../../components/ui/mascot';
|
2020-10-06 20:28:38 +02:00
|
|
|
import {
|
|
|
|
QUOTES_EXPIRED_ERROR,
|
|
|
|
SWAP_FAILED_ERROR,
|
|
|
|
ERROR_FETCHING_QUOTES,
|
|
|
|
QUOTES_NOT_AVAILABLE_ERROR,
|
2021-05-13 21:49:00 +02:00
|
|
|
CONTRACT_DATA_DISABLED_ERROR,
|
2020-10-06 20:28:38 +02:00
|
|
|
OFFLINE_FOR_MAINTENANCE,
|
2021-03-29 14:54:27 +02:00
|
|
|
SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP,
|
2021-04-28 21:53:59 +02:00
|
|
|
} from '../../../../shared/constants/swaps';
|
|
|
|
import { isSwapsDefaultTokenSymbol } from '../../../../shared/modules/swaps.utils';
|
2021-03-18 11:20:06 +01:00
|
|
|
import PulseLoader from '../../../components/ui/pulse-loader';
|
|
|
|
|
2022-08-17 17:37:01 +02:00
|
|
|
import { DEFAULT_ROUTE } from '../../../helpers/constants/routes';
|
|
|
|
import {
|
|
|
|
stopPollingForQuotes,
|
|
|
|
setDefaultHomeActiveTabName,
|
|
|
|
} from '../../../store/actions';
|
2020-10-06 20:28:38 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
import { getRenderableNetworkFeesForQuote } from '../swaps.util';
|
|
|
|
import SwapsFooter from '../swaps-footer';
|
2021-03-29 14:54:27 +02:00
|
|
|
|
2022-07-11 17:53:07 +02:00
|
|
|
import CreateNewSwap from '../create-new-swap';
|
|
|
|
import ViewOnBlockExplorer from '../view-on-block-explorer';
|
2022-09-16 21:05:21 +02:00
|
|
|
import { SUPPORT_LINK } from '../../../../shared/lib/ui-utils';
|
2021-02-04 19:15:23 +01:00
|
|
|
import SwapFailureIcon from './swap-failure-icon';
|
|
|
|
import SwapSuccessIcon from './swap-success-icon';
|
|
|
|
import QuotesTimeoutIcon from './quotes-timeout-icon';
|
2020-10-06 20:28:38 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
export default function AwaitingSwap({
|
2020-10-06 20:28:38 +02:00
|
|
|
swapComplete,
|
|
|
|
errorKey,
|
|
|
|
txHash,
|
|
|
|
tokensReceived,
|
|
|
|
submittingSwap,
|
2022-11-04 17:14:43 +01:00
|
|
|
txId,
|
2020-10-06 20:28:38 +02:00
|
|
|
}) {
|
2021-02-04 19:15:23 +01:00
|
|
|
const t = useContext(I18nContext);
|
2022-03-25 14:21:29 +01:00
|
|
|
const trackEvent = useContext(MetaMetricsContext);
|
2021-02-04 19:15:23 +01:00
|
|
|
const history = useHistory();
|
|
|
|
const dispatch = useDispatch();
|
|
|
|
const animationEventEmitter = useRef(new EventEmitter());
|
2022-11-04 17:14:43 +01:00
|
|
|
const { swapMetaData } =
|
|
|
|
useSelector((state) => getFullTxData(state, txId)) || {};
|
2021-12-07 18:33:13 +01:00
|
|
|
const fetchParams = useSelector(getFetchParams, isEqual);
|
2021-12-01 17:25:09 +01:00
|
|
|
const fromTokenInputValue = useSelector(getFromTokenInputValue);
|
|
|
|
const maxSlippage = useSelector(getMaxSlippage);
|
2021-12-07 18:33:13 +01:00
|
|
|
const usedQuote = useSelector(getUsedQuote, isEqual);
|
|
|
|
const approveTxParams = useSelector(getApproveTxParams, shallowEqual);
|
2021-02-04 19:15:23 +01:00
|
|
|
const swapsGasPrice = useSelector(getUsedSwapsGasPrice);
|
|
|
|
const currentCurrency = useSelector(getCurrentCurrency);
|
|
|
|
const usdConversionRate = useSelector(getUSDConversionRate);
|
2021-03-09 22:37:19 +01:00
|
|
|
const chainId = useSelector(getCurrentChainId);
|
2021-12-07 18:33:13 +01:00
|
|
|
const rpcPrefs = useSelector(getRpcPrefsForCurrentProvider, shallowEqual);
|
2022-07-31 20:26:40 +02:00
|
|
|
const [trackedQuotesExpiredEvent, setTrackedQuotesExpiredEvent] =
|
|
|
|
useState(false);
|
2020-10-06 20:28:38 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
let feeinUnformattedFiat;
|
2020-11-04 17:14:08 +01:00
|
|
|
|
|
|
|
if (usedQuote && swapsGasPrice) {
|
2021-03-18 11:20:06 +01:00
|
|
|
const renderableNetworkFees = getRenderableNetworkFeesForQuote({
|
|
|
|
tradeGas: usedQuote.gasEstimateWithRefund || usedQuote.averageGas,
|
|
|
|
approveGas: approveTxParams?.gas || '0x0',
|
|
|
|
gasPrice: swapsGasPrice,
|
2020-10-27 20:02:21 +01:00
|
|
|
currentCurrency,
|
2021-03-18 11:20:06 +01:00
|
|
|
conversionRate: usdConversionRate,
|
|
|
|
tradeValue: usedQuote?.trade?.value,
|
2022-11-04 17:14:43 +01:00
|
|
|
sourceSymbol: swapMetaData?.token_from,
|
2021-03-18 11:20:06 +01:00
|
|
|
sourceAmount: usedQuote.sourceAmount,
|
|
|
|
chainId,
|
|
|
|
});
|
2021-02-04 19:15:23 +01:00
|
|
|
feeinUnformattedFiat = renderableNetworkFees.rawNetworkFees;
|
2020-10-06 20:28:38 +02:00
|
|
|
}
|
|
|
|
|
2021-05-13 21:26:08 +02:00
|
|
|
const hardwareWalletUsed = useSelector(isHardwareWallet);
|
|
|
|
const hardwareWalletType = useSelector(getHardwareWalletType);
|
2022-02-18 17:48:38 +01:00
|
|
|
const smartTransactionsOptInStatus = useSelector(
|
|
|
|
getSmartTransactionsOptInStatus,
|
|
|
|
);
|
|
|
|
const smartTransactionsEnabled = useSelector(getSmartTransactionsEnabled);
|
2022-03-23 20:28:26 +01:00
|
|
|
const currentSmartTransactionsEnabled = useSelector(
|
|
|
|
getCurrentSmartTransactionsEnabled,
|
|
|
|
);
|
2021-05-21 17:14:56 +02:00
|
|
|
const sensitiveProperties = {
|
2022-11-04 17:14:43 +01:00
|
|
|
token_from: swapMetaData?.token_from,
|
|
|
|
token_from_amount: swapMetaData?.token_from_amount,
|
|
|
|
token_to: swapMetaData?.token_to,
|
2021-05-21 17:14:56 +02:00
|
|
|
request_type: fetchParams?.balanceError ? 'Quote' : 'Order',
|
2022-11-04 17:14:43 +01:00
|
|
|
slippage: swapMetaData?.slippage,
|
|
|
|
custom_slippage: swapMetaData?.slippage === 2,
|
2021-05-21 17:14:56 +02:00
|
|
|
gas_fees: feeinUnformattedFiat,
|
|
|
|
is_hardware_wallet: hardwareWalletUsed,
|
|
|
|
hardware_wallet_type: hardwareWalletType,
|
2022-02-18 17:48:38 +01:00
|
|
|
stx_enabled: smartTransactionsEnabled,
|
2022-03-23 20:28:26 +01:00
|
|
|
current_stx_enabled: currentSmartTransactionsEnabled,
|
2022-02-18 17:48:38 +01:00
|
|
|
stx_user_opt_in: smartTransactionsOptInStatus,
|
2021-05-21 17:14:56 +02:00
|
|
|
};
|
2020-10-06 20:28:38 +02:00
|
|
|
|
2021-05-19 16:51:47 +02:00
|
|
|
const baseNetworkUrl =
|
|
|
|
rpcPrefs.blockExplorerUrl ??
|
|
|
|
SWAPS_CHAINID_DEFAULT_BLOCK_EXPLORER_URL_MAP[chainId] ??
|
|
|
|
null;
|
|
|
|
const blockExplorerUrl = getBlockExplorerLink(
|
|
|
|
{ hash: txHash, chainId },
|
|
|
|
{ blockExplorerUrl: baseNetworkUrl },
|
|
|
|
);
|
2021-03-29 14:54:27 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
let headerText;
|
|
|
|
let statusImage;
|
|
|
|
let descriptionText;
|
|
|
|
let submitText;
|
|
|
|
let content;
|
2020-10-06 20:28:38 +02:00
|
|
|
|
|
|
|
if (errorKey === OFFLINE_FOR_MAINTENANCE) {
|
2021-02-04 19:15:23 +01:00
|
|
|
headerText = t('offlineForMaintenance');
|
|
|
|
descriptionText = t('metamaskSwapsOfflineDescription');
|
|
|
|
submitText = t('close');
|
|
|
|
statusImage = <SwapFailureIcon />;
|
2020-10-06 20:28:38 +02:00
|
|
|
} else if (errorKey === SWAP_FAILED_ERROR) {
|
2021-02-04 19:15:23 +01:00
|
|
|
headerText = t('swapFailedErrorTitle');
|
2021-03-01 17:32:02 +01:00
|
|
|
descriptionText = t('swapFailedErrorDescriptionWithSupportLink', [
|
|
|
|
<a
|
|
|
|
className="awaiting-swap__support-link"
|
|
|
|
key="awaiting-swap-support-link"
|
2022-01-06 01:55:20 +01:00
|
|
|
href={SUPPORT_LINK}
|
2021-03-01 17:32:02 +01:00
|
|
|
target="_blank"
|
|
|
|
rel="noopener noreferrer"
|
2022-08-11 19:33:33 +02:00
|
|
|
onClick={() => {
|
|
|
|
trackEvent(
|
|
|
|
{
|
|
|
|
category: EVENT.CATEGORIES.SWAPS,
|
|
|
|
event: EVENT_NAMES.SUPPORT_LINK_CLICKED,
|
|
|
|
properties: {
|
|
|
|
url: SUPPORT_LINK,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
{
|
|
|
|
contextPropsIntoEventProperties: [CONTEXT_PROPS.PAGE_TITLE],
|
|
|
|
},
|
|
|
|
);
|
|
|
|
}}
|
2021-03-01 17:32:02 +01:00
|
|
|
>
|
2022-01-06 01:55:20 +01:00
|
|
|
{new URL(SUPPORT_LINK).hostname}
|
2021-03-01 17:32:02 +01:00
|
|
|
</a>,
|
|
|
|
]);
|
2021-02-04 19:15:23 +01:00
|
|
|
submitText = t('tryAgain');
|
|
|
|
statusImage = <SwapFailureIcon />;
|
2020-10-06 20:28:38 +02:00
|
|
|
content = blockExplorerUrl && (
|
2022-07-11 17:53:07 +02:00
|
|
|
<ViewOnBlockExplorer
|
2020-10-06 20:28:38 +02:00
|
|
|
blockExplorerUrl={blockExplorerUrl}
|
2022-07-11 17:53:07 +02:00
|
|
|
sensitiveTrackingProperties={sensitiveProperties}
|
2020-10-06 20:28:38 +02:00
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-10-06 20:28:38 +02:00
|
|
|
} else if (errorKey === QUOTES_EXPIRED_ERROR) {
|
2021-02-04 19:15:23 +01:00
|
|
|
headerText = t('swapQuotesExpiredErrorTitle');
|
|
|
|
descriptionText = t('swapQuotesExpiredErrorDescription');
|
|
|
|
submitText = t('tryAgain');
|
|
|
|
statusImage = <QuotesTimeoutIcon />;
|
2020-10-06 20:28:38 +02:00
|
|
|
|
|
|
|
if (!trackedQuotesExpiredEvent) {
|
2021-02-04 19:15:23 +01:00
|
|
|
setTrackedQuotesExpiredEvent(true);
|
2022-03-25 14:21:29 +01:00
|
|
|
trackEvent({
|
|
|
|
event: 'Quotes Timed Out',
|
2022-04-22 18:09:10 +02:00
|
|
|
category: EVENT.CATEGORIES.SWAPS,
|
2022-03-25 14:21:29 +01:00
|
|
|
sensitiveProperties,
|
|
|
|
});
|
2020-10-06 20:28:38 +02:00
|
|
|
}
|
|
|
|
} else if (errorKey === ERROR_FETCHING_QUOTES) {
|
2021-02-04 19:15:23 +01:00
|
|
|
headerText = t('swapFetchingQuotesErrorTitle');
|
|
|
|
descriptionText = t('swapFetchingQuotesErrorDescription');
|
|
|
|
submitText = t('back');
|
|
|
|
statusImage = <SwapFailureIcon />;
|
2020-10-06 20:28:38 +02:00
|
|
|
} else if (errorKey === QUOTES_NOT_AVAILABLE_ERROR) {
|
2021-02-04 19:15:23 +01:00
|
|
|
headerText = t('swapQuotesNotAvailableErrorTitle');
|
|
|
|
descriptionText = t('swapQuotesNotAvailableErrorDescription');
|
|
|
|
submitText = t('tryAgain');
|
|
|
|
statusImage = <SwapFailureIcon />;
|
2021-05-13 21:49:00 +02:00
|
|
|
} else if (errorKey === CONTRACT_DATA_DISABLED_ERROR) {
|
|
|
|
headerText = t('swapContractDataDisabledErrorTitle');
|
|
|
|
descriptionText = t('swapContractDataDisabledErrorDescription');
|
|
|
|
submitText = t('tryAgain');
|
|
|
|
statusImage = <SwapFailureIcon />;
|
2020-10-06 20:28:38 +02:00
|
|
|
} else if (!errorKey && !swapComplete) {
|
2021-02-04 19:15:23 +01:00
|
|
|
headerText = t('swapProcessing');
|
|
|
|
statusImage = <PulseLoader />;
|
|
|
|
submitText = t('swapsViewInActivity');
|
2020-11-03 00:41:28 +01:00
|
|
|
descriptionText = t('swapOnceTransactionHasProcess', [
|
|
|
|
<span
|
|
|
|
key="swapOnceTransactionHasProcess-1"
|
|
|
|
className="awaiting-swap__amount-and-symbol"
|
|
|
|
>
|
2022-11-04 17:14:43 +01:00
|
|
|
{swapMetaData?.token_to}
|
2020-11-03 00:41:28 +01:00
|
|
|
</span>,
|
2021-02-04 19:15:23 +01:00
|
|
|
]);
|
2020-12-03 00:25:19 +01:00
|
|
|
content = blockExplorerUrl && (
|
2022-07-11 17:53:07 +02:00
|
|
|
<ViewOnBlockExplorer
|
2020-12-03 00:25:19 +01:00
|
|
|
blockExplorerUrl={blockExplorerUrl}
|
2022-07-11 17:53:07 +02:00
|
|
|
sensitiveTrackingProperties={sensitiveProperties}
|
2020-12-03 00:25:19 +01:00
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-10-06 20:28:38 +02:00
|
|
|
} else if (!errorKey && swapComplete) {
|
2021-02-04 19:15:23 +01:00
|
|
|
headerText = t('swapTransactionComplete');
|
|
|
|
statusImage = <SwapSuccessIcon />;
|
2021-05-21 17:14:56 +02:00
|
|
|
submitText = t('close');
|
2020-11-03 00:41:28 +01:00
|
|
|
descriptionText = t('swapTokenAvailable', [
|
|
|
|
<span
|
|
|
|
key="swapTokenAvailable-2"
|
|
|
|
className="awaiting-swap__amount-and-symbol"
|
|
|
|
>
|
2022-11-04 17:14:43 +01:00
|
|
|
{`${tokensReceived || ''} ${swapMetaData?.token_to}`}
|
2020-11-03 00:41:28 +01:00
|
|
|
</span>,
|
2021-02-04 19:15:23 +01:00
|
|
|
]);
|
2020-10-06 20:28:38 +02:00
|
|
|
content = blockExplorerUrl && (
|
2022-07-11 17:53:07 +02:00
|
|
|
<ViewOnBlockExplorer
|
2020-10-06 20:28:38 +02:00
|
|
|
blockExplorerUrl={blockExplorerUrl}
|
2022-07-11 17:53:07 +02:00
|
|
|
sensitiveTrackingProperties={sensitiveProperties}
|
2020-10-06 20:28:38 +02:00
|
|
|
/>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-10-06 20:28:38 +02:00
|
|
|
}
|
|
|
|
|
2021-09-15 15:13:18 +02:00
|
|
|
useEffect(() => {
|
|
|
|
if (errorKey) {
|
|
|
|
// If there was an error, stop polling for quotes.
|
|
|
|
dispatch(stopPollingForQuotes());
|
|
|
|
}
|
|
|
|
}, [dispatch, errorKey]);
|
|
|
|
|
2020-10-06 20:28:38 +02:00
|
|
|
return (
|
|
|
|
<div className="awaiting-swap">
|
|
|
|
<div className="awaiting-swap__content">
|
|
|
|
{!(swapComplete || errorKey) && (
|
|
|
|
<Mascot
|
|
|
|
animationEventEmitter={animationEventEmitter.current}
|
|
|
|
width="90"
|
|
|
|
height="90"
|
|
|
|
/>
|
|
|
|
)}
|
2020-11-03 00:41:28 +01:00
|
|
|
<div className="awaiting-swap__status-image">{statusImage}</div>
|
|
|
|
<div className="awaiting-swap__header">{headerText}</div>
|
2022-01-27 21:47:25 +01:00
|
|
|
<div className="awaiting-swap__main-description">{descriptionText}</div>
|
2020-10-06 20:28:38 +02:00
|
|
|
{content}
|
|
|
|
</div>
|
2022-07-11 17:53:07 +02:00
|
|
|
{!errorKey && swapComplete ? (
|
|
|
|
<CreateNewSwap sensitiveTrackingProperties={sensitiveProperties} />
|
|
|
|
) : null}
|
2020-10-06 20:28:38 +02:00
|
|
|
<SwapsFooter
|
|
|
|
onSubmit={async () => {
|
2022-10-04 18:55:05 +02:00
|
|
|
/* istanbul ignore next */
|
2020-10-06 20:28:38 +02:00
|
|
|
if (errorKey === OFFLINE_FOR_MAINTENANCE) {
|
2021-02-04 19:15:23 +01:00
|
|
|
await dispatch(prepareToLeaveSwaps());
|
|
|
|
history.push(DEFAULT_ROUTE);
|
2020-10-06 20:28:38 +02:00
|
|
|
} else if (errorKey === QUOTES_EXPIRED_ERROR) {
|
2021-02-04 19:15:23 +01:00
|
|
|
dispatch(prepareForRetryGetQuotes());
|
2020-11-03 00:41:28 +01:00
|
|
|
await dispatch(
|
|
|
|
fetchQuotesAndSetQuoteState(
|
|
|
|
history,
|
2021-12-01 17:25:09 +01:00
|
|
|
fromTokenInputValue,
|
2020-11-03 00:41:28 +01:00
|
|
|
maxSlippage,
|
2022-03-25 14:21:29 +01:00
|
|
|
trackEvent,
|
2020-11-03 00:41:28 +01:00
|
|
|
),
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-10-06 20:28:38 +02:00
|
|
|
} else if (errorKey) {
|
2021-02-04 19:15:23 +01:00
|
|
|
await dispatch(navigateBackToBuildQuote(history));
|
2021-03-18 11:20:06 +01:00
|
|
|
} else if (
|
2022-11-04 17:14:43 +01:00
|
|
|
isSwapsDefaultTokenSymbol(swapMetaData?.token_to, chainId) ||
|
2021-05-21 17:14:56 +02:00
|
|
|
swapComplete
|
2021-03-18 11:20:06 +01:00
|
|
|
) {
|
2021-02-04 19:15:23 +01:00
|
|
|
history.push(DEFAULT_ROUTE);
|
2020-10-06 20:28:38 +02:00
|
|
|
} else {
|
2022-08-17 17:37:01 +02:00
|
|
|
await dispatch(setDefaultHomeActiveTabName('Activity'));
|
|
|
|
history.push(DEFAULT_ROUTE);
|
2020-10-06 20:28:38 +02:00
|
|
|
}
|
|
|
|
}}
|
|
|
|
onCancel={async () => await dispatch(navigateBackToBuildQuote(history))}
|
|
|
|
submitText={submitText}
|
|
|
|
disabled={submittingSwap}
|
|
|
|
hideCancel={errorKey !== QUOTES_EXPIRED_ERROR}
|
|
|
|
/>
|
|
|
|
</div>
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2020-10-06 20:28:38 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
AwaitingSwap.propTypes = {
|
|
|
|
swapComplete: PropTypes.bool,
|
|
|
|
txHash: PropTypes.string,
|
|
|
|
tokensReceived: PropTypes.string,
|
|
|
|
errorKey: PropTypes.oneOf([
|
|
|
|
QUOTES_EXPIRED_ERROR,
|
|
|
|
SWAP_FAILED_ERROR,
|
|
|
|
ERROR_FETCHING_QUOTES,
|
|
|
|
QUOTES_NOT_AVAILABLE_ERROR,
|
|
|
|
OFFLINE_FOR_MAINTENANCE,
|
2021-05-13 21:49:00 +02:00
|
|
|
CONTRACT_DATA_DISABLED_ERROR,
|
2020-10-06 20:28:38 +02:00
|
|
|
]),
|
|
|
|
submittingSwap: PropTypes.bool,
|
2022-11-04 17:14:43 +01:00
|
|
|
txId: PropTypes.number,
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|