Skip to content

feat: implement Horizon SSE payment streaming with cursor persistence #2

Description

@cokehill

Summary

The stream manager should open a Horizon SSE connection per active payment subscription and
persist the paging cursor to SQLite so streams resume correctly after a restart.

Acceptance criteria

  • StreamManager._streamPayments() opens an SSE stream via @stellar/stellar-sdk
  • Cursor saved to stream_cursors table after each event
  • On restart, stream resumes from saved cursor (not "now")
  • Filter by asset_code and min_amount applied before queuing delivery
  • Unit test: mock Horizon SSE, assert delivery is queued for matching events
  • Unit test: assert filtered events (wrong asset) do NOT queue a delivery

Notes

Use server.payments().forAccount(addr).cursor(saved).stream({ onmessage }).
Cursor must be saved per account key, not globally.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Status
Todo

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions