aboutsummaryrefslogtreecommitdiffstats
path: root/ui/app/components/send/send-footer/send-footer.container.js
diff options
context:
space:
mode:
Diffstat (limited to 'ui/app/components/send/send-footer/send-footer.container.js')
-rw-r--r--ui/app/components/send/send-footer/send-footer.container.js107
1 files changed, 0 insertions, 107 deletions
diff --git a/ui/app/components/send/send-footer/send-footer.container.js b/ui/app/components/send/send-footer/send-footer.container.js
deleted file mode 100644
index 0c6120cc5..000000000
--- a/ui/app/components/send/send-footer/send-footer.container.js
+++ /dev/null
@@ -1,107 +0,0 @@
-import { connect } from 'react-redux'
-import ethUtil from 'ethereumjs-util'
-import {
- addToAddressBook,
- clearSend,
- signTokenTx,
- signTx,
- updateTransaction,
-} from '../../../actions'
-import SendFooter from './send-footer.component'
-import {
- getGasLimit,
- getGasPrice,
- getGasTotal,
- getSelectedToken,
- getSendAmount,
- getSendEditingTransactionId,
- getSendFromObject,
- getSendTo,
- getSendToAccounts,
- getSendHexData,
- getTokenBalance,
- getUnapprovedTxs,
- getSendErrors,
-} from '../send.selectors'
-import {
- isSendFormInError,
-} from './send-footer.selectors'
-import {
- addressIsNew,
- constructTxParams,
- constructUpdatedTx,
-} from './send-footer.utils'
-
-export default connect(mapStateToProps, mapDispatchToProps)(SendFooter)
-
-function mapStateToProps (state) {
- return {
- amount: getSendAmount(state),
- data: getSendHexData(state),
- editingTransactionId: getSendEditingTransactionId(state),
- from: getSendFromObject(state),
- gasLimit: getGasLimit(state),
- gasPrice: getGasPrice(state),
- gasTotal: getGasTotal(state),
- inError: isSendFormInError(state),
- selectedToken: getSelectedToken(state),
- to: getSendTo(state),
- toAccounts: getSendToAccounts(state),
- tokenBalance: getTokenBalance(state),
- unapprovedTxs: getUnapprovedTxs(state),
- sendErrors: getSendErrors(state),
- }
-}
-
-function mapDispatchToProps (dispatch) {
- return {
- clearSend: () => dispatch(clearSend()),
- sign: ({ selectedToken, to, amount, from, gas, gasPrice, data }) => {
- const txParams = constructTxParams({
- amount,
- data,
- from,
- gas,
- gasPrice,
- selectedToken,
- to,
- })
-
- selectedToken
- ? dispatch(signTokenTx(selectedToken.address, to, amount, txParams))
- : dispatch(signTx(txParams))
- },
- update: ({
- amount,
- data,
- editingTransactionId,
- from,
- gas,
- gasPrice,
- selectedToken,
- to,
- unapprovedTxs,
- }) => {
- const editingTx = constructUpdatedTx({
- amount,
- data,
- editingTransactionId,
- from,
- gas,
- gasPrice,
- selectedToken,
- to,
- unapprovedTxs,
- })
-
- return dispatch(updateTransaction(editingTx))
- },
- addToAddressBookIfNew: (newAddress, toAccounts, nickname = '') => {
- const hexPrefixedAddress = ethUtil.addHexPrefix(newAddress)
- if (addressIsNew(toAccounts)) {
- // TODO: nickname, i.e. addToAddressBook(recipient, nickname)
- dispatch(addToAddressBook(hexPrefixedAddress, nickname))
- }
- },
- }
-}