|
|
@ -105,6 +105,7 @@ SendTransactionScreen.prototype.render = function () { |
|
|
|
selectedToken, |
|
|
|
selectedToken, |
|
|
|
showCustomizeGasModal, |
|
|
|
showCustomizeGasModal, |
|
|
|
selectedAccount, |
|
|
|
selectedAccount, |
|
|
|
|
|
|
|
setSelectedAddress, |
|
|
|
primaryCurrency = 'ETH', |
|
|
|
primaryCurrency = 'ETH', |
|
|
|
gasLimit, |
|
|
|
gasLimit, |
|
|
|
gasPrice, |
|
|
|
gasPrice, |
|
|
@ -150,7 +151,7 @@ SendTransactionScreen.prototype.render = function () { |
|
|
|
dropdownOpen, |
|
|
|
dropdownOpen, |
|
|
|
accounts, |
|
|
|
accounts, |
|
|
|
selectedAccount, |
|
|
|
selectedAccount, |
|
|
|
setFromField: () => console.log('Set From Field'), |
|
|
|
onSelect: address => setSelectedAddress(address), |
|
|
|
openDropdown: () => this.setState({ dropdownOpen: true }), |
|
|
|
openDropdown: () => this.setState({ dropdownOpen: true }), |
|
|
|
closeDropdown: () => this.setState({ dropdownOpen: false }), |
|
|
|
closeDropdown: () => this.setState({ dropdownOpen: false }), |
|
|
|
conversionRate, |
|
|
|
conversionRate, |
|
|
@ -235,9 +236,43 @@ SendTransactionScreen.prototype.render = function () { |
|
|
|
// Buttons underneath card
|
|
|
|
// Buttons underneath card
|
|
|
|
h('div.send-v2__footer', [ |
|
|
|
h('div.send-v2__footer', [ |
|
|
|
h('button.send-v2__cancel-btn', {}, 'Cancel'), |
|
|
|
h('button.send-v2__cancel-btn', {}, 'Cancel'), |
|
|
|
h('button.send-v2__next-btn', {}, 'Next'), |
|
|
|
h('button.send-v2__next-btn', { |
|
|
|
|
|
|
|
onClick: event => this.onSubmit(event), |
|
|
|
|
|
|
|
}, 'Next'), |
|
|
|
]), |
|
|
|
]), |
|
|
|
]) |
|
|
|
]) |
|
|
|
|
|
|
|
|
|
|
|
) |
|
|
|
) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SendTransactionScreen.prototype.onSubmit = function (event) { |
|
|
|
|
|
|
|
event.preventDefault() |
|
|
|
|
|
|
|
const { |
|
|
|
|
|
|
|
to, |
|
|
|
|
|
|
|
amount, |
|
|
|
|
|
|
|
} = this.state |
|
|
|
|
|
|
|
const { |
|
|
|
|
|
|
|
gasLimit: gas, |
|
|
|
|
|
|
|
gasPrice, |
|
|
|
|
|
|
|
signTokenTx, |
|
|
|
|
|
|
|
signTx, |
|
|
|
|
|
|
|
selectedToken, |
|
|
|
|
|
|
|
selectedAccount: { address: from }, |
|
|
|
|
|
|
|
} = this.props |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const txParams = { |
|
|
|
|
|
|
|
from, |
|
|
|
|
|
|
|
value: '0', |
|
|
|
|
|
|
|
gas, |
|
|
|
|
|
|
|
gasPrice, |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!selectedToken) { |
|
|
|
|
|
|
|
txParams.value = amount |
|
|
|
|
|
|
|
txParams.to = to |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
selectedToken |
|
|
|
|
|
|
|
? signTokenTx(selectedToken.address, to, amount, txParams) |
|
|
|
|
|
|
|
: signTx(txParams) |
|
|
|
|
|
|
|
} |
|
|
|