OpenInfra.sh is now live - Solana infrastructure, included with every server. LEARN MORE HERE >

OpenInfra.shopeninfra.sh

getTokenSupply

Returns the current supply for an SPL Token mint.

Request

{  "jsonrpc": "2.0",  "id": 1,  "method": "getTokenSupply",  "params": [    "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr",    {      "commitment": "finalized"    }  ]}

Parameters

ParameterTypeRequiredDescription
pubkeystringRequiredPubkey of the token Mint to query, as a base-58 encoded string.
config.commitmentstringOptionalCommitment level: processed, confirmed, or finalized. Defaults to finalized.

Commitment levels

ValueDescription
processedReturn 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.
confirmedReturn 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.
finalizedReturn 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.

FieldTypeDescription
slotu64Slot at which the node evaluated this request.
apiVersionstringRPC 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.

FieldTypeDescription
amountstringRaw total token supply, as a base-10 integer string with no decimal point.
decimalsu8Number of decimal places configured on the mint.
uiAmountnumber | nullDecimal-scaled total supply as a floating-point number. Deprecated in favor of uiAmountString.
uiAmountStringstringDecimal-scaled total supply as a string.