The Light Token SDK calls these methods internally via interface functions
like
transferInterface and getAtaInterface. You rarely need to call
them directly.Call these methods directly if you are building a block explorer,
custom indexer, or working with
legacy compressed tokens.| Light SDK interface method | Solana RPC | Photon RPC |
|---|---|---|
getAccountInfoInterface | getAccountInfo | getCompressedAccount |
getBalanceInterface | getBalance | getCompressedBalanceByOwner |
getAtaInterface | getAccountInfo | getCompressedTokenAccountsByOwner |
getTokenAccountBalanceInterface | getTokenAccountBalance | getCompressedTokenBalancesByOwner |
getSignaturesForAddressInterface | getSignaturesForAddress | getCompressionSignaturesForAddress |
getSignaturesForOwnerInterface | getSignaturesForAddress | getCompressionSignaturesForOwner |
Create an RPC connection
- 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 reduce API calls. |
| Caching | Cache frequently accessed data to reduce API calls. |
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. |
Methods
These methods are called internally by the Light Token SDK. Call them directly for custom indexing, block explorers, or debugging.| GetCompressedAccount | Returns a compressed account by address or hash. |
| GetCompressedAccountsByOwner | Returns all compressed accounts for an owner. |
| GetCompressedBalanceByOwner | Returns the total compressed balance for an owner. |
| GetCompressedTokenAccountsByOwner | Returns all compressed token accounts for an owner. |
| GetCompressedTokenBalancesByOwner | Returns all token balances for compressed accounts owned by an address. |
| GetValidityProof | Returns a validity proof for compressed state transitions. |
| GetCompressionSignaturesForAddress | Returns signatures for transactions involving an address. |
| GetCompressionSignaturesForOwner | Returns signatures for transactions where an address is the owner. |
| GetTransactionWithCompressionInfo | Returns transaction details with compression context. |
| GetIndexerHealth | Returns the health status of the Photon indexer. |
| GetIndexerSlot | Returns the current slot of the Photon indexer. |
Legacy
Methods for direct compressed-token workflows. Not called by the Light Token SDK interface functions.| GetCompressedBalance | Returns the balance of a single compressed account. |
| GetCompressedMintTokenHolders | Lists all holders of a compressed token mint. |
| GetCompressedTokenAccountBalance | Returns the token balance of a single compressed token account. |
| GetCompressedTokenAccountsByDelegate | Returns all compressed token accounts delegated to an address. |
| GetCompressionSignaturesForAccount | Returns signatures for transactions involving a compressed account. |
| GetCompressionSignaturesForTokenOwner | Returns signatures for token transactions by owner. |
| GetLatestCompressionSignatures | Returns the most recent compression-related signatures. |
| GetLatestNonVotingSignatures | Returns recent non-voting transaction signatures. |
| GetMultipleCompressedAccounts | Returns multiple compressed accounts in a single request. |
| GetMultipleNewAddressProofs | Returns proofs that new addresses can be created. |