Learn getTokenSupply use cases, code examples, request parameters, response structure, and tips.
getTokenSupply
RPC method returns the total supply of a specific SPL Token mint. This is essential for understanding the overall quantity of a token that has been created.
mintAddress
(string, required): The base-58 encoded public key of the token mint whose total supply you want to query.
options
(object, optional): An optional configuration object that can include:
commitment
(string, optional): Specifies the commitment level for the query (e.g., "finalized"
, "confirmed"
, "processed"
).result.value
field in the JSON-RPC response is an object containing details about the token’s supply:
amount
(string): The total supply of the token in its smallest denomination (raw amount), as a string. This value is not adjusted for decimals.decimals
(u8): The number of decimal places defined for this token mint. This is crucial for converting the raw amount
to a human-readable format.uiAmount
(number | null): The total supply of the token as a floating-point number, adjusted for the token’s decimals
. This field might be null or less precise; uiAmountString
is generally preferred for display.uiAmountString
(string): The total supply of the token as a string, adjusted for the token’s decimals
. This is the most user-friendly representation of the total supply.decimals
is Key: Always use the decimals
field to correctly interpret the amount
or uiAmountString
.getTokenSupply
RPC method effectively for querying SPL token supply on Solana.