📋 Description
lib/remittance/horizon.ts wraps @stellar/stellar-sdk's Horizon.Server to map payment operations into TransactionItems for /api/remittance/history. The helper does not currently expose Horizon's native cursor paging, so the history route cannot page beyond the first batch — a problem given the documented testnet rate limit (~3500 req/hour/IP) called out in the file's own header comment.
This issue adds cursor-based pagination passthrough that aligns with the project's lib/utils/pagination.ts PaginatedResult<T> contract.
Why this matters: accounts with many payments cannot see their full history, and re-fetching from the top wastes the limited Horizon rate budget.
🎯 Requirements & Context
Functional requirements
Context & constraints
- Keep the lazily-initialised singleton (
getHorizonServer).
- Validate paging params with the existing
validatePaginationParams.
- Preserve
TxStatus mapping and existing TransactionItem shape.
🛠️ Suggested Execution
git checkout -b feature/horizon-cursor-pagination
- Implement paging passthrough + TSDoc.
- Add vitest tests with a mocked Horizon server: first page sets
nextCursor, last page sets hasMore: false, invalid cursor handled gracefully.
- Edge cases: empty account, limit clamping to 100, malformed cursor.
npx vitest run && npx tsc --noEmit && npm run lint
feat(remittance): expose Horizon cursor pagination in history mapper
✅ Acceptance Criteria & Guidelines
| Requirement |
Target |
| Cursor + limit passthrough |
Required |
Conforms to PaginatedResult<T> |
Required |
| Test coverage of paging branches |
≥ 90% |
tsc --noEmit, lint clean |
Required |
| Timeframe |
96 hours from assignment |
💬 Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim, and ask questions in the channel. 🚀
📋 Description
lib/remittance/horizon.tswraps@stellar/stellar-sdk'sHorizon.Serverto map payment operations intoTransactionItems for/api/remittance/history. The helper does not currently expose Horizon's native cursor paging, so the history route cannot page beyond the first batch — a problem given the documented testnet rate limit (~3500 req/hour/IP) called out in the file's own header comment.This issue adds cursor-based pagination passthrough that aligns with the project's
lib/utils/pagination.tsPaginatedResult<T>contract.🎯 Requirements & Context
Functional requirements
horizon.tsto acceptlimitandcursorand pass them to Horizon's.cursor()/.limit()builders.{ data, nextCursor, hasMore }consistent withPaginatedResult<T>./api/remittance/historyto read paging params and forward them.Context & constraints
getHorizonServer).validatePaginationParams.TxStatusmapping and existingTransactionItemshape.🛠️ Suggested Execution
nextCursor, last page setshasMore: false, invalid cursor handled gracefully.✅ Acceptance Criteria & Guidelines
PaginatedResult<T>tsc --noEmit,lintclean💬 Community & Support
Join the RemitWise contributor community on Discord: https://discord.gg/CtQuPZFMA
Comment to claim, and ask questions in the channel. 🚀