2021-02-04 19:15:23 +01:00
|
|
|
import { connect } from 'react-redux';
|
|
|
|
import { compose } from 'redux';
|
|
|
|
import { withRouter } from 'react-router-dom';
|
2022-08-10 03:26:25 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
import { clearConfirmTransaction } from '../../ducks/confirm-transaction/confirm-transaction.duck';
|
2019-07-03 22:33:44 +02:00
|
|
|
|
2019-09-27 06:30:36 +02:00
|
|
|
import {
|
|
|
|
updateCustomNonce,
|
|
|
|
cancelTx,
|
|
|
|
cancelTxs,
|
|
|
|
updateAndApproveTx,
|
|
|
|
showModal,
|
|
|
|
getNextNonce,
|
2019-11-01 18:54:00 +01:00
|
|
|
tryReverseResolveAddress,
|
2021-05-03 19:51:09 +02:00
|
|
|
setDefaultHomeActiveTabName,
|
2023-02-09 18:45:52 +01:00
|
|
|
addToAddressBook,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../store/actions';
|
2022-09-16 21:05:21 +02:00
|
|
|
import { isBalanceSufficient } from '../send/send.utils';
|
2022-03-07 19:54:36 +01:00
|
|
|
import { shortenAddress, valuesFor } from '../../helpers/utils/util';
|
2020-05-02 21:41:17 +02:00
|
|
|
import {
|
|
|
|
getAdvancedInlineGasShown,
|
|
|
|
getCustomNonceValue,
|
|
|
|
getIsMainnet,
|
|
|
|
getKnownMethodData,
|
|
|
|
getMetaMaskAccounts,
|
|
|
|
getUseNonceField,
|
|
|
|
transactionFeeSelector,
|
2021-04-28 20:02:01 +02:00
|
|
|
getNoGasPriceFetched,
|
|
|
|
getIsEthGasPriceFetched,
|
2021-06-24 01:28:49 +02:00
|
|
|
getShouldShowFiat,
|
2021-08-03 00:52:18 +02:00
|
|
|
checkNetworkAndAccountSupports1559,
|
2021-08-06 03:07:04 +02:00
|
|
|
getPreferences,
|
2021-10-21 21:17:03 +02:00
|
|
|
doesAddressRequireLedgerHidConnection,
|
2021-09-09 22:56:27 +02:00
|
|
|
getTokenList,
|
2021-11-11 17:46:45 +01:00
|
|
|
getIsMultiLayerFeeNetwork,
|
2022-03-25 15:02:08 +01:00
|
|
|
getIsBuyableChain,
|
2022-06-13 18:18:33 +02:00
|
|
|
getEnsResolutionByAddress,
|
2022-10-28 10:37:33 +02:00
|
|
|
getUnapprovedTransaction,
|
|
|
|
getFullTxData,
|
2023-01-17 16:23:04 +01:00
|
|
|
getUseCurrencyRateCheck,
|
2021-02-04 19:15:23 +01:00
|
|
|
} from '../../selectors';
|
|
|
|
import { getMostRecentOverviewPage } from '../../ducks/history/history';
|
2021-08-17 22:08:13 +02:00
|
|
|
import {
|
2021-10-21 21:17:03 +02:00
|
|
|
isAddressLedger,
|
2022-03-25 18:11:04 +01:00
|
|
|
updateGasFees,
|
2021-08-06 01:59:58 +02:00
|
|
|
getIsGasEstimatesLoading,
|
2021-09-15 23:54:51 +02:00
|
|
|
getNativeCurrency,
|
2023-02-09 18:45:52 +01:00
|
|
|
getSendToAccounts,
|
2021-08-06 01:59:58 +02:00
|
|
|
} from '../../ducks/metamask/metamask';
|
2023-02-09 18:45:52 +01:00
|
|
|
import { addHexPrefix } from '../../../app/scripts/lib/util';
|
2021-10-21 21:17:03 +02:00
|
|
|
|
|
|
|
import {
|
2022-03-17 19:35:40 +01:00
|
|
|
parseStandardTokenTransactionData,
|
2021-10-21 21:17:03 +02:00
|
|
|
transactionMatchesNetwork,
|
|
|
|
txParamsAreDappSuggested,
|
|
|
|
} from '../../../shared/modules/transaction.utils';
|
|
|
|
import { toChecksumHexAddress } from '../../../shared/modules/hexstring-utils';
|
|
|
|
|
2021-08-06 01:59:58 +02:00
|
|
|
import { getGasLoadingAnimationIsShowing } from '../../ducks/app/app';
|
2021-10-06 20:29:57 +02:00
|
|
|
import { isLegacyTransaction } from '../../helpers/utils/transactions.util';
|
2021-11-06 01:59:23 +01:00
|
|
|
import { CUSTOM_GAS_ESTIMATE } from '../../../shared/constants/gas';
|
2022-11-04 17:14:43 +01:00
|
|
|
import {
|
2023-01-18 15:47:29 +01:00
|
|
|
TransactionStatus,
|
|
|
|
TransactionType,
|
2022-11-04 17:14:43 +01:00
|
|
|
} from '../../../shared/constants/transaction';
|
2022-03-07 19:54:36 +01:00
|
|
|
import { isEqualCaseInsensitive } from '../../../shared/modules/string-utils';
|
2022-03-17 19:35:40 +01:00
|
|
|
import { getTokenAddressParam } from '../../helpers/utils/token-util';
|
2022-09-16 21:05:21 +02:00
|
|
|
import { calcGasTotal } from '../../../shared/lib/transactions-controller-utils';
|
2021-02-04 19:15:23 +01:00
|
|
|
import ConfirmTransactionBase from './confirm-transaction-base.component';
|
2018-07-20 23:18:50 +02:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
let customNonceValue = '';
|
2020-11-03 00:41:28 +01:00
|
|
|
const customNonceMerge = (txData) =>
|
|
|
|
customNonceValue
|
|
|
|
? {
|
|
|
|
...txData,
|
|
|
|
customNonceValue,
|
|
|
|
}
|
2021-02-04 19:15:23 +01:00
|
|
|
: txData;
|
2019-09-27 06:30:36 +02:00
|
|
|
|
2023-02-09 18:45:52 +01:00
|
|
|
function addressIsNew(toAccounts, newAddress) {
|
|
|
|
const newAddressNormalized = newAddress.toLowerCase();
|
|
|
|
const foundMatching = toAccounts.some(
|
|
|
|
({ address }) => address.toLowerCase() === newAddressNormalized,
|
|
|
|
);
|
|
|
|
return !foundMatching;
|
|
|
|
}
|
|
|
|
|
2019-06-18 14:17:14 +02:00
|
|
|
const mapStateToProps = (state, ownProps) => {
|
2020-11-03 00:41:28 +01:00
|
|
|
const {
|
|
|
|
toAddress: propsToAddress,
|
|
|
|
customTxParamsData,
|
|
|
|
match: { params = {} },
|
2021-02-04 19:15:23 +01:00
|
|
|
} = ownProps;
|
|
|
|
const { id: paramsTransactionId } = params;
|
|
|
|
const isMainnet = getIsMainnet(state);
|
2021-08-06 01:59:58 +02:00
|
|
|
|
|
|
|
const isGasEstimatesLoading = getIsGasEstimatesLoading(state);
|
|
|
|
const gasLoadingAnimationIsShowing = getGasLoadingAnimationIsShowing(state);
|
2022-03-25 15:02:08 +01:00
|
|
|
const isBuyableChain = getIsBuyableChain(state);
|
2021-02-04 19:15:23 +01:00
|
|
|
const { confirmTransaction, metamask } = state;
|
2019-07-03 22:33:44 +02:00
|
|
|
const {
|
|
|
|
conversionRate,
|
|
|
|
identities,
|
2019-08-08 20:45:30 +02:00
|
|
|
addressBook,
|
2019-07-03 22:33:44 +02:00
|
|
|
network,
|
|
|
|
unapprovedTxs,
|
2019-09-27 06:30:36 +02:00
|
|
|
nextNonce,
|
2022-11-15 19:49:42 +01:00
|
|
|
allNftContracts,
|
2022-01-10 17:23:53 +01:00
|
|
|
selectedAddress,
|
2021-03-01 16:15:42 +01:00
|
|
|
provider: { chainId },
|
2021-02-04 19:15:23 +01:00
|
|
|
} = metamask;
|
|
|
|
const { tokenData, txData, tokenProps, nonce } = confirmTransaction;
|
2021-06-29 18:02:00 +02:00
|
|
|
const { txParams = {}, id: transactionId, type } = txData;
|
2022-10-28 10:37:33 +02:00
|
|
|
const txId = transactionId || Number(paramsTransactionId);
|
|
|
|
const transaction = getUnapprovedTransaction(state, txId);
|
2019-02-06 01:24:28 +01:00
|
|
|
const {
|
|
|
|
from: fromAddress,
|
|
|
|
to: txParamsToAddress,
|
|
|
|
gasPrice,
|
|
|
|
gas: gasLimit,
|
|
|
|
value: amount,
|
2019-06-18 14:17:14 +02:00
|
|
|
data,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = (transaction && transaction.txParams) || txParams;
|
|
|
|
const accounts = getMetaMaskAccounts(state);
|
2018-09-13 10:47:05 +02:00
|
|
|
|
2022-03-17 19:35:40 +01:00
|
|
|
const transactionData = parseStandardTokenTransactionData(data);
|
|
|
|
const tokenToAddress = getTokenAddressParam(transactionData);
|
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
const { balance } = accounts[fromAddress];
|
|
|
|
const { name: fromName } = identities[fromAddress];
|
2022-07-12 19:20:20 +02:00
|
|
|
let toAddress = txParamsToAddress;
|
2023-01-18 15:47:29 +01:00
|
|
|
if (type !== TransactionType.simpleSend) {
|
2022-07-12 19:20:20 +02:00
|
|
|
toAddress = propsToAddress || tokenToAddress || txParamsToAddress;
|
|
|
|
}
|
2020-08-13 22:00:09 +02:00
|
|
|
|
2023-02-09 18:45:52 +01:00
|
|
|
const toAccounts = getSendToAccounts(state);
|
|
|
|
|
2021-09-09 22:56:27 +02:00
|
|
|
const tokenList = getTokenList(state);
|
2022-08-10 03:26:25 +02:00
|
|
|
|
2020-11-03 00:41:28 +01:00
|
|
|
const toName =
|
|
|
|
identities[toAddress]?.name ||
|
2022-08-10 03:26:25 +02:00
|
|
|
tokenList[toAddress?.toLowerCase()]?.name ||
|
2021-05-17 23:19:39 +02:00
|
|
|
shortenAddress(toChecksumHexAddress(toAddress));
|
2018-07-20 23:18:50 +02:00
|
|
|
|
2021-05-17 23:19:39 +02:00
|
|
|
const checksummedAddress = toChecksumHexAddress(toAddress);
|
2021-12-01 18:22:08 +01:00
|
|
|
const addressBookObject =
|
|
|
|
addressBook &&
|
|
|
|
addressBook[chainId] &&
|
|
|
|
addressBook[chainId][checksummedAddress];
|
2022-06-13 18:18:33 +02:00
|
|
|
const toEns = getEnsResolutionByAddress(state, checksummedAddress);
|
2021-02-04 19:15:23 +01:00
|
|
|
const toNickname = addressBookObject ? addressBookObject.name : '';
|
|
|
|
const transactionStatus = transaction ? transaction.status : '';
|
2021-10-06 20:29:57 +02:00
|
|
|
const supportsEIP1559 =
|
|
|
|
checkNetworkAndAccountSupports1559(state) && !isLegacyTransaction(txParams);
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2019-07-03 22:33:44 +02:00
|
|
|
const {
|
|
|
|
hexTransactionAmount,
|
2021-07-31 02:45:18 +02:00
|
|
|
hexMinimumTransactionFee,
|
|
|
|
hexMaximumTransactionFee,
|
2019-07-03 22:33:44 +02:00
|
|
|
hexTransactionTotal,
|
2021-08-06 21:31:30 +02:00
|
|
|
gasEstimationObject,
|
2021-02-04 19:15:23 +01:00
|
|
|
} = transactionFeeSelector(state, transaction);
|
2019-07-03 22:33:44 +02:00
|
|
|
|
2020-01-10 15:34:02 +01:00
|
|
|
const currentNetworkUnapprovedTxs = Object.keys(unapprovedTxs)
|
2021-03-01 16:15:42 +01:00
|
|
|
.filter((key) =>
|
|
|
|
transactionMatchesNetwork(unapprovedTxs[key], chainId, network),
|
|
|
|
)
|
2021-02-04 19:15:23 +01:00
|
|
|
.reduce((acc, key) => ({ ...acc, [key]: unapprovedTxs[key] }), {});
|
|
|
|
const unapprovedTxCount = valuesFor(currentNetworkUnapprovedTxs).length;
|
2018-09-20 02:48:28 +02:00
|
|
|
|
2019-02-06 01:24:28 +01:00
|
|
|
const insufficientBalance = !isBalanceSufficient({
|
|
|
|
amount,
|
|
|
|
gasTotal: calcGasTotal(gasLimit, gasPrice),
|
|
|
|
balance,
|
|
|
|
conversionRate,
|
2021-02-04 19:15:23 +01:00
|
|
|
});
|
2019-02-06 01:24:28 +01:00
|
|
|
|
2021-02-04 19:15:23 +01:00
|
|
|
const methodData = getKnownMethodData(state, data) || {};
|
2019-06-18 14:17:14 +02:00
|
|
|
|
2022-11-04 17:14:43 +01:00
|
|
|
const fullTxData = getFullTxData(
|
|
|
|
state,
|
|
|
|
txId,
|
2023-01-18 15:47:29 +01:00
|
|
|
TransactionStatus.unapproved,
|
2022-11-04 17:14:43 +01:00
|
|
|
customTxParamsData,
|
|
|
|
);
|
2022-01-10 17:23:53 +01:00
|
|
|
|
2023-02-16 20:23:29 +01:00
|
|
|
const isNftTransfer = Boolean(
|
2022-11-15 19:49:42 +01:00
|
|
|
allNftContracts?.[selectedAddress]?.[chainId]?.find((contract) => {
|
2022-01-10 17:23:53 +01:00
|
|
|
return isEqualCaseInsensitive(contract.address, fullTxData.txParams.to);
|
|
|
|
}),
|
|
|
|
);
|
|
|
|
|
2021-04-17 00:00:18 +02:00
|
|
|
customNonceValue = getCustomNonceValue(state);
|
2021-04-28 20:02:01 +02:00
|
|
|
const isEthGasPrice = getIsEthGasPriceFetched(state);
|
2021-10-06 20:29:57 +02:00
|
|
|
const noGasPrice = !supportsEIP1559 && getNoGasPriceFetched(state);
|
2021-08-06 03:07:04 +02:00
|
|
|
const { useNativeCurrencyAsPrimaryCurrency } = getPreferences(state);
|
2021-08-17 22:08:13 +02:00
|
|
|
const gasFeeIsCustom =
|
2021-11-06 01:59:23 +01:00
|
|
|
fullTxData.userFeeLevel === CUSTOM_GAS_ESTIMATE ||
|
2021-08-17 22:08:13 +02:00
|
|
|
txParamsAreDappSuggested(fullTxData);
|
2021-10-21 21:17:03 +02:00
|
|
|
const fromAddressIsLedger = isAddressLedger(state, fromAddress);
|
2021-09-15 23:54:51 +02:00
|
|
|
const nativeCurrency = getNativeCurrency(state);
|
2021-08-06 21:31:30 +02:00
|
|
|
|
2022-07-31 20:26:40 +02:00
|
|
|
const hardwareWalletRequiresConnection =
|
|
|
|
doesAddressRequireLedgerHidConnection(state, fromAddress);
|
2021-10-21 21:17:03 +02:00
|
|
|
|
2021-11-11 17:46:45 +01:00
|
|
|
const isMultiLayerFeeNetwork = getIsMultiLayerFeeNetwork(state);
|
|
|
|
|
2018-06-23 08:52:45 +02:00
|
|
|
return {
|
|
|
|
balance,
|
|
|
|
fromAddress,
|
|
|
|
fromName,
|
2023-02-09 18:45:52 +01:00
|
|
|
toAccounts,
|
2018-06-23 08:52:45 +02:00
|
|
|
toAddress,
|
2019-11-01 18:54:00 +01:00
|
|
|
toEns,
|
2018-06-23 08:52:45 +02:00
|
|
|
toName,
|
2019-08-08 20:45:30 +02:00
|
|
|
toNickname,
|
2018-10-17 01:03:29 +02:00
|
|
|
hexTransactionAmount,
|
2021-07-31 02:45:18 +02:00
|
|
|
hexMinimumTransactionFee,
|
|
|
|
hexMaximumTransactionFee,
|
2018-10-17 01:03:29 +02:00
|
|
|
hexTransactionTotal,
|
2019-11-05 16:13:48 +01:00
|
|
|
txData: fullTxData,
|
2018-06-23 08:52:45 +02:00
|
|
|
tokenData,
|
2018-06-28 20:23:31 +02:00
|
|
|
methodData,
|
2018-06-23 08:52:45 +02:00
|
|
|
tokenProps,
|
|
|
|
conversionRate,
|
|
|
|
transactionStatus,
|
|
|
|
nonce,
|
2018-09-20 02:48:28 +02:00
|
|
|
unapprovedTxs,
|
|
|
|
unapprovedTxCount,
|
2018-09-13 10:47:05 +02:00
|
|
|
customGas: {
|
2019-07-03 22:33:44 +02:00
|
|
|
gasLimit,
|
|
|
|
gasPrice,
|
2018-09-13 10:47:05 +02:00
|
|
|
},
|
2019-02-06 01:24:28 +01:00
|
|
|
advancedInlineGasShown: getAdvancedInlineGasShown(state),
|
2019-09-27 06:30:36 +02:00
|
|
|
useNonceField: getUseNonceField(state),
|
2021-04-17 00:00:18 +02:00
|
|
|
customNonceValue,
|
2019-02-06 01:24:28 +01:00
|
|
|
insufficientBalance,
|
2023-02-16 20:23:29 +01:00
|
|
|
hideSubtitle: !getShouldShowFiat(state) && !isNftTransfer,
|
2021-06-24 01:28:49 +02:00
|
|
|
hideFiatConversion: !getShouldShowFiat(state),
|
2021-03-10 21:16:44 +01:00
|
|
|
type,
|
2019-09-27 06:30:36 +02:00
|
|
|
nextNonce,
|
2020-06-01 19:54:32 +02:00
|
|
|
mostRecentOverviewPage: getMostRecentOverviewPage(state),
|
2020-08-19 16:03:15 +02:00
|
|
|
isMainnet,
|
2021-04-28 20:02:01 +02:00
|
|
|
isEthGasPrice,
|
|
|
|
noGasPrice,
|
2021-10-06 20:29:57 +02:00
|
|
|
supportsEIP1559,
|
2021-08-06 01:59:58 +02:00
|
|
|
gasIsLoading: isGasEstimatesLoading || gasLoadingAnimationIsShowing,
|
2021-08-06 03:07:04 +02:00
|
|
|
useNativeCurrencyAsPrimaryCurrency,
|
2021-08-06 21:31:30 +02:00
|
|
|
maxFeePerGas: gasEstimationObject.maxFeePerGas,
|
|
|
|
maxPriorityFeePerGas: gasEstimationObject.maxPriorityFeePerGas,
|
2021-08-07 00:18:53 +02:00
|
|
|
baseFeePerGas: gasEstimationObject.baseFeePerGas,
|
2021-08-17 00:45:55 +02:00
|
|
|
gasFeeIsCustom,
|
2021-10-21 21:17:03 +02:00
|
|
|
showLedgerSteps: fromAddressIsLedger,
|
2021-09-15 23:54:51 +02:00
|
|
|
nativeCurrency,
|
2021-10-21 21:17:03 +02:00
|
|
|
hardwareWalletRequiresConnection,
|
2021-11-11 17:46:45 +01:00
|
|
|
isMultiLayerFeeNetwork,
|
2021-12-01 18:22:08 +01:00
|
|
|
chainId,
|
2022-03-25 15:02:08 +01:00
|
|
|
isBuyableChain,
|
2023-01-17 16:23:04 +01:00
|
|
|
useCurrencyRateCheck: getUseCurrencyRateCheck(state),
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2020-02-15 21:34:12 +01:00
|
|
|
export const mapDispatchToProps = (dispatch) => {
|
2018-06-23 08:52:45 +02:00
|
|
|
return {
|
2019-11-01 18:54:00 +01:00
|
|
|
tryReverseResolveAddress: (address) => {
|
2021-02-04 19:15:23 +01:00
|
|
|
return dispatch(tryReverseResolveAddress(address));
|
2019-11-01 18:54:00 +01:00
|
|
|
},
|
2020-02-15 21:34:12 +01:00
|
|
|
updateCustomNonce: (value) => {
|
2021-02-04 19:15:23 +01:00
|
|
|
customNonceValue = value;
|
|
|
|
dispatch(updateCustomNonce(value));
|
2019-09-27 06:30:36 +02:00
|
|
|
},
|
2018-06-23 08:52:45 +02:00
|
|
|
clearConfirmTransaction: () => dispatch(clearConfirmTransaction()),
|
2018-09-17 19:34:29 +02:00
|
|
|
showTransactionConfirmedModal: ({ onSubmit }) => {
|
2021-02-04 19:15:23 +01:00
|
|
|
return dispatch(showModal({ name: 'TRANSACTION_CONFIRMED', onSubmit }));
|
2018-06-23 08:52:45 +02:00
|
|
|
},
|
2020-11-03 00:41:28 +01:00
|
|
|
showRejectTransactionsConfirmationModal: ({
|
|
|
|
onSubmit,
|
|
|
|
unapprovedTxCount,
|
|
|
|
}) => {
|
|
|
|
return dispatch(
|
|
|
|
showModal({ name: 'REJECT_TRANSACTIONS', onSubmit, unapprovedTxCount }),
|
2021-02-04 19:15:23 +01:00
|
|
|
);
|
2018-09-24 07:07:19 +02:00
|
|
|
},
|
2018-06-23 08:52:45 +02:00
|
|
|
cancelTransaction: ({ id }) => dispatch(cancelTx({ id })),
|
2018-09-20 02:48:28 +02:00
|
|
|
cancelAllTransactions: (txList) => dispatch(cancelTxs(txList)),
|
2020-11-03 00:41:28 +01:00
|
|
|
sendTransaction: (txData) =>
|
|
|
|
dispatch(updateAndApproveTx(customNonceMerge(txData))),
|
2019-09-27 06:30:36 +02:00
|
|
|
getNextNonce: () => dispatch(getNextNonce()),
|
2021-05-03 19:51:09 +02:00
|
|
|
setDefaultHomeActiveTabName: (tabName) =>
|
|
|
|
dispatch(setDefaultHomeActiveTabName(tabName)),
|
2021-07-08 22:23:00 +02:00
|
|
|
updateTransactionGasFees: (gasFees) => {
|
2022-03-25 18:11:04 +01:00
|
|
|
dispatch(updateGasFees({ ...gasFees, expectHexWei: true }));
|
2021-07-08 22:23:00 +02:00
|
|
|
},
|
2023-02-09 18:45:52 +01:00
|
|
|
showBuyModal: () => dispatch(showModal({ name: 'DEPOSIT_ETHER' })),
|
|
|
|
addToAddressBookIfNew: (newAddress, toAccounts, nickname = '') => {
|
|
|
|
const hexPrefixedAddress = addHexPrefix(newAddress);
|
|
|
|
if (addressIsNew(toAccounts, hexPrefixedAddress)) {
|
|
|
|
dispatch(addToAddressBook(hexPrefixedAddress, nickname));
|
|
|
|
}
|
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2018-06-23 08:52:45 +02:00
|
|
|
|
2018-07-06 20:58:41 +02:00
|
|
|
const mergeProps = (stateProps, dispatchProps, ownProps) => {
|
2021-08-02 16:07:15 +02:00
|
|
|
const { txData, unapprovedTxs } = stateProps;
|
2021-04-28 20:02:01 +02:00
|
|
|
|
2018-07-06 20:58:41 +02:00
|
|
|
const {
|
2018-09-20 02:48:28 +02:00
|
|
|
cancelAllTransactions: dispatchCancelAllTransactions,
|
2021-07-08 22:23:00 +02:00
|
|
|
updateTransactionGasFees: dispatchUpdateTransactionGasFees,
|
2018-07-06 20:58:41 +02:00
|
|
|
...otherDispatchProps
|
2021-02-04 19:15:23 +01:00
|
|
|
} = dispatchProps;
|
2018-07-06 20:58:41 +02:00
|
|
|
|
|
|
|
return {
|
|
|
|
...stateProps,
|
|
|
|
...otherDispatchProps,
|
|
|
|
...ownProps,
|
2020-11-03 00:41:28 +01:00
|
|
|
cancelAllTransactions: () =>
|
|
|
|
dispatchCancelAllTransactions(valuesFor(unapprovedTxs)),
|
2019-07-03 22:33:44 +02:00
|
|
|
updateGasAndCalculate: ({ gasLimit, gasPrice }) => {
|
2021-07-08 22:23:00 +02:00
|
|
|
dispatchUpdateTransactionGasFees({
|
|
|
|
gasLimit,
|
|
|
|
gasPrice,
|
|
|
|
transaction: txData,
|
|
|
|
});
|
2019-07-03 22:33:44 +02:00
|
|
|
},
|
2021-02-04 19:15:23 +01:00
|
|
|
};
|
|
|
|
};
|
2018-07-06 20:58:41 +02:00
|
|
|
|
2018-06-23 08:52:45 +02:00
|
|
|
export default compose(
|
|
|
|
withRouter,
|
2020-07-14 17:20:41 +02:00
|
|
|
connect(mapStateToProps, mapDispatchToProps, mergeProps),
|
2021-02-04 19:15:23 +01:00
|
|
|
)(ConfirmTransactionBase);
|