RPC

Accounts

Query account states, balances, and token holdings on Surfnet

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
string | string | stringThe 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
stringThe 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": {    "programId": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",    "config": {      "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
string | string | stringThe commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized'
â””filter
stringThe 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": {    "config": {      "commitment": "Processed",      "filter": "circulating"    }  }}

getSupply

Returns information about the current token supply.

Parameters
NameTypeDescription
config
objectConfiguration object for the query.
â””commitment
string | string | stringThe 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": {    "config": {      "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
string | string | stringThe 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": {    "mint": "<some-mint>",    "commitment": {      "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
string | string | stringThe 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
stringThe 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": {    "mint": "<some-mint>"  }}

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
string | string | stringThe 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
stringThe 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": {    "mint": "<some-mint>"  }}

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
string | string | stringThe 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
stringThe 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": {    "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",    "config": {      "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": {    "block": 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
string | string | stringThe 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
stringThe 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": {    "pubkeys": [      "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri"    ],    "config": {      "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
string | string | stringThe 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": {    "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",    "commitment": {      "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
string | string | stringThe 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": {    "mint": "<some-mint>",    "commitment": {      "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
string | string | stringThe 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": {    "pubkey": "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri",    "config": {      "commitment": "Processed",      "minContextSlot": 123456789    }  }}

On this page