Skip to main content
WSS
Messages
subscribe
type:object
unsubscribe
type:object
subscribe_response
type:object
unsubscribe_response
type:object
update
type:object

Overview

Subscription Parameters

chain_id
number
required
Target EVM network. See the Chain enumeration for supported values.
contract_addresses
string[]
Filter by emitting contract address (hex string, 20 bytes, no 0x prefix).
topic_zeros
string[]
Filter by the primary event topic (e.g., Transfer, Swap signature hashes).

Message Fields

Payload mirrors blockdb_evm.b0103_logs_v1 (binary fields as hex strings without 0x in JSON).
contract_address
string
Address of the emitting contract.
topic_zero
string
Primary topic hash identifying the event (32 bytes). null for anonymous events.
data_topics
string[]
Subsequent event topics (indexed parameters).
data
string
Raw event data payload (hex string (no 0x prefix)).
block_number
number
Block height containing the log.
block_time
string
Block time (ISO-8601).
tx_index
number
Transaction index.
log_index
number
Log index.
_tracing_id
string
Tracing identifier for lineage correlation.
_created_at
string
Record creation time (ISO-8601).
_updated_at
string
Record last update time (ISO-8601).

Subscription Example

# Use wscat to connect and subscribe
wscat -c wss://api.blockdb.io/v1/evm/ \
  -H "Authorization: Bearer $BLOCKDB_API_KEY" \
  -x '{"action": "subscribe", "dataset_id": "0103", "chain_id": 1, "params": {"topic_zeros": ["ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef"]}}'

Response Example

{
  "chain_id": 1,
  "dataset_id": "0103",
  "is_reorg": false,
  "data": {
    "block_number": 12345678,
    "block_time": "2025-11-11T18:42:15.123Z",
    "tx_index": 4,
    "log_index": 0,
    "contract_address": "0000000000000000000000000000000000000000",
    "topic_zero": "ddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef",
    "data_topics": [
      "0000000000000000000000000000000000000000000000000000000000000000",
      "0000000000000000000000000000000000000000000000000000000000000001"
    ],
    "data": "00000000000000000000000000000000000000000000000000000000000003e8",
    "_tracing_id": "0103000000000000000000000000000000000000",
    "_created_at": "2025-11-11T18:42:15.123Z",
    "_updated_at": "2025-11-11T18:42:15.123Z"
  }
}
Last modified on April 6, 2026