Skip to content

feat(sdk,wallet): real-time wallet activity feed via SSE#347

Open
collinsezedike wants to merge 1 commit into
Miracle656:mainfrom
collinsezedike:feat/real-time-activity-feed
Open

feat(sdk,wallet): real-time wallet activity feed via SSE#347
collinsezedike wants to merge 1 commit into
Miracle656:mainfrom
collinsezedike:feat/real-time-activity-feed

Conversation

@collinsezedike

Copy link
Copy Markdown
Contributor

Closes #320

Summary

  • Adds sdk/src/events.ts: exports mapHorizonOpToEvent (maps raw Horizon ops to typed ActivityEvent records) and createActivityFeed (opens a Horizon SSE stream with exponential-backoff reconnect, resuming from the last seen paging token to prevent gaps or duplicates)
  • Adds frontend/wallet/lib/activityFeed.ts: module-level pub/sub store (initActivityFeed, hydrateActivityFeed, subscribeActivityFeed, useActivityFeed) that wraps the SDK feed and converts events to the dashboard's TxRecord shape
  • Updates frontend/wallet/app/dashboard/page.tsx: swaps manual transactions state for useActivityFeed(), seeds the feed with the initial history fetch, and starts the live stream once the fee-payer key is known
  • Adds sdk/src/__tests__/events.test.ts: 15 unit tests covering the event mapper (all op types, edge cases) and the reconnect state machine (backoff timing, cursor resume, cap at 30 s, stop cancels reconnect)

Test plan

  • Run cd sdk && npm test - all events tests pass
  • Open the wallet dashboard and send/receive XLM on testnet - new transactions appear in the activity feed without a manual refresh
  • Disconnect network briefly and reconnect - the stream recovers automatically and no events are duplicated
  • Navigate away from dashboard and back - activity list renders instantly from module cache, then stream continues

@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown

@collinsezedike is attempting to deploy a commit to the miracle656's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@collinsezedike Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

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.

Real-time wallet activity feed via SSE

1 participant