services
Get a key

library / How to use Solana / Accounts and balances / HS0079

Account info response fields

One TypeScript file reads a wallet, a token mint, the Token program and an address with no account, then prints lamports, owner, data, executable, rentEpoch and space beside the slot of each read.

By Carbium · Accounts and balances · HS0079 · updated 2026-11-22

01

The envelope

A getAccountInfo answer carries two members under result: context and value. context.slot is the slot the node read the account at. value is an object with six fields, or null when no account exists at that address. All six fields describe the account as it stood in that one slot.

FieldJSON typeWhat it tells you
lamportsnumberThe balance in lamports, one billionth of a SOL each.
ownerstringThe program allowed to change the account's data.
dataarray or objectThe stored bytes, with the encoding named beside them.
executablebooleanTrue on a deployed program's account.
rentEpochnumberA leftover epoch marker, usually the largest u64.
spacenumberThe length of the stored data in bytes.

The slot sits outside value on purpose. Two reads of the same address at different slots can disagree on every field, and the slot is how you tell which one is newer.

02

Lamports and why they are bigint

One SOL is 1,000,000,000 lamports. The field is an unsigned 64 bit integer, and a JavaScript number holds integers exactly only up to 2^53, which is a little over 9 million SOL. A treasury or a large exchange wallet can sit above that line, and a plain JSON.parse would round its balance silently.

@solana/kit 8.6.0 parses the response with a reader that keeps big integers intact, so lamports arrives as a bigint. Keep it as one through every sum and comparison, and convert to a SOL string only when you print it. The same habit is laid out in BigInt lamport amounts.

03

Owner as the program in charge

Every account has exactly one owner, and the owner is always a program address. Only that program can write to the account's data or take lamports out of it. Anyone can send lamports in, which is why a stranger's dust shows up in a balance without any consent.

The owner tells you what kind of account you are looking at. A wallet is owned by the System Program, whose address is thirty-two characters of 1. A token mint is owned by the Token program. A program account is owned by a loader. The owner decides which byte layout data follows, so read it before you decode anything, as in Token program detection.

04

Data and its encoding tuple

With encoding: "base64", data is a two item array: the base64 text, then the word base64. The second item names the encoding the first one is in. A wallet has no stored bytes, so its data is an empty string beside the encoding name. A token mint holds 82 bytes, which come back as 112 base64 characters.

Decode with Buffer.from(data[0], "base64"). The decoded length equals space whenever you read the whole account. The other encodings, slicing and the parsed form are covered in Account data encodings, and the byte layouts of token accounts in Token account layout decoder.

05

Executable, rentEpoch and space

executable is true on the account of a deployed program and false on everything else. It is set when the program is deployed. Under the upgradeable loader, that program account holds a 4-byte loader tag plus the 32-byte address of its ProgramData account. The code sits in the ProgramData account, and that account reads executable false.

space is the data length in bytes. It is the number to feed a rent calculation, as in Rent-exempt minimum calculator, because an account's required balance grows with its size.

rentEpoch is the field people stumble on. The chain no longer collects rent from accounts, and accounts that hold the rent-exempt minimum are stamped with 18446744073709551615, the largest value a u64 can hold. That is 2^64 - 1, far above 2^53. A client that parses the reply with JSON.parse prints 18446744073709552000, which is a different number. Kit returns it as a bigint and the exact digits survive. The kit 8.6.0 account type does not declare the field, so the file reads it through a cast to { rentEpoch?: bigint } and prints absent when the reply leaves it out. Treat the field as a constant for any account you create today, and never compare it with the current epoch.

06

The run

The file reads four accounts and settles each call alone, so one failure becomes a line in the report and the other three still print. It needs only CARBIUM_KEY and @solana/kit 8.6.0. The mint defaults to USDC, and an optional first argument replaces it with any other mint.

main.ts
// HS0079 · Account info response fields// https://carbium.sh/library/howsolana/account-info-response-fields// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MITimport {  address,  createDefaultRpcTransport,  createSolanaRpcFromTransport,  generateKeyPairSigner,} from "@solana/kit";const key = process.env.CARBIUM_KEY ?? "";if (key === "") {  console.error("CARBIUM_KEY is empty: export your Carbium API key first.");  process.exit(1);}const rpc = createSolanaRpcFromTransport(  createDefaultRpcTransport({    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",    headers: { "x-api-key": key },  }),);const mint = address(process.argv[2] ?? "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v");// The fee payer is the first account key of the newest transaction on the mint.async function newestFeePayer(): Promise<string> {  const [newest] = await rpc.getSignaturesForAddress(mint, { limit: 1 }).send();  if (!newest) throw new Error("no signature found for the mint");  const tx = await rpc    .getTransaction(newest.signature, { encoding: "jsonParsed", maxSupportedTransactionVersion: 1 })    .send();  if (tx === null) throw new Error(`transaction ${newest.signature} is not stored yet`);  const keys = tx.transaction.message.accountKeys as unknown as { pubkey: string }[];  return keys[0].pubkey;}const targets: [string, () => Promise<string>][] = [  ["wallet", newestFeePayer],  ["mint", async () => mint],  ["program", async () => "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"],  ["missing", async () => (await generateKeyPairSigner()).address],];const results = await Promise.allSettled(  targets.map(async ([label, find]) => {    const who = address(await find());    const { context, value } = await rpc.getAccountInfo(who, { encoding: "base64" }).send();    const head = `${label.padEnd(8)} ${who} slot ${context.slot}`;    if (value === null) return `${head} value null`;    const [payload, encoding] = value.data;    const bytes = Buffer.from(payload, "base64").length;    const rentEpoch = (value as { rentEpoch?: bigint }).rentEpoch ?? "absent";    return [      head,      `  lamports ${value.lamports}`,      `  owner ${value.owner}`,      `  data ${bytes} bytes, encoding ${encoding}`,      `  executable ${value.executable}`,      `  rentEpoch ${rentEpoch}`,      `  space ${value.space}`,    ].join("\n");  }),);results.forEach((result, i) => {  const label = targets[i]![0];  if (result.status === "fulfilled") console.log(result.value);  else console.log(`${label.padEnd(8)} FAILED ${result.reason instanceof Error ? result.reason.message : String(result.reason)}`);});

run: node main.ts [mint-address]

The wallet is found at run time. The file asks getSignaturesForAddress for the newest signature on the mint, fetches that transaction with jsonParsed, and takes the first account key in the message, which is always the fee payer. The transaction call sends maxSupportedTransactionVersion: 1, because the newest transaction on a busy mint can be a v1 transaction, and a call without that option answers -32015 for it. Because the wallet comes from the newest activity, a different wallet shows up on each run.

The fourth address comes from generateKeyPairSigner. Nobody has ever sent it anything, so its row reads value null with the slot beside it. Every getAccountInfo call leaves commitment out, so kit sends confirmed. The four account reads cost 10 cells each and the two lookups cost 50 each, 140 cells for the run, which fits inside the 1,024 cell burst allowance of every plan.

Read the output as a side by side table. The wallet row shows the System Program as owner, space 0 and executable false. The mint row shows the Token program as owner and 82 bytes of data. The Token program row is the only one with executable true, and its owner is the upgradeable loader. Its 36 bytes of data are the loader tag and the address of the ProgramData account, so the program's code sits in that other account. The generated address is the only one without any of the six fields.

07

Where it ends

One call returns one account at one slot. There is no field for a previous balance, a previous owner or the transaction that last touched the account. To see how an account got to its present state, read its transactions and their balance changes.

Four calls are four reads, and each carries its own context.slot. The slots in the printed rows can differ by a few, and a wallet that received lamports between two reads will not match a sum you compute across rows. When the figures must belong together, take them from one call, as in Same-slot multi-account snapshot.

null has several causes. An address that never held lamports, a token account that was closed and an address copied with a typo all answer the same way. Telling a closed account from a missing one needs the transaction that closed it, which Closed account detection walks through.

The fields describe the account's header. What the bytes inside data mean depends on the owner program, and an Anchor or Token-2022 account carries layouts that this file does not decode.

08

When it goes wrong

what goes wrongwhat to do
TypeError: Cannot read properties of null on value.owner or value.data.The address has no account at that slot. Test value === null before reading any field, and report the address as missing.
A rentEpoch or a large lamports that prints with trailing zeros, such as 18446744073709552000.The reply went through JSON.parse and a JavaScript number. Use a client that returns bigint, and keep the field as a bigint or a string.
getTransaction answers -32015 while looking for the fee payer.The transaction is v1 and the call sent no maxSupportedTransactionVersion, or sent 0. Send 1 with the call.
getTransaction returns null for the newest signature.The node has not stored that transaction yet. Wait a moment and ask for the next signature, or retry the same one once.
Balances that do not add up across the printed rows.The four reads landed on different slots. Compare the slot column, or fetch the accounts in one getMultipleAccounts call.
Decoding goes wrong because the owner was assumed to be the System Program.Branch on owner first. A token mint, a program and a wallet each carry their own data layout.
09

Questions

Why is `rentEpoch` always 18446744073709551615?

Rent is no longer collected, and accounts with the rent-exempt minimum are stamped with the largest u64. The value carries no information, so ignore it unless you are reproducing the raw response.

Does `space` always equal the decoded length of `data`?

Yes for a full read. A dataSlice request shortens data but space still reports the full stored length, which makes it a quick size check.

Why is `executable` true on a program and false on its data?

Under the upgradeable loader the flag sits on the 36-byte program account. The separate ProgramData account that holds the code reads executable false, as do mints and token accounts, which hold plain state.

Can the same address return a different owner later?

Yes. A closed account can be created again, and an account with no data can be reassigned to a new program while it holds no data. Treat the owner as a field of one slot.