📌 Description
src/routes/events.ts lists indexed events without a pagination mechanism, so clients polling for new events have no efficient way to page through a large backlog.
🧩 Requirements and context
- Add cursor-based pagination (e.g. by event id or block/timestamp) with a default and max page size.
- Return a
nextCursor in the response when more results are available.
- Preserve stable ordering across pages even if new events are inserted mid-pagination.
🛠️ Suggested execution
- Add cursor query-param parsing and a stable ORDER BY to the query in
src/routes/events.ts.
- Return
nextCursor/hasMore in the response body.
- Extend
src/routes/events.test.ts with multi-page pagination coverage.
✅ Acceptance criteria
🔒 Security notes
Cursor values must not be guessable/incrementable in a way that lets a client infer internal row ids beyond what's already exposed.
📋 Guidelines
- Minimum 95% test coverage
- Clear documentation
- Timeframe: 96 hours
📌 Description
src/routes/events.tslists indexed events without a pagination mechanism, so clients polling for new events have no efficient way to page through a large backlog.🧩 Requirements and context
nextCursorin the response when more results are available.🛠️ Suggested execution
src/routes/events.ts.nextCursor/hasMorein the response body.src/routes/events.test.tswith multi-page pagination coverage.✅ Acceptance criteria
nextCursoris omitted/null on the last page.🔒 Security notes
Cursor values must not be guessable/incrementable in a way that lets a client infer internal row ids beyond what's already exposed.
📋 Guidelines