getTokenSupply

Returns the total supply of an SPL Token type.

📘

Supported on Solana (mainnet) only.

Parameters

  • <string> - Pubkey of token Mint to query, as base-58 encoded string
  • (optional) <object> - Configuration object containing the following field:

Returns

The result will be an RpcResponse JSON object with value equal to a JSON object containing:

  • amount: <string> - the raw total token supply without decimals, a string representation of u64
  • decimals: <u8> - number of base 10 digits to the right of the decimal place
  • uiAmount: <number|null> - the total token supply, using mint-prescribed decimals DEPRECATED
  • uiAmountString: <string> - the total token supply as a string, using mint-prescribed decimals

API Endpoint

The format of an Solana API endpoint is
https://open-platform.nodereal.io/{{apiKey}}/solana/

Here is an example:
https://open-platform.nodereal.io/4c0a1c23661a4e26bcbcwed461e34ea9/solana/

Example

Request

curl https://open-platform.nodereal.io/{{apiKey}}/solana/ \
  -X POST \
  -H "Content-Type: application/json" \
  --data '{"jsonrpc":"2.0", "id":1, "method":"getTokenSupply", "params": ["3wyAj7Rt1TWVPZVteFJPLa26JmLvdb1CAKEFZm3NY75E"]}'

Result

{
  "jsonrpc": "2.0",
  "result": {
    "context": {
      "slot": 1114
    },
    "value": {
      "amount": "100000",
      "decimals": 2,
      "uiAmount": 1000,
      "uiAmountString": "1000"
    }
  },
  "id": 1
}