TriportRPC

getTokenSupply

Last updated:

`getTokenSupply` returns the total supply currently in circulation for a single SPL token mint. The amount is reported both as a raw integer string (in the token's smallest indivisible unit) and as a human-readable value scaled by the mint's `decimals`.

Use it to display a token's circulating supply, to compute market cap alongside a price feed, or to confirm a mint's decimal precision before formatting other balances. The value reflects the supply as recorded on-chain at the slot named in the response `context` — pass a stricter `commitment` (e.g. `finalized`) when you need a confirmed, rollback-safe number.

This is a lightweight read; it is rate limited under the standard `sol_read_rpc` bucket and is available on every tier including free.

Parameters

getTokenSupply parameters
NameTypeRequiredDescription
mintPubkeyYes
configCommitmentConfigNo

Returns

getTokenSupply return value
FieldType
resultobject

Examples

curl https://<your-endpoint>/ \
  -X POST -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getTokenSupply","params":["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"]}'
const res = await fetch("https://<your-endpoint>/", {
  method: "POST",
  headers: { "Content-Type": "application/json" },
  body: JSON.stringify({
  "id": 1,
  "method": "getTokenSupply",
  "params": [
    "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
  ],
  "jsonrpc": "2.0"
}),
});
const data = await res.json();
import requests
resp = requests.post("https://<your-endpoint>/", json={"id":1,"method":"getTokenSupply","params":["EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"],"jsonrpc":"2.0"})
print(resp.json())
{
  "id": 1,
  "result": {
    "value": {
      "amount": "8417323371713833",
      "decimals": 6,
      "uiAmount": 8417323371.713833,
      "uiAmountString": "8417323371.713833"
    },
    "context": {
      "slot": 427699352,
      "apiVersion": "4.0.3"
    }
  },
  "jsonrpc": "2.0"
}

Usage

  1. Transport: HTTP (JSON-RPC).
  2. Networks: mainnet, devnet, testnet.
  3. Credit cost: 1 per call.

FAQ

What does getTokenSupply do?
Returns the total circulating supply of an SPL token mint.
How many credits does getTokenSupply cost?
getTokenSupply costs 1 credit(s) per call on Triport by default.
Is getTokenSupply available over WebSocket?
getTokenSupply is an HTTP JSON-RPC method.