Skip to main content

Parameters

string
required
Public key of the owner (base-58 encoded)
object
required
Configuration object containing:
string
required
Public key of the token program (base-58 encoded)
string
Commitment level (processed, confirmed, finalized)
string
Encoding for account data (base58, base64, jsonParsed)
object
number
Offset into account data
number
Length of data to return

Response

object
Object containing:
object
number
The slot the request was processed at
array
Array of token account objects containing:
string
Public key of the token account (base-58 encoded)
object
number
Number of lamports in the account
string
Public key of the account owner (base-58 encoded)
boolean
Whether the account is executable
number
Epoch at which the account will next owe rent
object
object
object
object
string
Raw amount of tokens as a string
number
Number of decimals configured for token’s mint
number
Token amount as a float, accounting for decimals
string
Token amount as a string, accounting for decimals
string
Public key of the token’s mint (base-58 encoded)
string
Public key of the token account owner (base-58 encoded)
string
Public key of the delegate (base-58 encoded)
string
Type of account (account)
string
Program that owns the account (spl-token)
number
Number of bytes allocated to the account

Code Examples

Basic Request

Using web3.js

Notes

  1. Returns all token accounts owned by the given public key
  2. The owner has full control over these accounts
  3. The response is immediate as it reads from the current state
  4. The accounts can change with token transfers and other operations
  5. The owner must be a valid public key

Best Practices

  1. Use appropriate commitment level based on your needs
  2. Cache results when appropriate to reduce RPC load
  3. Monitor for changes in owned accounts
  4. Consider using websocket subscription for real-time updates
  5. Handle network errors and retry when appropriate

Common Errors

Use Cases

  1. Owner Account Analysis
  2. Owner Account Monitoring
  3. Owner Account Planning