diff --git a/react/src/components/dashboard/sendCoin/sendCoin.js b/react/src/components/dashboard/sendCoin/sendCoin.js index 84d3eb8..b0d611c 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.js @@ -56,6 +56,25 @@ class SendCoin extends React.Component { this.isTransparentTx = this.isTransparentTx.bind(this); this.toggleSubtractFee = this.toggleSubtractFee.bind(this); this.isFullySynced = this.isFullySynced.bind(this); + this.setSendAmountAll = this.setSendAmountAll.bind(this); + this.setSendToSelf = this.setSendToSelf.bind(this); + } + + setSendAmountAll() { + const _amount = this.state.amount; + const _amountSats = this.state.amount * 100000000; + const _balanceSats = this.props.ActiveCoin.balance.balanceSats; + const _fees = mainWindow.spvFees; + + this.setState({ + amount: Number((0.00000001 * (_balanceSats - _fees[this.props.ActiveCoin.coin])).toFixed(8)), + }); + } + + setSendToSelf() { + this.setState({ + sendTo: this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub, + }); } copyTXID(txid) { diff --git a/react/src/components/dashboard/sendCoin/sendCoin.render.js b/react/src/components/dashboard/sendCoin/sendCoin.render.js index 84e5d40..c4a274f 100644 --- a/react/src/components/dashboard/sendCoin/sendCoin.render.js +++ b/react/src/components/dashboard/sendCoin/sendCoin.render.js @@ -52,6 +52,13 @@ export const _SendFormRender = function() { }