Source
get_program_accountsParameters
Pubkey of program, as base-58 encoded string
Configuration object containing the following fields:
Show propertiesHide properties
Show propertiesHide properties
Values:
processed, confirmed, finalizedSolana RPC uses the following commitment levels:| Value | Description |
|---|---|
processed | Return data from the highest slot this node has processed. This is the newest view, but the block can still be skipped. |
confirmed | Return data from the same slot as finalized. Kept for compatibility and planned for removal in a later release. |
finalized | Return data from the highest slot with a finalization certificate, from votes by 80% of stake in one round or 60% of stake in each of two rounds. This is the strongest commitment level. |
The minimum slot that the request can be evaluated at
Example
{ "minContextSlot": 341197000 }
Values:
true, falseWrap the result in an RpcResponse JSON objectExample
{ "withContext": true }
Values:
If you use
The nested
base58, base64, base64+zstd, binary, jsonParsedEncoding format for account data.| Encoding | Data format | Notes |
|---|---|---|
base64 | [data, "base64"] | Recommended |
base58 | [data, "base58"] | Slow. The account’s data field must be 128 bytes or fewer |
base64+zstd | [data, "base64+zstd"] | Zstandard compressed |
jsonParsed | {program, parsed, space} | Falls back to [data, "base64"] if no parser found |
binary | string | Deprecated default. Legacy encoding retained for backwards compatibility. Same base58 encoding as base58 with the same 128-byte data field limit, but returns data as a plain string instead of an array. Use base64 instead |
jsonParsed, each returned account uses the stable wrapper
{program, parsed, space}. The program field identifies the parser that
produced parsed. If no parser is available, the RPC node falls back to
[data, "base64"].program value | Parsed account type |
|---|---|
address-lookup-table | Address lookup table accounts |
bpf-upgradeable-loader | Upgradeable loader program and buffer accounts |
config | Config accounts |
nonce | Durable nonce accounts |
spl-token | SPL Token accounts |
spl-token-2022 | SPL Token 2022 accounts |
stake | Stake accounts |
sysvar | Sysvar accounts |
vote | Vote accounts |
parsed payload remains program-specific.For the shared account wrapper returned in each account field, see
Account Data.Request a slice of the account’s data.
| Field | Type | Description |
|---|---|---|
offset | usize | Byte offset from which to start reading account data. |
length | usize | Number of bytes to return. |
Example
{ "offset": 0, "length": 32 }
Data slicing is only available for
base58, base64, base64+zstd, and
binary encodings.Filter results using up to 4 filter objects. The resultant account(s) must meet
all filter criteria to be included in the returned results.The following filter types are supported:
| Filter | Type | Description |
|---|---|---|
memcmp | object | Compares a provided series of bytes with account data at a particular offset. Fields: offset (usize), byte offset into account data; bytes (string | array), data to match, provided as a base-58 string by default, a base-64 string when encoding is "base64", or a raw byte array; encoding (string, optional), encoding for string bytes, either "base58" (default), "base64", or "bytes". Decoded data is limited to 128 bytes. |
dataSize | u64 | Compares the account data length with the provided size. |
tokenAccountState | N/A | Filters for Token or Token-2022 accounts that have been initialized. No value is needed. |
Values:
true, falseWhether to sort returned accounts before returning them. If disabled, do not
assume any particular response order.Result
By default, returns an array of JSON objects. If
withContext flag is set, the
array will be wrapped in an RpcResponse JSON object.Each object contains:Show propertiesHide properties
Show propertiesHide properties
The account Pubkey as base-58 encoded string
Account data object.This field uses the shared
Account Data structure.
When
| Field | Type | Description |
|---|---|---|
data | string | [string, encoding] | object | Account data. Binary forms depend on the encoding parameter. When encoding is jsonParsed, this field is {program, parsed, space}; if no parser is available, the RPC node falls back to [data, "base64"]. |
executable | bool | Whether the account contains a program and is therefore read-only. |
lamports | u64 | Lamports assigned to the account. |
owner | string | Program owner pubkey, as a base-58 encoded string. |
rentEpoch | u64 | Next epoch at which the account owes rent. |
space | u64 | null | Account data size in bytes. Current Solana RPC responses populate this field for encoded account responses. |
account.data is returned as an object, it contains:| Field | Type | Description |
|---|---|---|
program | string | Name of the parser that produced the decoded account data. |
parsed | object | Parser-specific JSON payload. Its structure depends on the owning program and account type. |
space | u64 | Account data size in bytes. |