Parameters
pubkeystring required Pubkey of program, as base-58 encoded string.
configobject optional Configuration object.
commitmentstringCommitment level.
encodingstringEncoding for account data.
dataSliceobjectLimit the returned account data.
filtersarrayFilter results using memcmp and/or dataSize.
withContextboolWrap the result in an RpcResponse JSON object.
minContextSlotnumberThe minimum slot.
changedSinceSlotnumberOnly return accounts that were modified after the specified slot.
cursorFilterobjectAllows paginating gPA requests by specifying a cursor (public key) and a limit (uint).
Result
arrayArray of JSON objects with pubkey (base-58 string) and account (object).
Examples
1. Filter by changed accounts since slot
Request
JSONcurl "https://eu.fluxrpc.com?key=<your-API-key>" -s -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"FLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X",
{ "commitment": "finalized", "encoding": "jsonParsed",
"changedSinceSlot": 406846134,
"filters": [{ "dataSize": 324 }] }
]
}'2. Paginate results with cursor and limit
Request
JSONcurl "https://eu.fluxrpc.com?key=<your-API-key>" -s -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": 1,
"method": "getProgramAccounts",
"params": [
"FLUXubRmkEi2q6K3Y9kBPg9248ggaZVsoSFhtJHSrm1X",
{ "commitment": "finalized", "encoding": "jsonParsed",
"cursorFilter": {
"limit": 5,
"cursor": "11ab4iuDV1cuSdX4UK3thiKqM8P4CacSQMPr47g8SGp"
},
"filters": [{ "dataSize": 324 }] }
]
}'