Skip to content

Add helper for paginating database query results with cursor-based navigation #459

Description

@Chucks1093

Summary

The wallet holdings, activity feed, and key holders endpoints all need cursor-based pagination. Each currently implements pagination logic independently. A shared pagination helper that accepts a query builder, page size, and cursor should be used across all list endpoints.

Scope

  • Add a paginateQuery(query, { cursor, limit }) helper that appends cursor filtering and limit to a query
  • Returns { data, nextCursor, hasMore }
  • Add unit tests for: first page with no cursor, subsequent page with cursor, last page where hasMore is false

Acceptance Criteria

  • First page returns correct data and a valid next cursor
  • Subsequent page using the cursor returns the correct next slice
  • Last page returns hasMore: false and no next cursor
  • Helper is reusable across different query types

ETA: 12 hours


Coordinate on Telegram

Metadata

Metadata

Assignees

Labels

Stellar WaveIssues in the Stellar wave program

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