Retrieve all compressed accounts owned by a specific address. RPC method guide with use cases, tips and examples.
getCompressedAccountsByOwner RPC method returns all compressed accounts owned by a specific address, with support for filtering, pagination, and data slicing.
owner (PublicKey, required): Base58-encoded public key of the account owner to query compressed accounts for.options (object, optional): Configuration object for filtering and pagination:
filters (array, optional): Array of filter objects to narrow results by specific criteriadataSlice (object, optional): Slice of account data to return with offset and length fieldscursor (string, optional): Cursor for pagination from previous response to fetch next pagelimit (BN, optional): Maximum number of accounts to return (use bn() helper)items (array): Array of compressed account objects with merkle context
hash (string): Unique hash identifying the account for merkle proof generationaddress (string, optional): Account address if availablelamports (number): Account balance in lamportsowner (string): Public key of the account ownerdata (object): Account data information including discriminator and data hashtree (string): Public key of the merkle tree storing this accountleafIndex (number): Position of account in the merkle treeseq (number): Sequence number for account orderingslotCreated (number): Slot when account was createdcursor (string | null): Pagination cursor for next batch, null if no more resultsNo accounts found
Request timeout with large responses
Dependencies & Setup
light-client, solana-sdk, anyhow, and tokio crates. See Rust example comments for setup details.An ID to identify the request.
test-account The version of the JSON-RPC protocol.
2.0 The name of the method to invoke.
getCompressedAccountsByOwner