Repository navigation
feat: add WebSocket streaming for real-time ledger updates - #77
Merged
SharifIbrahimDev merged 1 commit intoJun 25, 2026
Conversation
…ellar-tools#74) - Add useLedgerStream hook wrapping native WebSocket API - Stream new ledger/transaction events to connected clients in real-time - Integrate live feed panel into Dashboard with connection status indicator - Add VITE_LEDGER_WS_URL env var (documented in .env.example) - Add 15 tests covering connection lifecycle, message handling, and WS construction
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #74
Integrates a WebSocket streaming service to push new ledger and transaction events to connected clients in real-time.
Changes
src/hooks/useLedgerStream.ts— new hook wrapping the nativeWebSocketAPI. Managesconnecting → open → closed/errorlifecycle, accumulates events newest-first up to a configurable limit (default 50), and cleans up on unmount.src/components/Dashboard.tsx— integratesuseLedgerStream; adds a "Live Ledger Stream" panel with a live connection status indicator (● open/connecting/error/closed).tests/hooks/useLedgerStream.test.ts— 15 tests covering connection lifecycle, message handling (ordering, limit, bad JSON), and WebSocket callback wiring..env.example— documents the newVITE_LEDGER_WS_URLenvironment variable.Testing
tsc --noEmit: zero errorshorizonMock.test.tsunrelated to this PR)