services
Get a key

library / How to use Solana / Webhooks / HS0123

Webhook transaction account list

A small Node.js file that takes a signature from a webhook payload, or an address to pull fresh ones from, and prints the full account list of each transaction: signers, writable accounts and the ones loaded from lookup tables. It only reads.

By Carbium · Webhooks · HS0123 · updated 2026-11-23

01

What a webhook can and cannot give you

Yes, with one step added. A webhook that fires at processed hands you a signature, and sometimes a trimmed payload. Treat the signature as the key and ask the RPC endpoint for the transaction. The response holds every account the transaction touched, which a payload often leaves out or cuts short.

There is one catch about the commitment level. getTransaction accepts confirmed or finalized and nothing lower, so you cannot read a processed transaction through it. For a webhook that fires at processed, the fetch has to wait until the transaction reaches confirmed. Because a slot is about 200 ms on mainnet since the Alpenglow switch, that wait is usually short, and the file retries a null answer a few times before it gives up.

If you need account lists the instant a transaction is processed, with no wait, the answer is a stream with a server-side filter, and the webhook is the wrong tool. Live gRPC filter updates covers that route.

02

The code

Install @solana/kit at 8.6.0, export CARBIUM_KEY and run the file with Node 24, which strips TypeScript types on load. Pass the signature from your webhook payload, or an address and the file takes that address's three newest signatures so you can try it before a live event arrives.

main.ts
// HS0123 · Webhook transaction account list// https://carbium.sh/library/howsolana/webhook-transaction-account-list// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MITimport { setTimeout as pause } from "node:timers/promises";import {  createDefaultRpcTransport,  createSolanaRpcFromTransport,  isAddress,  signature,} from "@solana/kit";const apiKey = process.env.CARBIUM_KEY;if (!apiKey) {  console.error("Set CARBIUM_KEY to your Carbium API key.");  process.exit(1);}const client = createSolanaRpcFromTransport(  createDefaultRpcTransport({    url: process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh",    headers: { "x-api-key": apiKey },  }),);const input = process.argv[2];if (!input) {  console.error("Usage: node main.ts <signature-or-address>");  process.exit(1);}// Waits in ms before each of the five reads: a processed event needs a few slots to confirm.const waits = [0, 300, 600, 900, 1200];async function accountsOf(sig: string) {  for (const wait of waits) {    await pause(wait);    const found = await client      .getTransaction(signature(sig), {        commitment: "confirmed",        encoding: "jsonParsed",        maxSupportedTransactionVersion: 1,      })      .send();    if (found) return found;  }  return null;}let targets: string[] = [input];if (isAddress(input)) {  const page = await client.getSignaturesForAddress(input, { limit: 3, commitment: "confirmed" }).send();  targets = page.map((row) => row.signature);}if (targets.length === 0) {  console.log("No signatures to read.");  process.exit(0);}for (const sig of targets) {  try {    const tx = await accountsOf(sig);    if (!tx) {      console.log(`${sig}: nothing after ${waits.length} reads, log it and move on`);      continue;    }    const list = tx.transaction.message.accountKeys;    const count = (test: (k: (typeof list)[number]) => boolean) => list.filter(test).length;    console.log(      `${sig}: slot ${tx.slot}, ${list.length} accounts, ${count((k) => k.signer)} signers, ` +        `${count((k) => k.writable)} writable, ${count((k) => k.source === "lookupTable")} from lookup tables`,    );    for (const k of list) {      console.log(`  ${k.pubkey} ${k.signer ? "S" : "-"}${k.writable ? "W" : "-"} ${k.source}`);    }  } catch (err) {    console.log(`${sig}: failed, ${String(err)}`);  }}

run: node main.ts <signature-or-address>

The call uses encoding: "jsonParsed". In that encoding the node resolves lookup tables for you and returns one flat accountKeys list. Each entry carries the address, a signer flag, a writable flag and a source field that reads transaction for an address written in the message and lookupTable for one loaded through a table. It also asks at confirmed and sets maxSupportedTransactionVersion: 1, so a v1 transaction comes back instead of an error.

03

Reading the account list

A versioned transaction does not spell out every account in its message. The message lists some addresses directly and points at lookup tables for the rest. A webhook payload built from the raw message shows only the first group, so a swap that touches thirty accounts can look like it touches twelve. The parsed list joins both groups in order.

FieldMeaning
pubkeyThe account address
signerTrue when the account signed the transaction
writableTrue when the transaction may change the account
sourcetransaction for a static address, lookupTable for a loaded one

Static addresses come first, in the message's order: fee payer, the other signers, writable accounts, then read-only ones. Lookup table accounts follow, the writable ones before the read-only ones. The file prints the signer count and the writable count next to the total, so a quick look tells you what a transaction can change.

Two details trip people. A program id is an account too, and it appears in the list as a read-only entry. A token transfer to an existing token account lists the token accounts and the sender's authority and never the receiving wallet, so a wallet filter built on this list misses incoming transfers. To find the wallet, read the token account's owner with a second call, or read the transaction's token balance fields.

04

On Carbium

Calls go to https://services.carbium.sh with the key in the x-api-key header. A `getTransaction` call costs 50 cells, and the address mode adds one getSignaturesForAddress, which costs 50 cells and runs at 0.24 req/s on Free, 1.2 on Dev, 100 on Business and 500 on Pro. Three transactions plus the lookup is four calls, so 200 cells when each read answers the first time. Each retry after a null is one more getTransaction call.

Webhook, RPC and WebSocket work is metered in credits, and limits are per account: every key on the account shares one budget. One fetch per webhook event is enough for this job. Do not fetch the same signature from several workers.

To receive the events in the first place, set up webhooks on your account. The file here starts after the event arrives and does only the lookup.

05

Where it ends

The list comes from a confirmed read, so it cannot arrive before confirmed. A transaction announced at processed can sit on a fork that is later dropped, and then no read finds it. The file stops after five attempts and prints that it found nothing. Log the signature and move on.

Every account an instruction reaches, inner cross-program calls included, has to be in this list, because the runtime refuses an account the message does not name. What the list leaves out is which instruction used which account. For that, read the transaction's inner instructions, as in Inner instruction tree.

getSignaturesForAddress on Carbium reads from an address index that keeps up to 30 days, and its pages reach below the validator's ledger floor, so getTransaction can answer null for an older signature the list returned. Retries do not change that. The address mode takes the newest signatures, which are inside the ledger.

The file does not verify who sent the webhook. Check the sender's auth header or shared secret in your handler before you trust the signature. For the receiving side, see Address transaction webhooks.

06

When it goes wrong

what goes wrongwhat to do
Every attempt answers null for a signature the webhook sent.The transaction has not reached confirmed, sat on a dropped fork, or belongs to another cluster. Check the cluster first, then raise the attempt count a little. After that, log it and stop.
Error -32015 on a transaction that exists.The call left out maxSupportedTransactionVersion or set it to 0, and the transaction is v1. Pass maxSupportedTransactionVersion: 1 with an encoding, as the file does.
An older signature from the address mode answers null on every read.The address index reaches below the validator's ledger floor, so that transaction is no longer served. Use the newest signatures, as the file does, and log the rest.
The webhook payload lists fewer accounts than the fetched transaction.The payload was built from the static part of the message. Trust the fetched list, which includes the lookup table accounts.
A wallet filter never matches an incoming token transfer.The transfer names token accounts, not the receiving wallet. Read each token account's owner and match on that.
07

Questions

Can I read the account list at the processed level?

Not through getTransaction, which takes confirmed or finalized. A log subscription at processed gives you the signature early, and the account list follows once the transaction confirms.

Does the list include lookup table accounts?

Yes. With jsonParsed the node joins them into one list and marks them with source: lookupTable, so you do not resolve the tables yourself.

Should I fetch every webhook event?

Only the ones you need. Each fetch is 50 cells, so filter on the payload first and fetch the signatures that pass.

What about a null result right after the event?

It is common and not an error. Webhook-to-RPC fetch retries covers the backoff schedule in detail.