Skip to content

008: add WebSocketProvider with eth_subscribe support#315

Open
dawsbot wants to merge 2 commits intomasterfrom
feat/008-websocket-provider
Open

008: add WebSocketProvider with eth_subscribe support#315
dawsbot wants to merge 2 commits intomasterfrom
feat/008-websocket-provider

Conversation

@dawsbot
Copy link
Owner

@dawsbot dawsbot commented Jan 31, 2026

Adds WebSocketProvider for real-time Ethereum subscriptions (newHeads, logs, pendingTransactions). Includes reconnection logic with exponential backoff. Event-based API with on/off. Part of Phase 1 roadmap (WebSocket Provider).

@vercel
Copy link

vercel bot commented Jan 31, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
essential-eth Ready Ready Preview, Comment Feb 16, 2026 6:56pm

@dawsbot
Copy link
Owner Author

dawsbot commented Jan 31, 2026

Closes #57

up506920 and others added 2 commits February 16, 2026 11:55
- WebSocketProvider extends BaseProvider, works over WebSocket instead of HTTP
- Supports all standard JSON-RPC methods (getBalance, getBlock, etc.)
- Real-time subscriptions: subscribe/unsubscribe for newHeads, logs, newPendingTransactions
- Event-based API with on/off for subscription notifications
- Reconnection logic with exponential backoff (3 attempts: 1s, 2s, 4s)
- Auto-incrementing request IDs for matching responses
- destroy() for clean connection teardown
- Uses global WebSocket (Node 21+, browsers), falls back to 'ws' package
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants