A simple Node.js project that creates endpoints for the circulating supply and the total supply using the Cosmos SDK API. Useful for platforms like CoinMarketCap or CoinGecko.
This has been written by ZENODE and is licensed under the MIT-license (see LICENSE).
- First create an
.env
file in the root of the repository. - Copy and paste the content of the
.env.example
into the.env
file. - Change the
API_ENDPOINT
to one that is up-to-date and stable (no trailing slash!). - Change the
COIN_DENOM
Make sure to use the correct denominator forCOIN_DENOM
. It is usually the smallest denom. - Change the
COIN_DECIMALS
to make sure your end result gets shown in the right amount of decimals. Defaults to 1, which leaves the API results as is. - Run
npm install
. - Turn on the server by running
npm start
. - Once the server is started, browse to the endpoints
localhost:3000/total-supply
andlocalhost:3000/circulating-supply
to see the outcomes.
Important
LOGIC: Total Supply - Community Pool = Circulating Supply.
The logic or API may not match with your chain, so make the necessary changes if the outcome appears to be incorrect or invalid.
— ZEN
Copyright (c) 2023 ZENODE