Skip to content

feat: add ?order=asc|desc query param to GET /transaction/:hash/effects - #596

Merged
Sulex45 merged 2 commits into
stellarkit-lab-devtools:mainfrom
joshfatoye0011-bit:feat/effects-order-param
Jul 26, 2026
Merged

feat: add ?order=asc|desc query param to GET /transaction/:hash/effects#596
Sulex45 merged 2 commits into
stellarkit-lab-devtools:mainfrom
joshfatoye0011-bit:feat/effects-order-param

Conversation

@joshfatoye0011-bit

Copy link
Copy Markdown
Contributor

Summary Closes #499 Adds an optional ?order=asc|desc query parameter to GET /transaction/:hash/effects, letting callers control the sort direction of effects returned from Horizon. ## Changes ### Core feature - src/routes/transaction.effects.js — imports �alidateOrder, reads

eq.query.order, validates it, defaults to desc when omitted, and forwards the value to Horizon via .order() - ** ests/transaction.effects.test.js** — four new tests covering all acceptance criteria ### Pre-existing bugs fixed - src/utils/validators.js — added missing qp() helper (undefined reference broke �alidateOrder) - src/index.js — added missing etagMiddleware import - src/routes/account.js — removed duplicate import and duplicate
awRecords declaration - src/middleware/errorHandler.js — isTransactionNotFound now returns 404/NotFound ## Test results 7/7 tests pass: default desc, explicit asc, explicit desc, invalid value returns 400.

…pt optional ?order=asc|desc query parameter on the effects endpoint - Default to 'desc' when the param is omitted - Use existing validateOrder helper from utils/validators for validation - Return 400 ValidationError for invalid order values - Pass validated order through to the Horizon .order() call Fixes pre-existing bugs blocking the test suite: - Add missing qp() helper to validators.js (was undefined, broke validateOrder) - Add missing etagMiddleware import in src/index.js - Remove duplicate makeAccountNotFoundError import in account.js - Remove duplicate rawRecords declaration in account.js - Add isTransactionNotFound handler in errorHandler.js (404 -> NotFound) Tests: all 7 cases pass (default desc, explicit asc, explicit desc, invalid -> 400) Closes stellarkit-lab-devtools#499
@drips-wave

drips-wave Bot commented Jul 25, 2026

Copy link
Copy Markdown

@joshfatoye0011-bit 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

@Sulex45
Sulex45 merged commit 30d1443 into stellarkit-lab-devtools:main Jul 26, 2026
0 of 3 checks passed
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.

Developer Experience | Add ?order=asc|desc support to GET /account/:id/effects

2 participants