v1

latestOpenAPI 3.0.02026-07-17224996.6 KB
Subscribe events

Subscribe events

IMPORTANT NOTE: This is a WebSocket connection, so the ws:// or wss:// schema should be used to subscribe to this endpoint.

This endpoint streams on-chain events for all blocks starting at the requested start block, up until the latest available block. Once the latest block is reached, the stream will remain open, and responses will be sent for each new block as it becomes available.

get/subscribe_events

Query parameters

string uint64
OR
'final' | 'sealed'

The block height of the events being streamed. Either provide this parameter or start_block_id parameter. This parameter is incompatible with start_block_id parameter.

start_block_idstring hexadecimal

A 32-byte unique identifier for an entity.

The block id of the events being streamed. Either provide this parameter or start_height parameter. This parameter is incompatible with start_height parameter.

heartbeat_intervalstring uint64

Interval in block heights at which the server should return a heartbeat message to the client.

event_typesEventType[]

A comma-separated list of events type to include.

addressesstring[]

A comma-separated list of addresses who's events should be included.

contractsstring[]

A comma-separated list of contracts who's events should be included.

Response

OK

BlockIdstring hexadecimal

A 32-byte unique identifier for an entity.

Heightstring

Example response

{
  "Events": [
    {
      "transaction_id": null,
      "payload": "",
      "transaction_index": "transaction_index",
      "type": "type",
      "event_index": "event_index"
    },
    {
      "transaction_id": null,
      "payload": "",
      "transaction_index": "transaction_index",
      "type": "type",
      "event_index": "event_index"
    }
  ],
  "BlockId": "BlockId",
  "Height": "Height"
}