{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "blockSubscribe",
  "params": [
    {
      "mentionsAccountOrProgram": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op"
    },
    {
      "commitment": "confirmed",
      "encoding": "base64",
      "showRewards": true,
      "transactionDetails": "full"
    }
  ]
}
{
  "jsonrpc": "2.0",
  "result": 0,
  "id": 1
}

This subscription is considered unstable and is only available if the validator was started with the --rpc-pubsub-enable-block-subscription flag. The format of this subscription may change in the future.

Endpoints

Websockets are available on mainnet and devnet with the following URLs:

  • Mainnet wss://mainnet.helius-rpc.com/?api-key=<API_KEY>
  • Devnet wss://devnet.helius-rpc.com/?api-key=<API_KEY>
Websockets have a 10-minute inactivity timer; implementing health checks and sending pings every minute is heavily recommended to keep the websocket connection alive.

Authorizations

api-key
string
required

Your Helius API key. You can get one for free in the dashboard.

Body

params
array
required

Response

result
integer

Subscription id (needed to unsubscribe)

Notification Format

The notification will be an object with the following fields:

  • slot: <u64> - The corresponding slot.
  • err: <object|null> - Error if something went wrong publishing the notification otherwise null.
  • block: <object|null> - A block object as seen in the getBlock RPC HTTP method.
{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "blockSubscribe",
  "params": [
    {
      "mentionsAccountOrProgram": "LieKvPRE8XeX3Y2xVNHjKlpAScD12lYySBVQ4HqoJ5op"
    },
    {
      "commitment": "confirmed",
      "encoding": "base64",
      "showRewards": true,
      "transactionDetails": "full"
    }
  ]
}
{
  "jsonrpc": "2.0",
  "result": 0,
  "id": 1
}