services
Get a key

library / How to use Solana

Confirmation and retries

Confirmation and retries in the Carbium Library: 11 working Solana examples, among them Post-confirmation account read and Block-height confirmation loop.

  • Post-confirmation account read HS0101

    Read an account right after its transaction confirms without a false null: wait for the signature status, then pin getAccountInfo to that slot.

  • Block-height confirmation loop HS0099

    Wait for a signature with a lastValidBlockHeight deadline using getBlockHeight and getSignatureStatuses in one read-only TypeScript file.

  • Transient RPC error retries HS0098

    Retry a Solana RPC call that fails with fetch failed, a timeout, a 429 or a 5xx, and surface every other error at once, in one TypeScript file on Carbium.

  • RPC request timeouts HS0097

    Put a timeout on each Solana RPC read with kit abort signals, retry timeouts under one deadline, and tell them from 429s on Carbium.

  • Processed-level transaction reads HS0095

    See a Solana transaction at processed from a logs subscription, then fetch the full body once it reaches confirmed, in one read-only TypeScript file.

  • Duplicate-safe retry check HS0093

    Decide whether to resend or re-sign a Solana transaction so a retry never pays twice, using getSignatureStatuses and block height on Carbium RPC.

  • Node-behind error handling HS0057

    Handle Solana RPC error -32005 (node is behind by N slots) by reading numSlotsBehind, waiting, then retrying a read or resending the same signed bytes.

  • Consistent reads with minContextSlot HS0029

    Pin a Solana RPC read to a slot floor with minContextSlot, and retry timeouts, 429s and stale-node refusals with one small TypeScript wrapper.

  • Dropped transaction detector HS0028

    Tell a dropped Solana transaction from a slow one with getSignatureStatuses and the last valid block height, in one read-only TypeScript file.

  • Transaction status check HS0008

    Check whether a Solana transaction landed, failed or finalized with getSignatureStatuses, in one read-only TypeScript file on Carbium RPC.

  • Solana commitment levels HS0003

    What the processed, confirmed and finalized commitment levels return on a Solana RPC read, shown with one read-only TypeScript file on Carbium.