getTokenSupply
Returns the total supply of an SPL Token type.

Parameters

  • <base-58 encoded string> - Pubkey of token Mint to query
  • <object> - (optional) Config object:
    • commitment: <object> - (optional) Configures the commitment level of the blocks queried Accepts one of the following strings: ["finalized", "confirmed", "processed"] For more info, refer to this doc.

Results

  • amount: <u64 string> - the raw balance without decimals
  • decimals: <u8> - number of base 10 digits to the right of the decimal place
  • uiAmountString: <string> - the balance as a string, using mint-prescribed decimals

Example

Request

cURL
1
curl --location --request POST 'https://solana-mainnet.g.alchemy.com/v2/alch-demo/' \
2
--header 'Content-Type: application/json' \
3
--data-raw '{
4
"jsonrpc": "2.0",
5
"id": 1,
6
"method": "getTokenSupply",
7
"params": [
8
"HfYFjMKNZygfMC8LsQ8LtpPsPxEJoXJx4M6tqi75Hajo"
9
]
10
}'
Copied!

Response

1
{
2
"jsonrpc": "2.0",
3
"result": {
4
"context": {
5
"slot": 137571639
6
},
7
"value": {
8
"amount": "999999999997060679",
9
"decimals": 9,
10
"uiAmount": 9.999999999970608E8,
11
"uiAmountString": "999999999.997060679"
12
}
13
},
14
"id": 1
15
}
Copied!