Documentation index

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:

FieldTypeDescription
commitmentstringCommitment level: processed, confirmed, or finalized
encodingstringData encoding: base58, base64, base64+zstd, or jsonParsed
dataSliceobject{ offset: number, length: number } - Limit returned data to a byte range
filtersarrayArray of filter objects to refine results
filters[].memcmpobject{ offset: number, bytes: string, encoding?: string } - Compare bytes at a specific offset
filters[].dataSizenumberFilter accounts by exact data size in bytes
withContextboolWrap result in an RpcResponse with slot context
minContextSlotnumberMinimum slot at which the request can be evaluated

Response

This is a configuration reference. See getProgramAccounts for the response format.

Code Examples

cURL

Terminal
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

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

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

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

JSON
{
  "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
}