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