getProgramAccounts RPC Method

Returns accounts owned by the specified program, optionally filtered by data content or size.

$ curl https://api.devnet.solana.com -s -X \
> POST -H "Content-Type: application/json" -d '
> {
> "jsonrpc": "2.0",
> "id": 1,
> "method": "getProgramAccounts",
> "params": [
> "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA",
> {
> "commitment": "finalized",
> "encoding": "base64",
> "filters": [
> { "dataSize": 165 },
> {
> "memcmp": {
> "offset": 0,
> "bytes": "Gh9ZwEmdLJ8DscKNTkTqPbNwLNNBjuSzaG9Vp2KGtKJr"
> }
> },
> {
> "memcmp": {
> "offset": 32,
> "bytes": "5wx11hXBHQALycTQNkeQ5w1N9vgup4ardN2yLiDK4JyK"
> }
> }
> ],
> "sortResults": true
> }
> ]
> }
> '

params

stringrequired

Pubkey of program, as base-58 encoded string

objectoptional

Configuration object containing the following fields:

result

Response
{
"jsonrpc": "2.0",
"result": [
{
"pubkey": "CxELquR1gPP8wHe33gZ4QxqGB3sZ9RSwsJ2KshVewkFY",
"account": {
"data": [
"KgAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA==",
"base64"
],
"executable": false,
"lamports": 15298080,
"owner": "4Nd1mBQtrMJVYVfKf2PJy9NZUZdTAsp7D4xWLs4gDB4T",
"rentEpoch": 28,
"space": 42
}
}
],
"id": 1
}
array

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:

Is this page helpful?

द्वारा प्रबंधित

© 2026 सोलाना फाउंडेशन। सर्वाधिकार सुरक्षित।
जुड़े रहें