Skip to content

Commit 0462841

Browse files
committed
add history data for ethereum
1 parent 84e6dab commit 0462841

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

css/ethplorer.css

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -637,6 +637,7 @@ a.dashed {
637637
}
638638

639639
.tx-value-price {
640+
font-weight: bold;
640641
font-size: 0.9em;
641642
color: white;
642643
opacity: 0.6;

js/ethplorer.js

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -716,11 +716,22 @@ Ethplorer = {
716716
from: txData.tx.from,
717717
to: txData.tx.to,
718718
valueEth: txData.tx.value,
719-
success: txData.tx.success
719+
success: txData.tx.success,
720+
usdPrice: txData.tx.usdPrice
720721
}
721722

722-
Ethplorer.fillValues('transfer', txData, ['operation', 'operation.from', 'operation.to', 'operation.valueEth']);
723+
Ethplorer.fillValues('transfer', txData, ['operation', 'operation.from', 'operation.to']);
723724
Ethplorer.fillValues('transfer', txData, ['tx', 'tx.timestamp']);
725+
726+
// Custom price value
727+
if(txData.tx.value && txData.tx.usdPrice && Ethplorer.ethPrice.rate) {
728+
value = Ethplorer.Utils.formatNum(txData.tx.value, true, 18, true, true) + '&nbsp;<i class="fab fa-ethereum"></i>&nbsp;ETH<br><span class="tx-value-price">$&nbsp;' + Ethplorer.Utils.formatNum(Ethplorer.ethPrice.rate * txData.tx.value, true, 2, true, true) + '</span>';
729+
value += getHistDiffPriceString(txData.tx.usdPrice, Ethplorer.ethPrice.rate);
730+
}
731+
$('#transfer-operation-value').html(value);
732+
// Price of eth on transaction exceute
733+
$('#historical-price').html(getHistUsdPriceString(txData.tx.usdPrice, txData.tx.value));
734+
724735
if(oTx.blockNumber && !txData.pending){
725736
$('#txTokenStatus')[txData.operation.success ? 'removeClass' : 'addClass']('text-danger');
726737
$('#txTokenStatus')[txData.operation.success ? 'addClass' : 'removeClass']('text-success');

0 commit comments

Comments
 (0)