Skip to content

Add account trustlines metadata endpoint#33

Open
mayasimi wants to merge 1 commit into
stellarkit-lab-devtools:mainfrom
mayasimi:account-trustlines-toml
Open

Add account trustlines metadata endpoint#33
mayasimi wants to merge 1 commit into
stellarkit-lab-devtools:mainfrom
mayasimi:account-trustlines-toml

Conversation

@mayasimi
Copy link
Copy Markdown

resolve #9
summary
Implemented GET /account/:id/trustlines.

This returns all non-native balances for the account and enriches each trustline with issuer-provided asset metadata when available. For each asset, the endpoint loads the issuer account, reads home_domain, fetches https://<home_domain>/.well-known/stellar.toml, parses [[CURRENCIES]], and returns the matching asset’s name, description, and image.

A couple of implementation details worth calling out:

  • Native XLM balances are excluded as requested.
  • Issuer lookups and TOML fetches are cached per request to avoid duplicate work.
  • Missing home_domain, unreachable TOML, parse failures, or missing currency metadata all resolve cleanly to toml: null.
  • Account ID validation uses the existing validator.

Tests added for:

  • Resolved TOML metadata
  • Missing/unresolved issuer metadata
  • Invalid account ID validation

Validation run:

  • npm.cmd test -- --runInBand passes: 15/15

Note: lint could not be run because the repo is on ESLint 9 but does not currently include an eslint.config.* file.

@drips-wave
Copy link
Copy Markdown

drips-wave Bot commented May 26, 2026

@mayasimi 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
Copy link
Copy Markdown
Contributor

Sulex45 commented May 27, 2026

Resolve src/routes/account.js and tests/api.test.js before i can merge

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.

Add GET /account/:id/trustlines with stellar.toml resolution

3 participants