WebSocket connections
Sei supportseth_subscribe over WebSocket. With the WebSocket transports in standard libraries, you can subscribe to new blocks, event logs, and pending transactions.
Endpoints
Connecting
Watching new blocks
Watching contract events
Watching ERC-20 transfers across all contracts
viem
Notes
- Sei has instant finality, so every block emitted over WebSocket is already final. You do not need to wait for more confirmations before you act 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 come from an in-process notifier, not from the legacy consensus event bus. The notifier publishes committed-block headers directly. Subscribers still observe headers only for fully committed blocks. However, 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 return in these fields.stateRootcomes from the finalized block’sAppHash(the post-execution application hash), not from a pre-execution header field.hashis the Autobahn block-header hash. It is the same value thateth_getBlockByNumberand the receipt APIs report asblockHash. This keepsnewHeadsconsistent with the rest of the EVM RPC surface.gasUsedis an approximation (summed from per-transaction results) that keeps the notification cheap.
- Subscribers that chain-validate the head stream by linking
parentHashvalues cannot rely onnewHeadsunder Autobahn. They need a different mechanism. - If you need the exact
gasUsedor the omitted hash fields, fetch the block explicitly witheth_getBlockByNumber.