Account Methods
These methods give developers access to account states, balances, token holdings, and program-specific storage. They are used to fetch, inspect, and query information about both native and SPL-token accounts.
getProgramAccounts
AvailableGet program accounts owned by a specific program ID.
Parameters
config
Configuration object for the query.
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
length
integer (optional)
The length of the data slice.
offset
integer (optional)
The offset of the data slice.
encoding
string (optional)
The encoding for the account data.
filters
array (optional)
Filters to apply to the program accounts. Each filter is a base58-encoded string representing an address or a specific filter type.
minContextSlot
integer (optional)
The minimum context slot for the account info.
sortResults
boolean (optional)
Whether to sort the results.
withContext
boolean (optional)
Whether to include the context in the response.
programId
requiredstring
The public key of the program, as a base-58 encoded string.
getLargestAccounts
AvailableReturns the 20 largest accounts by lamport balance.
Parameters
config
Configuration object for the query.
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
filter
string (optional)
The filter to apply to the largest accounts.
getSupply
AvailableReturns information about the current token supply.
Parameters
config
Configuration object for the query.
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
excludeNonCirculatingAccountsList
boolean (optional)
Whether to exclude non-circulating accounts.
getTokenLargestAccounts
AvailableReturns the largest accounts for a given token mint.
Parameters
commitment
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
mint
requiredstring
The public key of the token mint, as a base-58 encoded string.
getTokenAccountsByOwner
AvailableReturns all SPL Token accounts by owner.
Parameters
config
Configuration object for the query.
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
length
integer (optional)
The length of the data slice.
offset
integer (optional)
The offset of the data slice.
encoding
string (optional)
The encoding for the account data.
minContextSlot
integer (optional)
The minimum context slot for the account info.
owner
requiredstring
The public key of the account owner, as a base-58 encoded string.
getTokenAccountsByDelegate
AvailableReturns all SPL Token accounts by delegate.
Parameters
config
Configuration object for the query.
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
length
integer (optional)
The length of the data slice.
offset
integer (optional)
The offset of the data slice.
encoding
string (optional)
The encoding for the account data.
minContextSlot
integer (optional)
The minimum context slot for the account info.
delegate
requiredstring
The public key of the delegate, as a base-58 encoded string.
getAccountInfo
AvailableReturns detailed information about an account given its public key.
Parameters
config
Configuration object for the query.
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
length
integer (optional)
The length of the data slice.
offset
integer (optional)
The offset of the data slice.
encoding
string (optional)
The encoding for the account data.
minContextSlot
integer (optional)
The minimum context slot for the account info.
pubkey
requiredstring
The public key of the account to query, as a base-58 encoded string.
getBlockCommitment
AvailableReturns commitment levels for a given block (slot).
Parameters
block
requiredinteger
The slot to query for block commitment.
getMultipleAccounts
AvailableReturns account information for multiple public keys in a single call.
Parameters
config
Configuration object for the query.
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
length
integer (optional)
The length of the data slice.
offset
integer (optional)
The offset of the data slice.
encoding
string (optional)
The encoding for the account data.
minContextSlot
integer (optional)
The minimum context slot for the account info.
pubkeys
requiredarray[string]
An array of public keys to query, as base-58 encoded strings.
getTokenAccountBalance
AvailableReturns the balance of a token account, given its public key.
Parameters
commitment
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
pubkey
requiredstring
The public key of the token account to query, as a base-58 encoded string.
getTokenSupply
AvailableReturns the total supply of a token, given its mint address.
Parameters
commitment
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
commitment
string | string | string (optional)
The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
mint
requiredstring
The public key of the token mint, as a base-58 encoded string.