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. 11
      react/src/components/dashboard/sendCoin/sendCoin.js
  2. 20
      react/src/components/dashboard/sendCoin/sendCoin.render.js

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

@ -60,7 +60,7 @@ class SendCoin extends React.Component {
btcFeesAdvancedStep: 9,
btcFeesSize: 0,
btcFeesTimeBasedStep: 1,
btcPreflightRes: null,
spvPreflightRes: null,
};
this.defaultState = JSON.parse(JSON.stringify(this.state));
this.updateInput = this.updateInput.bind(this);
@ -262,7 +262,7 @@ class SendCoin extends React.Component {
if (_coinAddresses &&
_coinAddresses[type] &&
_coinAddresses[type].length) {
_coinAddresses[type].map((address) => {
_coinAddresses[type].map((address) => {
if (address.amount > 0 &&
(type !== 'public' || (address.canspend && type === 'public'))) {
_items.push(
@ -486,7 +486,12 @@ class SendCoin extends React.Component {
this.setState(Object.assign({}, this.state, {
spvVerificationWarning: !sendPreflight.result.utxoVerified,
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 {
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>
}
{ this.state.btcPreflightRes &&
{ this.state.spvPreflightRes &&
<div className="row padding-top-20">
<div className="col-xs-12">
<strong>Fee</strong>
</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>
}
{ this.state.btcPreflightRes &&
{ this.state.spvPreflightRes &&
<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">
<strong>Adjusted amount</strong>
<span>
@ -265,13 +265,19 @@ export const SendRender = function() {
effect="solid"
className="text-left" />
</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>
}
{ 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">
<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>

Loading…
Cancel
Save