Skip to content

Commit

Permalink
Added /info/coinsupply/total
Browse files Browse the repository at this point in the history
  • Loading branch information
lAmeR1 authored Feb 23, 2023
1 parent 09d97e3 commit 6b473dd
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion endpoints/get_circulating_supply.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ async def get_coinsupply():
resp = await kaspad_client.request("getCoinSupplyRequest")
return {
"circulatingSupply": resp["getCoinSupplyResponse"]["circulatingSompi"],
"totalSupply": resp["getCoinSupplyResponse"]["circulatingSompi"],
"maxSupply": resp["getCoinSupplyResponse"]["maxSompi"]
}

Expand All @@ -33,4 +34,14 @@ async def get_circulating_coins(in_billion : bool = False):
if in_billion:
return str(round(float(coins) / 1000000000, 2))
else:
return coins
return coins


@app.get("/info/coinsupply/total", tags=["Kaspa network info"],
response_class=PlainTextResponse)
async def get_circulating_coins():
"""
Get total amount of $KAS token as numerical value
"""
resp = await kaspad_client.request("getCoinSupplyRequest")
return str(float(resp["getCoinSupplyResponse"]["circulatingSompi"]) / 100000000)

0 comments on commit 6b473dd

Please sign in to comment.