Helius Labs maintains the canonical RPC API and Photon indexer implementation.
Connection class with compression-related endpoints.
The API exposed by the indexer closely mirrors existing RPC calls, with one-to-one mapping:
| Solana RPC | Photon RPC Calls |
|---|---|
| getAccountInfo | getCompressedAccount |
| getBalance | getCompressedBalance |
| getTokenAccountsByOwner | getCompressedTokenAccountsByOwner |
| getProgramAccounts | getCompressedAccountsByOwner |
Creating an RPC Connection
Connect to a specific RPC endpoint- Mainnet
- Devnet
Best Practices
| Best Practice | Description |
|---|---|
| Commitment Levels | Use appropriate commitment levels: processed (fastest), confirmed (balanced), finalized (most reliable) |
| Rate Limiting | Implement retry logic and respect rate limits. Public endpoints: 100 req/s, Private: 1000+ req/s |
| Batch Requests | Use batch requests when possible to improve efficiency and reduce API calls |
| Caching | Cache frequently accessed data to reduce API calls and improve performance |
Error Codes
| Code | Message | Description |
|---|---|---|
| -32600 | Invalid Request | The JSON sent is not a valid Request object |
| -32601 | Method not found | The method does not exist / is not available |
| -32602 | Invalid params | Invalid method parameter(s) |
| -32603 | Internal error | Internal JSON-RPC error |
| -32000 | Account not found | The compressed account was not found |
| -32001 | Invalid account hash | The provided account hash is invalid |
Mainnet ZK Compression JSON RPC Methods
GetCompressedAccount
Retrieves information about a specific compressed account by its address or hash.
GetCompressedAccountsByOwner
Returns all compressed accounts owned by a specific address.
GetCompressedBalance
Retrieves the balance of a compressed account.
GetCompressedBalanceByOwner
Gets the total balance of all compressed accounts owned by an address.
GetCompressedMintTokenHolders
Lists all holders of a specific compressed token mint.
GetCompressedTokenAccountBalance
Retrieves the token balance of a compressed token account.
GetCompressedTokenAccountsByDelegate
Returns all compressed token accounts delegated to a specific address.
GetCompressedTokenAccountsByOwner
Lists all compressed token accounts owned by a specific address.
GetCompressedTokenBalancesByOwner
Retrieves all token balances for compressed accounts owned by an address.
GetCompressionSignaturesForAccount
Returns signatures for transactions involving a compressed account.
GetCompressionSignaturesForAddress
Retrieves signatures for transactions involving a specific address.
GetCompressionSignaturesForOwner
Returns signatures for transactions where an address is the owner.
GetCompressionSignaturesForTokenOwner
Lists signatures for transactions involving tokens owned by an address.
GetIndexerHealth
Returns the health status of the compression indexer.
GetIndexerSlot
Retrieves the current slot of the compression indexer.
GetLatestCompressionSignatures
Returns the most recent transaction signatures related to compression.
GetLatestNon-VotingSignatures
Retrieves recent non-voting transaction signatures.
GetMultipleCompressedAccounts
Retrieves multiple compressed accounts in a single request.
GetMultipleNewAddressProofs
Returns proofs that the new addresses are not taken already and can be created.
GetTransactionWithCompressionInfo
Returns transaction details with additional compression-related information.
GetValidityProof
Retrieves a validity proof for compressed data.