2018-06-23 08:52:45 +02:00
|
|
|
import { connect } from 'react-redux'
|
|
|
|
import ConfirmTransactionSwitch from './confirm-transaction-switch.component'
|
2019-03-29 17:05:23 +01:00
|
|
|
import {
|
|
|
|
TOKEN_METHOD_TRANSFER,
|
|
|
|
TOKEN_METHOD_APPROVE,
|
|
|
|
TOKEN_METHOD_TRANSFER_FROM,
|
|
|
|
} from '../../helpers/constants/transactions'
|
2018-06-23 08:52:45 +02:00
|
|
|
|
|
|
|
const mapStateToProps = state => {
|
2018-07-06 20:58:41 +02:00
|
|
|
const {
|
|
|
|
confirmTransaction: {
|
|
|
|
txData,
|
|
|
|
methodData,
|
2018-08-17 23:34:14 +02:00
|
|
|
fetchingData,
|
|
|
|
toSmartContract,
|
2018-07-06 20:58:41 +02:00
|
|
|
},
|
|
|
|
} = state
|
2018-06-25 21:06:57 +02:00
|
|
|
|
2018-06-23 08:52:45 +02:00
|
|
|
return {
|
2018-07-06 20:58:41 +02:00
|
|
|
txData,
|
|
|
|
methodData,
|
2018-08-17 23:34:14 +02:00
|
|
|
fetchingData,
|
|
|
|
isEtherTransaction: !toSmartContract,
|
2019-03-29 17:05:23 +01:00
|
|
|
isTokenMethod: [TOKEN_METHOD_APPROVE, TOKEN_METHOD_TRANSFER, TOKEN_METHOD_TRANSFER_FROM].includes(methodData.name)
|
2018-06-23 08:52:45 +02:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
export default connect(mapStateToProps)(ConfirmTransactionSwitch)
|