Total Supply api for Coinmarketcap listing

Viewed 598

I'm looking at updating the Coinmarketcap listing for a token on the Solana blockchain.

For Total Supply Coinmarketcap asks to provide:

"API endpoint that displays ONLY 'Total Supply' as a numerical value (e.g. http://chainz.cryptoid.info/grs/api.dws?q=totalcoins)"

How would I go about doing this?

1 Answers

The getTokenSupply endpoint on the Solana JSON RPC will get you close: https://docs.solana.com/developing/clients/jsonrpc-api#gettokensupply

Unfortunately, it isn't a normal REST API endpoint, so it requires some parameters, and it provides JSON output. In the output, you'll need the uiAmountString. You may need to add in something to proxy the call and extract the value if CoinMarketCap is so stringent.

Related