getAccountInfo | Solana

The Solana getAccountInfo method returns all the account data for a given public key.

This method provides detailed information about the account, including the account's current balance, owner, and executable state. It is useful for retrieving the state of an account at a specific commitment level.

๐Ÿ‘

Get you own node endpoint today

Start for free and get your app to production levels immediately. No credit card required.

You can sign up with your GitHub, X, Google, or Microsoft account.

Parameters

  • publicKey โ€” the public key of the account to retrieve information for.
  • commitment โ€” (optional) the level of commitment desired:
    • processed โ€” the node has processed the block and the block may be on a fork.
    • confirmed โ€” the block is confirmed by the cluster as not being on a fork.
    • finalized โ€” the block is finalized by the cluster.

Response

  • value โ€” the account information:
    • lamports โ€” the account's current balance.
    • owner โ€” the public key of the program that owns the account.
    • executable โ€” whether the account is marked as executable.
    • rentEpoch โ€” the epoch at which this account will next owe rent.
    • data โ€” the account's data, represented as a base64 string.

Use case

A practical use case for getAccountInfo is to retrieve the current balance of a Solana account. This can be useful for wallets or other applications that need to display or make use of this information.

Try the getAccountInfo RPC method yourself

Language
Click Try It! to start a request and see the response here!