Skip to content

Stellar.toml Discoverability Endpoint#45

Open
deslawson wants to merge 1 commit into
StepFi-app:mainfrom
deslawson:main
Open

Stellar.toml Discoverability Endpoint#45
deslawson wants to merge 1 commit into
StepFi-app:mainfrom
deslawson:main

Conversation

@deslawson

Copy link
Copy Markdown

🔗 Related Issue

Closes #15


🔖 Title

Stellar.toml Discoverability Endpoint


📝 Description

Added GET /.well-known/stellar.toml via a new StellarTomlController so that Stellar wallets (Lobstr, StellarExpert) can auto-discover StepFi's federation file from the API domain. The endpoint returns a TOML body with org metadata (ORG_NAME, ORG_URL, ORG_GITHUB) and a [[CONTRACTS]] block listing all 4 contract IDs (CREDIT_LINE_CONTRACT_ID, LIQUIDITY_POOL_CONTRACT_ID, REPUTATION_CONTRACT_ID, VENDOR_REGISTRY_CONTRACT_ID) read from ConfigService. Response is cached in-memory with a 1-hour TTL. The route is excluded from the global API prefix and includes Content-Type: text/plain and Access-Control-Allow-Origin: * headers. Full Swagger decorators and a passing e2e test are included.


🔄 Changes Made

  • Created src/modules/health/stellar-toml.controller.ts — new controller exposing GET /.well-known/stellar.toml with org metadata, all 4 contract IDs from ConfigService, in-memory 1-hour cache, and Swagger decorators
  • Updated src/modules/health/health.module.ts — registered StellarTomlController in the module's controller list
  • Updated src/main.ts — excluded .well-known/stellar.toml from the global API prefix so it's served at root
  • Created test/e2e/stellar-toml.e2e-spec.ts — e2e test asserting 200, text/plain content-type, CORS header, and all 4 contract IDs present in body
  • Updated context/progress-tracker.md — marked stellar.toml endpoint as completed in the tracker

Closed #15

Added GET /.well-known/stellar.toml via a new StellarTomlController so that Stellar wallets (Lobstr, StellarExpert) can auto-discover StepFi's federation file from the API domain. The endpoint returns a TOML body with org metadata (ORG_NAME, ORG_URL, ORG_GITHUB) and a [[CONTRACTS]] block listing all 4 contract IDs (CREDIT_LINE_CONTRACT_ID, LIQUIDITY_POOL_CONTRACT_ID, REPUTATION_CONTRACT_ID, VENDOR_REGISTRY_CONTRACT_ID) read from ConfigService. Response is cached in-memory with a 1-hour TTL. The route is excluded from the global API prefix and includes Content-Type: text/plain and Access-Control-Allow-Origin: * headers. Full Swagger decorators and a passing e2e test are included.

Closed StepFi-app#15
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.

[23] Implement stellar.toml endpoint

1 participant