You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
docs(flashblocks): add WebSocket streaming guide to app-integration
The app-integration page covered RPC usage (viem, wagmi, ethers) but had
no documentation for direct WebSocket streaming — a common pattern for
real-time use cases like address monitoring and mempool tracking.
Added a new WebSocket Streaming section covering:
- Endpoint URLs for mainnet and sepolia
- Flashblock message format (Brotli-compressed JSON, index 0 vs diff)
- Basic connection example with Brotli decompression
- Auto-reconnect with exponential backoff for production use
- Address watcher pattern for real-time tx monitoring
All examples are TypeScript and use only the built-in zlib module
plus the ws package — no additional dependencies required.
You should see the confirmation time significantly lower than the standard RPC endpoint.
200
200
201
+
202
+
## WebSocket Streaming
203
+
204
+
For real-time monitoring — such as watching a specific address or tracking mempool activity — connect directly to the Flashblocks WebSocket stream.
205
+
206
+
<Warning>
207
+
Avoid hard dependencies on WebSocket in transaction-sending flows. Use WebSocket for monitoring only; use the RPC API for sending transactions and querying state.
For feedback, support or questions about Flashblocks, please don't hesitate to contact us in the `#developer-chat` channel in the [Base Discord](https://base.org/discord).
0 commit comments