getMultipleAccounts
Returns the account information for a list of Pubkeys.
Parameters
Pubkeys array<string>
- An array of Pubkeys to query, as base-58 encoded strings (up to a maximum of 100)
Configuration <object>
-
Configuration object containing the following fields:
-
encoding: <string>- encoding format for Account dataDetails
base58is slow and limited to less than 129 bytes of Account data. -base64will return base64 encoded data for Account data of any size. -base64+zstdcompresses the Account data using Zstandard and base64-encodes the result. -jsonParsedencoding attempts to use program-specific state parsers to return more human-readable and explicit account state data. - IfjsonParsedis requested but a parser cannot be found, the field falls back tobase64encoding, detectable when thedatafield is typestring.
-
dataSlice: <object>- Request a slice of the account's data-
length: <usize>- number of bytes to return -
offset: <usize>- byte offset from which to start readingDetails
data slicing is only available for
base58,base64, orbase64+zstdencodings.
-
-
Result
The result will be a JSON object with value equal to an array of:
<null>- if the account at that Pubkey doesn't exist, or<object>- a JSON object containing:lamports: <u64>- number of lamports assigned to this account, as a u64owner: <string>- base-58 encoded Pubkey of the program this account has been assigned todata: <[string, encoding]|object>- data associated with the account, either as encoded binary data or JSON format{<program>: <state>}- depending on encoding parameterexecutable: <bool>- boolean indicating if the account contains a program (and is strictly read-only)rentEpoch: <u64>- the epoch at which this account will next owe rent, as u64space: <u64>- the data size of the account
Code sample
curl "https://testnet.atlas.xyz" -X POST -H "Content-Type: application/json" -d '
{
"jsonrpc": "2.0",
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38",
"method": "getMultipleAccounts",
"params": [
[
"BjQGKpja61BXh7ViCcWU32gBnHuP6Spev8SxMYDcydQZ",
"AHhkdcEyhkYaKJNm8tmoU9En7GDGfctkKShbVcbMv4y6"
],
{
"encoding": "base58"
}
]
}
'
Response
{
"jsonrpc": "2.0",
"id": "0bdba4c1-3073-41b0-b849-46f14e004e38",
"result": {
"context": {
"slot": 11168992
},
"value": [
{
"lamports": 99915514775,
"data": ["", "base58"],
"owner": "11111111111111111111111111111111",
"executable": false,
"rentEpoch": 0,
"space": 0
},
{
"lamports": 99894405668,
"data": ["", "base58"],
"owner": "11111111111111111111111111111111",
"executable": false,
"rentEpoch": 0,
"space": 0
}
]
}
}