Browse Source

Add supply inflation

onryo
Duke Leto 2 years ago
parent
commit
c88a1be444
  1. 10
      supply/index.html

10
supply/index.html

@ -73,6 +73,7 @@
Shielded Percent:<h2 class="halving4lang" id="zfundspercent">... </h2>
Percent Circulating: <h2 id="percentcirculating">... HUSH</h2>
Total Supply:<h2 class="halving3lang">21,000,000 HUSH</h2>
Supply Inflation: <h2 id="inflation"> ... % monthly, ... % yearly</h2>
</p>
</div>
<br>
@ -214,6 +215,13 @@ $('.button-group').each( function( i, buttonGroup ) {
$('#totalsupply').html( json.total + " HUSH" );
$('#percentcirculating').html( parseFloat( 100*(json.total/ 21000000)).toPrecision(4) + "%" );
var block_time = 75;
var blocks_per_day = 60*60*24 / block_time;
var monthly_inflation = parseFloat( 100 * (blocks_per_day * 30 / json.total)).toPrecision(2);
var yearly_inflation = parseFloat( 100 * (blocks_per_day * 365 / json.total)).toPrecision(2);
$('#inflation').html( monthly_inflation + "% monthly, " + yearly_inflation + "% yearly" );
$.ajax({
url: "https://api.coingecko.com/api/v3/simple/price?ids=hush&vs_currencies=btc%2Cusd%2Ceur&include_market_cap=true&include_24hr_vol=true&include_24hr_change=true",
type: "GET",
@ -232,6 +240,7 @@ $('.button-group').each( function( i, buttonGroup ) {
log("zmcap=" + zmcap);
})
.fail(function( xhr, status, errorThrown ) {
log("Failed to get price data")
})
.always(function( xhr, status ) {
log("Finished!");
@ -239,6 +248,7 @@ $('.button-group').each( function( i, buttonGroup ) {
})
.fail(function( xhr, status, errorThrown ) {
// TODO: try the other explorer if we can't talk to the first one
//alert( "Ooops, error talking to explorer API!");
$('#seconds_until_halving').html("Ooops, error talking to explorer API !")
log( "Error: " + errorThrown );

Loading…
Cancel
Save