|
|
@ -321,18 +321,25 @@ SendTransactionScreen.prototype.setAmountToMax = function () { |
|
|
|
updateGasPrice, |
|
|
|
updateGasPrice, |
|
|
|
updateGasLimit, |
|
|
|
updateGasLimit, |
|
|
|
updateGasTotal, |
|
|
|
updateGasTotal, |
|
|
|
|
|
|
|
tokenBalance, |
|
|
|
|
|
|
|
selectedToken, |
|
|
|
} = this.props |
|
|
|
} = this.props |
|
|
|
|
|
|
|
const { decimals } = selectedToken || {} |
|
|
|
|
|
|
|
const multiplier = Math.pow(10, Number(decimals || 0)) |
|
|
|
|
|
|
|
|
|
|
|
const maxAmount = subtractCurrencies( |
|
|
|
const maxAmount = selectedToken |
|
|
|
ethUtil.addHexPrefix(balance), |
|
|
|
? multiplyCurrencies(tokenBalance, multiplier, {toNumericBase: 'hex'}) |
|
|
|
ethUtil.addHexPrefix(MIN_GAS_TOTAL), |
|
|
|
: subtractCurrencies( |
|
|
|
{ toNumericBase: 'hex' } |
|
|
|
ethUtil.addHexPrefix(balance), |
|
|
|
) |
|
|
|
ethUtil.addHexPrefix(gasTotal), |
|
|
|
|
|
|
|
{ toNumericBase: 'hex' } |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
updateSendErrors({ amount: null }) |
|
|
|
updateSendErrors({ amount: null }) |
|
|
|
updateGasPrice(MIN_GAS_PRICE_HEX) |
|
|
|
updateGasPrice(MIN_GAS_PRICE_HEX) |
|
|
|
updateGasLimit(MIN_GAS_LIMIT_HEX) |
|
|
|
updateGasLimit(MIN_GAS_LIMIT_HEX) |
|
|
|
updateGasTotal(MIN_GAS_TOTAL) |
|
|
|
updateGasTotal(MIN_GAS_TOTAL) |
|
|
|
|
|
|
|
|
|
|
|
updateSendAmount(maxAmount) |
|
|
|
updateSendAmount(maxAmount) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|