getProgramAccountsConfig
Note: This is not a standard Solana JSON-RPC method. It is a configuration reference helper. See the linked method above for the actual RPC endpoint.
This is not a standard Solana JSON-RPC method. It serves as a configuration reference for the getProgramAccounts method, documenting the available filter options and configuration parameters in detail. Use the getProgramAccounts method with these configuration options to query program-owned accounts with specific filter criteria.
Parameters
This method does not accept any parameters.
Configuration object fields:
| Field | Type | Description |
|---|---|---|
commitment | string | Commitment level: processed, confirmed, or finalized |
encoding | string | Data encoding: base58, base64, base64+zstd, or jsonParsed |
dataSlice | object | { offset: number, length: number } - Limit returned data to a byte range |
filters | array | Array of filter objects to refine results |
filters[].memcmp | object | { offset: number, bytes: string, encoding?: string } - Compare bytes at a specific offset |
filters[].dataSize | number | Filter accounts by exact data size in bytes |
withContext | bool | Wrap result in an RpcResponse with slot context |
minContextSlot | number | Minimum slot at which the request can be evaluated |
Response
This is a configuration reference. See getProgramAccounts for the response format.
Code Examples
cURL
curl http://88.216.36.108:7999 -X POST -H "Content-Type: application/json" -d '{
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
{
"encoding": "base64",
"filters": [
{ "dataSize": 165 },
{ "memcmp": { "offset": 32, "bytes": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg" } }
],
"withContext": true
}
]
}'TypeScript
const response = await fetch("http://88.216.36.108:7999", {
method: "POST",
headers: { "Content-Type": "application/json" },
body: JSON.stringify({
jsonrpc: "2.0",
id: 1,
method: "getProgramAccounts",
params: [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
{
encoding: "base64",
filters: [
{ dataSize: 165 },
{ memcmp: { offset: 32, bytes: "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg" } }
],
withContext: true
}
]
}),
});
const { result } = await response.json();
console.log("Accounts found:", result.value.length);Python
import requests
response = requests.post("http://88.216.36.108:7999", json={
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
{
"encoding": "base64",
"filters": [
{"dataSize": 165},
{"memcmp": {"offset": 32, "bytes": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"}}
],
"withContext": True
}
]
})
result = response.json()["result"]
print(f"Accounts found: {len(result['value'])}")Rust
use reqwest::Client;
use serde_json::json;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = Client::new();
let res = client.post("http://88.216.36.108:7999")
.json(&json!({
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
{
"encoding": "base64",
"filters": [
{"dataSize": 165},
{"memcmp": {"offset": 32, "bytes": "vines1vzrYbzLMRdu58ou5XTby4qAqVRLmqo36NKPTg"}}
],
"withContext": true
}
]
}))
.send().await?
.text().await?;
println!("{}", res);
Ok(())
}Example Response
{
"jsonrpc": "2.0",
"result": {
"context": { "slot": 123456789 },
"value": [
{
"pubkey": "CnPoSPKXu7wJqxe59Fs72tkBeALovhsCxYeFwPCQH9TD",
"account": {
"data": ["base64data...", "base64"],
"executable": false,
"lamports": 2039280,
"owner": "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
"rentEpoch": 361,
"space": 165
}
}
]
},
"id": 1
}