Skip to content

feat(account): add includeOperations option to account transactions (#563) - #655

Open
Loisyy wants to merge 2 commits into
stellarkit-lab-devtools:mainfrom
Loisyy:fix/563-include-operations-transactions
Open

feat(account): add includeOperations option to account transactions (#563)#655
Loisyy wants to merge 2 commits into
stellarkit-lab-devtools:mainfrom
Loisyy:fix/563-include-operations-transactions

Conversation

@Loisyy

@Loisyy Loisyy commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements issue #563 by adding support for the optional
?includeOperations=true query parameter on:

GET /account/:id/transactions

When the parameter is provided, each transaction includes its normalized
operations array. When omitted, the existing response format is preserved.

Changes

  • Added support for includeOperations=true
  • Embedded normalized operations into each transaction response
  • Preserved existing default response behavior
  • Added/updated tests for both enabled and default cases
  • Resolved merge artifacts discovered during implementation

Testing

  • ✅ Default response excludes embedded operations
  • ?includeOperations=true embeds normalized operations
  • ✅ Existing tests continue to pass

Closes #563

Loisyy added 2 commits July 30, 2026 13:04
…ctions

Adds an optional ?includeOperations query parameter to
GET /account/:id/transactions. When true, each transaction gets a
normalised operations array embedded under 'operations', using the
same shape as GET /transactions/:id/operations. Default behaviour
(omitted or false) is unchanged - no operations field, no extra
Horizon calls.

- src/utils/operationFormatter.js: new normalizeOperation() helper,
  extracted from the shape used by GET /transactions/:id/operations,
  so both endpoints share one normalised operation shape
- src/routes/account.js: formatTx is now async; when includeOperations
  is set, fetches server.operations().forTransaction(hash) per
  transaction and embeds the normalised records; falls back to an
  empty array (not an error) if a lookup fails
- src/middleware/coerceQueryParams.js: coerce ?includeOperations to
  boolean
- tests/account.transactions.includeOperations.test.js: covers
  includeOperations=true embedding operations, per-type shape
  (payment/create_account/change_trust), default/false behaviour
  unchanged, multiple transactions handled independently, and
  graceful fallback on lookup failure

Closes stellarkit-lab-devtools#563
@drips-wave

drips-wave Bot commented Jul 31, 2026

Copy link
Copy Markdown

@Loisyy 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

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 ?includeOperations=true option to GET /account/:id/transactions

1 participant