getProgramAccounts

getProgramAccounts — All accounts owned by a program

post
/

Returns all accounts owned by a given program. This method is useful for finding all accounts associated with a specific program, such as all token accounts for a particular token mint or all accounts created by a custom program. You can apply filters to narrow down the results. SPL/SPL2022 Token Program Requirements: When querying SPL or SPL2022 token programs, the configuration object must include: filters (array, required): An array of filters to apply to the accounts. Must contain the dataSize filter. Must be one of the known lengths for SPL/SPL2022 program accounts (mint= 82 , token= 165 ) or a larger value when filtering for SPL2022 accounts with extensions. When filtering for multisig accounts, the size must be 355 for accounts of both programs. When filtering for token accounts : Must contain at least one memcmp filter. Only the mint ( offset = 0 , 32 bytes data length) and the owner ( offset = 32 , 32 bytes data length) filters are supported. Parameters

  1. programId (required) — Program pubkey, base-58.

  2. config (optional) — Optional configuration object. Every field is optional; omit the entire object to use defaults.

Authorizations
AuthorizationstringOptional

Pass Authorization: <api-key> on each request.

Body
jsonrpcstring · enumRequired

JSON-RPC protocol version.

Example: 2.0Possible values:
idone ofRequired

Request identifier echoed back in the response.

Example: 1
stringOptional
or
integerOptional
methodstring · enumRequired

Must be getProgramAccounts.

Example: getProgramAccountsPossible values:
Responses
200

Successful getProgramAccounts response.

application/json

Base envelope of every JSON-RPC 2.0 response.

jsonrpcstring · enumRequiredExample: 2.0Possible values:
idone ofRequired

Echoed request id.

Example: 1
stringOptional
or
integerOptional
post
/

Last updated