Signing & Sending
Sign transaction messages and confirm landing on Agave 4.1.1.
Search across all documentation pages
Sign transaction messages and confirm landing on Agave 4.1.1.
Quick-reference recipe card - copy-paste ready.
import {
signTransactionMessageWithSigners,
getSignatureFromTransaction,
sendAndConfirmTransactionFactory,
createSolanaRpc,
createSolanaRpcSubscriptions,
} from "@solana/kit";
const signed = await signTransactionMessageWithSigners(message);
const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions });
await sendAndConfirm(signed, { commitment: "confirmed" });When to reach for this:
import {
createSolanaRpc,
createSolanaRpcSubscriptions,
signTransactionMessageWithSigners,
getSignatureFromTransaction,
sendAndConfirmTransactionFactory,
getBase64EncodedWireTransaction,
} from "@solana/kit";
const rpc = createSolanaRpc(process.env.RPC_URL!);
const rpcSubscriptions = createSolanaRpcSubscriptions(process.env.RPC_WSS_URL!);
const signed = await signTransactionMessageWithSigners(message);
const signature = getSignatureFromTransaction(signed);
const simulation = await rpc
.simulateTransaction(getBase64EncodedWireTransaction(signed), { sigVerify: true })
.send();
if (simulation.value.err) throw new Error(JSON.stringify(simulation.value.err));
const sendAndConfirm = sendAndConfirmTransactionFactory({ rpc, rpcSubscriptions });
await sendAndConfirm(signed, { commitment: "confirmed" });
console.log("https://explorer.solana.com/tx/" + signature + "?cluster=devnet");What this demonstrates:
sendAndConfirmTransactionFactory pairs HTTP send with signature subscription.sendTransaction broadcasts to the cluster.| Strategy | Trade-off |
|---|---|
sendAndConfirm | Simple; needs WSS |
Poll getSignatureStatuses | Works HTTP-only |
signatureNotifications | Fine-grained UI state |
rpcSubscriptions.confirmed+.| Alternative | Use When | Don't Use When |
|---|---|---|
| Jito bundles | Landing priority | Devnet smoke tests |
sendTransaction only | Fire-and-forget analytics | User-facing transfers |
| Server-sponsored send | Gasless UX | Trustless self-custody only |
Yes - point RPC and wallet at the same cluster.
Avoid in one module - migrate wholesale per route.
Wallets provide signers; kit builds messages.
Lock 7.0.0 in package.json and CI.
Compute budget instructions before send.
Surfpool 0.12.0 or local validator with devnet clones.
Always bigint lamports in kit code.
confirmed for UI; finalized for treasury.
Reads on server; signing in client components.
Simulate, read logs, verify account owners.
Stack versions: This page was written for Agave 4.1.1, Solana CLI 3.0.10, Anchor 0.32.1, anchor-lang 0.32.1, Rust 1.91.1, @solana/kit 7.0.0, Surfpool 0.12.0, and LiteSVM 0.6.x.
Reviewed by Chris St. John·Last updated Jul 16, 2026