services
Get a key

library / How to use Solana / HS0008

Transaction status check

One TypeScript file takes signatures, or an address to pull its three latest from, asks getSignatureStatuses about each, and polls once a second, five times at most, until every one is finalized or failed. It only reads, so it needs no keypair and sends nothing.

By Carbium · Confirmation and retries · HS0008 · updated 2026-11-22

01

What the call answers

Sending a transaction hands you a signature and nothing more. Whether the cluster has seen it, whether it ran, and how settled it is are separate questions, and getSignatureStatuses answers all three in one call. You pass up to 256 signatures and get an array back in the same order, one entry per signature.

An entry is null or an object. null means the node has no record of that signature. An object carries the slot the transaction landed in, an err field that is null on success, and a confirmationStatus of processed, confirmed or finalized. It says nothing about accounts, logs or fees.

A status check runs after every send, so a small answer suits it. Once a signature is finalized you fetch the full transaction once with getTransaction, which costs 50 cells on Carbium, and stop polling.

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 its own. Give it one or more signatures, or a single address. For an address it takes the three latest signatures and checks those, so you can run the file before you have a transaction of your own.

main.ts
// HS0008 · Transaction status check// https://carbium.sh/library/howsolana/transaction-status-check// Copyright (c) Carbium Corporation. MIT License (LICENSE). Keep this notice.// SPDX-License-Identifier: MITimport { setTimeout as sleep } from "node:timers/promises";import {  createDefaultRpcTransport,  createSolanaRpcFromTransport,  isAddress,  isSolanaError,  signature,  SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR,} from "@solana/kit";const key = process.env.CARBIUM_KEY;if (!key) {  console.error("Set CARBIUM_KEY to your Carbium API key.");  process.exit(1);}const url = process.env.CARBIUM_RPC_URL ?? "https://services.carbium.sh";const rpc = createSolanaRpcFromTransport(  createDefaultRpcTransport({ url, headers: { "x-api-key": key } }),);const args = process.argv.slice(2);if (args.length === 0 || args.length > 256) {  console.error("Usage: node main.ts <signature>... | <address>  (1 to 256 signatures)");  process.exit(1);}// One retry on HTTP 429, after the number of seconds the door asks for.async function withRetry<T>(call: () => Promise<T>): Promise<T> {  try {    return await call();  } catch (e) {    if (!isSolanaError(e, SOLANA_ERROR__RPC__TRANSPORT_HTTP_ERROR) || e.context.statusCode !== 429) throw e;    const seconds = Number(e.context.headers.get("retry-after")) || 1;    console.error(`429: waiting ${seconds}s, then one more try`);    await sleep(seconds * 1000);    return call();  }}// A single address gives its three latest signatures; otherwise every argument is a signature.const [first] = args;const sigs =  args.length === 1 && isAddress(first)    ? (        await withRetry(() =>          rpc.getSignaturesForAddress(first, { limit: 3, commitment: "confirmed" }).send(),        )      ).map((row) => row.signature)    : args.map((a) => signature(a));if (sigs.length === 0) {  console.log("No signatures to check.");  process.exit(0);}const show = (v: unknown) =>  JSON.stringify(v, (_k, x) => (typeof x === "bigint" ? x.toString() : x));for (let round = 1; round <= 5; round++) {  const { value } = await withRetry(() =>    rpc.getSignatureStatuses(sigs, { searchTransactionHistory: true }).send(),  );  let open = 0;  console.log(`poll ${round}`);  for (const [i, s] of value.entries()) {    // Done: finalized, or landed with an error. A null can still land until its blockhash expires.    if (s === null || (s.err === null && s.confirmationStatus !== "finalized")) open++;    const line = s === null ? "not found" : `${s.confirmationStatus} slot=${s.slot} err=${show(s.err)}`;    console.log(`  ${sigs[i]} ${line}`);  }  if (open === 0) break;  await sleep(1000);}

run: node main.ts <signature>... | <address>

Three parts carry the job. signature() validates each argument as a base58 signature before any request leaves, so a typo fails on your machine. The status call sets searchTransactionHistory: true, which tells the node to look in its ledger as well as in its short cache of recent slots. The loop polls once a second, five times at most, and stops as soon as every signature is finalized or has an error.

03

Reading one status

FieldTypeMeaning
slotbigintThe slot the transaction was processed in.
confirmationsbigint or nullA legacy count that is null for a finalized transaction. Read confirmationStatus instead.
errobject or nullnull when the transaction succeeded. Otherwise the error, such as an InstructionError with the index of the failing instruction.
confirmationStatusstringOne of processed, confirmed or finalized.

A status that reads confirmed on one poll can read finalized on the next, and the first poll that finds a signature will often find it already finalized. Check err first, then compare the level you need. Do not write code that waits to see all three levels go by.

$A non-null err still comes with a slot and a level. The transaction is in a block, it ran, and its changes were rolled back. Resending cannot help, because that signature is already in the ledger.
04

Telling slow from dead

A null has two readings and the call cannot choose between them: the transaction has not landed yet, or it never will. The deciding fact is the blockhash. A transaction is valid for about 150 blocks after the blockhash it carries, and the lastValidBlockHeight you got with that blockhash marks the end of the window. While the chain is inside it, keep polling. Resending the same signed bytes is safe in that time, because the signature is the same and the cluster drops the duplicate.

Once getBlockHeight passes lastValidBlockHeight and the status is still null with history search on, the transaction is dead. Only then build a new one with a fresh blockhash and a new signature. At about 200 ms a slot, 150 blocks is on the order of half a minute, so the polling loop stays short. A poll every second lands about five slots apart, which is often enough to see a status change.

If you want a push, signatureSubscribe on the WebSocket sends one confirmation for a signature and then the subscription ends. The socket is wss://services.carbium.sh with the key as ?api-key= in the URL. Such a subscription opens at 5 credits and then costs 20 credits per MiB sent. Polling is easier to reason about when you track many signatures, because one call covers up to 256 of them.

05

On Carbium

Every call goes to https://services.carbium.sh, or to whatever CARBIUM_RPC_URL names. The address mode adds one getSignaturesForAddress, which costs 50 cells and is rate-limited at 0.24 req/s on Free, 1.2 on Dev, 100 on Business and 500 on Pro.

Check all your pending signatures in one call. A JSON-RPC batch of up to 100 calls is a different tool and is not needed here, because the method already takes a list.

Polling a long list every second draws on your cells each time. If calls come in faster than your plan's rate, slow the loop down or move to a plan with a higher rate for the method.

06

Where it ends

The status says nothing about what a transaction did. An err of null means it ran without error. Whether a swap moved the amount you expected, or which accounts changed, needs getTransaction, and the status call cannot stand in for it.

A null for an old signature is just as ambiguous. With searchTransactionHistory on, the node searches the ledger it holds. A signature older than that comes back null, as if it had never existed, and the call does not tell the two apart. Keep the blockhash window you sent under next to each signature and decide from that.

The address mode reads getSignaturesForAddress, which on Carbium reaches back 30 days at most, from its own address index. An empty page past that is the index's age limit and does not mean you found the address's first transaction. A loop that pages backwards would reach that limit. The file asks for three signatures, so an active address never gets near it, while an address with no transaction in the last 30 days returns an empty list and the file prints "No signatures to check."

The call looks up signatures you already hold. It cannot find transactions by account, program or time, and it takes 256 signatures at most per request.

07

When it goes wrong

what goes wrongwhat to do
Every status is null right after a send.The node may not have the transaction yet. Poll again a second later, up to the end of the blockhash window. If the window is over and it is still null, rebuild with a fresh blockhash and send again.
A signature you know landed comes back null.Set searchTransactionHistory: true. Without it the node looks only in its short cache of recent slots. If it is still null, the transaction is older than the history the node holds, and this call cannot show it.
err is set on a signature you expected to succeed.The transaction landed and failed. Read the code in err, fetch the logs with getTransaction, fix the cause and send a new transaction. The old signature cannot be reused.
The file throws on an argument before any request leaves.A signature is 64 bytes, about 87 or 88 base58 characters. A string of about 43 or 44 characters is an address: pass it alone and the file takes its latest signatures instead.
Error -32602 on a long list.More than 256 signatures went into one call. Split the list into chunks of 256 and make one call per chunk.
HTTP 429 with a retry-after hint.The file already waits the retry-after seconds and tries once more, so a 429 that still gets through means the loop polls faster than your plan's rate for the method. A Free key also gets a 429 when its network's shared budget is spent. Poll less often or move up a plan.
08

Questions

Do I need a private key to check a status?

No. The call takes signatures, which are public, and returns state. The Carbium key only identifies your account to the RPC.

How often should I poll?

Once a second is enough. A status changes within a few slots of landing, and a faster loop only spends cells on the same answer.

How is this different from getTransaction?

getSignatureStatuses returns the outcome and the commitment level for up to 256 signatures at once. getTransaction returns the whole transaction for one signature and costs 50 cells on Carbium, so poll the status and fetch the transaction once.

Which commitment does the call use?

None: the method has no commitment option, and the level reached comes back as confirmationStatus. In this file only getSignaturesForAddress takes one, and it is set to confirmed.