getTokenSupply
Returns the current supply for an SPL Token mint.
Request
{ "jsonrpc": "2.0", "id": 1, "method": "getTokenSupply", "params": [ "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr", { "commitment": "finalized" } ]}Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| pubkey | string | Required | Pubkey of the token Mint to query, as a base-58 encoded string. |
| config.commitment | string | Optional | Commitment level: processed, confirmed, or finalized. Defaults to finalized. |
Commitment levels
| Value | Description |
|---|---|
| processed | Return data from the highest slot this node has processed on the fork it currently considers best. This is the newest view, but it can still change if the cluster switches forks. |
| confirmed | Return data from the highest slot that at least two-thirds of active stake has directly voted to confirm. More stable than processed, but still a weaker guarantee than finalized. |
| finalized | Return data from the highest slot that the cluster recognizes as finalized. The slot has reached maximum vote lockout in validators' vote towers and is recognized by at least two-thirds of active stake. This is the strongest commitment level. |
Response
{ "jsonrpc": "2.0", "result": { "context": { "apiVersion": "3.1.8", "slot": 1114 }, "value": { "amount": "100000", "decimals": 2, "uiAmount": 1000, "uiAmountString": "1000" } }, "id": 1}context
Slot and API version the node used to answer this request.
| Field | Type | Description |
|---|---|---|
| slot | u64 | Slot at which the node evaluated this request. |
| apiVersion | string | RPC API version reported by the node. This field may be omitted by older nodes. |
value
Token amount object. These fields follow the same uiTokenAmount shape documented in the Token Balances JSON structure.
| Field | Type | Description |
|---|---|---|
| amount | string | Raw total token supply, as a base-10 integer string with no decimal point. |
| decimals | u8 | Number of decimal places configured on the mint. |
| uiAmount | number | null | Decimal-scaled total supply as a floating-point number. Deprecated in favor of uiAmountString. |
| uiAmountString | string | Decimal-scaled total supply as a string. |