Browse Source

send form add info about fees and/or kmd interest to be claimed

v0.25
pbca26 7 years ago
parent
commit
766189258e
  1. 9
      react/src/components/dashboard/sendCoin/sendCoin.js
  2. 20
      react/src/components/dashboard/sendCoin/sendCoin.render.js

9
react/src/components/dashboard/sendCoin/sendCoin.js

@ -60,7 +60,7 @@ class SendCoin extends React.Component {
btcFeesAdvancedStep: 9, btcFeesAdvancedStep: 9,
btcFeesSize: 0, btcFeesSize: 0,
btcFeesTimeBasedStep: 1, btcFeesTimeBasedStep: 1,
btcPreflightRes: null, spvPreflightRes: null,
}; };
this.defaultState = JSON.parse(JSON.stringify(this.state)); this.defaultState = JSON.parse(JSON.stringify(this.state));
this.updateInput = this.updateInput.bind(this); this.updateInput = this.updateInput.bind(this);
@ -486,7 +486,12 @@ class SendCoin extends React.Component {
this.setState(Object.assign({}, this.state, { this.setState(Object.assign({}, this.state, {
spvVerificationWarning: !sendPreflight.result.utxoVerified, spvVerificationWarning: !sendPreflight.result.utxoVerified,
spvPreflightSendInProgress: false, spvPreflightSendInProgress: false,
btcPreflightRes: this.props.ActiveCoin.coin === 'BTC' ? { fee: sendPreflight.result.fee, value: sendPreflight.result.value, change: sendPreflight.result.change } : null, spvPreflightRes: {
fee: sendPreflight.result.fee,
value: sendPreflight.result.value,
change: sendPreflight.result.change,
estimatedFee: sendPreflight.result.estimatedFee,
},
})); }));
} else { } else {
this.setState(Object.assign({}, this.state, { this.setState(Object.assign({}, this.state, {

20
react/src/components/dashboard/sendCoin/sendCoin.render.js

@ -244,17 +244,17 @@ export const SendRender = function() {
</div> </div>
</div> </div>
} }
{ this.state.btcPreflightRes && { this.state.spvPreflightRes &&
<div className="row padding-top-20"> <div className="row padding-top-20">
<div className="col-xs-12"> <div className="col-xs-12">
<strong>Fee</strong> <strong>Fee</strong>
</div> </div>
<div className="col-lg-12 col-sm-12 col-xs-12">{ formatValue(this.state.btcPreflightRes.fee * 0.00000001) } ({ this.state.btcPreflightRes.fee } sats)</div> <div className="col-lg-12 col-sm-12 col-xs-12">{ formatValue(this.state.spvPreflightRes.fee * 0.00000001) } ({ this.state.spvPreflightRes.fee } sats)</div>
</div> </div>
} }
{ this.state.btcPreflightRes && { this.state.spvPreflightRes &&
<div className="row padding-top-20"> <div className="row padding-top-20">
{ this.state.btcPreflightRes.change === 0 && { this.state.spvPreflightRes.change === 0 &&
<div className="col-lg-12 col-sm-12 col-xs-12"> <div className="col-lg-12 col-sm-12 col-xs-12">
<strong>Adjusted amount</strong> <strong>Adjusted amount</strong>
<span> <span>
@ -265,13 +265,19 @@ export const SendRender = function() {
effect="solid" effect="solid"
className="text-left" /> className="text-left" />
</span> </span>
&nbsp;{ formatValue((this.state.btcPreflightRes.value * 0.00000001) - (this.state.btcPreflightRes.fee * 0.00000001)) } &nbsp;{ formatValue((this.state.spvPreflightRes.value * 0.00000001) - (this.state.spvPreflightRes.fee * 0.00000001)) }
</div> </div>
} }
{ this.state.btcPreflightRes.change > 0 && { this.state.spvPreflightRes.estimatedFee < 0 &&
<div className="col-lg-12 col-sm-12 col-xs-12 padding-bottom-20">
<strong>KMD interest</strong>&nbsp;
{ Math.abs(formatValue(this.state.spvPreflightRes.estimatedFee * 0.00000001)) } to { this.props.Dashboard.electrumCoins[this.props.ActiveCoin.coin].pub }
</div>
}
{ this.state.spvPreflightRes.change > 0 &&
<div className="col-lg-12 col-sm-12 col-xs-12"> <div className="col-lg-12 col-sm-12 col-xs-12">
<strong>Total (amount + transaction fee)</strong>&nbsp; <strong>Total (amount + transaction fee)</strong>&nbsp;
{ formatValue((this.state.btcPreflightRes.value * 0.00000001) + (this.state.btcPreflightRes.fee * 0.00000001)) } { formatValue((this.state.spvPreflightRes.value * 0.00000001) + (this.state.spvPreflightRes.fee * 0.00000001)) }
</div> </div>
} }
</div> </div>

Loading…
Cancel
Save