|
|
@ -197,6 +197,7 @@ class SendCoin extends React.Component { |
|
|
|
Store.dispatch(sendToAddressStateAlt(json)); |
|
|
|
} |
|
|
|
} else { |
|
|
|
Store.dispatch(sendToAddressStateAlt(json)); |
|
|
|
Store.dispatch(triggerToaster(true, translate('TOASTR.SIGNED_TX_GENERATED_FAIL') + '.', translate('TOASTR.WALLET_NOTIFICATION'), 'error')); |
|
|
|
} |
|
|
|
console.log(json); |
|
|
@ -207,14 +208,22 @@ class SendCoin extends React.Component { |
|
|
|
}, 1000);*/ |
|
|
|
} |
|
|
|
|
|
|
|
renderSignedTx(signedtx) { |
|
|
|
const substrBlocks = 10; |
|
|
|
const substrLength = this.props.ActiveCoin.lastSendToResponse['signedtx'].length / substrBlocks; |
|
|
|
renderSignedTx(isRawTx) { |
|
|
|
let substrBlocks; |
|
|
|
|
|
|
|
if (this.props.ActiveCoin.mode === 'basilisk') { |
|
|
|
substrBlocks = isRawTx ? 3 : 8; |
|
|
|
} else { |
|
|
|
substrBlocks = 10; |
|
|
|
} |
|
|
|
|
|
|
|
const _lastSendToResponse = this.props.ActiveCoin.lastSendToResponse[isRawTx ? 'rawtx' : 'signedtx']; |
|
|
|
const substrLength = _lastSendToResponse.length / substrBlocks; |
|
|
|
let out = []; |
|
|
|
|
|
|
|
for (let i = 0; i < substrBlocks; i++) { |
|
|
|
out.push( |
|
|
|
<div key={i}>{this.props.ActiveCoin.lastSendToResponse['signedtx'].substring(i * substrLength, substrLength * i + substrLength)}</div> |
|
|
|
<div key={i}>{_lastSendToResponse.substring(i * substrLength, substrLength * i + substrLength)}</div> |
|
|
|
); |
|
|
|
} |
|
|
|
|
|
|
@ -224,20 +233,18 @@ class SendCoin extends React.Component { |
|
|
|
renderKey(key) { |
|
|
|
if (key === 'signedtx') { |
|
|
|
return this.renderSignedTx(); |
|
|
|
} else if (key === 'complete') { |
|
|
|
if (this.props.ActiveCoin.lastSendToResponse[key] === true) { |
|
|
|
} else if (key === 'rawtx') { |
|
|
|
return this.renderSignedTx(true); |
|
|
|
} else if (key === 'complete' || key === 'completed' || key === 'result') { |
|
|
|
if (this.props.ActiveCoin.lastSendToResponse[key] === true || this.props.ActiveCoin.lastSendToResponse[key] === 'success') { |
|
|
|
return ( |
|
|
|
<span className="label label-success">true</span> |
|
|
|
<span className="label label-success">{this.props.ActiveCoin.lastSendToResponse[key] === true ? 'true' : 'success'}</span> |
|
|
|
); |
|
|
|
} else { |
|
|
|
return ( |
|
|
|
<span className="label label-danger">false</span> |
|
|
|
); |
|
|
|
} |
|
|
|
} else if (key === 'result') { |
|
|
|
return ( |
|
|
|
<span>{this.props.ActiveCoin.lastSendToResponse[key]}</span> |
|
|
|
); |
|
|
|
} else if (key === 'error') { |
|
|
|
return ( |
|
|
|
<span className="label label-danger">{this.props.ActiveCoin.lastSendToResponse[key]}</span> |
|
|
@ -252,11 +259,18 @@ class SendCoin extends React.Component { |
|
|
|
<span className="label label-danger">false</span> |
|
|
|
); |
|
|
|
} |
|
|
|
} else if (key === 'txid' || key === 'sent') { |
|
|
|
return ( |
|
|
|
<span>{this.props.ActiveCoin.lastSendToResponse[key]}</span> |
|
|
|
); |
|
|
|
} else if (key === 'tag') { |
|
|
|
return null; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
renderSendCoinResponse() { |
|
|
|
if (this.props.ActiveCoin.lastSendToResponse) { |
|
|
|
console.log('renderSendCoinResponse', this.props.ActiveCoin.lastSendToResponse); |
|
|
|
return Object.keys(this.props.ActiveCoin.lastSendToResponse).map((key, index) => |
|
|
|
<tr key={key}> |
|
|
|
<td>{key}</td> |
|
|
@ -401,7 +415,7 @@ class SendCoin extends React.Component { |
|
|
|
</div> |
|
|
|
<div className="col-lg-10 margin-top-10"> |
|
|
|
<div className="pull-left margin-right-10"> |
|
|
|
<input type="checkbox" id="edexcoin_send_sig" onClick={this.toggleSendSig} data-plugin="switchery" data-size="small" /> |
|
|
|
<input type="checkbox" id="edexcoin_send_sig" data-plugin="switchery" data-size="small" /> |
|
|
|
</div> |
|
|
|
<label className="padding-top-3" htmlFor="edexcoin_send_sig" onClick={this.toggleSendSig}>{translate('INDEX.DONT_SEND')}</label> |
|
|
|
</div> |
|
|
|