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.
| Name | Type | Description |
|---|---|---|
programId* | string | The public key of the program, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ filters | array | Filters to apply to the program accounts. Each filter is a base58-encoded string representing an address or a specific filter type. |
└ minContextSlot | integer | The minimum context slot for the account info. |
└ sortResults | boolean | Whether to sort the results. |
└ withContext | boolean | Whether to include the context in the response. |
| Field | Type | Description |
|---|---|---|
result | array<RpcKeyedAccount> | getProgramAccounts - Returns program-owned accounts |
└ [] | object | Array item |
└ account | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
└ pubkey | string |
{ "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.
| Name | Type | Description |
|---|---|---|
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ filter | string | The filter to apply to the largest accounts. |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcAccountBalance> | |
└ [] | object | Array item |
└ address | string | |
└ lamports | integer |
{ "jsonrpc": "2.0", "id": 1, "method": "getLargestAccounts", "params": [ { "commitment": "Processed", "filter": "circulating" } ]}getSupply
Returns information about the current token supply.
| Name | Type | Description |
|---|---|---|
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ excludeNonCirculatingAccountsList | boolean | Whether to exclude non-circulating accounts. |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ circulating | integer | |
└ nonCirculating | integer | |
└ nonCirculatingAccounts | array<string> | |
└ total | integer |
{ "jsonrpc": "2.0", "id": 1, "method": "getSupply", "params": [ { "commitment": "Processed", "excludeNonCirculatingAccountsList": true } ]}getTokenLargestAccounts
Returns the largest accounts for a given token mint.
| Name | Type | Description |
|---|---|---|
mint* | string | 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'. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcTokenAccountBalance> | |
└ [] | object | Array item |
└ address | string | |
└ amount | string | Token amount as string |
└ decimals | integer | Number of decimals |
└ uiAmount | number | Human readable amount as float |
└ uiAmountString | string | Human readable amount as string |
{ "jsonrpc": "2.0", "id": 1, "method": "getTokenLargestAccounts", "params": [ "<some-mint>", { "commitment": "Processed" } ]}getTokenAccountsByOwner
Returns all SPL Token accounts by owner.
| Name | Type | Description |
|---|---|---|
owner* | string | The public key of the account owner, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcKeyedAccount> | |
└ [] | object | Array item |
└ account | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
└ pubkey | string |
{ "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.
| Name | Type | Description |
|---|---|---|
delegate* | string | The public key of the delegate, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<RpcKeyedAccount> | |
└ [] | object | Array item |
└ account | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
└ pubkey | string |
{ "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.
| Name | Type | Description |
|---|---|---|
pubkey* | string | The public key of the account to query, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ data | array<string> | Account data |
└ executable | boolean | Whether this account contains executable code |
└ lamports | integer | Account balance in lamports |
└ owner | string | Program that owns this account |
└ rentEpoch | integer | Epoch at which this account will next owe rent |
{ "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).
| Name | Type | Description |
|---|---|---|
block* | integer | The slot to query for block commitment. |
| Field | Type | Description |
|---|---|---|
commitment | array | |
totalStake | integer |
{ "jsonrpc": "2.0", "id": 1, "method": "getBlockCommitment", "params": [ 0 ]}getMultipleAccounts
Returns account information for multiple public keys in a single call.
| Name | Type | Description |
|---|---|---|
pubkeys* | array[string] | An array of public keys to query, as base-58 encoded strings. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ dataSlice | object | The data slice configuration. |
└ length | integer | The length of the data slice. |
└ offset | integer | The offset of the data slice. |
└ encoding | string | The encoding for the account data. |
└ minContextSlot | integer | The minimum context slot for the account info. |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | array<any> |
{ "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.
| Name | Type | Description |
|---|---|---|
pubkey* | string | 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'. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ amount | string | Token amount as string |
└ decimals | integer | Number of decimals |
└ uiAmount | number | Human readable amount as float |
└ uiAmountString | string | Human readable amount as string |
{ "jsonrpc": "2.0", "id": 1, "method": "getTokenAccountBalance", "params": [ "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", { "commitment": "Processed" } ]}getTokenSupply
Returns the total supply of a token, given its mint address.
| Name | Type | Description |
|---|---|---|
mint* | string | 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'. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | object | |
└ amount | string | Token amount as string |
└ decimals | integer | Number of decimals |
└ uiAmount | number | Human readable amount as float |
└ uiAmountString | string | Human readable amount as string |
{ "jsonrpc": "2.0", "id": 1, "method": "getTokenSupply", "params": [ "<some-mint>", { "commitment": "Processed" } ]}getBalance
Returns the balance for a given address.
| Name | Type | Description |
|---|---|---|
pubkey* | string | The public key of the account to query, as a base-58 encoded string. |
config | object | Configuration object for the query. |
└ commitment | string | string | string | The commitment describes how finalized a block is at that point in time. Options are 'processed', 'confirmed', or 'finalized' |
└ minContextSlot | integer | The minimum context slot for the context. |
| Field | Type | Description |
|---|---|---|
context | object | |
└ apiVersion | string | The API version |
└ slot | integer | The current slot |
value | integer |
{ "jsonrpc": "2.0", "id": 1, "method": "getBalance", "params": [ "83astBRguLMdt2h5U1Tpdq5tjFoJ6noeGwaY3mDLVcri", { "commitment": "Processed", "minContextSlot": 123456789 } ]}