Skip to content

feat: add cursor pagination, CSV/JSON export, and OpenAPI spec for tr… - #1699

Closed
davidolatunle wants to merge 1 commit into
Split-Naira:mainfrom
davidolatunle:keyset-pagination
Closed

davidolatunle wants to merge 1 commit into
Split-Naira:mainfrom
davidolatunle:keyset-pagination

Conversation

@davidolatunle

Copy link
Copy Markdown

…ansactions

Summary

Summary
inspected the backend transaction pagination architecture and identified that while /transactions/history and /transactions/recipient/:walletAddress conformed to the Issue #1259 keyset pagination contract, the authenticated account-scoped endpoint GET /transactions/export (format=json) was previously using unbounded offset pagination without cursor support, omitting hasMore and nextCursor in violation of its declared OpenAPI schema. We resolved this by updating transactions.schemas.ts to accept an opaque validated cursor bounded by MAX_TRANSACTION_PAGE_SIZE (100 rows), and refactoring GET /transactions/export in transactions.ts to decode and strictly validate cursors via decodePageCursor(), query via payoutHistoryService.getPayoutsPage() with stable ordering (timestamp DESC, id DESC), give cursor precedence over offset, return hasMore and nextCursor metadata, and enforce strict token-based account isolation (req.user.walletAddress) while preserving string-level financial precision and on-chain invariants. We updated api-surface-contracts.md, regenerated the OpenAPI specifications (openapi.yaml and openapi.json) confirming zero schema drift via check-openapi-drift.mjs, and added comprehensive unit and integration test suites in transactions-pagination.test.ts and transactions-export.test.ts covering success paths, malformed cursor rejections (400 VALIDATION_ERROR), unauthorized access (401 UNAUTHORIZED), page ceiling limits (100 max), and boundary conditions.

Closes #1631

Changes

Testing

  • Unit tests added / updated
  • Integration / E2E tests pass
  • Manually verified on local stack

PR Checklist

  • Code follows the project's style guide
  • Tests written/updated and passing
  • No console.log or debug statements left in
  • Environment variables added to .env.example if needed
  • Documentation updated if behaviour changed
  • Soroban contracts tested on Stellar testnet

Deploy Impact

Risk level

  • Low — docs/config only, no logic change
  • Medium — logic change, backward-compatible
  • High — breaking change, contract change, or schema migration

Contract changes

  • No contract changes
  • Contract changes included — migration plan:

Database migrations

  • No migrations
  • Migration included — rollback script:

Environment variables

  • No new env vars
  • New env vars added to .env.example

Rollback plan


See release readiness checklist for
the full pre-deploy gate.

@vercel

vercel Bot commented Nov 24, 2026

Copy link
Copy Markdown

@davidolatunle is attempting to deploy a commit to the mimijuwonlo-8913's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Nov 24, 2026

Copy link
Copy Markdown

@davidolatunle Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@SheyeJDev SheyeJDev closed this Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Backend] Add keyset pagination to notification history

2 participants