Transaction stream
Receive transactions at the selected commitment and filter them by accounts, vote status, failure status, or signature.
Subscribe
import Client, { CommitmentLevel } from "@triton-one/yellowstone-grpc";import bs58 from "bs58"; const client = new Client("https://geyser.sol.openinfra.sh:443", process.env.OPENINFRA_API_KEY!);await client.connect(); const stream = await client.subscribe({ transactions: { jupiter_swaps: { vote: false, failed: false, accountInclude: ["JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"], accountExclude: [], accountRequired: [], signature: undefined, }, }, commitment: CommitmentLevel.CONFIRMED, accounts: {}, slots: {}, transactionsStatus: {}, blocks: {}, blocksMeta: {}, entry: {}, accountsDataSlice: [],}); stream.on("data", (update) => { if (!update.transaction) return; const { slot, transaction } = update.transaction; const signature = bs58.encode(transaction.signature); console.log("slot", slot, "—", signature);});Payload
Each transaction update can include:
slot— the slot associated with the update.transaction.signature— signature bytes; Base58-encode them for display.transaction.transaction.message— account keys and instructions.transaction.meta— status, balances, logs, and inner instructions when present.
Consumer design
- Filter to the accounts and status your application actually needs.
- Keep the stream data handler non-blocking.
- Move decoding and database writes to a queue or worker when throughput is high.
- Record slots and signatures so reconnect handling can identify gaps or duplicates.