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

​getProgramAccounts

Get program accounts owned by a specific program ID. Scans of large programs such as the Token program are fetched from the datasource. The public default datasource rejects them with 403 Forbidden, so start Surfpool with a private RPC URL (surfpool start --rpc-url <URL>) to run this sample, or query a program with fewer accounts. Parameters
​programId
string
required
The public key of the program, as a base-58 encoded string.
​config
object
Configuration object for the query.
Result
​result
array<RpcKeyedAccount>
getProgramAccounts - Returns program-owned accounts
Request
Response

​getLargestAccounts

Returns the 20 largest accounts by lamport balance. Parameters
​config
object
Configuration object for the query.
Result
​context
object
​value
array<RpcAccountBalance>
Request
Response

​getSupply

Returns information about the current token supply. Parameters
​config
object
Configuration object for the query.
Result
​context
object
​value
object
Request
Response

​getTokenLargestAccounts

Returns the largest accounts for a given token mint. Parameters
​mint
string
required
The public key of the token mint, as a base-58 encoded string.
​commitment
object
The commitment describes how finalized a block is at that point in time. Options are ‘processed’, ‘confirmed’, or ‘finalized’.
Result
​context
object
​value
array<RpcTokenAccountBalance>
Request
Response

​getTokenAccountsByOwner

Returns all SPL Token accounts by owner. Run the surfnet_setTokenAccount sample first to create a USDC token account for this owner; otherwise the list is empty. Parameters
​owner
string
required
The public key of the account owner, as a base-58 encoded string.
​config
object
Configuration object for the query.
Result
​context
object
​value
array<RpcKeyedAccount>
Request
Response

​getTokenAccountsByDelegate

Returns all SPL Token accounts by delegate. Returns accounts whose delegate is the given address; the list is empty unless you have delegated a token account to it (see surfnet_setTokenAccount). Parameters
​delegate
string
required
The public key of the delegate, as a base-58 encoded string.
​config
object
Configuration object for the query.
Result
​context
object
​value
array<RpcKeyedAccount>
Request
Response

​getAccountInfo

Returns detailed information about an account given its public key. Parameters
​pubkey
string
required
The public key of the account to query, as a base-58 encoded string.
​config
object
Configuration object for the query.
Result
​context
object
​value
object
Request
Response

​getBlockCommitment

Returns commitment levels for a given block (slot). Parameters
​block
integer
required
The slot to query for block commitment.
Result
​commitment
array
​totalStake
integer
Request
Response

​getMultipleAccounts

Returns account information for multiple public keys in a single call. Parameters
​pubkeys
array[string]
required
An array of public keys to query, as base-58 encoded strings.
​config
object
Configuration object for the query.
Result
​context
object
​value
array<any>
Request
Response

​getTokenAccountBalance

Returns the balance of a token account, given its public key. The sample token account is the USDC account that surfnet_setTokenAccount creates for 83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri; run that request first, otherwise the account is not found. Parameters
​pubkey
string
required
The public key of the token account to query, as a base-58 encoded string.
​commitment
object
The commitment describes how finalized a block is at that point in time. Options are ‘processed’, ‘confirmed’, or ‘finalized’.
Result
​context
object
​value
object
Request
Response

​getTokenSupply

Returns the total supply of a token, given its mint address. Parameters
​mint
string
required
The public key of the token mint, as a base-58 encoded string.
​commitment
object
The commitment describes how finalized a block is at that point in time. Options are ‘processed’, ‘confirmed’, or ‘finalized’.
Result
​context
object
​value
object
Request
Response

​getBalance

Returns the balance for a given address. Parameters
​pubkey
string
required
The public key of the account to query, as a base-58 encoded string.
​config
object
Configuration object for the query.
Result
​context
object
​value
integer
Request
Response