Skip to content

Commit afab4ee

Browse files
authored
Merge pull request #251 from Austinaminu2/feat/stellar-discovery
feat: add stellar.toml and OpenAPI well-known discovery endpoints
2 parents 22c67c3 + a966ea2 commit afab4ee

File tree

3 files changed

+46
-0
lines changed

3 files changed

+46
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -502,3 +502,11 @@ Insurance endpoints (v1)
502502
Notes:
503503
- These endpoints return transaction XDRs composed with `manageData` operations to encode policy actions. If you prefer Soroban contract invocations, I can convert the builders to use contract calls.
504504

505+
## API Discovery
506+
507+
RemitWise exposes an OpenAPI discovery endpoint:
508+
509+
/api/.well-known/openapi
510+
511+
This allows integrators and wallets to automatically discover
512+
the RemitWise API specification.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
export async function GET() {
2+
const toml = `
3+
VERSION="2.0.0"
4+
5+
NETWORK_PASSPHRASE="Test SDF Network ; September 2015"
6+
7+
ORG_NAME="RemitWise"
8+
ORG_URL="https://remitwise.app"
9+
ORG_DESCRIPTION="Stellar-based cross-border remittance platform"
10+
11+
DOCUMENTATION="https://remitwise.app/docs"
12+
13+
SIGNING_KEY="REPLACE_WITH_PROJECT_PUBLIC_KEY"
14+
15+
WEB_AUTH_ENDPOINT="https://remitwise.app/api/auth"
16+
17+
TRANSFER_SERVER="https://remitwise.app/api/anchor"
18+
`;
19+
20+
return new Response(toml.trim(), {
21+
headers: {
22+
"Content-Type": "text/plain",
23+
},
24+
});
25+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import fs from "fs";
2+
import path from "path";
3+
4+
export async function GET() {
5+
const file = path.join(process.cwd(), "openapi.yaml");
6+
const yaml = fs.readFileSync(file, "utf8");
7+
8+
return new Response(yaml, {
9+
headers: {
10+
"Content-Type": "text/yaml",
11+
},
12+
});
13+
}

0 commit comments

Comments
 (0)