Skip to content

Add pagination and eventType filter to stream events endpoint #337

@ogazboiz

Description

@ogazboiz

Join our community: https://t.me/+DOylgFv1jyJlNzM0

Description

GET /v1/streams/{id}/events returns all events with no limit. A high-frequency stream could have hundreds of events making this slow and memory-heavy.

What Needs to Happen

  • Add ?limit=50&offset=0 (default 50, max 500)
  • Return { data: [...], total: number, hasMore: boolean }
  • Add ?eventType=CREATED|TOPPED_UP|WITHDRAWN|CANCELLED|COMPLETED|PAUSED|RESUMED|FEE_COLLECTED filter
  • Add ?order=asc|desc (default desc by timestamp)
  • Update Swagger docs

Files

  • backend/src/controllers/stream.controller.ts (getStreamEvents)

Acceptance Criteria

  • Default limit of 50 enforced
  • hasMore is accurate
  • Event type filter works for all types

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave programbackendBackend related tasks

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions