Skip to main content
Creates a real-time event subscription over a WebSocket connection. Returns a subscription ID; events are pushed as eth_subscription notifications without the client needing to poll.
The public Base endpoints (mainnet.base.org, sepolia.base.org) are HTTP only. WebSocket connections are not available on public Base endpoints — choose a WebSocket-capable provider from the Builder Stack.

Parameters

string
required
The event type to subscribe to.
object
Optional filter options. Only applicable for the "logs" subscription type.

Subscription Types

Returns

string
A hex-encoded subscription ID. All event notifications from this subscription include this ID in params.subscription.
Event notifications arrive as unsolicited JSON-RPC messages:
Event Notification

Example