WebSocket Reference

WebSocket Methods

Subscribe to real-time Solana blockchain events through the FluxRPC WebSocket endpoint. Receive instant notifications for account changes, transactions, and more.

WebSocket Endpoint

wss://ws.eu.fluxrpc.com

Try It — Live Subscription

Subscribe to real-time events right from your browser.

How Subscriptions Work

WebSocket subscriptions follow a subscribe/unsubscribe pattern. When you subscribe to an event, the node returns a subscription id used for incoming notifications and to unsubscribe.

1

Subscribe Request

"jsonrpc" : "2.0" , "id" : 1 , "method" : "accountSubscribe" , "params" :[ "pubkey..." ]
2

Subscribe Response

{ "jsonrpc" : "2.0" , "result" : 0 , "id" : 1 }

Returns a subscription ID ( 0 ) to identify this subscription

3

Notification

{ "jsonrpc" : "2.0" , "method" : "accountNotification" , "params" :{ "subscription" : 0 , "result" :{...}}}

Real-time notifications reference the subscription ID

Available Subscriptions

18

accountSubscribe

Subscribe to an account to receive notifications when the lamports or data for a given account public key changes.

pubkeystring required

Account Pubkey, as base-58 encoded string.

configobject

Configuration object.

commitmentstring

Commitment level: "processed", "confirmed", or "finalized".

encodingstring

Encoding for account data: "base58", "base64", "base64+zstd", "binary", or "jsonParsed". Default: "binary".

dataSliceobject

Limit the returned account data. Only available for "base58", "base64", "base64+zstd" or "binary" encodings.

accountUnsubscribe

Unsubscribe from account change notifications.

subscriptionIdnumber required

ID of the subscription to cancel.

logsSubscribe

Subscribe to transaction logging.

filterstring | object required

Filter criteria: "all", "allWithVotes", or { mentions: ["<pubkey>"] }.

configobject

Configuration object.

commitmentstring

Commitment level: "processed", "confirmed", or "finalized".

logsUnsubscribe

Unsubscribe from transaction logging.

subscriptionIdnumber required

ID of the subscription to cancel.

programSubscribe

Subscribe to a program to receive notifications when the lamports or data for an account owned by the given program changes.

pubkeystring required

Program ID Pubkey, as base-58 encoded string.

configobject

Configuration object.

commitmentstring

Commitment level: "processed", "confirmed", or "finalized".

encodingstring

Encoding for account data: "base58", "base64", "base64+zstd", "binary", or "jsonParsed". Default: "binary".

dataSliceobject

Limit the returned account data. Only available for "base58", "base64", "base64+zstd" or "binary" encodings.

filtersarray

Filter results using up to 4 memcmp and/or dataSize filters.

withContextbool

Accepted for compatibility; notifications already include context.

programUnsubscribe

Unsubscribe from program-owned account change notifications.

subscriptionIdnumber required

ID of the subscription to cancel.

signatureSubscribe

Subscribe to receive a notification when the transaction with the given signature reaches the specified commitment level.

signaturestring required

Transaction signature, as base-58 encoded string.

configobject

Configuration object.

commitmentstring

Commitment level: "processed", "confirmed", or "finalized".

enableReceivedNotificationbool

Whether to also send a receivedSignature notification as soon as the node receives the transaction, before it reaches the requested commitment.

signatureUnsubscribe

Unsubscribe from signature confirmation notification.

subscriptionIdnumber required

ID of the subscription to cancel.

slotSubscribe

Subscribe to receive notification anytime a slot is processed by the validator.

No parameters required

slotUnsubscribe

Unsubscribe from slot notifications.

subscriptionIdnumber required

ID of the subscription to cancel.

rootSubscribe

Subscribe to receive notification anytime a new root is set by the validator.

No parameters required

rootUnsubscribe

Unsubscribe from root notifications.

subscriptionIdnumber required

ID of the subscription to cancel.

blockSubscribe

Subscribe to receive notification anytime a new block is confirmed or finalized.

filterstring | object required

Filter criteria: "all" or { mentionsAccountOrProgram: "<pubkey>" }.

configobject

Configuration object.

commitmentstring

Commitment level ("finalized" or "confirmed").

encodingstring

Encoding for each returned transaction: "json", "jsonParsed", "base58", or "base64".

transactionDetailsstring

Level of transaction detail: "full", "accounts", "signatures", or "none".

maxSupportedTransactionVersionnumber

Highest transaction version to return. Set to 1 to include v1 transactions.

showRewardsbool

Whether to populate the rewards array.

blockUnsubscribe

Unsubscribe from block notifications.

subscriptionIdnumber required

ID of the subscription to cancel.

slotsUpdatesSubscribe

Subscribe to receive a notification from the validator on a variety of updates on every slot.

No parameters required

slotsUpdatesUnsubscribe

Unsubscribe from slot-update notifications.

subscriptionIdnumber required

ID of the subscription to cancel.

voteSubscribe

Subscribe to receive notification anytime a new vote is observed in gossip.

No parameters required

voteUnsubscribe

Unsubscribe from vote notifications.

subscriptionIdnumber required

ID of the subscription to cancel.