Skip to content

[23] Implement stellar.toml endpoint #15

Description

@EmeditWeb

Problem

There is no GET /.well-known/stellar.toml endpoint. Wallets and indexers that auto-discover Stellar projects (Lobstr directory, StellarExpert) cannot find StepFi's federation file from the API domain.

Context

stellar.toml is the discoverability standard for Stellar projects — it advertises org info, contract IDs, and curated asset metadata. Wallets read it to display the project name and verify contract addresses.

Before Starting

Read these context files first:

  • context/architecture-context.md
  • context/code-standards.md
  • context/progress-tracker.md
  • src/modules/health/health.controller.ts

What To Build

  1. Add a StellarTomlController (or extend HealthController) exposing GET /.well-known/stellar.toml.
  2. Set Content-Type: text/plain; charset=utf-8 and Access-Control-Allow-Origin: *.
  3. Body content: org name, website, github, contracts block listing CREDITLINE_CONTRACT_ID, LIQUIDITY_POOL_CONTRACT_ID, REPUTATION_CONTRACT_ID, VENDOR_REGISTRY_CONTRACT_ID, all read from ConfigService.
  4. Cache the response in memory with 1-hour TTL (cheap to regenerate, but no need to do it per request).
  5. Add Swagger decorators marking it as a static metadata endpoint.
  6. Add e2e test asserting status 200, content-type text/plain, and contract IDs present.

Files To Touch

  • src/modules/health/stellar-toml.controller.ts
  • src/modules/health/health.module.ts
  • test/e2e/stellar-toml.e2e-spec.ts

Acceptance Criteria

  • GET /.well-known/stellar.toml returns 200 with text/plain body
  • Body includes all 4 contract IDs
  • CORS allows * for this endpoint specifically
  • Cached in memory for 60 minutes
  • E2E test verifies content
  • Swagger lists the endpoint

Mandatory Checks Before PR

  • npm run build passes with zero TypeScript errors
  • No new any types introduced anywhere
  • Full Swagger @apioperation + @apiresponse decorators on any new endpoints
  • New migration file created for any schema changes
  • context/progress-tracker.md updated

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions