Skip to content

feat(account): add ?sponsored filter to GET /account/:id/trustlines - #651

Merged
Sulex45 merged 2 commits into
stellarkit-lab-devtools:mainfrom
Loisyy:fix/556-sponsored-trustlines-filter
Jul 30, 2026
Merged

feat(account): add ?sponsored filter to GET /account/:id/trustlines#651
Sulex45 merged 2 commits into
stellarkit-lab-devtools:mainfrom
Loisyy:fix/556-sponsored-trustlines-filter

Conversation

@Loisyy

@Loisyy Loisyy commented Jul 30, 2026

Copy link
Copy Markdown
Contributor

Description:

Adds an optional ?sponsored query parameter to GET /account/:id/trustlines:

?sponsored=true → only trustlines sponsored by another account
?sponsored=false → only unsponsored trustlines
omitted → all trustlines (unchanged default)

Every trustline now includes a sponsoredBy field (sponsor's account ID, or null), sourced from Horizon's balance.sponsor.

Changes:

src/routes/account.js — add sponsoredBy field + sponsored filter; excluded filtered requests from the full-list cache (same treatment as the existing assetCode filter)
src/middleware/coerceQueryParams.js — coerce ?sponsored to boolean
README.md — document the new param
tests/account.sponsoredTrustlines.test.js — covers sponsored=true, sponsored=false, omitted, combined with assetCode, and invalid values

Closes #556

Adds an optional ?sponsored query parameter to GET /account/:id/trustlines:
- ?sponsored=true returns only trustlines sponsored by another account
- ?sponsored=false returns only unsponsored trustlines
- omitted returns all trustlines (unchanged default behaviour)

Each trustline now always includes a sponsoredBy field (the sponsor's
account ID, or null), sourced from Horizon's balance.sponsor field.

- src/middleware/coerceQueryParams.js: coerce ?sponsored to boolean
- src/routes/account.js: add sponsoredBy field + sponsored filter,
  and exclude filtered requests from the full-list cache (same
  treatment as the existing assetCode filter)
- README.md: document the new sponsored param
- tests/account.sponsoredTrustlines.test.js: cover sponsored=true,
  sponsored=false, omitted, combined with assetCode, and invalid values

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

drips-wave Bot commented Jul 30, 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

@Sulex45
Sulex45 merged commit 6815f7f into stellarkit-lab-devtools:main Jul 30, 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 ?sponsored=true filter to GET /account/:id/trustlines

3 participants