Solana
Solana
Solana
Free tier covers personal projects. Pay-as-you-go scales without a card.
On Solana — the high-throughput chain whose native token is SOL — getTokenSupply returns the total supply of a token mint, summed across every account that holds it. The figure comes straight from the SPL Token (or Token-2022) mint account, so it reflects all mints and burns recorded on chain. Send a JSON-RPC 2.0 request with positional params to https://solana.therpc.io/YOUR_API_KEY, passing the mint address, and you get back the raw amount, the mint's decimals, and a uiAmountString.
finalized commitment for stable numbers.| # | Name | Type | Required | Description |
|---|---|---|---|---|
| 1 | mint | string | Yes | Base-58 token mint address. |
| 2 | config | object | No | Options: commitment. |
| Type | Description |
|---|---|
| object | RpcResponse wrapping { amount, decimals, uiAmount, uiAmountString }. |
| Code | Message | Cause |
|---|---|---|
-32602 | Invalid params | A param is missing, of the wrong type, or malformed (e.g. a non-base58 pubkey or a bad config field). |
-32603 | Internal error | The node hit an internal error serving the request — retry, and reduce the requested range/encoding if it persists. |
amount is a raw integer string in the mint's smallest unit — divide by 10 to the power of decimals, or just read uiAmountString, to get the human figure.