> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# Solana RPC WebSocket Methods

> Index of Solana RPC WebSocket subscription methods by category, with the shared request conventions and links to each method's page.

Open an individual method page for request parameters, examples, notification
payloads, and unsubscription behavior. For shared response objects reused across
WebSocket methods, see
[Solana RPC JSON Structures Reference](/developers/docs/rpc/json-structures).
The [RPC overview](/developers/docs/rpc) lists the library versions the code
samples target.

## Request Format

Solana RPC WebSocket methods use
[JSON-RPC 2.0](https://www.jsonrpc.org/specification) over a persistent
WebSocket connection. Connect to the PubSub endpoint at `ws://<ADDRESS>/` or
`wss://<ADDRESS>/`.

| Field     | Type                       | Description                                                                         |
| --------- | -------------------------- | ----------------------------------------------------------------------------------- |
| `jsonrpc` | `string`                   | JSON-RPC version. Set this to `"2.0"`.                                              |
| `id`      | `string \| number \| null` | Client-supplied request identifier. The server echoes it in the subscribe response. |
| `method`  | `string`                   | PubSub method name, such as `accountSubscribe` or `slotSubscribe`.                  |
| `params`  | `array`                    | Ordered method parameters. Use an empty array when the method takes no parameters.  |

Many subscription methods take the optional
[`commitment` parameter](/developers/docs/rpc#configuring-state-commitment). If
unspecified, subscriptions that accept commitment default to `finalized`.

## Notification Format

After a subscribe request succeeds, the server returns a numeric subscription id
in the JSON-RPC response. Later notifications are pushed as JSON-RPC messages
with a method-specific notification name and the active subscription id.

| Field                 | Type     | Description                                                                                                  |
| --------------------- | -------- | ------------------------------------------------------------------------------------------------------------ |
| `jsonrpc`             | `string` | JSON-RPC version.                                                                                            |
| `method`              | `string` | Notification name, such as `accountNotification` or `slotNotification`.                                      |
| `params.result`       | `any`    | Method-specific notification payload. Many methods include a `context` object and a method-specific `value`. |
| `params.subscription` | `number` | Subscription id returned by the corresponding `*Subscribe` method.                                           |

For notifications that include `context` and `value`, PubSub includes
`context.slot` and omits `context.apiVersion`.

## Method Reference

### Accounts

| Method                                                         | Description                                                            |
| -------------------------------------------------------------- | ---------------------------------------------------------------------- |
| [`accountSubscribe`](/developers/docs/rpc/websocket/accountsubscribe)     | Subscribe to notifications when one account's lamports or data change. |
| [`accountUnsubscribe`](/developers/docs/rpc/websocket/accountunsubscribe) | Cancel an `accountSubscribe` subscription.                             |
| [`programSubscribe`](/developers/docs/rpc/websocket/programsubscribe)     | Subscribe to notifications for accounts owned by a program.            |
| [`programUnsubscribe`](/developers/docs/rpc/websocket/programunsubscribe) | Cancel a `programSubscribe` subscription.                              |

### Transactions

| Method                                                             | Description                                                      |
| ------------------------------------------------------------------ | ---------------------------------------------------------------- |
| [`logsSubscribe`](/developers/docs/rpc/websocket/logssubscribe)               | Subscribe to transaction log messages that match a log filter.   |
| [`logsUnsubscribe`](/developers/docs/rpc/websocket/logsunsubscribe)           | Cancel a `logsSubscribe` subscription.                           |
| [`signatureSubscribe`](/developers/docs/rpc/websocket/signaturesubscribe)     | Subscribe to status notifications for one transaction signature. |
| [`signatureUnsubscribe`](/developers/docs/rpc/websocket/signatureunsubscribe) | Cancel a `signatureSubscribe` subscription.                      |

### Blocks

| Method                                                     | Description                                                                         |
| ---------------------------------------------------------- | ----------------------------------------------------------------------------------- |
| [`blockSubscribe`](/developers/docs/rpc/websocket/blocksubscribe)     | Subscribe to block notifications as blocks reach confirmed or finalized commitment. |
| [`blockUnsubscribe`](/developers/docs/rpc/websocket/blockunsubscribe) | Cancel a `blockSubscribe` subscription.                                             |

### Cluster

| Method                                                                   | Description                                                          |
| ------------------------------------------------------------------------ | -------------------------------------------------------------------- |
| [`rootSubscribe`](/developers/docs/rpc/websocket/rootsubscribe)                     | Subscribe to notifications when the validator sets a new root slot.  |
| [`rootUnsubscribe`](/developers/docs/rpc/websocket/rootunsubscribe)                 | Cancel a `rootSubscribe` subscription.                               |
| [`slotSubscribe`](/developers/docs/rpc/websocket/slotsubscribe)                     | Subscribe to notifications when the validator processes a new slot.  |
| [`slotUnsubscribe`](/developers/docs/rpc/websocket/slotunsubscribe)                 | Cancel a `slotSubscribe` subscription.                               |
| [`slotsUpdatesSubscribe`](/developers/docs/rpc/websocket/slotsupdatessubscribe)     | Subscribe to tagged slot lifecycle updates emitted by the validator. |
| [`slotsUpdatesUnsubscribe`](/developers/docs/rpc/websocket/slotsupdatesunsubscribe) | Cancel a `slotsUpdatesSubscribe` subscription.                       |
| [`voteSubscribe`](/developers/docs/rpc/websocket/votesubscribe)                     | Subscribe to gossip vote notifications.                              |
| [`voteUnsubscribe`](/developers/docs/rpc/websocket/voteunsubscribe)                 | Cancel a `voteSubscribe` subscription.                               |
