WebSocket Connections
Sei supportseth_subscribe over WebSocket. You can subscribe to new blocks, event logs, and pending transactions using standard library WebSocket transports.
Endpoints
Connecting
Watching New Blocks
Watching Contract Events
Watching ERC-20 Transfers Across All Contracts
viem
Notes
- Sei’s instant finality means every block emitted over WebSocket is already final — no need to wait for additional confirmations before acting on an event.
- Pending transaction subscriptions (
newPendingTransactions) are supported at the RPC level but Sei does not guarantee Ethereum-style pending state visibility.
newHeads Under Autobahn Consensus
When a node runs under Autobahn consensus, eth_subscribe("newHeads") notifications are delivered from an in-process notifier that publishes committed-block headers directly, rather than from the legacy consensus event bus. Subscribers still only observe headers for fully committed blocks, but the header payload differs from the legacy path in a few ways:
parentHash,receiptsRoot, andtransactionsRootare returned as zero hashes (0x0000…0000). The Autobahn block-execution path does not build a Tendermint-style hash chain, so there is no meaningful value to surface for these fields.stateRootis sourced from the finalized block’sAppHash(the post-execution application hash), rather than from a pre-execution header field.hashis the Autobahn block-header hash — the same value reported asblockHashbyeth_getBlockByNumberand the receipt APIs, keepingnewHeadsconsistent with the rest of the EVM RPC surface.gasUsedis an approximation (summed from per-transaction results) to keep the notification cheap.
- Subscribers that chain-validate the head stream by linking
parentHashvalues cannot rely onnewHeadsunder Autobahn and need a different mechanism. - If you need exact
gasUsedor the omitted hash fields, fetch the block explicitly witheth_getBlockByNumber.