getMultipleAccounts | Solana

Solana getMultipleAccounts method

The Solana getMultipleAccounts method returns information about multiple accounts by public key.

This method provides detailed information about each account, including the account's current balance, owner, and executable state. It is useful for retrieving the state of multiple accounts 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

  • publicKeys — an array of public keys of the accounts 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 — an array of account information objects, each containing:
    • 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 getMultipleAccounts is to retrieve the current state of multiple Solana accounts. This can be useful for wallets or other applications that need to display or make use of this information.

Try the getMultipleAccounts RPC method yourself

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