Contas

Query account states, balances, token holdings, and program-specific storage data.

getProgramAccounts

Get program accounts owned by a specific program ID.

Parameters
NameTypeDescription
programId*
stringThe public key of the program, as a base-58 encoded string.
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└dataSlice
objectThe data slice configuration.
└length
integerThe length of the data slice.
└offset
integerThe offset of the data slice.
└encoding
"binary" | "base58" | "base64" | "jsonParsed" | "base64+zstd"The encoding for the account data.
└filters
arrayFilters to apply to the program accounts. Each filter is a base58-encoded string representing an address or a specific filter type.
└minContextSlot
integerThe minimum context slot for the account info.
└sortResults
booleanWhether to sort the results.
└withContext
booleanWhether to include the context in the response.
Result
FieldTypeDescription
result
array<RpcKeyedAccount>getProgramAccounts - Returns program-owned accounts
└[]
objectArray item
└account
object
└data
array<string>Account data
└executable
booleanWhether this account contains executable code
└lamports
integerAccount balance in lamports
└owner
stringProgram that owns this account
└rentEpoch
integerEpoch at which this account will next owe rent
└pubkey
string
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getProgramAccounts",
  "params": [
    "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
    {
      "commitment": "processed",
      "dataSlice": {
        "length": 0,
        "offset": 0
      },
      "encoding": "binary",
      "filters": [],
      "minContextSlot": 123456789,
      "sortResults": true,
      "withContext": true
    }
  ]
}

getLargestAccounts

Returns the 20 largest accounts by lamport balance.

Parameters
NameTypeDescription
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└filter
"circulating" | "nonCirculating"The filter to apply to the largest accounts.
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
array<RpcAccountBalance>
└[]
objectArray item
└address
string
└lamports
integer
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getLargestAccounts",
  "params": [
    {
      "commitment": "processed",
      "filter": "circulating"
    }
  ]
}

getSupply

Returns information about the current token supply.

Parameters
NameTypeDescription
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└excludeNonCirculatingAccountsList
booleanWhether to exclude non-circulating accounts.
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
object
└circulating
integer
└nonCirculating
integer
└nonCirculatingAccounts
array<string>
└total
integer
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getSupply",
  "params": [
    {
      "commitment": "processed",
      "excludeNonCirculatingAccountsList": true
    }
  ]
}

getTokenLargestAccounts

Returns the largest accounts for a given token mint.

Parameters
NameTypeDescription
mint*
stringThe public key of the token mint, as a base-58 encoded string.
commitment
objectThe commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
array<RpcTokenAccountBalance>
└[]
objectArray item
└address
string
└amount
stringToken amount as string
└decimals
integerNumber of decimals
└uiAmount
numberHuman readable amount as float
└uiAmountString
stringHuman readable amount as string
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenLargestAccounts",
  "params": [
    "<some-mint>",
    {
      "commitment": "processed"
    }
  ]
}

getTokenAccountsByOwner

Returns all SPL Token accounts by owner.

Parameters
NameTypeDescription
owner*
stringThe public key of the account owner, as a base-58 encoded string.
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└dataSlice
objectThe data slice configuration.
└length
integerThe length of the data slice.
└offset
integerThe offset of the data slice.
└encoding
"binary" | "base58" | "base64" | "jsonParsed" | "base64+zstd"The encoding for the account data.
└minContextSlot
integerThe minimum context slot for the account info.
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
array<RpcKeyedAccount>
└[]
objectArray item
└account
object
└data
array<string>Account data
└executable
booleanWhether this account contains executable code
└lamports
integerAccount balance in lamports
└owner
stringProgram that owns this account
└rentEpoch
integerEpoch at which this account will next owe rent
└pubkey
string
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountsByOwner",
  "params": [
    "11111111111111111111111111111111",
    {
      "commitment": "processed",
      "dataSlice": {
        "length": 0,
        "offset": 0
      },
      "encoding": "binary",
      "minContextSlot": 123456789
    }
  ]
}

getTokenAccountsByDelegate

Returns all SPL Token accounts by delegate.

Parameters
NameTypeDescription
delegate*
stringThe public key of the delegate, as a base-58 encoded string.
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└dataSlice
objectThe data slice configuration.
└length
integerThe length of the data slice.
└offset
integerThe offset of the data slice.
└encoding
"binary" | "base58" | "base64" | "jsonParsed" | "base64+zstd"The encoding for the account data.
└minContextSlot
integerThe minimum context slot for the account info.
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
array<RpcKeyedAccount>
└[]
objectArray item
└account
object
└data
array<string>Account data
└executable
booleanWhether this account contains executable code
└lamports
integerAccount balance in lamports
└owner
stringProgram that owns this account
└rentEpoch
integerEpoch at which this account will next owe rent
└pubkey
string
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountsByDelegate",
  "params": [
    "<some-delegate>",
    {
      "commitment": "processed",
      "dataSlice": {
        "length": 0,
        "offset": 0
      },
      "encoding": "binary",
      "minContextSlot": 123456789
    }
  ]
}

getAccountInfo

Returns detailed information about an account given its public key.

Parameters
NameTypeDescription
pubkey*
stringThe public key of the account to query, as a base-58 encoded string.
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└dataSlice
objectThe data slice configuration.
└length
integerThe length of the data slice.
└offset
integerThe offset of the data slice.
└encoding
"binary" | "base58" | "base64" | "jsonParsed" | "base64+zstd"The encoding for the account data.
└minContextSlot
integerThe minimum context slot for the account info.
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
object
└data
array<string>Account data
└executable
booleanWhether this account contains executable code
└lamports
integerAccount balance in lamports
└owner
stringProgram that owns this account
└rentEpoch
integerEpoch at which this account will next owe rent
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAccountInfo",
  "params": [
    "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
    {
      "commitment": "processed",
      "dataSlice": {
        "length": 0,
        "offset": 0
      },
      "encoding": "binary",
      "minContextSlot": 123456789
    }
  ]
}

getBlockCommitment

Returns commitment levels for a given block (slot).

Parameters
NameTypeDescription
block*
integerThe slot to query for block commitment.
Result
FieldTypeDescription
commitment
array
totalStake
integer
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBlockCommitment",
  "params": [
    0
  ]
}

getMultipleAccounts

Returns account information for multiple public keys in a single call.

Parameters
NameTypeDescription
pubkeys*
array[string]An array of public keys to query, as base-58 encoded strings.
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└dataSlice
objectThe data slice configuration.
└length
integerThe length of the data slice.
└offset
integerThe offset of the data slice.
└encoding
"binary" | "base58" | "base64" | "jsonParsed" | "base64+zstd"The encoding for the account data.
└minContextSlot
integerThe minimum context slot for the account info.
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
array<any>
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getMultipleAccounts",
  "params": [
    [
      "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"
    ],
    {
      "commitment": "processed",
      "dataSlice": {
        "length": 0,
        "offset": 0
      },
      "encoding": "binary",
      "minContextSlot": 123456789
    }
  ]
}

getTokenAccountBalance

Returns the balance of a token account, given its public key.

Parameters
NameTypeDescription
pubkey*
stringThe public key of the token account to query, as a base-58 encoded string.
commitment
objectThe commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
object
└amount
stringToken amount as string
└decimals
integerNumber of decimals
└uiAmount
numberHuman readable amount as float
└uiAmountString
stringHuman readable amount as string
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenAccountBalance",
  "params": [
    "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
    {
      "commitment": "processed"
    }
  ]
}

getTokenSupply

Returns the total supply of a token, given its mint address.

Parameters
NameTypeDescription
mint*
stringThe public key of the token mint, as a base-58 encoded string.
commitment
objectThe commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
object
└amount
stringToken amount as string
└decimals
integerNumber of decimals
└uiAmount
numberHuman readable amount as float
└uiAmountString
stringHuman readable amount as string
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getTokenSupply",
  "params": [
    "<some-mint>",
    {
      "commitment": "processed"
    }
  ]
}

getBalance

Returns the balance for a given address.

Parameters
NameTypeDescription
pubkey*
stringThe public key of the account to query, as a base-58 encoded string.
config
objectConfiguration object for the query.
└commitment
"processed" | "confirmed" | "finalized"The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
└minContextSlot
integerThe minimum context slot for the context.
Result
FieldTypeDescription
context
object
└apiVersion
stringThe API version
└slot
integerThe current slot
value
integer
Example
{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getBalance",
  "params": [
    "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",
    {
      "commitment": "processed",
      "minContextSlot": 123456789
    }
  ]
}

Is this page helpful?

Índice

Editar Página
© 2026 Fundação Solana. Todos os direitos reservados.