Skip to content

Add pagination and eventType filter to stream events endpoint #364

@ogazboiz

Description

@ogazboiz

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

Description

GET /v1/streams/{id}/events returns all events for a stream with no limit. A high-frequency stream with many top-ups and withdrawals could have hundreds of events, making this response large and slow.

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/OpenAPI 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 8 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