Subscribe to real-time transaction events with custom filters. Monitor specific accounts, exclude vote transactions, and receive instant notifications with configurable detail levels.
WebSockets have a 10-minute inactivity timer; implementing health checks and sending pings every minute is heavily recommended to keep the WebSocket connection alive.
Opt in to associated token account (ATA) expansion so an accountInclude wallet also matches transactions where it owns an SPL token balance — for example, incoming token transfers that touch the wallet’s token account rather than its pubkey. Accepts:
"balanceChanged" — match when the wallet owns a token balance whose amount changed (or whose token account was closed) in the transaction.
"all" — match any transaction referencing a token balance the wallet owns, even if unchanged. Higher volume.
"none" — same as omitting the field (no expansion). This is the default.
An invalid value returns JSON-RPC error -32602: Invalid tokenAccounts value '<x>', expected one of: none, balanceChanged, all.
When transactionSubscribe succeeds, the server returns a subscription ID in the result field. This is the same number that appears in params.subscription on every notification from that subscription:
To stop receiving notifications, call transactionUnsubscribe with the subscription ID. Each transactionSubscribe call on the same connection creates a separate subscription with its own ID, so make sure to unsubscribe before resubscribing to avoid receiving duplicate notifications.